:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #1e2430;
  --muted: #5c6b7a;
  --line: #e1e5ea;
  --accent: #1d5688;
  --accent-dark: #16436b;
  --link: #16436b;
  --row: #eef3f8;
  --bar: #3c8dbc;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #141820;
  --surface: #1c222d;
  --text: #f4f0e8;
  --muted: #b7bdc8;
  --line: #343c4c;
  --accent: #3f6f8c;
  --accent-dark: #4e86a8;
  --link: #9ec0dc;
  --row: #232a38;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 40px;
  height: auto;
}

.brand img.brand-mark-day {
  display: none;
}

:root:not([data-theme="night"]) .brand img.brand-mark:not(.brand-mark-day) {
  display: none;
}

:root:not([data-theme="night"]) .brand img.brand-mark-day {
  display: block;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  min-width: 0;
}

.top-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.top-name {
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.theme-toggle button,
.theme-toggle button:hover {
  padding: 0.35rem 0.6rem;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

:root[data-theme="night"] .theme-toggle [data-theme-choice="night"],
:root[data-theme="night"] .theme-toggle [data-theme-choice="night"]:hover {
  background: var(--accent);
  color: #fff;
}

:root:not([data-theme="night"]) .topbar {
  background: var(--bar);
  border-bottom-color: var(--bar);
  color: #fff;
}

:root:not([data-theme="night"]) .topbar .brand,
:root:not([data-theme="night"]) .topbar .account-link,
:root:not([data-theme="night"]) .topbar .top-link,
:root:not([data-theme="night"]) .topbar .top-name {
  color: #fff;
}

.top-lists {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.top-sep {
  opacity: 0.75;
}

.top-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

:root:not([data-theme="night"]) .topbar .button,
:root:not([data-theme="night"]) .topbar form > button,
:root:not([data-theme="night"]) .topbar .nav-toggle {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

:root:not([data-theme="night"]) .theme-toggle {
  border-color: rgba(255, 255, 255, 0.75);
}

:root:not([data-theme="night"]) .theme-toggle button,
:root:not([data-theme="night"]) .theme-toggle button:hover {
  color: #fff;
}

:root:not([data-theme="night"]) .theme-toggle [data-theme-choice="day"],
:root:not([data-theme="night"]) .theme-toggle [data-theme-choice="day"]:hover {
  background: #fff;
  color: var(--bar);
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.nav-toggle {
  display: none;
  margin-left: auto;
}

.shell,
body > main {
  flex: 1 0 auto;
}

.shell {
  display: flex;
  align-items: flex-start;
}

.site-footer {
  padding: 0.75rem 1.25rem 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.site-footer p {
  margin: 0;
}

.site-testing {
  margin-top: 0.15rem;
  font-weight: 700;
  text-align: center;
}

.shell main {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.side-nav {
  width: 220px;
  flex: none;
  align-self: stretch;
  box-sizing: border-box;
  padding: 1rem 0.75rem 2rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.side-nav .side-label {
  margin: 1.1rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-nav .side-label:first-child {
  margin-top: 0.2rem;
}

.side-nav .side-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.side-nav a.side-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.side-nav .side-sub {
  margin: 0.55rem 0 0.2rem;
  padding-left: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.side-nav button.side-fold {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  width: 100%;
  margin: 0.55rem 0 0.2rem;
  padding: 0.1rem 0.35rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.side-nav button.side-fold::before {
  content: '';
  width: 0;
  height: 0;
  border-top: 0.28rem solid transparent;
  border-bottom: 0.28rem solid transparent;
  border-left: 0.38rem solid currentColor;
}

.side-nav button.side-fold[aria-expanded="true"]::before {
  border-left: 0.28rem solid transparent;
  border-right: 0.28rem solid transparent;
  border-top: 0.38rem solid currentColor;
  border-bottom: 0;
}

.side-nav button.side-fold:hover {
  background: var(--row);
  color: var(--text);
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav .side-tertiary {
  margin: 0 0 0.35rem;
  padding: 0 0 0 0.9rem;
}

.side-nav .side-tertiary a {
  padding: 0.16rem 0.45rem;
  font-size: 0.86rem;
}

.side-nav li {
  margin: 0;
}

.side-nav a {
  display: block;
  margin: 0.1rem 0;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.side-nav a:hover {
  background: var(--row);
  color: var(--text);
}

.side-nav a.active {
  background: var(--row);
  color: var(--text);
  font-weight: 600;
}

.side-nav .side-create {
  margin: 0.15rem 0 0;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.view-head h1 {
  margin: 0;
}

.view-head .button {
  flex: none;
  margin: 0;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.55rem 0.95rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  background: var(--accent-dark);
}

.button-quiet,
.button-quiet:hover {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.button-quiet:hover {
  background: var(--row);
}

.actions {
  margin: 1.25rem 0;
}

.person {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.email {
  margin: 0;
  color: var(--muted);
}

.orbit {
  margin: 0 0 1rem;
  font-weight: 600;
}

label {
  display: block;
  margin-bottom: 0.35rem;
}

input[type="date"] {
  display: block;
  width: 100%;
  max-width: 16rem;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.signout {
  margin-top: 1.5rem;
}

.notice {
  color: var(--accent-dark);
}

.form-error {
  font-weight: 600;
}

@media (max-width: 1100px) {
  .shell {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
  }

  .shell {
    display: block;
  }

  .side-nav {
    display: none;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body.nav-open .side-nav {
    display: block;
  }

  .topbar {
    display: block;
  }

  .topbar-end {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.55rem 0.75rem;
    width: 100%;
    max-width: 100%;
    margin: 0.65rem 0 0;
  }

  .theme-toggle {
    flex: none;
  }

  main {
    padding-top: 1.5rem;
  }

  .person {
    align-items: flex-start;
  }

  .avatar {
    width: 72px;
    height: 72px;
  }

  h1 {
    font-size: 1.45rem;
  }
}

h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.list-orbit {
  margin: 1.75rem 0 0.75rem;
}

.list-orbit h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0;
}

.list-date {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.list-detail {
  margin: 0.25rem 0 0;
}

.field,
select.field,
textarea.field {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.field-line {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
}

.field-line .field,
.field-line select.field,
.field-line textarea.field {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.field-line-check {
  align-items: center;
  margin-bottom: 0.35rem;
}

.field-line-check .check,
.field-line-check .flag-checks {
  flex: 1;
  margin-bottom: 0;
}

.info-mark,
.info-mark:hover {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.45rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}

.field-line-check .info-mark {
  margin-top: 0;
}

.info-mark:hover {
  background: var(--row);
  color: var(--text);
}

.info-text {
  margin: 0 1.8rem 0.85rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.problem-dialog {
  max-width: 28rem;
  padding: 1.25rem 1.35rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.problem-dialog p {
  margin: 0 0 1rem;
  white-space: pre-wrap;
}

.problem-dialog::backdrop {
  background: rgba(20, 24, 32, 0.45);
}

textarea.field {
  min-height: 6rem;
  resize: vertical;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.check input {
  margin: 0;
}

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.orbit-list,
.members {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.orbit-list li,
.member {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.orbit-list a {
  font-weight: 600;
}

.orbit-list .muted {
  display: block;
}

.member {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.member form {
  margin: 0;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--line);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.settings {
  max-width: 46rem;
}

.settings fieldset.settings-fields {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.settings-form .settings-row,
.settings .settings-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 22rem);
  gap: 0.35rem 1rem;
  align-items: center;
  margin: 0 0 0.7rem;
}

.settings-label {
  font-weight: 600;
}

.settings-form .field {
  width: 100%;
  max-width: none;
  margin: 0;
}

.settings-row .field-line {
  margin: 0;
}

.settings-row .info-mark {
  margin-top: 0;
}

.settings-help {
  margin: -0.2rem 0 0.85rem calc(8.5rem + 1rem);
  max-width: 22rem;
}

.settings-form input[type="checkbox"] {
  justify-self: start;
  width: 1rem;
  height: 1rem;
}

.settings .settings-row:has(.invite-line) {
  grid-template-columns: 8.5rem minmax(0, 1fr);
}

.settings-form textarea.field {
  min-height: 0;
  height: 4.5rem;
}

.settings-band {
  padding: 0.9rem 0.9rem 0.25rem;
  margin: 0 0 0.85rem;
}

.settings-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.15rem 0 0 calc(0.9rem + 8.5rem + 1rem);
}

.food-management {
  margin: 1.4rem 0 0.4rem;
}

.food-head,
.section-head,
.chat-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}

.food-head,
.chat-head {
  justify-content: space-between;
}

.food-head h2,
.food-management h2,
.chat-head h2 {
  margin: 0;
}

.info-mark.section-info {
  margin-top: 0;
  margin-left: auto;
}

.field-help {
  display: none;
  margin: -0.2rem 0 0.85rem calc(8.5rem + 1rem);
  max-width: 22rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.show-field-help .field-help {
  display: block;
}

.invite-help,
.members-help {
  margin-left: 0;
  max-width: 40rem;
}

.orbit-fields {
  max-width: calc(8.5rem + 1rem + 22rem);
}

.orbit-fields .field-help {
  margin-left: calc(8.5rem + 1rem);
  max-width: 22rem;
}

.orbit-fields input[type="date"].field {
  max-width: none;
  margin: 0;
}

.orbit-create .create-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0 calc(8.5rem + 1rem);
}

.orbit-fields .flag-checks {
  gap: 0.35rem 0.85rem;
}

.food-setup {
  list-style: none;
  margin: 0;
  padding: 0;
}

.food-setup li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 22rem);
  gap: 0.35rem 1rem;
  align-items: center;
  margin: 0 0 0.7rem;
}

.food-setup .field {
  width: 5rem;
  margin: 0;
}

.invite-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.invite-line .field {
  flex: 1 1 12rem;
  width: auto;
  margin: 0;
}

.invite-line form {
  margin: 0;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
}

.settings-table th,
.settings-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  background: var(--surface);
  color: var(--text);
}

.settings-table th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

:root:not([data-theme="night"]) .settings-table tbody tr:nth-child(even) td {
  background: var(--row);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.member-actions form {
  margin: 0;
}

.settings-table button {
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .settings-form .settings-row,
  .settings .settings-row {
    grid-template-columns: 1fr;
  }

  .settings-help,
  .orbit-fields .field-help {
    margin-left: 0;
  }

  .orbit-create .create-actions {
    margin-left: 0;
  }

  .settings-save {
    margin-left: 0;
  }

  .food-setup li {
    grid-template-columns: 1fr;
  }
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.topic-list a {
  font-weight: 600;
}

.post {
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-meta .member-avatar {
  width: 28px;
  height: 28px;
}

.post-actions {
  margin: 0;
}

.post-actions a + a {
  margin-left: 0.75rem;
}

.reply-box textarea.field {
  max-width: 40rem;
  min-height: 6rem;
}

.person-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.person-line h2 {
  margin: 0;
}

.members-help {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.members-prompt {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.members-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 16rem;
  margin: 0.35rem 0 0;
}

.members-filter label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.members-filter input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.members-table {
  width: 100%;
  max-width: 42rem;
  margin: 0.35rem 0 0;
  border-collapse: collapse;
}

.members-table th,
.members-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  background: var(--surface);
  color: var(--text);
}

.members-table th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.members-table th.available,
.members-table td.available,
.members-table th.claimed,
.members-table td.claimed,
.members-table th.complete,
.members-table td.complete {
  width: 6.5rem;
  text-align: right;
}

.members-table tbody tr[hidden] {
  display: none;
}

:root:not([data-theme="night"]) .members-table tbody tr:nth-child(even of :not([hidden])) td {
  background: var(--row);
}

:root:not([data-theme="night"]) .members-table tbody tr.is-open:nth-child(n of :not([hidden])) td,
:root[data-theme="night"] .members-table tbody tr.is-open td {
  background: color-mix(in srgb, var(--accent) 28%, var(--surface));
}

:root:not([data-theme="night"]) .members-table tbody tr.is-open:nth-child(n of :not([hidden])) td:first-child,
:root[data-theme="night"] .members-table tbody tr.is-open td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.members-table a {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.members-table a:hover {
  color: var(--accent-dark);
}

.members-table form {
  margin: 0;
}

.members-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.wishes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wish {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.wish-form {
  --wish-label: 9.5rem;
  max-width: 40rem;
}

.wish-hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.req {
  margin-left: 0.12rem;
  color: #c23a3a;
  font-weight: 700;
}

:root[data-theme="night"] .req {
  color: #e3c48a;
}

.wish-form .wish-row {
  display: grid;
  grid-template-columns: var(--wish-label) minmax(0, 22rem);
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin: 0 0 0.55rem;
}

.wish-form .wish-row:has(textarea),
.wish-form .wish-row:has(.wish-image) {
  align-items: start;
}

.wish-form .wish-row:has(textarea) label {
  padding-top: 0.45rem;
}

.wish-form label,
.wish-form .wish-row > span {
  margin: 0;
  font-weight: 600;
}

.wish-form .field {
  width: 100%;
  margin: 0;
}

.wish-form-head {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.35rem;
}

.wish-form .field-help {
  margin: -0.2rem 0 0.75rem calc(var(--wish-label) + 0.75rem);
  max-width: 22rem;
}

.wish-form .wish-required {
  margin-top: 0.35rem;
  margin-bottom: 0.55rem;
}

.money-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.money-field .field {
  flex: 1;
}

.wish-form textarea.field {
  min-height: 0;
  height: 4.5rem;
}

.wish-form input[type="checkbox"] {
  justify-self: start;
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.wish-form .wish-image {
  margin: 0;
}

.wish-form > button,
.wish-actions {
  margin: 0.15rem 0 1rem calc(var(--wish-label) + 0.75rem);
}

.wish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

:root[data-theme="night"] .wish-page a {
  color: #9ec0dc;
}

:root[data-theme="night"] .wish-page .req {
  color: #e3c48a;
}

:root[data-theme="night"] .wish-page button,
:root[data-theme="night"] .wish-page .button,
:root[data-theme="night"] .wish-page button:hover,
:root[data-theme="night"] .wish-page .button:hover {
  background: #3f6f8c;
  color: #f7f4ee;
}

:root[data-theme="night"] .wish-page button:hover,
:root[data-theme="night"] .wish-page .button:hover {
  background: #4e86a8;
}

@media (max-width: 640px) {
  .wish-form .wish-row {
    grid-template-columns: 1fr;
  }

  .wish-form .wish-row:has(textarea) label {
    padding-top: 0;
  }

  .wish-form > button,
  .wish-actions,
  .wish-form .field-help {
    margin-left: 0;
  }
}

.wish-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 16rem;
  margin: 0 0 0.75rem;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface);
}

input[type="file"].field {
  padding: 0.45rem 0;
  border: 0;
  background: transparent;
}

.orbit-head h1 {
  margin-bottom: 0.4rem;
}

.orbit-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem 1.25rem;
}

.orbit-facts dl {
  display: flex;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.35rem;
  margin: 0;
  min-width: 0;
}

.orbit-facts dl > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.45rem;
  min-width: 0;
  margin: 0;
}

.orbit-facts .orbit-note {
  flex: 1 0 100%;
  flex-wrap: nowrap;
}

.orbit-facts dd {
  min-width: 0;
}

.orbit-facts dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.orbit-facts dd {
  margin: 0;
}

.orbit-actions {
  display: flex;
  flex: none;
  gap: 0.5rem;
  margin-left: auto;
}

.orbit-facts .button,
.orbit-facts .orbit-actions .button {
  flex: none;
  margin-left: 0;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

.orbit-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.3rem;
  max-width: 100%;
  margin: 1rem 0 0;
  border-bottom: 1px solid var(--line);
}

.orbit-tabs a {
  margin-bottom: -1px;
  padding: 0.4rem 0.95rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--text);
  background: var(--row);
  text-decoration: none;
}

.orbit-tabs a:hover {
  color: var(--text);
}

.orbit-tabs a[aria-current="page"],
.orbit-tabs a[aria-current="page"]:hover {
  background: var(--row);
  color: var(--text);
  border-color: var(--line);
  font-weight: 600;
  box-shadow: inset 0 2px 0 var(--bar);
}

.flag-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.food-theme,
.food-item-form {
  display: grid;
  gap: 0.35rem;
  max-width: 24rem;
  margin: 0.75rem 0 1rem;
}

.food-theme-text {
  margin: 0.75rem 0 1rem;
}

.food-types {
  list-style: none;
  margin: 0;
  padding: 0;
}

.food-type {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin: 0 0 0.65rem;
}

.food-type h3 {
  margin: 0;
  width: 8rem;
  flex: none;
  font-size: 1rem;
}

.food-type > button {
  flex: none;
}

.food-needed {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.food-needed .field {
  width: 4.5rem;
}

.food-item-form {
  flex-basis: 100%;
  margin: 0.15rem 0 0.35rem;
}

.food-item-form[hidden] {
  display: none;
}

.food-soft,
.food-help {
  margin: 0.35rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.food-soft {
  margin: 0;
}

.food-menu {
  margin-top: 1.5rem;
}

.food-menu tr:has(.food-edit) {
  scroll-margin-top: 1.5rem;
  scroll-margin-bottom: 2rem;
}

#orbit-invite {
  scroll-margin-top: 1rem;
}

.menu-count {
  color: var(--muted);
  font-weight: 500;
}

.food-table {
  width: 100%;
  border-collapse: collapse;
}

.food-table th,
.food-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  background: var(--surface);
  color: var(--text);
  overflow-wrap: anywhere;
}

.food-table th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.food-table .food-type-row th,
.food-table .food-type-row td {
  padding-top: 0.9rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

.food-table .food-tally {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.food-table td.food-mine {
  font-weight: 700;
}

.food-table .food-actions {
  width: 3.4rem;
  text-align: right;
  white-space: nowrap;
}

.food-edit,
.food-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.food-edit .field {
  width: auto;
  flex: 1 1 8rem;
  margin: 0;
}

.food-edit button,
.food-confirm button {
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}



.chat-column {
  width: 440px;
  flex: none;
  align-self: stretch;
  box-sizing: border-box;
  padding: 1.25rem 0.9rem 2rem;
  border-left: 1px solid var(--line);
  background: var(--surface);
  max-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.chat-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}

.chat-column .field-help {
  margin: -0.45rem 0 0.75rem;
  max-width: none;
}

.chat-column h2 {
  margin: 0;
  font-size: 1.05rem;
}

.chat-column .field,
.chat-column textarea.field {
  width: 100%;
  max-width: none;
}

.chat-column textarea.field {
  min-height: 0;
}

.chat-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
}

.chat-toolbar .chat-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.chat-toolbar .chat-tool.is-on,
.chat-toolbar .chat-tool:hover {
  background: var(--row);
}

.chat-toolbar .chat-expand {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
}

.chat-toolbar .chat-expand:hover {
  background: var(--row);
}

.chat-body {
  display: none;
}

.chat-topic.open .chat-body {
  display: block;
}

button.chat-title {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.chat-compose,
.chat-column .reply-box,
.chat-column form {
  margin: 0 0 0.85rem;
}

.chat-topics {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chat-topic {
  padding: 0.65rem 0.45rem;
  border-bottom: 1px solid var(--line);
}

:root:not([data-theme="night"]) .day-stripe,
:root[data-theme="night"] .chat-topic.day-stripe {
  background: var(--row);
  border-radius: 6px;
}

:root:not([data-theme="night"]) .day-stripe .food-table th,
:root:not([data-theme="night"]) .day-stripe .food-table td {
  background: transparent;
}

:root:not([data-theme="night"]) .day-stripe .food-table .food-type-row th,
:root:not([data-theme="night"]) .day-stripe .food-table .food-type-row td {
  background: var(--bg);
}

.chat-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.chat-title:hover {
  text-decoration: underline;
}

.chat-topic .muted {
  margin-top: 0.15rem;
  font-size: 0.85rem;
}

.chat-column .post {
  position: relative;
  margin: 0.85rem 0 0;
  padding: 0 2.7rem 0.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.chat-column .post:first-of-type {
  margin-top: 0.65rem;
  border-top: 0;
}

.chat-column .prose {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.chat-column .post-tools {
  position: absolute;
  top: 0;
  right: 0;
}

.icon-tools {
  display: flex;
  justify-content: flex-end;
  gap: 0.2rem;
}

.icon-tools a {
  display: inline-flex;
  padding: 0.1rem;
  color: var(--muted);
  line-height: 0;
  text-decoration: none;
}

.icon-tools a:hover {
  color: var(--text);
}

.icon-tools svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-column form a {
  margin-left: 0.75rem;
}

@media (max-width: 1100px) {
  .chat-column {
    width: 100%;
    max-height: none;
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

.chat-close,
.chat-open-button {
  display: none;
}

@media (max-width: 640px) {
  body:has(#orbit-chat) {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom));
  }

  .chat-open-button {
    display: inline-flex;
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    box-shadow: 0 2px 10px rgba(20, 24, 32, 0.2);
  }

  body.chat-open {
    overflow: hidden;
  }

  body.chat-open .chat-open-button {
    display: none;
  }

  .chat-column {
    display: none;
  }

  body.chat-open .chat-column {
    display: flex;
    position: fixed;
    z-index: 40;
    inset: 0;
    width: auto;
    max-height: none;
    border: 0;
    overflow: hidden;
  }

  body.chat-open .chat-close,
  body.chat-open .chat-close:hover {
    display: inline-flex;
    flex: none;
    margin: 0;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
  }

  .food-table {
    min-width: 36rem;
  }

  .food-table th {
    white-space: nowrap;
  }
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.wish-table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
}

.wish-table.wish-columns {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.wish-table.wish-columns col.pick { width: 4%; }
.wish-table.wish-columns col.priority { width: 12%; }
.wish-table.wish-columns col.item { width: 29%; }
.wish-table.wish-columns col.price { width: 10%; }
.wish-table.wish-columns col.store { width: 16%; }
.wish-table.wish-columns col.qty { width: 9%; }
.wish-table.wish-columns col.actions { width: 20%; }

@media (max-width: 700px) {
  .wish-table.wish-columns {
    min-width: 42rem;
  }
}

.wish-table th,
.wish-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

.wish-table th {
  font-size: 0.85rem;
  font-weight: 600;
}

:root:not([data-theme="night"]) .wish-table th {
  background: var(--bar);
  color: #fff;
}

:root:not([data-theme="night"]) .wish-table tbody tr:not(.odd) td {
  background: #fff;
}

.wish-table.wish-columns th,
.wish-table.wish-columns td {
  padding: 0.4rem 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wish-table.wish-columns td:not(.item):not(.links):not(.claim) {
  font-size: 0.92rem;
}

.wish-table.wish-columns th {
  font-size: 0.8rem;
}

.wish-help-section {
  margin-top: 0.9rem;
}

.wish-help-section .field-help {
  margin: 0 0 0.65rem;
  max-width: 42rem;
}

.wish-toolbar {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.65rem;
}

.wish-toolbar .section-info {
  margin-top: 0;
  margin-left: auto;
}

.wish-toolbar-actions,
.wish-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.wish-toolbar-actions {
  gap: 0;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.wish-tool {
  position: relative;
  display: inline-flex;
}

.wish-tool:hover::after,
.wish-tool:focus-within::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translateX(-50%);
  z-index: 5;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.wish-tool + .wish-tool {
  margin-left: 0.15rem;
  padding-left: 0.15rem;
  border-left: 1px solid var(--line);
}

.wish-tool-gap {
  display: inline-flex;
  align-items: center;
  margin: 0 0.35rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1;
  opacity: 0.75;
  user-select: none;
}

.wish-copy {
  gap: 0.4rem;
}

.wish-toolbar-actions button,
.wish-toolbar-actions button:hover {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
}

.wish-toolbar-actions button:hover:not(:disabled) {
  background: var(--row);
}

.wish-toolbar-actions button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.wish-toolbar-actions button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wish-toolbar-actions button svg.orbit-mark {
  stroke-width: 1.45;
}

.wish-toolbar-actions[hidden],
.wish-ask[hidden] {
  display: none;
}

.wish-toolbar button:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.wish-table.wish-columns th.pick,
.wish-table.wish-columns td.pick {
  text-align: center;
  overflow: visible;
}

.wish-table.wish-columns .pick input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.wish-table.wish-columns th.qty,
.wish-table.wish-columns td.qty {
  text-align: right;
}

.wish-table.wish-columns th.qty {
  overflow: visible;
  text-overflow: clip;
}

.wish-table.wish-columns td.priority {
  overflow: visible;
  text-overflow: clip;
}

.stars {
  color: #b86e00;
  letter-spacing: 0.04em;
}

:root[data-theme="night"] .stars {
  color: #f0c14a;
}

.wish-table.wish-columns td.item,
.wish-table.wish-columns th.item {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.wish-table.wish-columns td.links,
.wish-table.wish-columns td.claim {
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
  text-align: right;
}

.wish-table th.tablesorter-header {
  cursor: pointer;
}

.wish-table th.tablesorter-headerAsc::after {
  content: " \2191";
}

.wish-table th.tablesorter-headerDesc::after {
  content: " \2193";
}

.wish-table tbody tr.odd td,
:root[data-theme="night"] .food-table tbody tr.food-item td {
  background: var(--row);
}

.shopping-total td {
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border-top: 2px solid var(--line);
}

.wish-table tbody tr.filtered {
  display: none;
}

.wish-table .tablesorter-filter-row td {
  padding: 0.35rem 0.4rem;
  background: var(--surface);
  vertical-align: top;
}

.wish-table .tablesorter-filter-row input {
  width: 100%;
  min-width: 4.5rem;
  margin: 0;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.wish-table .tablesorter-filter-row input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.wish-table .tablesorter-filter-row input:disabled {
  display: none;
}

.wish-table.wish-columns .tablesorter-filter-row input {
  min-width: 0;
  max-width: 100%;
}

.wish-table.wish-columns .reserve-form,
.wish-table.wish-columns .claim-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  max-width: none;
}

.wish-table .links a.row-icon {
  display: inline-flex;
  padding: 0.1rem;
  color: var(--muted);
  line-height: 0;
  text-decoration: none;
  vertical-align: middle;
}

.wish-table .links a.row-icon:hover {
  color: var(--text);
}

.wish-table .links a.row-icon svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wish-table .links a.row-icon + a.row-icon {
  margin-left: 0.35rem;
}

.wish-table.wish-columns .reserve-form button,
.wish-table.wish-columns .claim-actions button {
  max-width: none;
  white-space: nowrap;
}

.wish-table .links a + a {
  margin-left: 0.75rem;
}

.reserve-form,
.claim-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.reserve-qty {
  width: 3.25rem;
  margin: 0;
  padding: 0.3rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.reserve-form button,
.claim-actions button {
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
}

button.image-mark,
button.notes-mark {
  width: 0.85rem;
  height: 0.85rem;
  margin: 0 0 0 0.4rem;
  padding: 0;
  border-radius: 2px;
  vertical-align: 0.05rem;
}

button.notes-mark,
button.notes-mark:hover {
  background: transparent;
  color: var(--muted);
}

button.notes-mark:hover {
  color: var(--text);
}

button.notes-mark svg {
  width: 0.85rem;
  height: 0.85rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image-preview {
  position: fixed;
  z-index: 5;
  width: min(480px, calc(100vw - 1rem));
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.image-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

.notes-preview {
  position: fixed;
  z-index: 5;
  width: min(22rem, calc(100vw - 1rem));
  max-height: 50vh;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
