/* Closer — design tokens, then components. System type, one accent, hairlines, 8pt grid. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", var(--font-display);

  --bg: #F2F2F7;
  --bg-plain: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --elevated: #FFFFFF;
  --label: #1D1D1F;
  --label-2: #6E6E73;
  --label-3: #8E8E93;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.08);
  --fill-strong: rgba(120, 120, 128, 0.2);
  --sep: rgba(60, 60, 67, 0.16);
  --sep-strong: rgba(60, 60, 67, 0.29);
  --bar: rgba(242, 242, 247, 0.8);
  --bar-plain: rgba(255, 255, 255, 0.8);
  --accent: #BE3455;
  --accent-text: #BE3455;
  --accent-soft: rgba(190, 52, 85, 0.1);
  --on-accent: #FFFFFF;
  --danger: #D70015;
  --online: #248A3D;
  --scrim: rgba(0, 0, 0, 0.32);
  --sheet-bg: #F2F2F7;
  --sheet-surface: #FFFFFF;
  --shadow-sheet: 0 -1px 0 var(--sep);
  --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 22px;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --nav-h: 44px;
  --tab-h: 50px;
  --gutter: 16px;
  --col: 640px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-plain: #000000;
    --surface: #1C1C1E;
    --surface-2: #2C2C2E;
    --elevated: #1C1C1E;
    --label: #F5F5F7;
    --label-2: #A1A1A6;
    --label-3: #8E8E93;
    --fill: rgba(120, 120, 128, 0.24);
    --fill-2: rgba(120, 120, 128, 0.16);
    --fill-strong: rgba(120, 120, 128, 0.36);
    --sep: rgba(84, 84, 88, 0.55);
    --sep-strong: rgba(84, 84, 88, 0.8);
    --bar: rgba(18, 18, 20, 0.78);
    --bar-plain: rgba(18, 18, 20, 0.78);
    --accent-text: #FF7A9C;
    --accent-soft: rgba(255, 122, 156, 0.14);
    --danger: #FF453A;
    --online: #30D158;
    --scrim: rgba(0, 0, 0, 0.5);
    --sheet-bg: #1C1C1E;
    --sheet-surface: #2C2C2E;
    --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-plain: #000000;
  --surface: #1C1C1E;
  --surface-2: #2C2C2E;
  --elevated: #1C1C1E;
  --label: #F5F5F7;
  --label-2: #A1A1A6;
  --label-3: #8E8E93;
  --fill: rgba(120, 120, 128, 0.24);
  --fill-2: rgba(120, 120, 128, 0.16);
  --fill-strong: rgba(120, 120, 128, 0.36);
  --sep: rgba(84, 84, 88, 0.55);
  --sep-strong: rgba(84, 84, 88, 0.8);
  --bar: rgba(18, 18, 20, 0.78);
  --bar-plain: rgba(18, 18, 20, 0.78);
  --accent-text: #FF7A9C;
  --accent-soft: rgba(255, 122, 156, 0.14);
  --danger: #FF453A;
  --online: #30D158;
  --scrim: rgba(0, 0, 0, 0.5);
  --sheet-bg: #1C1C1E;
  --sheet-surface: #2C2C2E;
  --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------------------------------------------------------------- Base */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  height: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  font: 400 17px/1.294 var(--font);
  letter-spacing: -0.022em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  font-feature-settings: "kern";
}
html.locked, html.locked body { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
a { color: var(--accent-text); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; font-weight: inherit; }
svg { flex-shrink: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.no-select { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Type scale (iOS) */
.t-large { font: 700 34px/41px var(--font-display); letter-spacing: 0.011em; }
.t-title1 { font: 700 28px/34px var(--font-display); letter-spacing: 0.013em; }
.t-title2 { font: 700 22px/28px var(--font-display); letter-spacing: -0.016em; }
.t-title3 { font: 600 20px/25px var(--font-display); letter-spacing: -0.019em; }
.t-headline { font: 600 17px/22px var(--font); letter-spacing: -0.024em; }
.t-body { font: 400 17px/22px var(--font); letter-spacing: -0.024em; }
.t-callout { font: 400 16px/21px var(--font); letter-spacing: -0.02em; }
.t-sub { font: 400 15px/20px var(--font); letter-spacing: -0.016em; }
.t-foot { font: 400 13px/18px var(--font); letter-spacing: -0.006em; }
.t-cap { font: 400 12px/16px var(--font); letter-spacing: 0; }
.t-cap2 { font: 500 11px/13px var(--font); letter-spacing: 0.006em; }
.c2 { color: var(--label-2); }
.c3 { color: var(--label-3); }
.ca { color: var(--accent-text); }
.semi { font-weight: 600; }

/* ---------------------------------------------------------------- Splash */

.splash {
  position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg);
  animation: splash-in 0.6s var(--ease-out) both;
}
@keyframes splash-in { from { opacity: 0; transform: scale(0.96); } }

/* ---------------------------------------------------------------- Shell */

.shell { min-height: 100vh; min-height: 100dvh; }
.screen { display: none; }
.screen.on { display: block; animation: screen-in 0.22s var(--ease-out); }
@keyframes screen-in { from { opacity: 0; } }

.nav {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  margin: 0 auto; max-width: var(--col);
  padding: var(--safe-t) calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l));
  height: calc(var(--nav-h) + var(--safe-t));
  display: flex; align-items: flex-end;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: var(--bar); box-shadow: 0 0.5px 0 var(--sep-strong);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  transition: opacity 0.2s;
}
.page-plain .nav::before { background: var(--bar-plain); }
.nav.scrolled::before { opacity: 1; }
@media (min-width: 641px) { .nav::before { left: calc(50% - 50vw); right: calc(50% - 50vw); } }
.nav-inner { width: 100%; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; }
.nav-title {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font: 600 17px/22px var(--font); letter-spacing: -0.024em; white-space: nowrap;
  opacity: 0; transition: opacity 0.18s;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis;
}
.nav.scrolled .nav-title { opacity: 1; }
.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; margin-right: -10px; }

.page {
  max-width: var(--col); margin: 0 auto;
  padding: calc(var(--nav-h) + var(--safe-t)) calc(var(--gutter) + var(--safe-r)) calc(var(--tab-h) + var(--safe-b) + 32px) calc(var(--gutter) + var(--safe-l));
}
.page-plain, .page-plain .page { background: var(--bg-plain); }
.page-plain { min-height: 100vh; min-height: 100dvh; }
.lt { padding: 2px 0 16px; }
.lt-eyebrow { font: 600 13px/18px var(--font); letter-spacing: -0.006em; color: var(--label-2); text-transform: uppercase; margin-bottom: 2px; }
.lt-eyebrow .num { letter-spacing: 0; }

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  display: flex; justify-content: center;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--sep-strong);
}
.tabbar-inner { display: flex; width: 100%; max-width: var(--col); }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding-top: 2px; color: var(--label-3); position: relative; min-height: 44px;
  transition: color 0.15s;
}
.tab svg { width: 26px; height: 26px; transition: transform 0.25s var(--spring); }
.tab:active svg { transform: scale(0.88); }
.tab.on { color: var(--accent-text); }
.tab-label { font: 500 10px/12px var(--font); letter-spacing: 0.01em; }
.tab-dot {
  position: absolute; top: 5px; left: calc(50% + 9px);
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--accent); color: var(--on-accent);
  font: 600 12px/18px var(--font); text-align: center; letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: var(--r-m);
  font: 600 17px/22px var(--font); letter-spacing: -0.024em;
  transition: transform 0.18s var(--ease-out), opacity 0.18s, background-color 0.18s;
  text-align: center;
}
.btn:active:not(:disabled) { transform: scale(0.97); opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-block { width: 100%; }
.btn-filled { background: var(--accent); color: var(--on-accent); }
.btn-dark { background: var(--label); color: var(--bg-plain); }
.btn-gray { background: var(--fill); color: var(--label); }
.btn-tinted { background: var(--accent-soft); color: var(--accent-text); }
.btn-plain { color: var(--accent-text); min-height: 44px; padding: 0 12px; font-weight: 400; }
.btn-plain.semi { font-weight: 600; }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 14px; border-radius: 17px; font-size: 15px; line-height: 20px; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 22px;
  color: var(--accent-text); transition: transform 0.18s var(--ease-out), opacity 0.18s, background-color 0.18s;
}
.icon-btn:active { transform: scale(0.9); opacity: 0.7; }
.icon-btn.filled { background: var(--fill); width: 32px; height: 32px; margin: 6px; color: var(--label-2); }
.icon-btn.on-dark { color: #fff; }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; opacity: 0.8;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Cards, lists */

.card { background: var(--surface); border-radius: var(--r-l); }
.section { margin-top: 32px; }
.section:first-child { margin-top: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px 8px;
}
.section-title { font: 700 22px/28px var(--font-display); letter-spacing: -0.016em; }
.section-link { font: 400 17px/22px var(--font); color: var(--accent-text); min-height: 44px; display: inline-flex; align-items: center; margin: -11px -8px -11px 0; padding: 0 8px; }

.group-label { font: 400 13px/18px var(--font); color: var(--label-2); text-transform: uppercase; letter-spacing: 0.02em; padding: 0 16px 7px; }
.group { background: var(--surface); border-radius: var(--r-m); overflow: hidden; }
.group + .group-note, .group-note { font: 400 13px/18px var(--font); color: var(--label-2); padding: 7px 16px 0; letter-spacing: -0.006em; }
.group-wrap { margin-top: 35px; }
.group-wrap:first-child { margin-top: 0; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; width: 100%;
  padding: 11px 16px; position: relative; text-align: left; background: var(--surface);
  transition: background-color 0.15s;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep-strong); }
.row.has-icon + .row::before, .row + .row.has-icon::before { left: 58px; }
button.row:active, label.row:active, a.row:active { background: var(--fill-strong); }
.row-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; background: #8E8E93; flex-shrink: 0; }
.row-icon svg { width: 18px; height: 18px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font: 400 17px/22px var(--font); letter-spacing: -0.024em; }
.row-sub { font: 400 13px/18px var(--font); color: var(--label-2); margin-top: 1px; }
.row-value { color: var(--label-2); font: 400 17px/22px var(--font); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.row-chev { color: var(--label-3); width: 14px; height: 14px; margin-right: -4px; }
.row.danger .row-title { color: var(--danger); }
.row.accent .row-title { color: var(--accent-text); }
.row input.row-input {
  flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: right; color: var(--label-2);
  font: 400 17px/22px var(--font);
}
.row input.row-input:focus { color: var(--label); }
.row input[type="date"].row-date {
  border: 0; background: var(--fill); border-radius: 6px; padding: 6px 10px; color: var(--label);
  font: 400 17px/22px var(--font); min-height: 34px; -webkit-appearance: none; appearance: none;
}
.row input[type="date"].row-date::-webkit-date-and-time-value { text-align: right; }

/* iOS switch */
.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-strong); transition: background-color 0.25s; }
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s var(--spring);
}
.switch input:checked ~ .switch-track { background: var(--accent); }
.switch input:checked ~ .switch-thumb { transform: translateX(20px); }
.switch input:disabled ~ * { opacity: 0.5; }

/* Segmented control */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: relative;
  background: var(--fill); border-radius: 9px; padding: 2px; height: 32px;
}
.seg-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 2px; border-radius: 7px; background: var(--elevated);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s var(--ease);
}
:root[data-theme="dark"] .seg-thumb { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-thumb { background: #636366; } }
.seg button { position: relative; z-index: 1; font: 500 13px/18px var(--font); letter-spacing: -0.006em; border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.seg button.on { font-weight: 600; }

/* Avatar */
.avatar {
  border-radius: 50%; background: var(--fill-strong); color: var(--label);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0; position: relative;
  font-family: var(--font-round); font-weight: 600; letter-spacing: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-pair { display: flex; }
.avatar-pair .avatar + .avatar { margin-left: -12px; box-shadow: 0 0 0 3px var(--bg); }
.presence {
  position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--online); box-shadow: 0 0 0 2px var(--surface);
}

/* Fields */
.field {
  width: 100%; border: 0; border-radius: var(--r-m); background: var(--surface);
  padding: 14px 16px; font: 400 17px/22px var(--font); color: var(--label); min-height: 50px;
  -webkit-appearance: none; appearance: none; transition: box-shadow 0.15s;
}
.field::placeholder { color: var(--label-3); }
.field:focus { box-shadow: 0 0 0 2px var(--accent-text); }

/* ---------------------------------------------------------------- Today */

/* Latest status: theirs large, yours underneath. */
.status-card { padding: 16px 16px 0; overflow: hidden; }
.sc-head { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.sc-name { font: 600 15px/20px var(--font); letter-spacing: -0.016em; flex-shrink: 0; }
.sc-presence { font: 400 13px/18px var(--font); color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: flex; align-items: center; gap: 6px; }
.sc-presence.online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--online); flex-shrink: 0; }
.sc-icon { margin-left: auto; color: var(--label-2); display: flex; flex-shrink: 0; }
.sc-body { display: block; width: 100%; text-align: left; padding-top: 12px; }
.sc-text { font: 700 28px/34px var(--font-display); letter-spacing: 0.007em; overflow-wrap: anywhere; }
.sc-text.l { font-size: 22px; line-height: 28px; letter-spacing: -0.012em; }
.sc-text.m { font: 600 19px/25px var(--font-display); letter-spacing: -0.02em; }
.sc-text.empty { color: var(--label-3); font-weight: 600; font-size: 22px; line-height: 28px; }
.sc-time { font: 400 15px/20px var(--font); color: var(--label-2); letter-spacing: -0.016em; }
.sc-body .sc-time { margin: 4px 0 12px; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 2px -10px 0 0; }
.sc-love { width: 44px; height: 44px; display: grid; place-items: center; color: var(--label-2); border-radius: 22px; }
.sc-love.on { color: var(--accent-text); }
.sc-love .beat, .note-love .beat { animation: beat 0.6s var(--spring); }
.sc-mine { display: flex; align-items: center; gap: 8px; width: calc(100% + 32px); min-height: 48px; margin: 4px -16px 0; padding: 12px 16px; position: relative; text-align: left; transition: background-color 0.15s; }
.sc-mine::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep-strong); }
.sc-mine:active { background: var(--fill-2); }
.sc-mine-who { font: 600 15px/20px var(--font); letter-spacing: -0.016em; flex-shrink: 0; }
.sc-mine-text { flex: 1; min-width: 0; font: 400 15px/20px var(--font); letter-spacing: -0.016em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-mine-text.muted { color: var(--label-2); }
.sc-mine-loved { color: var(--accent-text); display: flex; }
.sc-mine-time { font: 400 13px/18px var(--font); color: var(--label-2); font-variant-numeric: tabular-nums; }

/* This week: seven days of squares, and who's thought of whom. */
.week { padding: 16px; }
.wk-grid { display: grid; grid-template-columns: max-content repeat(7, minmax(0, 1fr)); gap: 4px; align-items: center; }
.wk-day { font: 600 12px/16px var(--font); color: var(--label-2); text-align: center; text-transform: uppercase; padding-bottom: 2px; }
.wk-day.today { color: var(--accent-text); }
.wk-who { font: 600 13px/18px var(--font); letter-spacing: -0.006em; white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.wk-cell { aspect-ratio: 1; border-radius: 6px; overflow: hidden; position: relative; display: grid; place-items: center; background: var(--fill-2); transition: transform 0.15s var(--ease-out); }
.wk-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wk-cell.today { background: none; box-shadow: inset 0 0 0 1.5px var(--sep-strong); }
.wk-cell.add { background: var(--accent-soft); color: var(--accent-text); }
button.wk-cell:active { transform: scale(0.92); }
.wk-note { font: 400 13px/18px var(--font); color: var(--label-2); margin-top: 12px; }
.wk-note b { font-weight: 600; color: var(--label); }
.tally { margin-top: 16px; padding-top: 12px; border-top: 0.5px solid var(--sep-strong); }
.tally-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 4px; }
.tally-title { display: flex; align-items: center; gap: 6px; font: 600 15px/20px var(--font); letter-spacing: -0.016em; }
.tally-title svg { color: var(--accent-text); }
.tally-row { display: grid; grid-template-columns: 72px 1fr 28px; align-items: center; gap: 12px; min-height: 28px; }
.tally-name { font: 400 15px/20px var(--font); letter-spacing: -0.016em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tally-track { height: 8px; border-radius: 4px; background: var(--fill-2); overflow: hidden; }
.tally-bar { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.6s var(--ease); }
.tally-n { font: 600 15px/20px var(--font); text-align: right; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.action {
  background: var(--surface); border-radius: var(--r-l); padding: 14px 12px 12px; min-height: 76px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px;
  text-align: left; transition: transform 0.2s var(--ease-out), background-color 0.2s;
}
.action:active { transform: scale(0.96); background: var(--surface-2); }
.action svg { width: 24px; height: 24px; color: var(--accent-text); }
.action-label { font: 600 15px/20px var(--font); letter-spacing: -0.016em; }
.action.primary { background: var(--accent); color: var(--on-accent); }
.action.primary svg { color: var(--on-accent); }
.action.primary:active { background: var(--accent); opacity: 0.88; }
.action .beat { animation: beat 0.6s var(--spring); }
@keyframes beat { 0% { transform: scale(1); } 30% { transform: scale(1.35); } 60% { transform: scale(0.92); } 100% { transform: scale(1); } }

.diptych { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dip { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dip-frame {
  aspect-ratio: 1; border-radius: var(--r-m); overflow: hidden; position: relative; background: var(--fill);
  display: grid; place-items: center; transition: transform 0.2s var(--ease-out);
}
button.dip-frame:active { transform: scale(0.97); }
.dip-frame img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.dip-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; text-align: center; color: var(--label-2); }
.dip-empty svg { width: 28px; height: 28px; }
.dip-empty.mine { color: var(--accent-text); }
.dip-frame.dashed { background: none; box-shadow: inset 0 0 0 1.5px var(--sep-strong); }
.dip-cap { font: 400 13px/18px var(--font); color: var(--label-2); padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dip-cap b { font-weight: 600; color: var(--label); }
.dip-more {
  position: absolute; right: 8px; bottom: 8px; z-index: 1; padding: 2px 8px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font: 600 12px/16px var(--font);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-radius: var(--r-l); }
.stat { padding: 14px 12px 12px 16px; text-align: left; min-width: 0; position: relative; min-height: 76px; display: flex; flex-direction: column; justify-content: space-between; transition: background-color 0.15s; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 0.5px; background: var(--sep-strong); }
button.stat:active { background: var(--fill-2); }
.stat:first-child { border-radius: var(--r-l) 0 0 var(--r-l); }
.stat:last-child { border-radius: 0 var(--r-l) var(--r-l) 0; }
.stats.two { grid-template-columns: 1fr 1fr; }
.stats.two .stat:nth-child(2n+1)::before { content: none; }
.stat-num { font: 700 28px/34px var(--font-display); letter-spacing: 0.007em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-num small { font-size: 15px; font-weight: 600; letter-spacing: -0.016em; margin-left: 2px; }
.stat-num.muted { color: var(--label-3); font-size: 22px; }
.stat-label { font: 400 13px/16px var(--font); color: var(--label-2); margin-top: 2px; }

button.feed-item:active { background: var(--fill-2); }


.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; margin-bottom: 12px;
  background: var(--surface); border-radius: var(--r-l); text-align: left; width: 100%;
}
.banner svg { width: 22px; height: 22px; color: var(--accent-text); }
.banner-main { flex: 1; min-width: 0; }
.banner-title { font: 600 15px/20px var(--font); letter-spacing: -0.016em; }
.banner-sub { font: 400 13px/18px var(--font); color: var(--label-2); }

/* ---------------------------------------------------------------- Snaps grid */

.snaps-head { position: sticky; z-index: 5; top: calc(var(--nav-h) + var(--safe-t)); padding: 8px 0 8px; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); background: var(--bar-plain); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.month { margin-top: 20px; }
.month-title { font: 600 15px/20px var(--font); letter-spacing: -0.016em; padding: 0 0 8px; display: flex; justify-content: space-between; }
.month-title span:last-child { color: var(--label-2); font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0 calc(-1 * var(--gutter)); }
@media (min-width: 641px) { .grid { margin: 0; gap: 4px; } .grid .tile { border-radius: 4px; } }
.tile { aspect-ratio: 1; position: relative; overflow: hidden; background: var(--fill); display: block; width: 100%; }
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; }
.tile img.loaded { opacity: 1; }
.tile:active img { opacity: 0.8; }
.tile-heart { position: absolute; left: 6px; bottom: 6px; width: 16px; height: 16px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.tile.pending img { opacity: 0.55; }
.tile-progress { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.tile-progress svg { width: 36px; height: 36px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4)); }
.tile-failed { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); color: #fff; font: 600 13px/18px var(--font); text-align: center; padding: 8px; }

.empty-state { padding: 64px 24px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state .es-art { margin-bottom: 16px; }
.empty-state p { max-width: 280px; }
.empty-state .btn { margin-top: 16px; }
.load-more { display: flex; justify-content: center; padding: 24px 0; color: var(--label-2); }

/* ---------------------------------------------------------------- Us */

.us-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 28px; gap: 12px; }
.us-hero .avatar-pair .avatar + .avatar { box-shadow: 0 0 0 4px var(--bg); }
.us-names { font: 700 28px/34px var(--font-display); letter-spacing: 0.007em; }
.theme-seg { width: 100%; }

/* ---------------------------------------------------------------- Overlays */

.layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.layer > * { pointer-events: auto; }

.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 0.35s var(--ease); }
.scrim.in { opacity: 1; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: var(--col);
  background: var(--sheet-bg); border-radius: 14px 14px 0 0;
  max-height: calc(100% - var(--safe-t) - 12px);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.45s var(--ease);
  padding-bottom: var(--safe-b);
  will-change: transform; overscroll-behavior: contain;
}
.sheet.plain { background: var(--bg-plain); }
.sheet .field, .sheet .preset, .sheet .steps, .sheet .note-bubble { background: var(--sheet-surface); }
.sheet.in { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet.full { height: calc(100% - var(--safe-t) - 12px); }
@media (min-width: 641px) {
  .sheet { bottom: auto; top: 50%; border-radius: 14px; max-height: min(760px, calc(100% - 64px)); transform: translateY(-50%) translateY(40px) scale(0.98); opacity: 0; transition: transform 0.4s var(--ease), opacity 0.25s; max-width: 540px; padding-bottom: 0; }
  .sheet.in { transform: translateY(-50%); opacity: 1; }
  .sheet.full { height: min(760px, calc(100% - 64px)); }
}
.sheet-grab { padding: 6px 0 0; display: grid; place-items: center; touch-action: none; flex-shrink: 0; }
.sheet-grab::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-strong); }
@media (min-width: 641px) { .sheet-grab { display: none; } }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; padding: 0 8px; touch-action: none; flex-shrink: 0; }
.sheet-head > :first-child { justify-self: start; }
.sheet-head > :last-child { justify-self: end; }
.sheet-title { font: 600 17px/22px var(--font); letter-spacing: -0.024em; text-align: center; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 24px; overscroll-behavior: contain; flex: 1; }

/* Alert & action sheet */
.alert {
  position: fixed; left: 50%; top: 50%; width: 270px; transform: translate(-50%, -50%) scale(1.12); opacity: 0;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  border-radius: 14px; overflow: hidden; text-align: center;
  transition: transform 0.3s var(--spring), opacity 0.2s;
}
:root:not([data-theme="dark"]) .alert { background: rgba(242, 242, 247, 0.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alert { background: rgba(37, 37, 39, 0.92); } }
:root[data-theme="dark"] .alert { background: rgba(37, 37, 39, 0.92); }
.alert.in { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.alert-body { padding: 19px 16px 15px; }
.alert-title { font: 600 17px/22px var(--font); letter-spacing: -0.024em; }
.alert-msg { font: 400 13px/18px var(--font); margin-top: 2px; letter-spacing: -0.006em; }
.alert-actions { display: flex; border-top: 0.5px solid var(--sep-strong); }
.alert-actions.stack { flex-direction: column; }
.alert-actions button { flex: 1; min-height: 44px; font: 400 17px/22px var(--font); color: var(--accent-text); }
.alert-actions button + button { border-left: 0.5px solid var(--sep-strong); }
.alert-actions.stack button + button { border-left: 0; border-top: 0.5px solid var(--sep-strong); }
.alert-actions button.bold { font-weight: 600; }
.alert-actions button.danger { color: var(--danger); }
.alert-actions button:active { background: var(--fill); }

.asheet {
  position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); margin: 0 auto; max-width: 420px;
  transform: translateY(calc(100% + 16px)); transition: transform 0.45s var(--ease);
  display: flex; flex-direction: column; gap: 8px;
}
.asheet.in { transform: translateY(0); }
.asheet-group { border-radius: 14px; overflow: hidden; background: rgba(242, 242, 247, 0.94); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); }
:root[data-theme="dark"] .asheet-group { background: rgba(37, 37, 39, 0.94); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .asheet-group { background: rgba(37, 37, 39, 0.94); } }
.asheet-title { padding: 14px 16px; text-align: center; font: 400 13px/18px var(--font); color: var(--label-2); border-bottom: 0.5px solid var(--sep-strong); }
.asheet-title b { display: block; font-weight: 600; }
.asheet button { width: 100%; min-height: 57px; font: 400 20px/25px var(--font); color: var(--accent-text); letter-spacing: -0.019em; }
.asheet button + button { border-top: 0.5px solid var(--sep-strong); }
.asheet button.danger { color: var(--danger); }
.asheet button.cancel { font-weight: 600; background: var(--elevated); border-radius: 14px; }
.asheet button:active { background: var(--fill); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 200;
  transform: translate(-50%, 16px) scale(0.96); opacity: 0;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  padding: 12px 18px 12px 14px; border-radius: 26px;
  background: var(--elevated); color: var(--label); box-shadow: var(--shadow-float);
  font: 600 15px/20px var(--font); letter-spacing: -0.016em; pointer-events: none;
  transition: transform 0.4s var(--spring), opacity 0.2s;
}
:root:not([data-theme="dark"]) .toast { background: #1D1D1F; color: #F5F5F7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #2C2C2E; color: #F5F5F7; } }
:root[data-theme="dark"] .toast { background: #2C2C2E; color: #F5F5F7; }
.toast.in { transform: translate(-50%, 0) scale(1); opacity: 1; }
.toast svg { width: 20px; height: 20px; }
.toast.err svg { color: #FF6961; }
.toast .ok { color: #FF7A9C; }

/* Incoming nudge */
.nudge-fx { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; pointer-events: none; }
.nudge-fx::before {
  content: ""; position: absolute; inset: 0; background: var(--bar);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  animation: nudge-veil 1.9s var(--ease-out) both;
}
@keyframes nudge-veil { 0% { opacity: 0; } 15%, 75% { opacity: 1; } 100% { opacity: 0; } }
.nudge-heart { position: relative; width: 120px; height: 120px; color: var(--accent); animation: nudge-heart 1.8s var(--ease-out) both; }
.nudge-heart svg { width: 100%; height: 100%; }
@keyframes nudge-heart {
  0% { transform: scale(0.4); opacity: 0; }
  18% { transform: scale(1.1); opacity: 1; }
  30% { transform: scale(0.95); }
  42% { transform: scale(1.08); }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}
.nudge-text {
  position: absolute; top: calc(50% + 80px); left: 24px; right: 24px; text-align: center;
  font: 600 20px/25px var(--font-display); letter-spacing: -0.019em; animation: fade-up 1.8s var(--ease-out) both;
}
@keyframes fade-up { 0% { opacity: 0; transform: translateY(8px); } 20%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- Viewer */

/* Overlays stack in the order they open (DOM order inside .layer), so no z-index here. */
.viewer { position: fixed; inset: 0; color: #fff; touch-action: none; }
.viewer-bg { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity 0.35s var(--ease); }
.viewer.in .viewer-bg { opacity: 1; }
.viewer-track {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x;
  overscroll-behavior: contain;
}
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; position: relative; }
.viewer-img {
  width: min(100vw, calc(100dvh - 240px - var(--safe-t) - var(--safe-b)), 720px);
  aspect-ratio: 1; position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.06);
  will-change: transform;
}
@media (max-height: 520px) { .viewer-img { width: min(100vw, calc(100dvh - 120px)); } }
.viewer-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.viewer-chrome { position: absolute; left: 0; right: 0; transition: opacity 0.25s; pointer-events: none; }
.viewer-chrome > * { pointer-events: auto; }
.viewer.in .viewer-chrome { opacity: 1; }
.viewer-chrome { opacity: 0; }
.viewer.hide-chrome .viewer-chrome { opacity: 0 !important; pointer-events: none; }
.viewer.hide-chrome .viewer-chrome > * { pointer-events: none; }
.viewer-nav { position: absolute; top: 50%; margin-top: -22px; opacity: 0; transition: opacity 0.25s; background: rgba(0, 0, 0, 0.35); }
.viewer.in .viewer-nav { opacity: 1; }
.viewer.hide-chrome .viewer-nav { opacity: 0; pointer-events: none; }
.viewer-top { top: 0; padding: calc(var(--safe-t) + 4px) 8px 0; display: flex; align-items: center; gap: 4px; }
.viewer-who { flex: 1; text-align: center; min-width: 0; }
.viewer-who b { display: block; font: 600 17px/22px var(--font); letter-spacing: -0.024em; }
.viewer-who span { font: 400 13px/18px var(--font); color: rgba(255, 255, 255, 0.7); }
.viewer-bottom { bottom: 0; padding: 0 16px calc(var(--safe-b) + 12px); max-width: 720px; margin: 0 auto; }
.viewer-caption { font: 400 17px/22px var(--font); letter-spacing: -0.024em; padding: 0 4px 8px; overflow-wrap: anywhere; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; }
.viewer-bar .icon-btn { color: #fff; }
.heart-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; color: #fff; font: 400 15px/20px var(--font); }
.heart-btn svg { width: 28px; height: 28px; transition: transform 0.35s var(--spring); }
.heart-btn.on svg { color: #FF5C7F; }
.heart-btn:active svg { transform: scale(0.85); }
.heart-btn .pop { animation: beat 0.5s var(--spring); }
.double-heart { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; color: #fff; pointer-events: none; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35)); animation: nudge-heart 0.9s var(--ease-out) both; }
.double-heart svg { width: 100%; height: 100%; }
.viewer-count { font: 400 13px/18px var(--font); color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.fly { position: fixed; z-index: 130; overflow: hidden; pointer-events: none; transform-origin: 0 0; will-change: transform; }
.fly img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- Composer (crop) */

.composer { position: fixed; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.45s var(--ease); }
.composer.in { transform: none; }
.composer-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: calc(var(--safe-t) + 4px) 8px 4px; min-height: 52px; }
.composer-top > :last-child { justify-self: end; }
.composer-top .btn-plain { color: #fff; }
.composer-title { font: 600 17px/22px var(--font); letter-spacing: -0.024em; }
.crop-stage { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; touch-action: none; min-height: 0; }
.crop-frame { width: min(100vw, calc(100% - 16px), 600px); aspect-ratio: 1; position: relative; }
@supports not (aspect-ratio: 1) { .crop-frame { height: 100vw; } }
.crop-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; will-change: transform; -webkit-user-drag: none; user-select: none; }
.crop-img.settle { transition: transform 0.35s var(--ease); }
.crop-mask { position: absolute; inset: 0; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.62); pointer-events: none; border: 0.5px solid rgba(255, 255, 255, 0.5); }
.crop-grid { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.crop-grid.on { opacity: 1; }
.crop-grid::before, .crop-grid::after { content: ""; position: absolute; inset: 0; }
.crop-grid::before { border-left: 0.5px solid rgba(255, 255, 255, 0.55); border-right: 0.5px solid rgba(255, 255, 255, 0.55); left: 33.333%; right: 33.333%; }
.crop-grid::after { border-top: 0.5px solid rgba(255, 255, 255, 0.55); border-bottom: 0.5px solid rgba(255, 255, 255, 0.55); top: 33.333%; bottom: 33.333%; }
.crop-hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font: 400 13px/18px var(--font); color: rgba(255, 255, 255, 0.7); pointer-events: none; transition: opacity 0.3s; }
.composer-bottom { padding: 12px 16px calc(var(--safe-b) + 12px); display: flex; flex-direction: column; gap: 12px; max-width: 640px; width: 100%; margin: 0 auto; }
.caption-field {
  width: 100%; border: 0; border-radius: var(--r-m); background: rgba(255, 255, 255, 0.12); color: #fff;
  padding: 14px 16px; font: 400 17px/22px var(--font); min-height: 50px;
}
.caption-field::placeholder { color: rgba(255, 255, 255, 0.55); }
.caption-field:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.composer .btn-filled:disabled { opacity: 0.5; }
.composer-loading { display: grid; place-items: center; color: rgba(255, 255, 255, 0.7); }

/* ---------------------------------------------------------------- Status sheet */

.status-input-wrap { position: relative; }
.status-input-wrap .field { padding-right: 56px; }
.status-count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 400 13px/18px var(--font); color: var(--label-3); font-variant-numeric: tabular-nums; }
.status-input-wrap .note-field { display: block; min-height: 96px; resize: none; padding: 14px 16px 30px; }
.note-field + .status-count { top: auto; bottom: 8px; transform: none; }
.status-count.low { color: var(--accent-text); }

/* Status history */
.notes { list-style: none; margin: 0; padding: 4px 0 16px; display: grid; gap: 12px; }
.note { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.note.mine { align-items: flex-end; }
.note-line { display: flex; align-items: center; gap: 2px; max-width: 86%; }
.note-bubble { padding: 9px 14px; border-radius: 18px; font: 400 17px/22px var(--font); letter-spacing: -0.024em; text-align: left; overflow-wrap: anywhere; color: var(--label); min-width: 0; }
.note.mine .note-bubble { background: var(--accent); color: var(--on-accent); }
.note-love { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; color: var(--label-2); border-radius: 22px; }
.note-love.on { color: var(--accent-text); }
.note-meta { font: 400 12px/16px var(--font); color: var(--label-2); margin-top: 4px; padding: 0 8px; }
.note-meta .accent { color: var(--accent-text); }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.preset {
  display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 52px; border-radius: var(--r-m);
  background: var(--surface); text-align: left; font: 400 15px/20px var(--font); letter-spacing: -0.016em;
  transition: transform 0.18s var(--ease-out), background-color 0.15s;
}
.preset:active { transform: scale(0.97); background: var(--surface-2); }
.preset svg { width: 20px; height: 20px; color: var(--label-2); }
.preset.sel { box-shadow: inset 0 0 0 2px var(--accent-text); }
.preset.sel svg { color: var(--accent-text); }
.icon-pick { display: flex; gap: 4px; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px; scrollbar-width: none; }
.icon-pick::-webkit-scrollbar { display: none; }
.icon-pick button { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; color: var(--label-2); flex-shrink: 0; transition: background-color 0.15s, color 0.15s; }
.icon-pick button svg { width: 22px; height: 22px; }
.icon-pick button.on { background: var(--accent-soft); color: var(--accent-text); }

/* ---------------------------------------------------------------- Onboarding */

.ob { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; padding: calc(var(--safe-t) + 24px) calc(24px + var(--safe-r)) calc(var(--safe-b) + 24px) calc(24px + var(--safe-l)); animation: ob-in 0.5s var(--ease) both; }
@keyframes ob-in { from { opacity: 0; transform: translateX(24px); } }
.ob.back { animation-name: ob-back; }
@keyframes ob-back { from { opacity: 0; transform: translateX(-24px); } }
.ob-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }
.ob-main.top { justify-content: flex-start; padding-top: 32px; }
.ob-mark { margin-bottom: 28px; }
.ob-title { font: 700 40px/46px var(--font-display); letter-spacing: -0.01em; }
.ob-title.sm { font-size: 34px; line-height: 41px; letter-spacing: 0.011em; }
.ob-lede { font: 400 20px/26px var(--font-display); letter-spacing: -0.019em; color: var(--label-2); margin-top: 12px; max-width: 360px; }
.ob-foot { display: grid; gap: 8px; }
.ob-fine { font: 400 13px/18px var(--font); color: var(--label-2); text-align: center; margin-top: 8px; }
.choose { margin-top: 40px; }
.choose .row { min-height: 68px; }
.choose .row + .row::before { left: 72px; }
.choose .row:active { background: var(--fill-2); }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--label-2); font: 400 15px/20px var(--font); margin-top: 24px; }
.waiting-dots { display: inline-flex; gap: 4px; }
.waiting-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--label-3); animation: dot 1.4s infinite both; }
.waiting-dots i:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

.mark-anim rect:first-child { animation: mark-l 0.9s var(--ease) both; }
.mark-anim rect:last-child { animation: mark-r 0.9s var(--ease) both; }
@keyframes mark-l { from { transform: translateX(-8px); } }
@keyframes mark-r { from { transform: translateX(8px); } }

/* Install steps */
.steps { display: grid; gap: 0; margin-top: 8px; background: var(--surface); border-radius: var(--r-m); overflow: hidden; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 16px; align-items: center; position: relative; }
.step + .step::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: 0.5px; background: var(--sep-strong); }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font: 600 15px/1 var(--font); font-variant-numeric: tabular-nums; }
.step-t { font: 400 16px/21px var(--font); letter-spacing: -0.02em; }
.step-t svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent-text); margin: 0 2px; }

/* Offline pill */
.offline {
  position: fixed; z-index: 40; top: calc(var(--safe-t) + 52px); left: 50%; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 14px; background: var(--elevated); box-shadow: var(--shadow-float);
  font: 600 13px/18px var(--font); color: var(--label-2); display: flex; align-items: center; gap: 6px;
  animation: fade-in 0.3s var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } }

/* Skeleton */
.skel { background: var(--fill); border-radius: 6px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-contrast: more) {
  :root { --sep: rgba(60, 60, 67, 0.4); --sep-strong: rgba(60, 60, 67, 0.6); --label-2: #4B4B50; }
}
@media (min-width: 641px) {
  :root { --gutter: 24px; }
  .toast { bottom: calc(var(--tab-h) + 24px); }
}
