/* GiftFlip panel: a quiet iOS-style trader's screen. Graphite surfaces, one accent (system blue),
   green and red only for profit and loss. Glass only on what floats over content: the top bar,
   the tab bar and bottom sheets. Spacing on a 4px grid. Dark by default, light follows the system. */

:root {
  color-scheme: dark;
  /* graphite ramp */
  --bg: #0e0f11;
  --surface: #17181b;
  --fill: #222327;
  --fill-2: #2c2d32;
  --seg-on: #3a3b41;
  --line: rgba(255, 255, 255, 0.08);
  /* text roles */
  --text: #f2f2f4;
  --text-2: #a3a4aa;
  --text-3: #808187;
  /* one accent; semantic profit / loss */
  --accent: #0a84ff;
  --accent-fill: #0a6cdf;
  --accent-hover: #1a78ea;
  --on-accent: #fff;
  --green: #45c26f;
  --red: #f0675c;
  /* floating layers */
  --glass: rgba(23, 24, 27, 0.72);
  --glass-sheet: rgba(30, 31, 35, 0.88);
  --tab-on: rgba(255, 255, 255, 0.08);
  --float-shadow: none;
  --scrim: rgba(0, 0, 0, 0.5);
  --toast: #2c2d32;
  --toast-text: #f2f2f4;
  --toast-err: #b8322a;
  --knob-shadow: 0 2px 4px rgba(0, 0, 0, 0.24);
  --blur: blur(20px) saturate(160%);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  /* motion: iOS-like spring for things that move, a quick ease-in for things that leave */
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --leave: cubic-bezier(0.4, 0, 1, 1);
  --t-fast: 160ms;
  --t: 300ms;
  --t-slow: 460ms;
  /* radii: cards 14 > controls 10 > small controls 8 > chips 6 */
  --r-card: 14px;
  --r-ctl: 10px;
  --r-sm: 8px;
  --tabbar: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f2f2f4;
    --surface: #fff;
    --fill: #ededf0;
    --fill-2: #e1e1e5;
    --seg-on: #fff;
    --line: rgba(0, 0, 0, 0.08);
    --text: #111214;
    --text-2: #56575c;
    --text-3: #737479;
    --accent: #0066d6;
    --accent-fill: #0071e3;
    --accent-hover: #0062c4;
    --green: #1b8043;
    --red: #d23a2f;
    --glass: rgba(242, 242, 244, 0.76);
    --glass-sheet: rgba(250, 250, 251, 0.9);
    --tab-on: rgba(0, 0, 0, 0.05);
    --float-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --scrim: rgba(0, 0, 0, 0.28);
    --toast: #1d1d1f;
    --toast-text: #fff;
    --toast-err: #c4382e;
    --knob-shadow: 0 2px 4px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  }
}

* { box-sizing: border-box; }

/* The page is exactly as wide as the screen: nothing may push it sideways, and it neither zooms nor
   rubber-bands, so it never drifts under the finger. */
html { background: var(--bg); scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; overflow-x: hidden; overscroll-behavior: none; }
html, body {
  margin: 0;
  max-width: 100%;
  color: var(--text);
  font: 17px/1.4 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body {
  min-height: 100vh; min-height: 100dvh; overflow-x: clip; touch-action: pan-y;
  padding-bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom) + 24px);
}
.tabs, .tb, .btn, .seg, .switch, summary { -webkit-user-select: none; user-select: none; }

b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
svg.i { width: 18px; height: 18px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- top bar: solid at rest, glass once content scrolls under it ------------------------------------ */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) max(16px, calc((100% - 688px) / 2)) 8px;
  background: var(--bg);
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.scrolled .top {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo { width: 22px; height: 22px; }
.name { font-size: 17px; font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 8px; }

.tb {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: var(--r-sm); font-size: 15px; font-weight: 500; white-space: nowrap;
  background: var(--fill); transition: background-color 0.15s var(--ease);
}
.tb:hover { background: var(--fill-2); }
.tb.link { background: none; color: var(--accent); padding: 0 8px; }
.tb.link:hover { background: var(--fill); }
.tb .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.tb.on .dot { background: var(--green); }
.tb.off .dot { background: none; box-shadow: inset 0 0 0 1.5px var(--text-3); }

/* --- layout ---------------------------------------------------------------------------------------- */
.view { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.large-title { font-size: 34px; font-weight: 600; line-height: 1.2; margin: 4px 0 16px; }
/* minmax(0, 1fr): a grid column may not grow to fit one long unbreakable line (that pushed cards
   past the screen edge); long text is cut with an ellipsis instead. */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.gap-top { margin-top: 12px; }
.section-title { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 24px 16px 8px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.green { color: var(--green); }
.red { color: var(--red); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.base { align-items: baseline; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.note { margin: 12px 16px; font-size: 15px; }
.empty { text-align: center; color: var(--text-2); padding: 48px 16px; font-size: 15px; }
.empty b { display: block; color: var(--text); font-size: 20px; font-weight: 600; margin-bottom: 4px; }

/* --- gift pieces ----------------------------------------------------------------------------------- */
.head { display: flex; align-items: flex-start; gap: 12px; }
.thumb { width: 56px; height: 56px; border-radius: var(--r-ctl); flex: none; object-fit: cover; background: var(--fill); }
.thumb.lg { width: 112px; height: 112px; border-radius: 12px; }
.title { font-size: 17px; font-weight: 600; line-height: 1.3; min-width: 0; }
.title.lg { font-size: 20px; }
.title a { transition: color 0.15s var(--ease); }
.title a:hover { color: var(--accent); }
.sub { color: var(--text-2); font-size: 15px; line-height: 1.3; margin-top: 2px; }
.when { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text-3); min-width: 0; }

.badge {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; flex: none;
  font-size: 11px; font-weight: 600; line-height: 1; color: var(--text-2);
  background: var(--fill); box-shadow: inset 0 0 0 1px var(--line);
}
.badge.blank { background: none; }

.attrs { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; max-width: 320px; margin-top: 12px; font-size: 15px; line-height: 1.3; }
.attrs .r { color: var(--text-2); text-align: right; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.metrics.flush { margin-top: 0; }
.metrics + .metrics { margin-top: 12px; }
.metric { min-width: 0; }
.metric .k { font-size: 13px; color: var(--text-3); }
.metric .v { font-size: 20px; font-weight: 600; line-height: 1.3; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .u { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.metric .s { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the flip line: buy → list from → net, one row of figures under a hairline */
.flip, .foot {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 15px; line-height: 1.4; color: var(--text-2);
}
.flip b, .foot b { font-weight: 600; color: var(--text); }
.flip .arr { color: var(--text-3); }
.flip .green, .foot .green { color: var(--green); }
.foot .red { color: var(--red); }

/* where to sell: one row per market, the advised one in the text colour */
.plans { margin-top: 12px; font-size: 13px; color: var(--text-3); }
.plan { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 56px; align-items: center; gap: 8px; min-height: 36px; border-top: 1px solid var(--line); }
.plan .price { color: var(--text-2); font-variant-numeric: tabular-nums; }
.plan .pl { text-align: right; font-variant-numeric: tabular-nums; }
.plan .pl.green { color: var(--green); }
.plan .pl.red { color: var(--red); }
.plan.on { color: var(--text-2); }
.plan.on .price { color: var(--text); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions.one-line { flex-wrap: nowrap; }
.actions.one-line .btn { padding: 0 12px; flex: none; }
.actions.one-line .btn.wide { flex: 1 1 auto; min-width: 72px; }

/* --- buttons and inputs ---------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: var(--r-ctl);
  font-size: 15px; font-weight: 500; white-space: nowrap;
  background: var(--fill); color: var(--text);
  transition: background-color var(--t-fast) var(--ease), transform var(--t) var(--spring), opacity var(--t-fast) var(--ease);
}
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(0.96); transition-duration: 80ms; }
.btn.icon svg { transition: transform var(--t) var(--spring); }
.btn.icon[aria-expanded="true"] { background: var(--fill-2); }
.btn.icon[aria-expanded="true"] svg { transform: rotate(90deg); }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--red); }
.btn.wide { flex: 1; }
.btn.sm { height: 32px; padding: 0 12px; border-radius: var(--r-sm); }
.btn.icon { width: 44px; padding: 0; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.btn.preset {
  flex-direction: column; gap: 4px; height: 64px; padding: 0 8px; min-width: 0;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.btn.preset:hover { background: var(--fill); }
.btn.preset svg { color: var(--text-2); }
.btn.preset span { max-width: 100%; font-size: 13px; }

.input {
  width: 100%; height: 44px; padding: 0 12px; border-radius: var(--r-ctl); border: 0;
  background: var(--fill); color: var(--text);
}
textarea.input { height: auto; min-height: 64px; padding: 12px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.input::placeholder { color: var(--text-3); }
.input.inline { flex: 0 1 176px; width: auto; min-width: 0; height: 32px; border-radius: var(--r-sm); }
.search { display: flex; gap: 8px; }
.search .input {
  height: 40px; padding-left: 36px;
  background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808187' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E") 12px center / 18px no-repeat;
}
.search .btn { height: 40px; }
.sheet-hint { font-size: 13px; color: var(--text-3); margin: -4px 4px 0; }

/* --- inset grouped lists --------------------------------------------------------------------------- */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; }
.item + .item::before, .li + .li::before, .market-row + .market-row::before, .market-row + .item::before,
.group > details + details::before, .group > .item + details::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line);
}
.market-row.head + .market-row::before { display: none; }
.item .label { flex: 1; min-width: 0; }
.item .label small { display: block; color: var(--text-3); font-size: 13px; line-height: 1.3; margin-top: 2px; }
.item.wrap { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 12px; }
.item.wrap .label { flex: 1 0 100%; }
.item.wrap .input.inline { flex: 1 1 0; }

.opt { width: 100%; text-align: left; transition: background-color var(--t-fast) var(--ease); }
.opt:hover, .opt:active { background: var(--fill); }
.opt svg { color: var(--accent); animation: pop var(--t) var(--spring); }
details.more summary { transition: background-color var(--t-fast) var(--ease); }
details.more summary:active { background: var(--fill); }

.field { display: flex; align-items: center; gap: 8px; flex: none; }
.field input {
  width: 80px; height: 32px; padding: 0 8px; border-radius: var(--r-sm); border: 0;
  text-align: right; background: var(--fill); color: var(--text);
}
.field input:focus, .fees input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.field .unit { width: 32px; color: var(--text-3); font-size: 15px; }

/* iOS switch, 51 × 31 */
.switch { position: relative; flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--fill-2); transition: background-color var(--t) var(--ease); }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px;
  background: #fff; box-shadow: var(--knob-shadow); transition: transform var(--t) var(--spring), width var(--t) var(--spring);
}
.switch[aria-pressed="true"] { background: var(--accent-fill); }
.switch[aria-pressed="true"]::after { transform: translateX(20px); }
/* pressed: the knob stretches toward where it will go, as on iOS */
.switch:active::after { width: 33px; }
.switch[aria-pressed="true"]:active::after { transform: translateX(14px); }

/* iOS segmented control: outer 8, padding 2, inner 6 */
.seg { display: inline-flex; flex: none; padding: 2px; border-radius: var(--r-sm); background: var(--fill); }
.seg button {
  height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.seg button.on { background: var(--seg-on); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

.market-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; }
.market-row.head { min-height: 0; padding-top: 12px; padding-bottom: 0; }
.market-row .mk { display: flex; align-items: center; gap: 12px; min-width: 0; }
.market-row .lbl { font-size: 13px; color: var(--text-3); text-align: center; }
.market-row .switch { justify-self: center; }

.fees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; padding: 4px 16px 16px; }
.fees label { display: grid; gap: 4px; font-size: 13px; color: var(--text-3); }
.fees input { width: 100%; height: 36px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: var(--fill); color: var(--text); }

.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.li { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 12px 16px; font-size: 15px; }
.li.top { align-items: flex-start; }
.li .price { min-width: 48px; text-align: right; font-weight: 600; }
.li > .when { min-width: 64px; text-align: right; }
.li .when { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.li .strong { font-weight: 600; }
.li .sub.small { font-size: 13px; }
.li .small.red { margin-top: 4px; }

details.more { position: relative; }
details.more summary {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px;
  cursor: pointer; list-style: none; font-size: 17px;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 0 4px;
  border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transform: rotate(-45deg); transition: transform 0.2s var(--ease);
}
details.more[open] summary::after { transform: rotate(45deg); }
details.more summary .detail { text-align: right; font-size: 15px; }
details.more summary > svg { color: var(--text-2); }
.add-form { padding: 4px 16px 16px; }

.status-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.status-dot.ok { background: var(--green); }
.status-dot.err { background: var(--red); }

/* --- floating tab bar (glass) ---------------------------------------------------------------------- */
.tabs {
  position: fixed; z-index: 20; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 480px; height: var(--tabbar); margin: 0 auto; padding: 4px; border-radius: 32px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 0 0 1px var(--line), var(--float-shadow);
}
.tabs[hidden] { display: none; }
/* the highlight under the current tab glides to the next one instead of jumping */
.tab-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 5);
  border-radius: 28px; background: var(--tab-on); pointer-events: none;
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform var(--t-slow) var(--spring);
}
.tab {
  position: relative; display: grid; place-items: center; align-content: center; gap: 2px; min-width: 0; border-radius: 28px;
  color: var(--text-2); font-size: 11px; font-weight: 500;
  transition: color var(--t) var(--ease);
}
.tab svg { transition: transform var(--t) var(--spring); }
.tab:hover { color: var(--text); }
.tab:active svg { transform: scale(0.86); transition-duration: 80ms; }
.tab.on { color: var(--accent); }
.tab.on svg { transform: translateY(-1px) scale(1.08); }

/* --- sheet and toast ------------------------------------------------------------------------------- */
.sheet {
  position: fixed; inset: 0; z-index: 40; display: grid; align-items: end; justify-items: center;
  background: var(--scrim); animation: fade var(--t) var(--ease);
  overscroll-behavior: contain; touch-action: none;
}
.sheet[hidden] { display: none; }
.sheet .panel {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: calc(100% - 16px); max-width: 480px;
  margin-bottom: calc(8px + env(safe-area-inset-bottom)); padding: 8px 16px 16px; border-radius: 20px;
  background: var(--glass-sheet); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 0 0 1px var(--line), var(--float-shadow);
  animation: sheet-up var(--t-slow) var(--spring); touch-action: manipulation;
}
.sheet.closing { animation: fade-out var(--t) var(--leave) forwards; }
.sheet.closing .panel { animation: sheet-down var(--t) var(--leave) forwards; }
.sheet .panel::before { content: ""; justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--fill-2); }
.sheet h3 { margin: 4px 0; font-size: 17px; font-weight: 600; text-align: center; }
@media (min-width: 760px) {
  .sheet { align-items: center; }
  .sheet .panel { margin-bottom: 0; animation-name: zoom-in; }
  .sheet.closing .panel { animation-name: zoom-out; }
}

/* --- collection picker: a tall sheet of cards, grey until chosen ---------------------------------------- */
.sheet.tall .panel {
  height: min(780px, calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-width: 640px; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; padding-bottom: 12px;
}
.picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px; }
.picker-head h3 { text-align: left; }
.picker-count { font-size: 15px; color: var(--text-2); white-space: nowrap; }
.picker-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 14px 10px;
  margin: 0 -16px; padding: 4px 16px 12px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 8px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, transparent 0, #000 8px, #000 calc(100% - 16px), transparent);
}
@media (min-width: 480px) { .picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.col { display: grid; justify-items: center; align-content: start; gap: 6px; min-width: 0; text-align: center; transition: transform var(--t) var(--spring); }
.col[hidden] { display: none; }
.col:active { transform: scale(0.94); transition-duration: 80ms; }
.col-img {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden;
  border-radius: 18px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--t) var(--ease);
}
.col-img img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) brightness(0.72) contrast(0.9); opacity: 0.55;
  transition: filter var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--spring);
}
.col.on .col-img img { filter: none; opacity: 1; transform: scale(1.06); }
.col.on .col-img { box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(0, 0, 0, 0.28); }
.col-img.blank img { display: none; }
/* the first letter stands in only when the picture fails to load */
.col-letter { display: none; font-size: 28px; font-weight: 600; color: var(--text-3); }
.col-img.blank .col-letter { display: block; }
.col-mark {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-fill); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transform: scale(0.4); opacity: 0; transition: transform var(--t) var(--spring), opacity var(--t-fast) var(--ease);
}
.col-mark svg.i { width: 14px; height: 14px; stroke-width: 2.5; }
.col.on .col-mark { transform: scale(1); opacity: 1; }
.picker-grid.skip .col.on .col-img { box-shadow: 0 0 0 2px var(--red), 0 6px 18px rgba(0, 0, 0, 0.28); }
.picker-grid.skip .col-mark { background: var(--red); }
.col-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 500; line-height: 1.25; color: var(--text-3); transition: color var(--t) var(--ease);
}
.col.on .col-name { color: var(--text); }
.col-sub { margin-top: -4px; font-size: 11px; color: var(--text-3); }

/* the settings row that opens the picker: the chosen ones' faces and a chevron */
.pick .faces { display: flex; flex: none; }
.pick .faces img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--fill); box-shadow: 0 0 0 2px var(--surface); }
.pick .faces img + img { margin-left: -10px; }
.chev { flex: none; width: 8px; height: 8px; margin-right: 4px; border-top: 1.5px solid var(--text-3); border-right: 1.5px solid var(--text-3); transform: rotate(45deg); }

.toast {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); top: max(12px, env(safe-area-inset-top));
  max-width: calc(100% - 32px); padding: 8px 16px; border-radius: 12px;
  font-size: 15px; font-weight: 500; background: var(--toast); color: var(--toast-text);
  box-shadow: inset 0 0 0 1px var(--line), var(--float-shadow);
  animation: toast-in var(--t-slow) var(--spring);
}
.toast.out { animation: toast-out var(--t) var(--leave) forwards; }
.toast.err { background: var(--toast-err); color: #fff; }

.lock { text-align: center; padding: 96px 24px; }
.lock b { display: block; font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.skeleton { height: 160px; border-radius: var(--r-card); border: 1px solid var(--line); }
.skeleton, .shimmer {
  background: linear-gradient(100deg, var(--surface) 35%, var(--fill) 50%, var(--surface) 65%) 0 0 / 300% 100%;
  animation: shimmer 1.4s var(--ease) infinite;
}

/* --- motion ---------------------------------------------------------------------------------------- */
/* a section slides in from the side it lies on in the tab bar; its cards follow one after another */
.view.enter-fwd > * { animation: in-fwd var(--t-slow) var(--spring) both; }
.view.enter-back > * { animation: in-back var(--t-slow) var(--spring) both; }
.view.enter-fwd .stack > *, .view.enter-back .stack > * { animation: rise var(--t-slow) var(--spring) both; }
.view .stack > :nth-child(2) { animation-delay: 40ms; }
.view .stack > :nth-child(3) { animation-delay: 80ms; }
.view .stack > :nth-child(4) { animation-delay: 120ms; }
.view .stack > :nth-child(5) { animation-delay: 160ms; }
.view .stack > :nth-child(n+6) { animation-delay: 200ms; }
.card.fresh { animation: fresh var(--t-slow) var(--spring) both; }
.reveal, details.more[open] > :not(summary) { animation: rise var(--t) var(--spring) both; }

@keyframes in-fwd { from { opacity: 0; transform: translateX(24px); } }
@keyframes in-back { from { opacity: 0; transform: translateX(-24px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fresh { from { opacity: 0; transform: translateY(-12px) scale(0.97); } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(calc(100% + 24px)); } }
@keyframes sheet-down { to { transform: translateY(calc(100% + 24px)); } }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.94); } }
@keyframes zoom-out { to { opacity: 0; transform: scale(0.96); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -8px) scale(0.98); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
