/* The shared list in a browser, in the iPhone's colours (UITheme's tokens,
   App/UI/UITheme.swift) with the clean type and spacing of ChatGPT's web app. */
@font-face { font-family: Inter; src: url('/fonts/inter.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f7f5f0;               /* homeBg */
  --text: #1a1a18;             /* homeText */
  --secondary: #6b6b60;        /* homeSecondaryText */
  --brand: #6b8e23;            /* BrandGreen */
  --primary: #6b8e23;
  --primary-strong: #526d1b;
  --button: #283b1e;
  --on-button: #fff;
  --inverse: #fff;             /* inverseText */
  --adaptive: #11192c;         /* textPrimaryAdaptive */
  --adaptive-secondary: #606a7b; /* textSecondaryAdaptive */
  --tertiary: #a0a7b3;         /* textTertiary */
  --card: #fff;                /* cardBg */
  --elevated: #fff;            /* elevatedBg */
  --sheet: #f2f2f0;            /* sheetBg */
  --divider: rgb(0 0 0 / .08); /* dividerAdaptive */
  --overlay: rgb(0 0 0 / .3);  /* overlayBg */
  --icon-bg: #e6e6e8;          /* iconBgAdaptive */
  --close-icon: #606064;
  --drawer-label: #606a7b;
  --danger: #ff453a;
  --line: #dedfd4;
  --cart-fill: #ebebe9;        /* chipBg */
  --input-border: #bfc6b8;
  --error: #963b27;
  --sidebar-bg: #efede7;       /* the docked sidebar on a wide screen */
  --hover: rgb(0 0 0 / .05);
  --selected: color-mix(in srgb, var(--text) 9%, transparent);
  --menu-bg: #fafaf8;
  --composer-height: 76px;
  color-scheme: light;
}
/* Dark: the Theme in Settings, or the device's under System (theme.js). */
:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --text: #f0f0f0;
  --secondary: #adadad;
  --primary-strong: #9cbd5a;
  --button: #6b8e23;
  --inverse: #1a1a1a;
  --adaptive: #fff;
  --adaptive-secondary: #8e8e93;
  --tertiary: rgb(255 255 255 / .4);
  --card: #1c1c1e;
  --elevated: #222;
  --sheet: #121212;
  --divider: rgb(255 255 255 / .06);
  --overlay: rgb(0 0 0 / .42);
  --icon-bg: #3a3a3c;
  --close-icon: #787880;
  --drawer-label: #94a3b8;
  --line: #2c2c2e;
  --cart-fill: #1a1a1a;
  --input-border: #3a3a3c;
  --error: #ff8a70;
  --sidebar-bg: #171717;
  --hover: rgb(255 255 255 / .06);
  --menu-bg: #2c2c2e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.top, main { width: min(100%, 560px); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: max(12px, env(safe-area-inset-top)); }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-size: 19px; font-weight: 700; text-decoration: none; }
.brand img { display: block; }
.offline-note { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; z-index: 30; margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--cart-fill); color: var(--secondary); font-size: 13px; font-weight: 600; white-space: nowrap; transform: translateX(-50%); }
main { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
body.has-composer main { padding-bottom: calc(var(--composer-height) + max(24px, env(safe-area-inset-bottom))); }

h1 { margin: 0 0 8px; font-size: clamp(25px, 7vw, 30px); line-height: 1.16; letter-spacing: -0.03em; font-weight: 650; overflow-wrap: anywhere; }
p { margin: 0 0 16px; }
.muted { color: var(--secondary); font-size: 13px; }
a { color: var(--primary-strong); }
:focus-visible { outline: 2px solid #7da244; outline-offset: 2px; }

/* Messages */
.card { margin-top: clamp(20px, 6vh, 56px); padding: 26px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.card > p { color: var(--secondary); }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 600; }
input, .fields select { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid var(--input-border); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
button, .button-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 11px 16px; border: 0; border-radius: 12px; background: var(--button); color: var(--on-button); font: 600 15px/1.3 Inter, sans-serif; text-decoration: none; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button.secondary { background: color-mix(in srgb, var(--primary) 12%, var(--card)); color: var(--text); }
.status { margin: 14px 0 0; color: var(--error); overflow-wrap: anywhere; }
.status:empty { display: none; }
.actions { display: grid; gap: 10px; margin-top: 8px; }
body.on-welcome .top { display: none; }

/* First launch (GrocerApp FirstLaunchView): steps over a pinned pair of buttons */
.first-launch { max-width: 480px; margin: 0 auto; padding: max(48px, env(safe-area-inset-top)) 8px calc(150px + env(safe-area-inset-bottom)); color: var(--text); font-size: 16px; }
.first-launch-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 44px; font: 500 26px/1 Inter, sans-serif; }
.steps { display: flex; gap: 6px; margin-left: auto; }
.step { width: 8px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--secondary) 20%, transparent); transition: width .25s, background-color .25s; }
.step.done { background: var(--brand); }
.step.current { width: 24px; }
.first-launch h1 { margin: 0 0 12px; font: 500 28px/1.2 Inter, sans-serif; letter-spacing: -0.01em; }
.first-launch-intro { margin: 0 0 24px; color: var(--secondary); }
.values { list-style: none; display: grid; gap: 20px; margin: 0 0 24px; padding: 0; }
.values li { display: flex; align-items: flex-start; gap: 14px; color: var(--secondary); font-size: 15px; line-height: 1.4; }
.values strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 16px; font-weight: 500; }
.value-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.value-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.legal { margin: 0 0 10px; color: var(--secondary); font-size: 13px; }
.legal-links { display: flex; gap: 16px; margin: 0; }
.legal-links a { color: var(--primary); font: 500 14px/1.3 Inter, sans-serif; text-decoration: none; }
.first-launch-buttons {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; gap: 8px;
  width: min(100%, 528px); margin: 0 auto; padding: 24px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: var(--bg);
}
.first-launch-primary { min-height: 48px; border-radius: 999px; background: var(--primary); color: #fff; font: 500 16px/1.2 Inter, sans-serif; }
.first-launch-secondary { min-height: 44px; background: none; color: var(--text); font: 400 16px/1.2 Inter, sans-serif; }

/* Sign-in (SupabaseAuthSheet): Apple and Google, "or", then an email code in a card */
.auth { max-width: 480px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 0 40px; }
body:has(#view-sign-in:not(.hidden)) { background: var(--sheet); }
.auth-head { position: relative; display: grid; place-items: center; min-height: 56px; }
.auth-head h1 { margin: 0; color: var(--adaptive); font: 500 18px/1.3 Inter, sans-serif; letter-spacing: 0; text-align: center; }
.auth-head .close-button { position: absolute; right: -7px; top: 7px; margin: 0; padding: 0; min-height: 42px; }
.auth-intro { display: grid; justify-items: center; gap: 10px; margin: 8px 0 24px; text-align: center; }
.auth-icon { width: 52px; height: 52px; fill: var(--text); }
.auth-intro p { margin: 0; color: var(--adaptive-secondary); font: 400 14px/1.45 Inter, sans-serif; }
.auth form { gap: 20px; }
.auth-social { display: grid; gap: 12px; padding: 16px; }
.auth-social:not(:has(button:not(.hidden))) { display: none; }
.provider { min-height: 50px; border-radius: 999px; font: 500 16px/1.2 Inter, sans-serif; }
.provider svg { flex: none; width: 18px; height: 18px; }
.provider.apple { background: #000; color: #fff; }
.provider.google { border: 1px solid var(--divider); background: var(--card); color: var(--adaptive); }
:where([data-theme="dark"]) .provider.apple { border: 1px solid rgb(255 255 255 / .08); background: var(--card); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--adaptive-secondary); font: 500 12px/1 Inter, sans-serif; }
.divider::before, .divider::after { content: ""; flex: 1; height: .5px; background: var(--divider); }
.auth-card { display: grid; gap: 14px; padding: 16px; border-radius: 12px; background: var(--card); }
.auth-card input { min-height: 48px; border: 0; border-radius: 10px; background: var(--sheet); font: 400 15px/1.3 Inter, sans-serif; }
:where([data-theme="dark"]) .auth-card input { background: #373737; }
.auth-card button[type="submit"] { min-height: 48px; border-radius: 999px; background: var(--primary); font: 500 15px/1.2 Inter, sans-serif; }
.auth-code-note { margin: 0; color: var(--adaptive-secondary); font: 400 13px/1.4 Inter, sans-serif; text-align: center; }
#code-form { margin-top: 20px; }
#change-email { justify-self: center; min-height: 36px; color: var(--adaptive-secondary); font: 500 12px/1 Inter, sans-serif; }
.auth .status { color: var(--danger); font: 400 12px/1.4 Inter, sans-serif; text-align: center; }
.auth .agreement { margin: 18px 4px 0; text-align: center; }
.text-button { min-height: 44px; padding: 8px 4px; background: none; color: var(--secondary); font-weight: 600; font-size: 14px; }
a.text-button { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.text-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.center-note { display: grid; justify-items: center; gap: 14px; margin-top: 30vh; color: var(--secondary); }
.spinner { width: 28px; height: 28px; border: 3px solid color-mix(in srgb, var(--primary) 25%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* A list: the iPhone's bar (HomeListRootView header) over the page */
body.on-list .top { display: none; }
body.on-list main { padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
.list-bar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center;
  margin: 0 -28px; padding: max(11px, env(safe-area-inset-top)) 28px 10px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.list-bar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 20px; background: linear-gradient(color-mix(in srgb, var(--bg) 85%, transparent), transparent); pointer-events: none; }
.bar-button { position: relative; width: 44px; min-height: 44px; padding: 0; border-radius: 0; background: none; color: var(--adaptive); }
#open-drawer { justify-content: flex-start; }
#members-button { justify-content: flex-end; }
.menu-icon { width: 26px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.people-icon { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.shared .people-icon { fill: currentColor; }
.members-badge {
  position: absolute; top: 4px; right: -6px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
  border: 1.5px solid var(--bg); border-radius: 999px; background: var(--primary); color: #fff; font: 700 10px/1 Inter, sans-serif;
}
:where([data-theme="dark"]) .members-badge { color: #000; }
.list-heading { min-width: 0; }
.list-actions, .sidebar-toggle, .sidebar-icon, .drawer-count, .drawer-gear-label, .members-label { display: none; }
.list-title {
  margin: 0; overflow: hidden; color: var(--text); font: 400 18px/1.3 Inter, sans-serif; letter-spacing: -0.01em;
  text-align: center; white-space: nowrap; text-overflow: ellipsis;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}

/* The sidebar (HomeListRootView drawer): slides over the list, which dims */
.drawer-scrim { position: fixed; inset: 0; z-index: 40; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity .28s ease; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 41;
  display: flex; flex-direction: column; width: min(75vw, 340px);
  background: var(--bg); transform: translateX(-100%); transition: transform .28s cubic-bezier(.2, .9, .25, 1);
}
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: none; }
.drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; }
.drawer-brand { flex: none; margin: 0; padding: calc(env(safe-area-inset-top) + 4px) 22px 4px max(22px, env(safe-area-inset-left)); color: var(--primary); font: 700 22px/44px Inter, sans-serif; letter-spacing: -0.01em; }
.drawer-lists { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 32px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 22px 28px max(22px, env(safe-area-inset-left)); }
.drawer-label { margin: 0 0 4px; padding: 0 14px; color: var(--drawer-label); font: 400 13px/1.3 Inter, sans-serif; }
.drawer-row {
  display: grid; gap: 4px; padding: 12px 14px; color: var(--adaptive); text-decoration: none;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.drawer-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.drawer-title { min-width: 0; overflow: hidden; font: 400 16px/1.35 Inter, sans-serif; white-space: nowrap; text-overflow: ellipsis; }
.drawer-summary { color: var(--tertiary); font: 400 12px/1.3 Inter, sans-serif; }
.drawer-row[aria-current] { border-radius: 12px; background: var(--selected); }
.drawer-row[aria-current] .drawer-title { font-weight: 500; }
.drawer-row[aria-current] .drawer-summary { color: var(--adaptive-secondary); font-weight: 500; }
.shared-badge { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font: 700 10px/1 Inter, sans-serif; }
.shared-badge svg { width: 11px; height: 11px; fill: currentColor; }
.drawer-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: -48px; padding: 56px 22px max(16px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background: linear-gradient(transparent, var(--bg) 45%); pointer-events: none;
}
.drawer-foot > * { pointer-events: auto; }
.add-list { gap: 9px; min-height: 52px; padding: 0 22px; border-radius: 26px; background: var(--text); color: var(--inverse); font: 500 17px/1 Inter, sans-serif; }
.add-list svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.drawer-gear { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--divider); border-radius: 50%; background: var(--elevated); color: var(--text); }
.drawer-gear svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-scrim { transition: none; } }

.back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; color: var(--secondary); font-size: 14px; font-weight: 600; text-decoration: none; }
.page-title { margin: 14px 0 6px; }
.icon-button { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: none; color: var(--secondary); }
.icon-button svg { width: 22px; height: 22px; fill: currentColor; }
.note { margin: 6px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--cart-fill); color: var(--secondary); font-size: 13px; }
/* The sharing tip (HomeListRootView sharingHint): a primary-coloured row with an X */
.sharing-hint { display: flex; align-items: center; gap: 8px; }
button.sharing-hint-share { flex: 1 1 auto; justify-content: flex-start; gap: 8px; min-width: 0; min-height: 44px; padding: 0; border-radius: 0; background: none; color: var(--primary); font: 400 15px/1.3 Inter, sans-serif; text-align: left; }
button.sharing-hint-dismiss { flex: none; width: 44px; min-height: 44px; padding: 0; border-radius: 0; background: none; color: var(--primary); }
.sharing-hint svg { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sharing-hint-dismiss svg { width: 17px; height: 17px; stroke-width: 2; }
/* Rows (HomeListRootView liveItemRow): aisles in order, each under its coloured label, then In Cart */
#sections { margin-top: 4px; }
.aisle { margin-top: 12px; }
.aisle + .aisle { margin-top: 24px; }
.aisle-pill {
  display: inline-block; margin: 0 0 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--pill-fill); box-shadow: inset 0 0 0 .8px var(--pill-stroke); color: var(--pill-text);
  font: 600 11px/1.2 Inter, -apple-system, sans-serif; letter-spacing: 1px; text-transform: uppercase;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
:where([data-theme="dark"]) .aisle-pill { background: var(--pill-dark-fill); box-shadow: none; color: var(--pill-dark-text); }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 9%, transparent);
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
@media (min-resolution: 2dppx) { .row { border-bottom-width: .5px; } }
.row.last { border-bottom: 0; }
.row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-name { color: var(--text); font: 400 16px/1.4 Inter, -apple-system, sans-serif; overflow-wrap: anywhere; }
.row-amount { flex: none; display: grid; place-items: center; min-width: 44px; min-height: 44px; color: var(--secondary); font: 400 15px/1.2 Inter, -apple-system, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-amount-long { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--secondary); font: 500 13px/1.3 Inter, -apple-system, sans-serif; }
.row-detail { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--secondary); font: 400 13px/1.3 Inter, -apple-system, sans-serif; overflow-wrap: anywhere; }
.row-detail .fork { display: inline-block; width: 12px; height: 12px; margin: 0 4px -1px 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.row.in-cart .row-name { color: color-mix(in srgb, var(--text) 35%, transparent); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); }
.row.in-cart .row-amount { color: color-mix(in srgb, var(--text) 30%, transparent); }
.row.pending { opacity: .7; }
/* The iPhone's ShoppingCheckmarkButton: a 24pt green ring that fills in */
.check { flex: none; width: 44px; min-height: 44px; margin-right: -10px; padding: 0; border-radius: 50%; background: none; }
.check:disabled { cursor: default; opacity: 1; }
.check .circle { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--primary); transition: background-color .2s, transform .12s; }
.check svg { width: 14px; height: 14px; fill: none; stroke: var(--inverse); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.7); transition: opacity .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.row.in-cart .check .circle { background: var(--primary); box-shadow: none; }
.row.in-cart .check svg { opacity: 1; transform: none; }
.check:active .circle { transform: scale(1.15); }
/* Checkbox position: Left (Settings) puts the check first, and names, amounts
   and categories align to the other side (HomeListRootView checkboxesOnLeft). */
.checks-left .row .check { order: -1; margin: 0 0 0 -10px; }
.checks-left .row-text { justify-items: end; text-align: right; }
.checks-left .aisle { text-align: right; }
.checks-left .row-options { right: auto; left: 44px; }
.row-options { position: absolute; right: 44px; width: 1px; min-height: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); background: var(--card); color: var(--secondary); }
.row-options:focus-visible { width: 36px; min-height: 36px; height: 36px; clip-path: none; border-radius: 50%; }
.row-options svg { width: 18px; height: 18px; fill: currentColor; }
@media (prefers-reduced-motion: reduce) { .check .circle, .check svg { transition: none; } }

.empty { display: grid; justify-items: center; gap: 9px; padding-top: 58px; text-align: center; }
.empty p { margin: 0; }
.empty-title { color: var(--text); font: 400 26px/1.25 Inter, sans-serif; letter-spacing: -0.02em; }
.empty-text { max-width: 320px; color: var(--adaptive-secondary); font-size: 16px; line-height: 1.45; }
.empty-link { gap: 6px; min-height: 40px; margin-top: 6px; padding: 0 16px; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent); color: var(--primary); font: 500 15px/1.2 Inter, sans-serif; }
.empty-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Adding items (HomeListRootView composer): the + button, or open, suggestion rows over a rounded box */
body.has-composer main { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
body.composer-open main { padding-bottom: calc(var(--composer-height) + 16px + max(6px, env(safe-area-inset-bottom))); }
.add-fab {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10;
  width: 48px; min-height: 48px; height: 48px; padding: 0; border-radius: 50%;
  border: 1px solid rgb(0 0 0 / .06); background: rgb(255 255 255 / .72); color: var(--text);
  box-shadow: 0 4px 14px rgb(0 0 0 / .1); -webkit-backdrop-filter: blur(12px) saturate(1.6); backdrop-filter: blur(12px) saturate(1.6);
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.add-fab:active { transform: scale(.92); }
:where([data-theme="dark"]) .add-fab { border-color: rgb(255 255 255 / .1); background: rgb(44 44 46 / .72); box-shadow: 0 4px 14px rgb(0 0 0 / .4); }
.add-fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; flex-direction: column;
  width: min(100%, 560px); margin: 0 auto; padding: 0 0 max(6px, env(safe-area-inset-bottom));
  background: var(--bg);
}
.composer::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.composer-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.suggestions-toggle { min-height: 44px; padding: 0; background: none; color: var(--secondary); font: 400 15px/1.2 Inter, sans-serif; }
.suggestions-toggle.invisible { visibility: hidden; }
.composer-close { width: 44px; min-height: 44px; margin-right: -12px; padding: 0; background: none; color: var(--secondary); }
.composer-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.suggestions { padding: 0 28px 8px; }
.suggestion-rows { display: grid; max-height: calc(48px * var(--suggestion-rows, 4)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 65%, transparent) transparent; }
.suggestion-row {
  justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0; border-radius: 0;
  background: none; color: var(--adaptive-secondary); font: 400 16px/1.2 Inter, sans-serif; text-align: left;
}
.suggestion-row:active { opacity: .6; }
.suggestion-row svg { flex: none; width: 24px; height: 18px; fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linecap: round; }
.suggestion-row span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.composer-card { margin: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); border: 1px solid var(--divider); border-radius: 28px; background: var(--elevated); box-shadow: 0 4px 16px rgb(0 0 0 / .05); }
:where([data-theme="dark"]) .composer-card { border-color: transparent; box-shadow: none; }
.composer-row { display: flex; align-items: center; padding: 4px 6px; }
.composer input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 4px 0 14px; border: 0; border-radius: 0;
  background: none; color: var(--text); font: 400 17px/1.35 Inter, sans-serif; caret-color: var(--primary);
}
.composer input::placeholder { color: var(--adaptive-secondary); opacity: 1; }
.composer input:focus-visible { outline: none; }
.composer-mic { flex: none; width: 44px; min-height: 44px; padding: 0; background: none; color: var(--text); }
.composer-mic svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.composer-send { flex: none; width: 38px; min-height: 38px; height: 38px; margin: 3px; padding: 0; border-radius: 50%; background: var(--primary); color: var(--inverse); transition: background-color .15s; }
.composer-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.composer.empty .composer-send { background: var(--icon-bg); color: var(--secondary); }
/* Dictation: a round X and stop button, and the words arriving in the box */
.composer-round { flex: none; width: 38px; min-height: 38px; height: 38px; margin: 3px; padding: 0; border-radius: 50%; background: var(--divider); color: var(--text); }
.composer-round svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#dictate .stop, .composer.dictating #dictate .mic { display: none; }
.composer.dictating #dictate { width: 38px; min-height: 38px; height: 38px; margin: 3px; border-radius: 50%; background: var(--divider); animation: listening 1.6s ease-out infinite; }
.composer.dictating #dictate .stop { display: block; fill: currentColor; stroke: none; }
@keyframes listening {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
@media (prefers-reduced-motion: reduce) { .composer.dictating #dictate { animation: none; } .add-fab { transition: none; } }

/* An item's long-press menu: a frosted card beside the row, over a dimmed list */
.context-menu {
  position: fixed; inset: auto auto auto max(14px, env(safe-area-inset-left)); margin: 0; width: min(250px, calc(100% - 28px));
  padding: 6px; border: 1px solid var(--divider); border-radius: 16px; background: var(--menu-bg); color: var(--adaptive);
  box-shadow: 0 10px 32px rgb(0 0 0 / .14);
}
.context-menu::backdrop { background: rgb(0 0 0 / .08); }
.menu-actions { gap: 0; }
.menu-button {
  justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  background: none; color: var(--adaptive); font: 400 16px/1.2 Inter, sans-serif;
}
.menu-button svg { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.menu-button:active, .menu-button:focus-visible { outline: none; background: var(--hover); }
@media (hover: hover) { .menu-button:hover { background: var(--hover); } }
.menu-button.danger-text { position: relative; margin-top: 12px; color: var(--danger); }
.menu-button.danger-text svg { opacity: 1; }
.menu-button.danger-text::before { content: ""; position: absolute; top: -6px; left: 12px; right: 12px; height: 1px; background: var(--line); }

/* Dialogs: a sheet of list actions from the bottom, and centered prompts */
dialog { padding: 0; border: 0; color: var(--text); background: var(--card); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; background: rgb(0 0 0 / .4); }
dialog h2 { margin: 0 0 8px; font-size: 19px; line-height: 1.25; font-weight: 650; overflow-wrap: anywhere; }
.modal { width: min(calc(100% - 32px), 400px); padding: 22px 20px 20px; border-radius: 20px; }
.modal p { color: var(--secondary); }
#confirm-text { white-space: pre-line; }
.modal form { gap: 14px; }
.modal .status { margin: 0; color: var(--error); }
.dialog-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.dialog-buttons button, .modal .done { border-radius: 999px; }
.dialog-buttons:has(> .hidden) { grid-template-columns: 1fr; }
.modal p:empty { display: none; }
.dialog-subtitle { margin: -4px 0 12px; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

/* An item's details: what the tiles leave out, read-only */
.fields { display: grid; gap: 14px; }
.facts { display: grid; gap: 12px; margin: 0; }
.facts:empty { display: none; }
.facts dt { color: var(--secondary); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; white-space: pre-line; }
.text-button.wide { width: 100%; }
.modal .danger-text { color: #b3261e; }
:where([data-theme="dark"]) .modal .danger-text { color: #ff8a70; }

/* Arrange categories: drag a row by its handle, or use its arrows */
.arrange { list-style: none; max-height: min(52dvh, 460px); margin: 0 0 12px; padding: 0; overflow-y: auto; border-radius: 12px; background: var(--bg); }
.arrange-row { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 4px 4px 0; background: var(--bg); }
.arrange-row + .arrange-row { border-top: 1px solid var(--line); }
.arrange-row.dragging { position: relative; z-index: 1; border-radius: 12px; background: var(--card); box-shadow: 0 6px 20px rgb(0 0 0 / .16); }
.arrange-handle { flex: none; display: grid; place-items: center; width: 40px; align-self: stretch; color: var(--secondary); cursor: grab; touch-action: none; }
.arrange-handle svg { width: 18px; height: 18px; fill: currentColor; }
.arrange-emoji { flex: none; width: 24px; text-align: center; }
.arrange-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.arrange-count { flex: none; color: var(--secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.arrange-row .icon-button { width: 36px; min-height: 36px; }
.arrange-row .icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.arrange-row .icon-button:disabled { opacity: .25; cursor: default; }
.text-button:disabled { opacity: .45; cursor: default; }

/* Sharing and members */
.share-link { margin: 0 0 14px; color: var(--secondary); font-size: 14px; text-overflow: ellipsis; }
.done { display: flex; width: 100%; margin-top: 6px; }
.members { list-style: none; max-height: min(50dvh, 420px); margin: 0 0 12px; padding: 0; overflow-y: auto; border-radius: 12px; background: var(--bg); }
.member { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 6px 8px 12px; }
.member + .member { border-top: 1px solid var(--line); }
.avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary-strong); font-size: 15px; font-weight: 700; }
.member-text { flex: 1; min-width: 0; display: grid; }
.member-name { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.member-role { color: var(--secondary); font-size: 13px; font-weight: 500; }
.member select { justify-self: start; min-height: 36px; margin-top: 4px; padding: 0 8px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--card); color: var(--text); font: 600 13px Inter, sans-serif; }
.member .icon-button svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.known { margin: 16px 0 0; }
.known-title { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.known .members { margin-bottom: 8px; }
.known .member { padding-right: 10px; }
button.add-person { flex: none; min-width: 64px; min-height: 36px; padding: 0 18px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 15px; }
.auto-add { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--secondary); font-size: 13px; font-weight: 500; cursor: pointer; }
.auto-add .switch { transform: scale(.8); transform-origin: left center; margin-right: -10px; }
button.danger { background: #b3261e; color: #fff; }
.sheet {
  width: min(100%, 560px); max-width: none; margin: auto auto 0;
  padding: 8px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-radius: 20px 20px 0 0;
}
.sheet-title { margin: 10px 8px 6px; color: var(--secondary); font-size: 13px; font-weight: 600; text-align: center; }
.sheet-actions { gap: 0; }
.sheet-button { justify-content: flex-start; min-height: 52px; border-radius: 12px; background: none; color: var(--text); font-weight: 600; font-size: 16px; }
.sheet-button:hover { background: var(--cart-fill); }
.sheet-button.danger-text { color: #b3261e; }
:where([data-theme="dark"]) .sheet-button.danger-text { color: #ff8a70; }
.sheet-button:last-child { justify-content: center; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; color: var(--secondary); }

/* Settings, the iPhone's sheet (SettingsView): grouped cards on the sheet grey */
body.on-settings { background: var(--sheet); }
body.on-settings .top { display: none; }
.settings-head { display: flex; justify-content: flex-end; padding-top: max(18px, env(safe-area-inset-top)); }
.close-button {
  display: grid; place-items: center; width: 42px; height: 42px; margin: 7px -7px 0 0; border-radius: 50%;
  background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--close-icon); box-shadow: 0 2px 6px rgb(0 0 0 / .05);
}
:where([data-theme="dark"]) .close-button { background: rgb(56 56 56 / .68); box-shadow: 0 2px 6px rgb(0 0 0 / .1); }
.close-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.settings-label { margin: 28px 4px 10px; color: var(--adaptive-secondary); font: 500 12px/1.3 Inter, sans-serif; letter-spacing: .8px; text-transform: uppercase; }
.settings-head + .settings-label { margin-top: 4px; }
.settings-card { border-radius: 12px; background: var(--card); overflow: hidden; }
.settings-card-after { margin-top: 10px; }
.settings-footnote { margin: 8px 4px 0; color: var(--adaptive-secondary); font: 400 13px/1.35 Inter, sans-serif; }
.settings-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; color: var(--adaptive); text-decoration: none; }
.settings-row + .settings-row::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: .5px; background: var(--divider); }
.settings-toggle { padding-top: 10px; padding-bottom: 10px; cursor: pointer; }
.settings-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #787880; color: #fff; }
:where([data-theme="dark"]) .settings-icon { background: #8e8e93; }
.settings-icon.green { background: var(--brand); }
.settings-icon.red { background: var(--danger); }
.settings-icon svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.settings-icon .cut { fill: none; stroke: var(--settings-cut, #787880); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:where([data-theme="dark"]) .settings-icon .cut { stroke: #8e8e93; }
.settings-icon .ring { fill: none; stroke: currentColor; stroke-width: 1.8; }
/* A menu picker, as the iPhone's Theme row: the choice and up/down chevrons */
.settings-select { position: relative; flex: none; display: flex; align-items: center; margin-right: -4px; color: var(--adaptive); }
.settings-select select { appearance: none; min-height: 44px; padding: 0 22px 0 8px; border: 0; background: none; color: inherit; font: 400 16px/1.3 Inter, sans-serif; text-align: right; cursor: pointer; }
.settings-select select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.settings-select option { background: var(--menu-bg); color: var(--text); }
.settings-select svg { position: absolute; right: 2px; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
/* A row with its control and explanation under the name (Checkbox position) */
.settings-stack { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.settings-row.settings-stack::before, .settings-toggle + .settings-toggle::before { left: 16px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.segmented label { position: relative; display: grid; cursor: pointer; }
.segmented input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; min-height: 36px; border-radius: 7px; color: var(--adaptive); font: 500 14px/1.2 Inter, sans-serif; }
.segmented input:checked + span { background: var(--elevated); box-shadow: 0 1px 4px rgb(0 0 0 / .12); }
:where([data-theme="dark"]) .segmented input:checked + span { background: #636366; box-shadow: none; }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
.settings-text { flex: 1; display: grid; gap: 2px; min-width: 0; text-align: left; }
.settings-name { flex: 1; min-width: 0; color: var(--adaptive); font: 400 16px/1.3 Inter, sans-serif; text-align: left; }
.settings-text .settings-name { flex: none; }
.settings-detail { color: var(--adaptive-secondary); font: 400 13px/1.35 Inter, sans-serif; overflow-wrap: anywhere; }
.settings-detail:empty { display: none; }
.settings-chevron { flex: none; width: 15px; height: 15px; fill: none; stroke: color-mix(in srgb, var(--text) 25%, transparent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.settings-row.settings-tall { padding-top: 12px; padding-bottom: 12px; }
button.settings-button { width: 100%; justify-content: flex-start; min-height: 50px; padding: 0 16px; border-radius: 0; background: none; color: var(--adaptive); font: inherit; }
.settings-button:active { background: color-mix(in srgb, var(--text) 6%, transparent); }
.sign-out { flex: none; min-height: 44px; padding: 0; background: none; color: var(--danger); font: 500 13px/1 Inter, sans-serif; }
#view-settings .danger-text { color: var(--danger); }
#view-settings { padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 32px)); }
/* An iOS-style switch for on/off settings */
input.switch { appearance: none; flex: none; position: relative; width: 51px; min-height: 31px; height: 31px; padding: 0; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--text) 16%, transparent); cursor: pointer; transition: background .2s; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .2); transition: transform .2s; }
input.switch:checked { background: var(--brand); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:disabled { opacity: .45; cursor: default; }
input.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::after { transition: none; } }

/* Use with ChatGPT, the iPhone's guide */
.guide { max-height: calc(100dvh - 32px); overflow-y: auto; }
.guide-title { font: 600 24px/1.2 Inter, sans-serif; letter-spacing: -0.02em; }
.guide-open { display: flex; width: 100%; border-radius: 999px; background: var(--primary); color: #fff; }
.guide-open svg, .guide-privacy svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.modal .guide-hint { margin: 8px 0 22px; font-size: 13px; text-align: center; }
.guide-label { margin: 0 4px 10px; color: var(--secondary); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.guide-card { list-style: none; margin: 0 0 22px; padding: 0; border-radius: 12px; background: var(--bg); }
.guide-card li + li { border-top: 1px solid var(--line); }
.guide-steps { counter-reset: step; }
.guide-steps li { display: flex; align-items: baseline; gap: 12px; padding: 13px 16px; font-size: 15px; counter-increment: step; }
.guide-steps li::before { content: counter(step); flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary-strong); font-size: 13px; font-weight: 650; }
.guide-prompts li { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 4px 4px 16px; font-size: 15px; }
.guide-prompts span { flex: 1; min-width: 0; }
.guide-prompts .icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.guide-prompts .copied { color: var(--primary-strong); }
.guide .status { margin: -10px 4px 14px; color: var(--secondary); font-size: 13px; }
.guide-privacy { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 4px 4px; font-size: 14px; font-weight: 600; text-decoration: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 56px); z-index: 20;
  max-width: min(92vw, 420px); padding: 10px 16px; border-radius: 14px;
  background: #1a1a18; color: #fff; font-size: 14px; text-align: center;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
:where([data-theme="dark"]) .toast { background: #f0f0f0; color: #1a1a18; }

/* The list-complete burst (confetti.ts): over everything, never in the way */
.confetti { position: fixed; inset: 0; z-index: 60; width: 100vw; height: 100vh; pointer-events: none; }
/* "Deleted Milk · Undo": the latest check-off or delete, for a few seconds */
.undo-bar {
  position: fixed; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 56px); z-index: 20;
  display: flex; align-items: center; gap: 12px; width: min(calc(100% - 32px), 420px); min-height: 48px; padding: 0 8px 0 16px; border-radius: 14px;
  background: var(--adaptive); color: var(--inverse); font: 500 15px/1.3 Inter, sans-serif; box-shadow: 0 4px 10px rgb(0 0 0 / .18);
  transform: translate(-50%, 12px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
}
body.composer-open .toast, body.composer-open .undo-bar { bottom: calc(var(--composer-height) + 8px + max(6px, env(safe-area-inset-bottom))); }
.undo-bar.visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.undo-bar span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.undo-bar button { flex: none; min-width: 44px; min-height: 44px; padding: 0 10px; background: none; color: inherit; font-weight: 700; }

@media (max-width: 360px) {
  .card { padding: 22px 18px; }
}

/* Wide screens: ChatGPT's web layout. The sidebar stays docked on the left
   until its button folds it away, the list reads in a centred column, and
   the composer is always open under it, like ChatGPT's message box. */
@media (min-width: 768px) {
  .sheet { width: min(calc(100% - 32px), 380px); margin: auto; padding: 8px; border-radius: 16px; }
}
body.wide { --sidebar: 0px; --column: min(100% - 48px, 680px); }
body.wide.docked { --sidebar: 260px; }
body.wide main { width: auto; margin: 0 0 0 var(--sidebar); padding-left: 0; padding-right: 0; }
/* It slides only when folded or unfolded, not as the page opens. */
body.wide .drawer { transition: none; }
body.sidebar-moving .drawer { transition: transform .28s cubic-bezier(.2, .9, .25, 1); }
body.sidebar-moving main { transition: margin-left .28s cubic-bezier(.2, .9, .25, 1); }
body.sidebar-moving .composer { transition: left .28s cubic-bezier(.2, .9, .25, 1); }
body.wide #view-list > :not(.list-bar), body.wide #view-settings { width: var(--column); margin-left: auto; margin-right: auto; }
body.wide #view-settings { --column: min(100% - 48px, 560px); }
body.wide #view-loading { margin-top: 38vh; }

body.wide .list-bar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px; margin: 0; padding: 10px 14px; background: var(--bg); }
body.wide .list-bar::after { display: none; }
body.wide.docked #open-drawer { display: none; }
body.wide .list-heading { grid-column: 2; display: flex; align-items: center; gap: 2px; padding-left: 6px; }
body.wide #members-button { grid-column: 3; justify-content: center; gap: 6px; width: auto; min-height: 36px; padding: 0 12px; border-radius: 999px; font: 500 14px/1 Inter, sans-serif; }
body.wide #members-button .people-icon { width: 19px; height: 19px; stroke-width: 1.8; }
body.wide .members-label { display: inline; }
body.wide .members-badge { position: static; border: 0; }
body.wide .list-title { text-align: left; }
/* A new list has no name yet; the iPhone leaves the bar blank, a wide one says so. */
body.wide .list-title:empty::before { content: "New list"; color: var(--tertiary); }
body.wide .menu-icon { display: none; }
body.wide .sidebar-icon { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
body.wide #open-drawer { justify-content: center; border-radius: 10px; }
body.wide .list-actions {
  display: grid; place-items: center; flex: none; width: 32px; min-height: 32px; height: 32px; padding: 0; border-radius: 8px;
  background: none; color: var(--secondary);
}
.list-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

body.wide .drawer-scrim { display: none; }
body.wide .drawer { width: 260px; transform: translateX(-100%); border-right: 1px solid var(--divider); background: var(--sidebar-bg); }
body.wide.docked .drawer { transform: none; }
body.wide .drawer-head { padding: 8px 8px 0 0; }
body.wide .drawer-brand { padding: 0 0 0 18px; font-size: 20px; }
body.wide .sidebar-toggle {
  display: grid; place-items: center; width: 40px; min-height: 40px; height: 40px; padding: 0; border-radius: 10px;
  background: none; color: var(--secondary);
}
body.wide .sidebar-toggle .sidebar-icon { width: 21px; height: 21px; }
body.wide .drawer-foot { display: contents; }
body.wide .add-list {
  order: 1; flex: none; justify-content: flex-start; gap: 10px; min-height: 40px; margin: 10px 8px 0; padding: 0 10px; border-radius: 10px;
  background: none; color: var(--adaptive); font: 500 14px/1 Inter, sans-serif;
}
body.wide .add-list svg { width: 18px; height: 18px; stroke-width: 1.9; }
body.wide .drawer-lists { order: 2; gap: 18px; padding: 14px 8px 16px; }
body.wide .drawer-label { margin: 0 0 2px; padding: 0 10px; font-size: 13px; }
body.wide .drawer-row { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 10px; }
body.wide .drawer-row-top { flex: 1; }
body.wide .drawer-title, body.wide .drawer-row[aria-current] .drawer-title { font: 400 14px/1.4 Inter, sans-serif; }
body.wide .drawer-row[aria-current] { border-radius: 10px; background: var(--selected); }
body.wide .drawer-row[aria-current] .drawer-title { font-weight: 500; }
body.wide .drawer-summary { display: none; }
body.wide .drawer-count { display: block; flex: none; color: var(--tertiary); font: 400 12px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
body.wide .drawer-gear {
  order: 3; flex: none; display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: auto; height: auto; min-height: 56px;
  margin: 0 8px max(8px, env(safe-area-inset-bottom)); min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: none;
  color: var(--adaptive); font: 500 14px/1 Inter, sans-serif; text-decoration: none;
}
body.wide .drawer-gear svg { width: 20px; height: 20px; }
body.wide.on-settings .drawer-gear { background: var(--hover); }
body.wide .drawer-gear-label { display: inline; }
@media (hover: hover) {
  body.wide .drawer-row:hover, body.wide .add-list:hover, body.wide .drawer-gear:hover,
  body.wide .sidebar-toggle:hover, body.wide #open-drawer:hover, body.wide .list-actions:hover { background: var(--hover); }
  body.wide .drawer-row[aria-current]:hover { background: var(--selected); }
  body.wide #members-button:hover { background: var(--hover); }
}

body.wide .composer { left: var(--sidebar); width: auto; margin: 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
body.wide .composer > * { width: var(--column); margin-left: auto; margin-right: auto; }
body.wide .composer-controls { padding: 0 6px; }
body.wide .composer-close { display: none; }
body.wide .suggestions { padding: 0 2px 8px; }
body.wide .suggestion-rows { max-height: calc(40px * var(--suggestion-rows, 4)); }
body.wide .suggestion-row { min-height: 40px; border-radius: 10px; padding: 0 8px; }
@media (hover: hover) { body.wide .suggestion-row:hover { background: var(--hover); } }
body.wide .composer-card { box-shadow: 0 4px 16px rgb(0 0 0 / .06); }
body.wide .toast, body.wide .undo-bar, body.wide .offline-note { left: calc(50% + var(--sidebar) / 2); }
@media (prefers-reduced-motion: reduce) { body.sidebar-moving :is(.drawer, main, .composer) { transition: none; } }
