/* Reunion Admin: iOS-style, phone first, works in any modern browser. */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --cell: #ffffff;
  --cell-pressed: #e5e5ea;
  --fill: rgba(118, 118, 128, 0.12);
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.29);
  --bar: rgba(249, 249, 249, 0.82);
  --accent: #5856d6;
  --accent-soft: rgba(88, 86, 214, 0.12);
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --yellow: #ffcc00;
  --pink: #ff2d55;
  --teal: #30b0c7;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  --banner-a: #5856d6;
  --banner-b: #af52de;
  --banner-c: #ff2d55;
  --banner-d: #ff9500;
  --radius: 12px;
  --tabbar-h: 50px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --cell: #1c1c1e;
    --cell-pressed: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.6);
    --bar: rgba(22, 22, 24, 0.82);
    --accent: #7d7aff;
    --accent-soft: rgba(125, 122, 255, 0.18);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --yellow: #ffd60a;
    --pink: #ff375f;
    --teal: #40c8e0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --cell: #1c1c1e; --cell-pressed: #2c2c2e; --fill: rgba(118, 118, 128, 0.24);
  --label: #ffffff; --label-2: rgba(235, 235, 245, 0.6); --label-3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.6); --bar: rgba(22, 22, 24, 0.82); --accent: #7d7aff;
  --accent-soft: rgba(125, 122, 255, 0.18); --green: #30d158; --orange: #ff9f0a; --red: #ff453a;
  --yellow: #ffd60a; --pink: #ff375f; --teal: #40c8e0; --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--label); }
body {
  font: 17px/1.3 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
html.sheet-open, html.sheet-open body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- App frame ---------- */

.app { max-width: 760px; margin: 0 auto; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.page { padding: 0 16px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-t) + 6px) 16px 6px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--sep); }
.titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 44px; }
.titlebar h1 { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.01em; }
.titlebar .back { display: flex; align-items: center; gap: 2px; margin-left: -8px; padding: 8px; color: var(--accent); background: none; border: 0; font-size: 17px; min-height: 44px; }
.titlebar .back svg { width: 12px; height: 20px; }
.titlebar-row { display: flex; flex-direction: column; }
.actions { display: flex; gap: 4px; align-items: center; margin-bottom: 2px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 22px; background: none; color: var(--accent);
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.filled { width: 34px; height: 34px; margin: 5px; background: var(--accent-soft); }
.icon-btn.filled svg { width: 18px; height: 18px; }
.icon-btn:active { opacity: 0.5; }

/* ---------- Tab bar ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  padding-bottom: var(--safe-b);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
}
.tabbar-inner { display: flex; width: 100%; max-width: 760px; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); border: 0; background: none; color: #999999;
  font-size: 10px; font-weight: 500; letter-spacing: 0.01em; text-decoration: none;
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab .badge {
  position: absolute; transform: translate(12px, -14px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 12px; line-height: 18px; font-weight: 600; text-align: center;
}
.tab-icon { position: relative; display: grid; place-items: center; }

/* ---------- Countdown banner ---------- */

.countdown {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 8px 0 20px; padding: 18px 16px 16px; border-radius: 22px;
  color: #fff; text-align: center;
  background: linear-gradient(125deg, var(--banner-a), var(--banner-b) 40%, var(--banner-c) 75%, var(--banner-d));
  background-size: 220% 220%;
  animation: banner-shift 14s ease-in-out infinite alternate;
  box-shadow: 0 12px 28px rgba(175, 82, 222, 0.28);
  border: 0; width: 100%; display: block; font: inherit;
}
.countdown::before, .countdown::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 20%, rgba(255,255,255,.55) 0 3px, transparent 4px),
    radial-gradient(circle at 22% 78%, rgba(255,214,10,.9) 0 3px, transparent 4px),
    radial-gradient(circle at 38% 12%, rgba(48,209,88,.85) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 62% 86%, rgba(255,255,255,.6) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgba(100,210,255,.9) 0 3px, transparent 4px),
    radial-gradient(circle at 92% 70%, rgba(255,214,10,.85) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.35) 0 1.5px, transparent 2.5px);
  animation: confetti-drift 9s linear infinite;
}
.countdown::after { transform: rotate(180deg); opacity: 0.7; animation-duration: 13s; animation-direction: reverse; }
@keyframes banner-shift { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
@keyframes confetti-drift { from { background-position: 0 0; } to { background-position: 0 120px; } }

.countdown .kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.92; }
.countdown .event-name { margin: 2px 0 12px; font-size: 22px; font-weight: 800; line-height: 1.15; text-wrap: balance; }
.clock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 420px; margin: 0 auto; }
.clock-unit {
  padding: 10px 0 8px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.clock-num {
  display: block; font: 800 34px/1 var(--font-round);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.clock-num.tick { animation: tick 0.35s ease-out; }
@keyframes tick { 0% { transform: translateY(-6px) scale(1.08); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
.clock-label { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.countdown .when { margin-top: 12px; font-size: 15px; font-weight: 600; opacity: 0.95; }
.countdown .party-now { font: 800 40px/1.1 var(--font-round); margin: 6px 0; }
.countdown .set-date {
  display: inline-block; margin-top: 4px; padding: 10px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.95); color: var(--banner-a); font-weight: 700; font-size: 15px;
}

/* Slim version shown on every other tab. */
.countdown.mini {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 4px 0 6px; padding: 8px 14px; border-radius: 999px; text-align: left;
  box-shadow: 0 6px 16px rgba(175, 82, 222, 0.22);
  font-size: 15px; font-weight: 700;
}
.countdown.mini .mini-num { font: 800 17px/1 var(--font-round); font-variant-numeric: tabular-nums; }
.countdown.mini .mini-sep { opacity: 0.6; }
.countdown.mini .mini-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Confetti burst when the banner is tapped. */
.confetti-piece {
  position: fixed; z-index: 100; width: 8px; height: 12px; border-radius: 2px; pointer-events: none;
  animation: confetti-fall var(--dur, 1.4s) cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .countdown, .countdown::before, .countdown::after, .clock-num.tick { animation: none; }
  .confetti-piece { display: none; }
}

/* ---------- Grouped lists ---------- */

.section { margin: 0 0 28px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 16px 7px; font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.02em;
}
.section-head.big { margin: 0 4px 8px; font-size: 22px; font-weight: 700; color: var(--label); text-transform: none; letter-spacing: 0; }
.section-head a, .section-head button { font-size: 15px; text-transform: none; color: var(--accent); background: none; border: 0; padding: 0; }
.section-foot { margin: 7px 16px 0; font-size: 13px; color: var(--label-2); }

.list { background: var(--cell); border-radius: var(--radius); overflow: hidden; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; padding: 10px 16px;
  background: none; border: 0; text-align: left; color: var(--label);
}
.row + .row::before, .row + .cell::before, .cell + .row::before, .cell + .cell::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: 0.5px solid var(--sep);
}
.row.indent + .row::before { left: 60px; }
button.row:active, a.row:active { background: var(--cell-pressed); }
a.row { text-decoration: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: block; margin-top: 2px; font-size: 15px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-trail { flex: none; display: flex; align-items: center; gap: 6px; color: var(--label-2); font-size: 17px; font-variant-numeric: tabular-nums; }
.chev { width: 8px; height: 14px; color: var(--label-3); flex: none; }
.row.done .row-title { color: var(--label-2); text-decoration: line-through; }
.row.danger { color: var(--red); justify-content: center; }
.row.action { color: var(--accent); }

.avatar {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px;
}

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--fill); color: var(--label-2);
}
.pill.yes { background: rgba(52, 199, 89, 0.16); color: var(--green); }
.pill.maybe { background: rgba(255, 149, 0, 0.16); color: var(--orange); }
.pill.no { background: rgba(255, 59, 48, 0.14); color: var(--red); }
.pill.paid { background: rgba(48, 176, 199, 0.16); color: var(--teal); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.empty { padding: 36px 24px; text-align: center; color: var(--label-2); }
.empty .emoji { font-size: 44px; display: block; margin-bottom: 8px; }
.empty strong { display: block; color: var(--label); font-size: 20px; margin-bottom: 4px; }

/* Checkbox circle for to-dos. */
.check {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -10px -6px -10px -12px;
  border: 0; background: none; color: var(--label-3);
}
.check span {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid currentColor; transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.check svg { width: 14px; height: 14px; color: #fff; opacity: 0; }
.check[aria-checked="true"] { color: var(--accent); }
.check[aria-checked="true"] span { background: var(--accent); }
.check[aria-checked="true"] svg { opacity: 1; }
.check:active span { transform: scale(0.85); }

/* ---------- Home cards ---------- */

.greeting { margin: 4px 4px 12px; font-size: 15px; color: var(--label-2); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.card {
  display: flex; flex-direction: column; gap: 6px; min-height: 104px;
  padding: 14px; border-radius: 16px; background: var(--cell); border: 0; text-align: left; color: var(--label);
}
.card:active { background: var(--cell-pressed); }
.card .card-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.card .card-icon svg { width: 17px; height: 17px; }
.card .card-value { font: 700 28px/1.05 var(--font-round); font-variant-numeric: tabular-nums; }
.card .card-label { font-size: 15px; font-weight: 600; color: var(--label-2); }
.card .card-note { font-size: 13px; color: var(--label-2); }
.card.wide { grid-column: 1 / -1; }

.meter { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 28px; }
.quick button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px;
  border: 0; border-radius: 14px; background: var(--cell); color: var(--accent); font-size: 13px; font-weight: 600;
}
.quick button svg { width: 24px; height: 24px; }
.quick button:active { background: var(--cell-pressed); }

/* ---------- Controls ---------- */

.search {
  display: flex; align-items: center; gap: 6px; height: 36px; margin: 2px 0 10px; padding: 0 8px;
  border-radius: 10px; background: var(--fill); color: var(--label-2);
}
.search svg { width: 17px; height: 17px; flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 17px; color: var(--label); }
.search input::placeholder { color: var(--label-2); }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: 16px; border: 0;
  background: var(--cell); color: var(--label); font-size: 15px; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.chip .n { opacity: 0.6; margin-left: 4px; font-variant-numeric: tabular-nums; }

.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  padding: 2px; border-radius: 9px; background: var(--fill); margin: 2px 0 14px;
}
.segmented button {
  height: 30px; border: 0; border-radius: 7px; background: none; color: var(--label);
  font-size: 13px; font-weight: 500; padding: 0 4px;
}
.segmented button[aria-pressed="true"] { background: var(--cell); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button[aria-pressed="true"] { background: #636366; } }
.cell .segmented { margin: 0; flex: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat { padding: 10px 12px; border-radius: 12px; background: var(--cell); }
.stat b { display: block; font: 700 22px/1.1 var(--font-round); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--label-2); }

.quick-add { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; min-height: 48px; background: var(--cell); border-radius: var(--radius); margin-bottom: 16px; }
.quick-add svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.quick-add input { flex: 1; min-width: 0; height: 48px; border: 0; background: none; outline: none; font-size: 17px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 0 20px; border: 0; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 600;
}
.btn svg { width: 22px; height: 22px; }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.plain { background: none; color: var(--accent); min-height: 44px; }
.btn:disabled { opacity: 0.45; }
.btn:active:not(:disabled) { filter: brightness(0.9); }
.btn + .btn { margin-top: 10px; }

/* ---------- Form cells ---------- */

.cell {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px;
}
.cell-label { flex: none; width: 34%; max-width: 150px; color: var(--label); }
.cell input, .cell select, .cell textarea {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 0; border: 0; background: none; outline: none;
  font-size: 17px; color: var(--label); text-align: right;
}
.cell input::placeholder, .cell textarea::placeholder { color: var(--label-3); }
.cell select { -webkit-appearance: none; appearance: none; color: var(--label-2); text-align-last: right; padding-right: 2px; }
.cell input[type="date"], .cell input[type="time"] { -webkit-appearance: none; appearance: none; color: var(--label-2); }
.cell input[type="date"]::-webkit-date-and-time-value, .cell input[type="time"]::-webkit-date-and-time-value { text-align: right; }
.cell.stack { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
.cell.stack .cell-label { width: auto; max-width: none; font-size: 13px; color: var(--label-2); }
.cell.stack textarea { text-align: left; min-height: 96px; resize: vertical; line-height: 1.35; }
.cell.stack input { text-align: left; }
.cell.seg { padding-top: 8px; padding-bottom: 8px; }

.switch {
  -webkit-appearance: none; appearance: none; flex: none !important; position: relative;
  width: 51px !important; height: 31px; min-height: 31px !important; padding: 0 !important; margin: 0;
  border-radius: 16px; background: var(--fill) !important; transition: background 0.2s; cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform 0.2s;
}
.switch:checked { background: var(--green) !important; }
.switch:checked::after { transform: translateX(20px); }
.cell .grow { flex: 1; }

.stepper { display: flex; align-items: center; gap: 0; margin-left: auto; border-radius: 9px; background: var(--fill); }
.stepper button { width: 44px; height: 32px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--label); }
.stepper output { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

.contact-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin: 0 0 20px; }
.contact-actions a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px;
  background: var(--cell); color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none;
}
.contact-actions svg { width: 22px; height: 22px; }

.meta { margin: -14px 16px 24px; font-size: 13px; color: var(--label-2); }

/* ---------- Sheet ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.4);
  opacity: 0; transition: opacity 0.25s;
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-width: 760px; margin: 0 auto;
  height: calc(100% - var(--safe-t) - 12px);
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 12px 12px 0 0; box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform 0.32s cubic-bezier(.32,.72,0,1);
}
.sheet.show { transform: none; }
.sheet-nav {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 56px; padding: 6px 8px 0;
}
.sheet-nav h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-nav button { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--accent); font-size: 17px; }
.sheet-nav .save { justify-self: end; font-weight: 600; }
.sheet-nav .cancel { justify-self: start; }
.sheet-nav button:disabled { color: var(--label-3); }
.sheet-grab { position: absolute; top: 5px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--label-3); }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px calc(32px + var(--safe-b)); overscroll-behavior: contain; }
.sheet .group-title { margin: 0 16px 7px; font-size: 13px; color: var(--label-2); text-transform: uppercase; }
.sheet .group { margin-bottom: 28px; }
@media (min-width: 800px) {
  .sheet { top: 40px; bottom: 40px; height: auto; max-width: 600px; border-radius: 14px; transform: translateY(40px); opacity: 0; transition: transform .25s, opacity .25s; }
  .sheet.show { transform: none; opacity: 1; }
}

/* ---------- Sign-in screens ---------- */

.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 440px; margin: 0 auto;
  padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px);
}
.auth .logo {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--banner-a), var(--banner-c) 60%, var(--banner-d)); font-size: 44px;
  box-shadow: 0 10px 24px rgba(175, 82, 222, 0.3);
}
.auth h1 { margin: 0 0 6px; text-align: center; font-size: 28px; font-weight: 700; }
.auth p.lead { margin: 0 0 28px; text-align: center; color: var(--label-2); }
.auth .field { display: block; margin-bottom: 12px; }
.auth .field input {
  width: 100%; height: 50px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--cell); font-size: 17px; outline: none;
}
.auth .field input:focus { box-shadow: 0 0 0 2px var(--accent); }
.auth .code input { text-align: center; font: 600 28px/1 var(--font-round); letter-spacing: 0.4em; padding-left: 0.4em; }
.auth .divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--label-2); font-size: 13px; }
.auth .divider::before, .auth .divider::after { content: ""; flex: 1; border-top: 0.5px solid var(--sep); }
.auth .hint { margin: 22px 0 0; text-align: center; font-size: 13px; color: var(--label-2); }
.auth .error { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 59, 48, 0.12); color: var(--red); font-size: 15px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; z-index: 90;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: rgba(30, 30, 32, 0.94); color: #fff; font-size: 15px; font-weight: 500; text-align: center;
  box-shadow: var(--shadow); transition: transform 0.25s, opacity 0.25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--red); }

/* ---------- Link box (sign-in link to share) ---------- */

.linkbox {
  padding: 14px 16px; border-radius: var(--radius); background: var(--cell);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; color: var(--label-2);
  -webkit-user-select: all; user-select: all;
}

@media (min-width: 600px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
  .card.wide { grid-column: span 2; }
  .clock-num { font-size: 44px; }
}

/* Icons inside list rows and buttons-as-links. */
.row > svg:not(.chev) { flex: none; width: 22px; height: 22px; color: var(--accent); }
a.btn { text-decoration: none; }
.card.wide { min-height: 0; }
