/* MatchRole — follows Apple's Human Interface Guidelines: system font, large titles,
   grouped inset sections, segmented controls, blurred toolbars, system colours. */

:root {
  color-scheme: light;
  --blue: #007aff; --green: #34c759; --orange: #ff9500; --red: #ff3b30; --yellow: #ffcc00;
  --purple: #af52de; --indigo: #5856d6; --teal: #30b0c7; --pink: #ff2d55; --gray: #8e8e93;
  --bg: #f2f2f7; --bg2: #ffffff; --bg3: #f2f2f7;
  --label: #000000; --label2: rgba(60, 60, 67, 0.6); --label3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.18); --fill: rgba(120, 120, 128, 0.12); --fill2: rgba(120, 120, 128, 0.2);
  --bar: rgba(249, 249, 249, 0.78); --sidebar: #f2f2f7; --selected: rgba(0, 122, 255, 0.12);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 12px; --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #0a84ff; --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --yellow: #ffd60a;
  --purple: #bf5af2; --indigo: #5e5ce6; --teal: #40c8e0; --pink: #ff375f; --gray: #8e8e93;
  --bg: #000000; --bg2: #1c1c1e; --bg3: #2c2c2e;
  --label: #ffffff; --label2: rgba(235, 235, 245, 0.6); --label3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.6); --fill: rgba(118, 118, 128, 0.24); --fill2: rgba(118, 118, 128, 0.32);
  --bar: rgba(22, 22, 24, 0.78); --sidebar: #1c1c1e; --selected: rgba(10, 132, 255, 0.24);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 17px; line-height: 1.35; letter-spacing: -0.01em;
  background: var(--bg); color: var(--label);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Buttons & controls ---------- */
.btn {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 16px; background: var(--fill); color: var(--blue);
  transition: transform 0.12s var(--ease), opacity 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); opacity: 0.8; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.plain { background: transparent; padding: 0 10px; }
.btn.danger { color: var(--red); }
.btn.small { min-height: 34px; font-size: 14px; padding: 0 12px; border-radius: 10px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--blue);
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn:active { background: var(--fill); }
.icon-btn svg, .btn svg { width: 22px; height: 22px; }
.btn.small svg { width: 18px; height: 18px; }

.seg {
  display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent; border-radius: 7px; padding: 0 14px; min-height: 32px;
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--label);
  transition: background 0.2s var(--ease), box-shadow 0.2s;
}
.seg button[aria-pressed="true"] { background: var(--bg2); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #636366; }
.seg-wrap { position: relative; display: inline-flex; min-height: 44px; align-items: center; max-width: 100%; }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { appearance: none; margin: 0; width: 100%; height: 100%; border-radius: 16px; background: var(--fill2); cursor: pointer; transition: background 0.25s; }
.switch input:checked { background: var(--green); }
.switch input::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.25s var(--ease); }
.switch input:checked::after { transform: translateX(20px); }

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

select.inline {
  appearance: none; border: 0; background: transparent; color: var(--blue); font-weight: 500; font-size: 15px;
  padding: 0 18px 0 4px; min-height: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23007aff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; background-size: 12px;
}

/* ---------- Grouped inset lists ---------- */
.group { background: var(--bg2); border-radius: var(--radius); overflow: hidden; }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--label2); margin: 22px 16px 7px; font-weight: 400; }
.group-foot { font-size: 13px; color: var(--label2); margin: 7px 16px 0; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 16px; position: relative;
  width: 100%; border: 0; background: transparent; text-align: left; font-size: 17px; color: var(--label);
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.row.icon + .row.icon::before { left: 56px; }
button.row, a.row { cursor: pointer; }
button.row:active, a.row:active { background: var(--fill); }
.row .grow { flex: 1; min-width: 0; }
.row .sub { font-size: 13px; color: var(--label2); margin-top: 2px; }
.row .val { color: var(--label2); font-size: 15px; }
.row .chev { color: var(--label3); width: 14px; height: 14px; flex: none; }
.ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.ico svg { width: 18px; height: 18px; }
.row input[type="text"], .row input[type="url"], .row input[type="email"], .row select.field, .row textarea {
  flex: 1; border: 0; outline: none; background: transparent; text-align: right; font-size: 17px; min-width: 0; color: var(--label2);
}
.row textarea { text-align: left; resize: vertical; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 280px minmax(340px, 420px) 1fr; height: 100vh; height: 100dvh; }
.sidebar { background: var(--sidebar); border-right: 0.5px solid var(--sep); overflow-y: auto; padding: 8px 10px 24px; display: flex; flex-direction: column; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 10px 8px 6px; min-height: 52px; }
.logo { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.logo img { display: block; height: auto; }
.logo .logo-mark { height: 30px; width: auto; }
.logo .logo-word { height: 19px; width: auto; }
.logo.lg .logo-mark { height: 36px; }
.logo.lg .logo-word { height: 22px; }
.logo .on-dark { display: none; }
:root[data-theme="dark"] .logo .on-dark { display: block; }
:root[data-theme="dark"] .logo .on-light { display: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--blue), var(--indigo)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -0.03em; flex: none; }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.side-label { font-size: 13px; font-weight: 600; color: var(--label2); padding: 18px 10px 6px; }
.side-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; font-size: 15px; text-align: left; color: var(--label);
}
.side-item svg { width: 20px; height: 20px; color: var(--blue); flex: none; }
.side-item .count { margin-left: auto; color: var(--label2); font-size: 14px; font-variant-numeric: tabular-nums; }
.side-item[aria-current="true"] { background: var(--selected); font-weight: 600; }
.side-item:active { background: var(--fill); }
.side-foot { margin-top: auto; padding-top: 18px; display: grid; gap: 8px; }

.listcol { display: flex; flex-direction: column; min-width: 0; border-right: 0.5px solid var(--sep); background: var(--bg); position: relative; overflow: hidden; }
.toolbar {
  position: sticky; top: 0; z-index: 5; background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--sep); padding: 4px 16px 10px;
}
.toolbar .top { display: flex; align-items: center; gap: 4px; min-height: 44px; margin: 0 -10px; }
.toolbar .top .spacer { flex: 1; }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.1; margin: 2px 0 10px; }
.toolbar .controls { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.toolbar .line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.toolbar .line .tog { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--label2); min-height: 44px; }
.toolbar .line .tog .switch { transform: scale(0.82); transform-origin: right center; margin-left: -6px; }
.runline { font-size: 13px; color: var(--label2); display: flex; align-items: center; gap: 6px; min-height: 20px; }
.runline .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.runline.busy .dot { background: var(--orange); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.list { overflow-y: auto; flex: 1; padding: 10px 12px 40px; display: grid; gap: 10px; align-content: start; }
.card {
  display: grid; grid-template-columns: 44px 1fr 48px; gap: 12px; align-items: start; padding: 14px; border-radius: var(--radius);
  background: var(--bg2); border: 0; text-align: left; cursor: pointer; width: 100%; position: relative;
  transition: transform 0.15s var(--ease), box-shadow 0.2s;
}
.card:active { transform: scale(0.985); }
.card[aria-selected="true"] { box-shadow: 0 0 0 2px var(--blue); }
.card.passed { opacity: 0.55; }
.mono { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.card h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.card .co { font-size: 14px; color: var(--label2); margin-top: 2px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 13px; color: var(--label2); align-items: center; }
.card .meta .fresh { display: inline-flex; align-items: center; gap: 5px; }
.card .meta .fresh i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--fill); color: var(--label2); white-space: nowrap; }
.badge.blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.badge.green { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 70%, var(--label)); }
.badge.orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: color-mix(in srgb, var(--orange) 75%, var(--label)); }
.badge.red { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.badge.purple { background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--purple); }
.badge.indigo { background: color-mix(in srgb, var(--indigo) 14%, transparent); color: var(--indigo); }
.ring { width: 48px; height: 48px; position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ring.lg { width: 76px; height: 76px; }
.ring.lg b { font-size: 24px; }
.est { font-size: 11px; font-weight: 600; color: var(--orange); margin-left: 2px; }

.sponsor { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--bg2); font-size: 14px; color: var(--label); border: 0.5px solid var(--sep); }
.sponsor .s-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--label2); font-weight: 600; }
.sponsor .s-logo { width: 36px; height: 36px; border-radius: 8px; background: var(--fill); display: grid; place-items: center; overflow: hidden; font-weight: 700; color: var(--label2); }
.sponsor .s-logo img { width: 100%; height: 100%; object-fit: cover; }
.sponsor strong { display: block; margin-top: 2px; }
.sponsor p { margin: 2px 0 6px; color: var(--label2); font-size: 13px; }
.sponsor .s-cta { font-weight: 600; font-size: 14px; }

/* ---------- Detail ---------- */
.detail { overflow-y: auto; background: var(--bg); position: relative; min-width: 0; }
.detail-inner { max-width: 760px; margin: 0 auto; padding: 0 20px 60px; }
.detail .toolbar { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.detail .toolbar .top { margin: 0 -10px; }
.dhead { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; margin: 18px 0 14px; }
.dhead .mono { width: 56px; height: 56px; border-radius: 13px; font-size: 22px; }
.dhead h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: 0.005em; }
.dhead .co { color: var(--label2); font-size: 16px; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.tile { background: var(--bg2); border-radius: var(--radius); padding: 14px; min-width: 0; }
.tile .k { font-size: 13px; color: var(--label2); font-weight: 500; }
.tile .v { font-size: 20px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; }
.tile .n { font-size: 13px; color: var(--label2); margin-top: 4px; }
.tile.fit { display: flex; align-items: center; gap: 12px; }
.bars .row { display: block; }
.bar-top { display: flex; justify-content: space-between; font-size: 15px; }
.bar-top span:last-child { color: var(--label2); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: var(--fill); margin: 7px 0 5px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); transition: width 0.6s var(--ease); }
.bar-why { font-size: 13px; color: var(--label2); }
.prose { padding: 14px 16px; font-size: 15px; line-height: 1.45; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.empty-detail { height: 100%; display: grid; place-items: center; text-align: center; color: var(--label2); padding: 30px; }
.empty-detail svg { width: 56px; height: 56px; color: var(--label3); }

.composer { padding: 12px 16px 14px; }
.composer textarea {
  width: 100%; min-height: 200px; border: 0; outline: none; resize: vertical; background: var(--bg3); border-radius: 10px;
  padding: 12px; font-size: 15px; line-height: 1.45;
}
.composer .crow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-top: 10px; }
.counter { font-size: 13px; color: var(--label2); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--red); font-weight: 600; }
.composer .to { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; color: var(--label2); flex-wrap: wrap; }

/* ---------- Sheets & toasts ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 40; opacity: 0; transition: opacity 0.3s var(--ease); }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 50; left: 50%; bottom: 0; width: min(620px, 100%); max-height: 92dvh; overflow-y: auto;
  background: var(--bg); border-radius: 14px 14px 0 0; box-shadow: var(--shadow);
  transform: translate(-50%, 100%); transition: transform 0.42s var(--ease); padding-bottom: env(safe-area-inset-bottom);
}
.sheet.show { transform: translate(-50%, 0); }
@media (min-width: 700px) {
  .sheet { top: 50%; bottom: auto; border-radius: 14px; transform: translate(-50%, -46%) scale(0.96); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.25s; }
  .sheet.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.sheet-head {
  position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 56px; padding: 0 8px;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--sep);
}
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; }
.sheet-head .r { justify-self: end; }
.sheet-body { padding: 4px 16px 24px; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 6px auto 0; position: absolute; left: 50%; transform: translateX(-50%); top: 0; }
@media (min-width: 700px) { .grabber { display: none; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; z-index: 60;
  background: rgba(30, 30, 32, 0.92); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 500;
  transition: transform 0.35s var(--ease), opacity 0.25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 12px; min-height: 34px; border-radius: 17px; background: var(--fill); font-size: 15px; }
.chip button { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 50%; color: var(--label2); cursor: pointer; display: grid; place-items: center; }
.chip button svg { width: 14px; height: 14px; }
.chip .ord { font-size: 12px; font-weight: 700; color: var(--blue); margin-right: 2px; }
.chip-add { border: 0; outline: none; background: transparent; min-width: 140px; flex: 1; min-height: 34px; font-size: 15px; }

/* ---------- Landing: always one screen, no scrolling ---------- */
.landing {
  height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.landing nav { display: flex; align-items: center; gap: 4px; padding: clamp(6px, 1.4vh, 12px) 16px; max-width: 1080px; width: 100%; margin: 0 auto; flex: none; }
.landing nav .spacer { flex: 1; }
.hero {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: safe center;
  width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px; text-align: center;
}
.hero h1 { font-size: clamp(30px, min(8.6vw, 7.2vh), 60px); line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 clamp(8px, 1.8vh, 16px); font-weight: 700; }
.hero h1 span { background: linear-gradient(120deg, #0a84ff, #5e5ce6 55%, #bf5af2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(15px, min(4.3vw, 2.5vh), 20px); color: var(--label2); margin: 0 auto clamp(14px, 3.4vh, 30px); max-width: 560px; line-height: 1.38; }
.drop {
  background: var(--bg2); border-radius: 20px; padding: clamp(14px, 3.6vh, 34px) 20px; border: 2px dashed var(--sep); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease); display: grid; justify-items: center; gap: clamp(3px, 0.9vh, 10px);
}
.drop:hover, .drop.over { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 5%, var(--bg2)); }
.drop.over { transform: scale(1.01); }
.drop.busy { cursor: progress; border-style: solid; border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.drop svg.big { width: clamp(30px, 5vh, 44px); height: clamp(30px, 5vh, 44px); color: var(--blue); }
.drop .spinner.big { width: clamp(28px, 4.6vh, 40px); height: clamp(28px, 4.6vh, 40px); }
.drop strong { font-size: clamp(16px, 2.3vh, 19px); }
.drop .hint { color: var(--label2); font-size: 14px; }
.under { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; justify-content: center; margin-top: clamp(6px, 1.4vh, 12px); }
.privacy { display: inline-flex; gap: 6px; align-items: center; color: var(--label2); font-size: 13px; }
.privacy svg { width: 15px; height: 15px; color: var(--green); flex: none; }
.notice.compact { margin-top: 10px; padding: 9px 12px; font-size: 14px; text-align: left; }
.steps { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 900px; margin: clamp(10px, 2.4vh, 26px) auto 0; padding: 0 20px; }
.step { background: var(--bg2); border-radius: var(--radius-lg); padding: clamp(10px, 1.8vh, 16px); display: flex; gap: 12px; align-items: flex-start; text-align: left; }
.step .ico { width: 30px; height: 30px; flex: none; margin: 0; }
.step h3 { margin: 0 0 2px; font-size: 15px; }
.step p { margin: 0; color: var(--label2); font-size: 13px; line-height: 1.35; }
.landing footer { flex: none; display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: wrap; padding: clamp(4px, 1.2vh, 14px) 16px clamp(6px, 1.4vh, 14px); color: var(--label2); font-size: 13px; }
.landing footer .btn.small { min-height: 44px; }
.landing footer .dot-sep { color: var(--label3); }
.landing footer .foot-note { width: 100%; text-align: center; font-size: 12px; color: var(--label3); }
@media (min-width: 700px) { .landing footer .foot-note { width: auto; margin-left: 12px; } }

/* Phones: compact steps (icon + title only). */
@media (max-width: 600px) {
  .steps { gap: 8px; padding: 0 12px; }
  .step { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 10px 6px; }
  .step p { display: none; }
  .step h3 { font-size: 13px; margin: 0; }
  .step .ico { width: 28px; height: 28px; }
  .step .ico svg { width: 16px; height: 16px; }
  .logo.lg .logo-mark { height: 32px; }
  .logo.lg .logo-word { height: 19px; }
}
/* Short screens (small phones, browser toolbars showing, small laptops): tighten further. */
@media (max-height: 700px) {
  .step p { display: none; }
  .step { align-items: center; }
  .landing footer .foot-note { display: none; }
}
@media (max-height: 720px) {
  .landing.has-msg .steps { display: none; }   /* make room for the message */
}
@media (max-height: 600px) {
  .hero p.lead { font-size: 14px; }
}
@media (max-height: 520px) {
  .steps { display: none; }
}
/* Landscape phones: too short for one screen, so let it scroll rather than clip. */
@media (max-height: 420px) {
  .landing { height: auto; min-height: 100dvh; overflow: visible; }
}
.progress { margin-top: 18px; display: grid; gap: 10px; justify-items: center; color: var(--label2); font-size: 15px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill2); border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { background: color-mix(in srgb, var(--orange) 12%, var(--bg2)); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; color: var(--label); display: flex; gap: 10px; }
.notice.blue { background: color-mix(in srgb, var(--blue) 10%, var(--bg2)); }
.notice svg { width: 20px; height: 20px; flex: none; color: var(--orange); margin-top: 1px; }
.notice.blue svg { color: var(--blue); }

.state { text-align: center; padding: 50px 24px; color: var(--label2); display: grid; justify-items: center; gap: 10px; }
.state svg { width: 48px; height: 48px; color: var(--label3); }
.state h3 { margin: 0; color: var(--label); font-size: 20px; }
.state p { margin: 0; max-width: 340px; font-size: 15px; }
.skel { background: var(--bg2); border-radius: var(--radius); height: 112px; position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--fill), transparent); animation: shimmer 1.3s infinite; transform: translateX(-100%); }
@keyframes shimmer { to { transform: translateX(100%); } }

.tool { max-width: 760px; margin: 0 auto; padding: 0 20px 60px; }
.tool .toolbar { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
ol.howto { margin: 0; padding: 14px 16px 14px 36px; font-size: 15px; line-height: 1.5; }
ol.howto li + li { margin-top: 6px; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 16px; }
.amounts button { min-height: 48px; border-radius: 12px; border: 0; background: var(--bg3); font-weight: 600; cursor: pointer; font-size: 16px; }
.amounts button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; padding: 14px 16px; }
.share-grid a, .share-grid button { display: grid; justify-items: center; gap: 6px; font-size: 13px; color: var(--label); border: 0; background: transparent; cursor: pointer; padding: 6px 0; min-height: 44px; }
.share-grid .ico { width: 54px; height: 54px; border-radius: 14px; }
.share-grid .ico svg { width: 26px; height: 26px; }
.share-preview { background: var(--bg2); border-radius: var(--radius); padding: 14px 16px; font-size: 15px; line-height: 1.45; }

.mobile-only { display: none; }
.listcol, .detail, .tool, .detail-inner { min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: 240px minmax(320px, 380px) 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tiles .tile.fit { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .mobile-only { display: inline-grid; }
  .btn.mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(310px, 86vw); z-index: 45; transform: translateX(-100%);
    transition: transform 0.38s var(--ease); box-shadow: var(--shadow); padding-top: calc(8px + env(safe-area-inset-top));
  }
  .sidebar.open { transform: translateX(0); }
  .listcol { border-right: 0; height: 100dvh; }
  .detail {
    position: fixed; inset: 0; z-index: 30; transform: translateX(100%); transition: transform 0.42s var(--ease);
    box-shadow: var(--shadow);
  }
  .detail.open { transform: translateX(0); }
  .detail-inner, .tool { padding: 0 16px 60px; }
  .detail .toolbar, .tool .toolbar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .toolbar { padding-top: calc(4px + env(safe-area-inset-top)); }
  .kv { grid-template-columns: 1fr 1fr; }
  .dhead h1 { font-size: 24px; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr; }
  .large-title { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Accent pass: a clear focal colour, using Apple system colours */
:root { --grad: linear-gradient(135deg, #007aff 0%, #5856d6 55%, #af52de 100%); --grad-soft: linear-gradient(90deg, rgba(88, 86, 214, 0.16), rgba(0, 122, 255, 0.06)); }
.side-item[aria-current="true"] { background: var(--grad); color: #fff; box-shadow: 0 2px 8px rgba(88, 86, 214, 0.35); }
.side-item[aria-current="true"] svg, .side-item[aria-current="true"] .count { color: #fff; }
.card[aria-selected="true"] { background: var(--grad-soft); box-shadow: inset 4px 0 0 #5856d6, 0 0 0 1px rgba(88, 86, 214, 0.25); }
.btn.primary { background: var(--grad); box-shadow: 0 4px 14px rgba(88, 86, 214, 0.3); }
.tile.fit { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(88, 86, 214, 0.3); }
.tile.fit .k, .tile.fit .v, .tile.fit .n, .tile.fit .ring b { color: #fff; }
.tile.fit .ring circle:first-child { stroke: rgba(255, 255, 255, 0.3); }
.tile.fit .ring circle:last-child { stroke: #fff; }
.tile.fit .ring.lg, .tile.fit .ring.lg svg { width: 60px; height: 60px; }
.tile.fit .ring.lg b { font-size: 18px; }
.tile.fit .v { font-size: 17px; line-height: 1.2; }
.tile.fit { gap: 10px; }

/* Tighter detail panel: secondary text collapses, fit breakdown stays visible */
.more { margin-top: 16px; }
.more summary { cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; color: var(--blue); padding: 10px 2px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "▸ "; }
.more[open] summary::before { content: "▾ "; }
.tiles .tile { padding: 12px; }
.tiles .tile .v { font-size: 18px; }
.bars .row { padding: 10px 14px; }
.bars .bar-why { font-size: 12px; }
