:root {
  color-scheme: light;
  --page: #f5f4ed;
  --surface: #fffef9;
  --surface-raised: #ffffff;
  --surface-soft: #eeeee4;
  --ink: #203229;
  --muted: #78837a;
  --line: #e4e6dc;
  --line-strong: #d3d9ce;
  --green: #2e5845;
  --green-strong: #234634;
  --green-soft: #e3eee5;
  --orange: #e5a354;
  --red: #a54338;
  --red-soft: #f8e9e5;
  --shadow: 0 18px 55px rgba(34, 49, 39, .09);
  --shadow-small: 0 4px 16px rgba(34, 49, 39, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--page);
  color: var(--ink);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #171d19;
  --surface: #1d2520;
  --surface-raised: #232d27;
  --surface-soft: #29332c;
  --ink: #f1f0e7;
  --muted: #a6b0a7;
  --line: #344039;
  --line-strong: #46534a;
  --green: #b8d09d;
  --green-strong: #cce0b5;
  --green-soft: #2d3d31;
  --orange: #e7b16b;
  --red: #edaaa0;
  --red-soft: #442b28;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
  --shadow-small: 0 4px 16px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 78%, transparent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--green);
  color: var(--surface);
}
.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.icon[src$="/settings.svg"] { filter: brightness(1.05); }
:root[data-theme="dark"] .icon[src$="/settings.svg"] { filter: brightness(1.45); }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  white-space: nowrap;
}
.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 0;
  object-fit: contain;
}
.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.06em;
}
.brand-caption {
  align-self: flex-end;
  margin: 0 0 4px -6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}
.muted-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.99); }
.button-primary {
  background: var(--green);
  color: var(--surface);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--green) 18%, transparent);
}
.button-primary:hover { background: var(--green-strong); }
:root[data-theme="dark"] .button-primary { box-shadow: none; }
.button-secondary {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--ink);
}
.button-secondary:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.button-danger { background: var(--red); color: #fff; }
.button-large { min-height: 60px; padding: 12px 16px; }
.button-small { min-height: 38px; padding: 7px 11px; border-radius: 10px; font-size: 12px; }
.button-small .icon { width: 16px; height: 16px; }

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.icon-button:hover { border-color: var(--line); background: var(--surface-soft); color: var(--ink); }
.icon-button .avatar { width: 34px; height: 34px; }
.sync-status {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.sync-status .icon { width: 15px; height: 15px; }
.sync-status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.sync-status[data-status="syncing"] .sync-status-dot,
.sync-status[data-status="reconnecting"] .sync-status-dot,
.sync-status[data-status="checking"] .sync-status-dot { background: var(--orange); animation: sync-pulse 1.1s ease-in-out infinite; }
.sync-status[data-status="offline"] .sync-status-dot,
.sync-status[data-status="error"] .sync-status-dot { background: var(--red); }
.sync-status[data-status="queued"] .sync-status-dot { background: var(--orange); }
.sync-status:hover { border-color: var(--line-strong); color: var(--ink); }
.text-button {
  min-height: 36px;
  padding: 6px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.text-button:hover { background: var(--green-soft); }

.avatar {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green) 15%, transparent);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.avatar > span { position: relative; z-index: 1; }
.avatar > img { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-large { width: 46px; height: 46px; font-size: 15px; }

.app-shell {
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: 276px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: calc(27px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, var(--page));
}
.sidebar > .brand-lockup { margin: 0 8px 42px; }
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .15em;
}
.sidebar-heading .text-button { font-size: 11px; letter-spacing: 0; }
.list-navigation {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.list-navigation::-webkit-scrollbar { display: none; }
.nav-list-row {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  border-radius: 13px;
  transition: background .18s ease, opacity .18s ease, transform .18s ease;
}
.nav-list-row:hover { background: var(--surface-soft); }
.nav-list-row.is-current { background: var(--green-soft); }
.nav-list-row.is-dragging { z-index: 2; opacity: .7; box-shadow: var(--shadow-small); transform: scale(1.02); }
.nav-list {
  display: flex;
  min-width: 0;
  min-height: 56px;
  flex: 1;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.list-glyph, .list-heading-glyph {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--list-color, var(--orange)) 15%, var(--surface-raised));
  font-size: 19px;
}
.nav-list-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.nav-list-text strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-list-text small { color: var(--muted); font-size: 10px; }
.nav-list-row.is-current .nav-list-text strong { color: var(--green); }
.sidebar-empty {
  padding: 16px 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.sidebar-add {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 0 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.sidebar-add:hover { border-color: var(--green); background: var(--green-soft); }
.sidebar-add .icon { width: 18px; height: 18px; }
.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.account-button {
  display: flex;
  min-width: 0;
  min-height: 54px;
  flex: 1;
  align-items: center;
  gap: 9px;
  padding: 5px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.account-button:hover { background: var(--surface-soft); }
.account-button > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.account-button strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-button small { color: var(--muted); font-size: 10px; }
.account-button > .icon { width: 17px; }
.theme-button { width: 40px; height: 40px; }
.drag-handle {
  display: grid;
  width: 32px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle .icon { width: 17px; height: 17px; }
.order-buttons { display: flex; flex-direction: column; margin-right: 4px; }
.order-buttons button {
  width: 26px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}
.order-buttons button:hover { background: var(--surface); color: var(--green); }
.order-buttons button:disabled { opacity: .3; cursor: default; }

.main-column { display: flex; min-width: 0; min-height: 0; flex-direction: column; }
.main-topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) clamp(22px, 4vw, 58px) 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.topbar-spacer { flex: 1; }
.mobile-back, .mobile-brand { display: none; }
.main-panel { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; }
.home-view, .list-view { width: min(100%, 1120px); min-height: 100%; margin: 0 auto; padding: 40px clamp(22px, 4vw, 58px) 32px; }
.home-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.home-intro-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; }
.reorder-home-button { white-space: nowrap; }
.home-intro h1, .list-heading h1, .auth-card h1, .onboarding-card h1, .invite-card h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.055em;
}
.home-intro h1 { font-size: clamp(36px, 4vw, 53px); line-height: 1.02; }
.home-intro .muted-copy { margin: 11px 0 0; }
.heading-period { color: var(--orange); }
.create-list-button { flex: 0 0 auto; }
.home-list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.home-list-card {
  position: relative;
  display: flex;
  min-height: 112px;
  align-items: flex-start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(40, 50, 42, .02);
  animation: card-enter .38s both;
  animation-delay: calc(var(--card-index, 0) * 35ms);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.home-list-card:hover { border-color: color-mix(in srgb, var(--list-color) 35%, var(--line)); box-shadow: var(--shadow-small); transform: translateY(-2px); }
.home-list-card.is-reordering { border-style: dashed; cursor: grab; }
.home-list-card.is-reordering:active { cursor: grabbing; }
.home-list-card.is-reordering .home-card-main { padding-left: 54px; }
.home-drag-handle {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}
.home-drag-handle:active { cursor: grabbing; }
.home-drag-handle .icon { width: 17px; height: 17px; }
.home-order-buttons {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 10px;
  display: flex;
  gap: 2px;
}
.home-order-buttons button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
}
.home-order-buttons button:first-child .icon { transform: rotate(-90deg); }
.home-order-buttons button:last-child .icon { transform: rotate(90deg); }
.home-order-buttons button:disabled { opacity: .35; cursor: default; }
.home-order-buttons .icon { width: 17px; height: 17px; }
.home-card-main {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 4px 13px;
  padding: 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.home-card-icon {
  display: grid;
  width: 43px;
  height: 43px;
  grid-row: span 2;
  place-items: center;
  margin: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--list-color) 14%, var(--surface));
  font-size: 22px;
}
.home-card-title { max-width: 100%; overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.home-card-meta { margin-top: 6px; color: var(--muted); font-size: 11px; }
.home-card-menu {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.home-card-menu:hover { background: var(--surface-soft); color: var(--ink); }
.home-card-menu .icon { width: 18px; height: 18px; }

.list-view { display: flex; min-height: 100%; flex-direction: column; padding-top: 20px; padding-bottom: 0; }
.list-heading { display: flex; min-height: 69px; align-items: center; gap: 13px; }
.list-heading-glyph { width: 48px; height: 48px; border-radius: 16px; font-size: 25px; }
.list-heading-text { min-width: 0; flex: 1; }
.list-heading h1 { overflow: hidden; font-size: clamp(24px, 3vw, 34px); text-overflow: ellipsis; white-space: nowrap; }
.list-heading-text p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.list-heading-actions { display: flex; align-items: center; gap: 2px; }
.list-heading-actions .icon-button { display: flex; width: auto; min-width: 42px; padding: 0 10px; gap: 7px; }
.action-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.list-edit-button { width: 36px; height: 36px; }
.list-edit-button .icon { width: 17px; height: 17px; }

.list-toolbar { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; }
.search-box {
  display: flex;
  min-width: 0;
  min-height: 44px;
  flex: 1;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}
.search-box:focus-within { border-color: color-mix(in srgb, var(--green) 54%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 9%, transparent); }
.search-box > .icon { width: 17px; height: 17px; }
.search-box input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.search-box input::placeholder { color: var(--muted); opacity: .8; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.search-box button .icon { width: 16px; height: 16px; }
.sort-select-wrap {
  position: relative;
  flex: 0 0 auto;
}
.sort-trigger {
  display: inline-flex;
  max-width: 170px;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.sort-trigger .icon { width: 15px; height: 15px; }
.sort-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  min-width: 170px;
  flex-direction: column;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}
.sort-menu[hidden] { display: none; }
.sort-option {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.sort-option:hover, .sort-option[aria-selected="true"] { background: var(--green-soft); color: var(--green); }
.sort-option .icon { width: 16px; height: 16px; }

.list-scroll-area { min-height: 150px; flex: 1; padding-bottom: 18px; }
.active-section { padding-top: 6px; }
.section-heading, .purchased-heading {
  display: flex;
  min-height: 35px;
  align-items: center;
  gap: 9px;
}
.section-kicker { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.count-pill {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 20px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.item-list { display: flex; flex-direction: column; }
.item-row {
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 13px;
  padding: 11px 12px 11px 4px;
  border-bottom: 1px solid var(--line-strong);
}
.item-check {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  margin: -9px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.item-check::before {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1.7px solid var(--line-strong);
  border-radius: 50%;
  background: color-mix(in srgb, var(--line-strong) 18%, var(--surface));
  content: "";
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.item-check:hover::before { border-color: var(--green); transform: scale(1.06); }
.item-check.is-checked::before { border-color: var(--green); background: var(--green); }
.item-check .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.item-main { min-width: 0; flex: 1; }
.item-name { overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.item-details { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.item-comment { color: var(--muted); }
.detail-dot { color: var(--line-strong); }
.item-author { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.item-author .avatar, .item-buyer .avatar, .group-heading .avatar { width: 20px; height: 20px; font-size: 8px; }
.author-label { opacity: .74; }
.item-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; }
.item-action {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.item-action:hover { background: var(--surface-soft); color: var(--green); }
.item-action .icon { width: 17px; height: 17px; }
.item-action.item-delete:hover { background: var(--red-soft); color: var(--red); }
.item-purchased { opacity: .74; }
.item-purchased .item-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.item-purchased .item-author { opacity: .82; }
.item-buyer { display: flex; max-width: 155px; flex: 0 0 auto; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.item-buyer span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.author-group { margin: 10px 0 16px; }
.group-heading { display: flex; align-items: center; gap: 8px; margin: 19px 0 3px; font-size: 12px; font-weight: 700; }
.group-heading small { display: inline-grid; min-width: 19px; height: 19px; place-items: center; margin-left: auto; border-radius: 20px; background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.purchased-section { margin-top: 12px; padding: 8px 16px 14px; border: 1px solid var(--line); border-radius: 17px; background: color-mix(in srgb, var(--surface) 82%, var(--page)); }
.purchased-heading {
  width: 100%;
  justify-content: space-between;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.purchased-heading > span:first-child { display: flex; align-items: center; gap: 9px; }
.collapse-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.collapse-label .icon { width: 15px; height: 15px; transform: rotate(90deg); transition: transform .18s ease; }
.collapse-label .icon.is-open { transform: rotate(-90deg); }
.purchased-date-group h3 { margin: 18px 0 4px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: capitalize; }
.purchased-date-group .item-row:last-child { border-bottom: 0; }
.purchased-empty p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

.add-item-form {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 calc(clamp(22px, 4vw, 58px) * -1);
  padding: 12px clamp(22px, 4vw, 58px) calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 94%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.add-name-wrap { position: relative; min-width: 0; flex: 1; }
.add-name-wrap > input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  box-shadow: var(--shadow-small);
}
.add-name-wrap > input::placeholder { color: var(--muted); opacity: .82; }
.add-extra-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.add-extra-button:hover { color: var(--green); }
.add-submit {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: var(--surface);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: var(--shadow-small);
}
.add-submit:hover { background: var(--green-strong); }
.add-submit .icon { width: 18px; height: 18px; }
.suggestions {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  display: flex;
  max-height: 220px;
  flex-direction: column;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}
.suggestions[hidden] { display: none; }
.suggestion { min-height: 42px; padding: 8px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.suggestion:hover, .suggestion:focus-visible { background: var(--green-soft); }

.empty-state {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 18px;
  text-align: center;
  animation: fade-in .28s ease both;
}
.empty-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
  transform: rotate(-5deg);
}
.empty-mark .icon { width: 22px; height: 22px; }
.empty-state h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; }
.empty-state p { max-width: 340px; margin: 8px 0 15px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.empty-state .button { margin-top: 4px; }
.empty-search .empty-mark { background: color-mix(in srgb, var(--orange) 20%, var(--surface)); color: #9c652c; }
.empty-history .empty-mark { background: var(--surface-soft); color: var(--muted); }
.empty-members .empty-mark { background: color-mix(in srgb, #d9e7d5 80%, var(--surface)); }
.empty-error .empty-mark { background: var(--red-soft); color: var(--red); }

.auth-screen, .onboarding-screen, .invite-screen {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: calc(24px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
}
.auth-topline { position: absolute; z-index: 2; top: calc(21px + env(safe-area-inset-top)); right: 24px; left: 24px; display: flex; align-items: center; justify-content: space-between; }
.auth-card, .onboarding-card, .invite-card {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  animation: card-enter .45s cubic-bezier(.2,.8,.2,1) both;
}
.auth-card { margin: 30px 0; }
.auth-card .eyebrow { margin-top: 7px; }
.auth-card h1, .onboarding-card h1, .invite-card h1 { font-size: clamp(37px, 8vw, 54px); line-height: .99; }
.auth-card h1 em, .onboarding-card h1 em, .invite-card h1 em { color: var(--green); font-weight: 400; }
.auth-description { margin: 17px 0 25px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; }
.auth-actions .button { justify-content: flex-start; text-align: left; }
.auth-actions .button > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.auth-actions .button strong { font-size: 12px; }
.auth-actions .button small { color: var(--muted); font-size: 10px; font-weight: 500; }
.auth-actions .button-primary small { color: color-mix(in srgb, var(--surface) 72%, transparent); }
.button-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--surface) 15%, transparent); }
.button-icon .icon { width: 18px; height: 18px; }
.button-trailing { width: 17px; height: 17px; }
.google-g { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: #4285f4; font-weight: 800; }
.google-signin-button { min-height: 48px; border-color: #747775; border-radius: 4px; background: #fff; color: #1f1f1f; }
.google-signin-button:hover { border-color: #5f6368; background: #f8fafd; }
.google-logo { display: block; width: 20px; height: 20px; }
.google-signin-button .google-g { width: 20px; height: 20px; border: 0; border-radius: 0; background: transparent; }
.auth-actions .google-signin-button { justify-content: center; gap: 12px; padding: 10px 16px; }
.auth-actions .google-signin-button strong { color: #1f1f1f; font-size: 13px; font-weight: 500; }
.auth-footnote { margin: 22px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.invite-preview { display: flex; align-items: center; gap: 11px; margin: 18px 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); color: var(--muted); font-size: 11px; line-height: 1.5; }
.invite-preview-icon { font-size: 23px; }
.invite-invalid { color: var(--red); }

.onboarding-card { width: min(100%, 510px); }
.onboarding-card > .brand-lockup { margin-bottom: 36px; }
.onboarding-card .muted-copy { max-width: 350px; margin: 15px 0 23px; }
.form-stack { display: flex; flex-direction: column; gap: 9px; }
.form-stack label { margin-top: 9px; color: var(--ink); font-size: 12px; font-weight: 700; }
.form-stack label span { color: var(--muted); font-weight: 500; }
.form-stack input, .form-stack select, .form-stack textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 15px;
}
.form-stack input[type="color"] { min-height: 46px; padding: 5px; cursor: pointer; }
.form-stack textarea { min-height: 82px; resize: vertical; }
.form-stack small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-stack .button { margin-top: 11px; }
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) 90px; gap: 13px; }
.icon-picker { position: relative; }
.icon-picker-trigger {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.icon-picker-trigger .icon { width: 16px; height: 16px; margin-left: auto; color: var(--muted); }
.selected-list-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--green-soft); font-size: 18px; }
.icon-picker-grid {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(38px, 1fr));
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}
.icon-picker-grid[hidden] { display: none; }
.icon-picker-option { display: grid; min-height: 42px; place-items: center; border: 0; border-radius: 10px; background: transparent; font-size: 21px; cursor: pointer; }
.icon-picker-option:hover, .icon-picker-option.is-selected { background: var(--green-soft); }
.icon-picker-option.is-selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 35%, transparent); }
.form-error { min-height: 16px; margin: 0; color: var(--red); font-size: 11px; }
.inline-note { padding: 11px 13px; border-radius: 11px; background: var(--green-soft); color: var(--green); font-size: 11px; line-height: 1.55; }

.invite-screen { overflow-y: auto; }
.invite-card { width: min(100%, 475px); text-align: center; }
.invite-card > .brand-lockup { margin-bottom: 27px; }
.invite-large-mark { display: grid; width: 74px; height: 74px; place-items: center; margin: 0 auto 22px; border-radius: 24px 24px 24px 8px; background: color-mix(in srgb, var(--list-color, var(--green)) 15%, var(--surface)); color: var(--green); font-size: 35px; }
.invite-large-mark .icon { width: 28px; height: 28px; }
.invite-card .eyebrow { margin-bottom: 12px; }
.invite-card h1 { font-size: clamp(36px, 8vw, 49px); }
.invite-card .muted-copy { margin: 15px auto 19px; }
.invite-list-preview { display: grid; grid-template-columns: 45px minmax(0,1fr); align-items: center; gap: 2px 12px; margin: 23px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); text-align: left; }
.invite-list-preview > span { grid-row: span 2; font-size: 26px; }
.invite-list-preview strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.invite-list-preview small { color: var(--muted); font-size: 10px; }
.invite-accept-button { width: 100%; }
.invite-card .auth-actions { margin-top: 20px; }
.text-link { display: inline-block; margin-top: 19px; color: var(--muted); font-size: 11px; text-decoration: none; }
.text-link:hover { color: var(--green); text-decoration: underline; }

#app-dialog {
  width: min(100% - 24px, 560px);
  max-width: 560px;
  max-height: min(88dvh, 850px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: dialog-enter .2s ease both;
}
#app-dialog.sheet-wide { max-width: 680px; }
#app-dialog::backdrop { background: rgba(15, 23, 18, .44); backdrop-filter: blur(4px); }
.sheet { padding: 25px; }
.sheet-wide { padding: 27px; }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.sheet-header .eyebrow { margin-bottom: 6px; }
.sheet-header h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 500; letter-spacing: -.035em; }
.sheet-header .icon-button { margin: -5px -5px 0 0; }
.sheet-divider { height: 1px; margin: 20px 0; background: var(--line); }
.setting-row {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 5px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.setting-row:hover { color: var(--green); }
.setting-row > span:first-child { display: flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 650; }
.setting-row .icon { width: 18px; height: 18px; color: var(--muted); }
.setting-row.danger-row { color: var(--red); }
.setting-row.danger-row .icon { color: var(--red); }
.row-arrow { color: var(--muted); }
.account-sheet-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 15px; padding: 13px; border-radius: 14px; background: var(--surface-soft); }
.account-sheet-row > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.account-sheet-row strong { font-size: 13px; }
.account-sheet-row small { color: var(--muted); font-size: 10px; }
.confirm-copy { margin: 12px 0; color: var(--ink); font-size: 14px; line-height: 1.6; }
.confirm-copy strong { color: var(--green); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.confirm-actions .button { min-width: 110px; }
.sheet-tabs { display: flex; gap: 4px; overflow-x: auto; margin: -3px -4px 17px; padding: 4px; border-bottom: 1px solid var(--line); }
.sheet-tabs button { min-height: 38px; padding: 8px 13px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.sheet-tabs button.active { background: var(--green-soft); color: var(--green); }
.sheet-tab-content { max-height: 60dvh; overflow-y: auto; padding-right: 2px; }
.settings-section { margin: 17px 0 22px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title-row .eyebrow { margin-bottom: 4px; font-size: 9px; }
.section-title-row h3, .notification-info h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 500; }
.member-list, .invite-list, .device-list { display: flex; flex-direction: column; }
.member-row, .invite-row, .device-row { display: flex; min-height: 59px; align-items: center; gap: 10px; padding: 8px 3px; border-bottom: 1px solid var(--line); }
.member-copy, .invite-row-copy, .device-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.member-copy strong, .invite-row-copy strong, .device-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.member-copy small, .invite-row-copy small, .device-copy small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.role-badge { flex: 0 0 auto; padding: 5px 7px; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 750; }
.invite-empty { padding: 12px 3px; color: var(--muted); }
.invite-empty p { margin: 0 0 4px; font-size: 11px; }
.invite-empty small { font-size: 10px; }
.invite-row { flex-wrap: wrap; }
.invite-row-copy { flex-basis: 110px; }
.invite-url { max-width: 100%; overflow-wrap: anywhere; color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.invite-status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.status-active { background: #71a978; box-shadow: 0 0 0 4px var(--green-soft); }
.status-accepted { background: var(--green); }
.status-revoked { background: var(--red); }
.status-expired { background: var(--orange); }
.invite-revoke { flex: 0 0 auto; }
.notification-info { padding: 8px 2px 16px; text-align: center; }
.notification-symbol { display: grid; width: 52px; height: 52px; place-items: center; margin: 4px auto 13px; border-radius: 18px; background: var(--green-soft); color: var(--green); }
.notification-symbol .icon { width: 23px; height: 23px; }
.notification-info h3 { font-size: 22px; }
.notification-info > p { max-width: 390px; margin: 9px auto 17px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.notification-info .inline-note { margin: 12px auto; }
.notification-info .button { margin: 7px auto; }
.permission-button { display: block; margin: 8px auto; }
.device-row { text-align: left; }
.device-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: var(--surface-soft); color: var(--muted); }
.device-icon .icon { width: 17px; height: 17px; }
.switch { position: relative; width: 46px; height: 27px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 18px; background: var(--line-strong); cursor: pointer; transition: background .18s ease; }
.switch > span:first-child { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s ease; }
.switch.is-on { background: var(--green); }
.switch.is-on > span:first-child { transform: translateX(19px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.qr-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 4px 0 8px; text-align: center; }
.qr-frame { display: grid; width: min(100%, 288px); aspect-ratio: 1; place-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.qr-frame svg { display: block; width: 100%; height: 100%; }
.qr-panel p { max-width: 340px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.qr-panel code { padding: 9px 12px; border-radius: 9px; background: var(--surface-soft); color: var(--green); font-size: 10px; }
.history-list { display: flex; flex-direction: column; }
.history-event { display: flex; align-items: flex-start; gap: 11px; padding: 13px 3px; border-bottom: 1px solid var(--line); }
.history-copy { min-width: 0; flex: 1; }
.history-copy p { margin: 2px 0 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.history-copy p strong { color: var(--ink); }
.history-copy small { display: block; margin: 2px 0 4px; color: var(--muted); font-size: 10px; }
.history-copy time { color: var(--muted); font-size: 9px; }
.history-sequence { padding-top: 4px; color: var(--muted); font-size: 9px; }
.load-more { display: flex; margin: 16px auto 0; }

.toast {
  position: fixed;
  z-index: 30;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast[data-kind="error"] { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); color: var(--red); }

.pwa-banner {
  position: fixed;
  z-index: 28;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 18px;
  display: flex;
  max-width: 520px;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(20, 32, 25, .18);
  animation: card-enter .24s ease both;
}
.pwa-banner[hidden] { display: none; }
.pwa-banner-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0;
  background: var(--green);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}
.pwa-banner-mark img { width: 100%; height: 100%; object-fit: contain; }
.pwa-banner-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.pwa-banner-copy strong { font-size: 11px; }
.pwa-banner-copy small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.pwa-banner .button { flex: 0 0 auto; }
.pwa-banner-close {
  width: 29px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}
.install-steps { display: grid; gap: 13px; margin: 18px 0; padding-left: 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.install-steps strong { color: var(--ink); }
.pwa-update-banner .pwa-banner-mark { background: var(--orange); color: #382817; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes sync-pulse { 50% { opacity: .35; } }

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 236px minmax(0,1fr); }
  .sidebar { padding-right: 12px; padding-left: 12px; }
  .list-heading-actions .icon-button { width: 40px; padding: 0; }
  .action-label { display: none; }
  .home-list-grid { gap: 11px; }
  .home-list-card { min-height: 104px; }
}

@media (max-width: 680px) {
  body { background: var(--page); }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-column { width: 100%; height: 100%; }
  .main-topbar {
    position: relative;
    z-index: 2;
    min-height: 60px;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    border-bottom-color: var(--line);
    background: color-mix(in srgb, var(--page) 91%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .home-topbar .mobile-brand { display: block; }
  .home-topbar .mobile-brand .brand-mark { width: 31px; height: 31px; }
  .home-topbar .mobile-brand .brand-name { font-size: 20px; }
  .list-topbar .mobile-brand { display: block; }
  .list-topbar .mobile-brand .brand-mark { width: 31px; height: 31px; }
  .list-topbar .mobile-brand .brand-name { font-size: 20px; }
  .home-topbar .icon-button { width: 38px; height: 38px; }
  .list-topbar .account-avatar-button { display: inline-grid; width: 38px; height: 38px; padding: 0; align-items: center; justify-items: center; }
  .sync-status { width: 38px; min-height: 38px; justify-content: center; padding: 0; border-color: transparent; background: transparent; }
  .sync-status-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .sync-status .icon { display: none; }
  .main-panel { height: calc(100% - 60px - env(safe-area-inset-top)); }
  .home-view { padding: 28px 17px calc(22px + env(safe-area-inset-bottom)); }
  .home-intro { align-items: flex-end; gap: 10px; margin-bottom: 19px; }
  .home-intro-actions { gap: 7px; }
  .reorder-home-button { padding: 8px 4px; font-size: 10px; }
  .home-intro h1 { font-size: clamp(34px, 10vw, 43px); }
  .home-intro .eyebrow { margin-bottom: 8px; }
  .home-intro .muted-copy { max-width: 220px; margin-top: 7px; font-size: 12px; }
  .create-list-button { min-height: 42px; gap: 6px; padding: 8px 10px; border-radius: 11px; font-size: 11px; }
  .create-list-button .icon { width: 17px; height: 17px; }
  .home-list-grid { grid-template-columns: 1fr; gap: 9px; }
  .home-list-card { min-height: 82px; border-radius: 16px; }
  .home-card-main { grid-template-columns: 45px minmax(0, 1fr); gap: 1px 12px; padding: 12px; }
  .home-card-icon { grid-row: span 2; width: 43px; height: 43px; margin: 0; }
  .home-card-title { max-width: 100%; font-size: 18px; }
  .home-card-meta { margin-top: 4px; font-size: 10px; }
  .home-card-menu { top: 7px; right: 8px; width: 32px; height: 32px; }
  .list-view { min-height: 100%; padding: 8px 15px 0; }
  .list-heading { position: relative; display: grid; min-height: 96px; grid-template-columns: 44px 40px minmax(0, 1fr); grid-template-rows: 52px 44px; gap: 0 7px; }
  .mobile-back { display: grid; width: 44px; height: 44px; grid-column: 1; grid-row: 1; place-items: center; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
  .mobile-back:hover { background: var(--surface-soft); }
  .mobile-back .icon { width: 19px; height: 19px; }
  .list-heading-glyph { width: 40px; height: 40px; grid-column: 2; grid-row: 1; border-radius: 13px; font-size: 21px; }
  .list-heading-text { grid-column: 3; grid-row: 1; padding-right: 46px; }
  .list-heading h1 { font-size: clamp(21px, 6vw, 27px); }
  .list-heading-text p { font-size: 10px; }
  .list-edit-button { position: absolute; top: 4px; right: 0; width: 44px; height: 44px; }
  .list-heading-actions { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; gap: 3px; }
  .list-heading-actions .icon-button { width: 44px; min-width: 44px; height: 44px; }
  .list-heading-actions .icon { width: 18px; height: 18px; }
  .list-toolbar { gap: 7px; margin: 11px 0 10px; }
  .search-box { min-height: 42px; gap: 7px; padding: 0 10px; border-radius: 11px; }
  .search-box input { min-height: 40px; font-size: 14px; }
  .sort-trigger { max-width: 134px; min-height: 42px; gap: 4px; padding: 0 8px; border-radius: 11px; font-size: 10px; }
  .sort-menu { min-width: 164px; }
  .list-scroll-area { padding-bottom: 10px; }
  .section-heading { min-height: 31px; }
  .item-row { min-height: 64px; gap: 9px; padding: 8px 1px; }
  .item-name { font-size: 15px; }
  .item-details { font-size: 10px; }
  .item-author { gap: 5px; margin-top: 6px; font-size: 9px; }
  .item-author .avatar, .item-buyer .avatar { width: 19px; height: 19px; }
  .item-buyer { max-width: 85px; gap: 4px; font-size: 9px; }
  .item-actions { gap: 0; }
  .item-action { width: 31px; height: 34px; }
  .item-action .icon { width: 16px; height: 16px; }
  .purchased-section { margin-top: 9px; padding: 5px 10px 10px; border-radius: 14px; }
  .add-item-form {
    margin: 0 -15px;
    gap: 7px;
    padding: 10px 13px calc(10px + env(safe-area-inset-bottom));
  }
  .add-name-wrap > input { min-height: 46px; padding-left: 12px; border-radius: 13px; font-size: 16px; }
  .add-extra-button { width: 40px; height: 42px; border-radius: 12px; }
  .add-submit { width: 47px; height: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
  .add-submit span { display: none; }
  .add-submit .icon { width: 20px; height: 20px; }
  .auth-screen, .onboarding-screen, .invite-screen { align-items: center; padding: calc(82px + env(safe-area-inset-top)) 15px calc(22px + env(safe-area-inset-bottom)); }
  .auth-topline { top: calc(14px + env(safe-area-inset-top)); right: 14px; left: 14px; }
  .auth-card, .onboarding-card, .invite-card { padding: 26px 21px; border-radius: 21px; }
  .auth-card h1, .onboarding-card h1, .invite-card h1 { font-size: clamp(37px, 11vw, 47px); }
  .auth-description { margin: 13px 0 20px; font-size: 12px; }
  .auth-actions .button { min-height: 58px; gap: 8px; padding: 10px; }
  .auth-actions .google-signin-button { min-height: 48px; gap: 10px; padding: 9px 12px; }
  .auth-actions .button strong { font-size: 11px; }
  .auth-actions .button small { font-size: 9px; }
  .button-icon, .google-g { width: 30px; height: 30px; }
  .google-logo { width: 20px; height: 20px; }
  .auth-footnote { margin-top: 17px; font-size: 9px; }
  .onboarding-card > .brand-lockup { margin-bottom: 28px; }
  .invite-card > .brand-lockup { margin-bottom: 23px; }
  .invite-large-mark { width: 63px; height: 63px; margin-bottom: 18px; border-radius: 20px; font-size: 30px; }
  .invite-list-preview { margin: 18px 0; }
  #app-dialog { width: 100%; max-width: none; max-height: min(88dvh, 850px); margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  #app-dialog::backdrop { background: rgba(15, 23, 18, .5); }
  .sheet, .sheet-wide { padding: 21px 17px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-header h2 { font-size: 22px; }
  .sheet-tab-content { max-height: 59dvh; }
  .toast { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); left: 12px; max-width: none; text-align: center; }
  .pwa-banner { right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 10px; gap: 8px; padding: 9px; border-radius: 15px; }
  .pwa-banner-mark { width: 34px; height: 34px; border-radius: 0; }
  .pwa-banner-copy strong { font-size: 10px; }
  .pwa-banner-copy small { font-size: 8px; }
  .pwa-banner .button { min-height: 34px; padding: 7px 9px; font-size: 9px; }
  .pwa-banner-close { width: 22px; }
}

@media (max-width: 380px) {
  .list-heading { gap: 5px; }
  .list-heading-actions .icon-button { width: 44px; min-width: 44px; }
  .list-heading-glyph { width: 36px; height: 36px; }
  .list-heading h1 { font-size: 20px; }
  .sort-trigger { max-width: 120px; }
  .item-buyer { max-width: 70px; }
}

@media (min-width: 681px) and (max-height: 700px) {
  .sidebar > .brand-lockup { margin-bottom: 24px; }
  .home-view { padding-top: 28px; }
  .list-view { padding-top: 15px; }
  .home-list-card { min-height: 122px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
