:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --text: #16161a;
  --muted: #6b6b76;
  --line: #e6e6ea;
  --accent: #4f46e5;
  --accent-soft: #e0e7ff;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --ok: #16a34a;
  --green: #107c10;            /* subscription catalogs (Game Pass green) */
  --green-strong-bg: #107c10;  --green-strong-fg: #ffffff;
  --deal: #0d9488;             /* money-saving: sale alerts, Room in your budget */
  --viz-planned: #4f46e5; --viz-spent: var(--deal); --viz-budget: #16161a;
  --pill-day-one-bg: #dcfce7; --pill-day-one-fg: #166534;
  --pill-wait-bg: #fef3c7;    --pill-wait-fg: #92400e;
  --pill-maybe-bg: #e5e7eb;   --pill-maybe-fg: #374151;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1014; --surface: #1a1b22; --text: #f2f2f5; --muted: #9a9aa6; --line: #2a2b35;
    --accent: #818cf8; --accent-soft: #2b2f57; --danger: #f87171; --danger-soft: #4a1d1d;
    --pill-day-one-bg: #14532d; --pill-day-one-fg: #bbf7d0;
    --pill-wait-bg: #713f12;    --pill-wait-fg: #fde68a;
    --pill-maybe-bg: #374151;   --pill-maybe-fg: #e5e7eb;
    --green: #4ade80; --green-strong-bg: #166534; --green-strong-fg: #dcfce7;
    --deal: #0f9f8f;
    --viz-planned: #6d75f0; --viz-spent: var(--deal); --viz-budget: #f2f2f5;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
.page { max-width: 520px; margin: 0 auto; padding: 8px 16px 48px; }

.topnav {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 520px; margin: 0 auto; padding: 12px 16px;
}
.brand { color: var(--muted); font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.nav-link { font-weight: 600; font-size: 14px; }

.flash { list-style: none; max-width: 520px; margin: 0 auto; padding: 0 16px; }
.flash li { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px; background: var(--accent-soft); font-size: 14px; }
.flash .flash-error { background: var(--danger-soft); }

/* Month header */
.month-header { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.month-header h1 { font-size: 22px; margin: 0; font-weight: 700; }
.month-nav {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  font-size: 28px; line-height: 1; color: var(--text); background: var(--surface); border: 1px solid var(--line);
}

/* Summary card */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.summary-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.total { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.of-budget { color: var(--muted); font-size: 15px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; margin: 12px 0 8px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }
.summary.over .bar-fill { background: var(--danger); }
.over-line { margin: 0; color: var(--danger); font-weight: 600; font-size: 14px; }
.under-line { margin: 0; color: var(--muted); font-size: 14px; }

/* Day groups and rows */
.day-group { margin-bottom: 18px; }
.day-header {
  font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 6px 4px;
}
.day-group.vague .day-header { color: var(--accent); }
.row {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px;
}
.cover { width: 44px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: var(--line); }
.cover-placeholder {
  display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--muted); font-size: 13px; margin: 2px 0 4px; }
.row-sub .sep { margin: 0 5px; }
.delayed { color: var(--danger); font-weight: 500; }
.row-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-price.estimated { color: var(--muted); font-weight: 600; }

.pill {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  letter-spacing: .02em;
}
.pill-day-one { background: var(--pill-day-one-bg); color: var(--pill-day-one-fg); }
.pill-wait-for-sale { background: var(--pill-wait-bg); color: var(--pill-wait-fg); }
.pill-maybe { background: var(--pill-maybe-bg); color: var(--pill-maybe-fg); }
.pill-owned { background: var(--accent-soft); color: var(--accent); }

/* Coming up */
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 28px 0 8px 4px; display: flex; justify-content: space-between; }
.section-meta { font-weight: 500; text-transform: none; letter-spacing: 0; }
.bucket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 12px; margin-bottom: 8px; }
.bucket-later { border-style: dashed; }
.bucket-quarter .later-title::before, .bucket-year .later-title::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }
.later-summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 10px 0; list-style: none; }
.later-summary::-webkit-details-marker { display: none; }
.later-title { font-weight: 600; }
.later-meta { color: var(--muted); font-size: 14px; white-space: nowrap; }
.bucket[open] .later-summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.bucket .row { border: none; background: transparent; padding-left: 0; padding-right: 0; }
.bucket-link { display: inline-block; font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.past-note { color: var(--muted); font-size: 13px; text-align: center; margin: 20px 0 0; }

.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
.notice.error { background: var(--danger-soft); }
code { font-size: 13px; }

/* Search */
.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input { flex: 1; font: inherit; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); }
button { font: inherit; font-weight: 600; padding: 10px 14px; border-radius: var(--radius); border: none; background: var(--accent); color: #fff; cursor: pointer; }
.add-form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.add-form select { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.add-form button { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.result .cover { align-self: flex-start; }

/* Tappable rows */
.row-tappable { cursor: pointer; }
.row-tappable:hover, .row-tappable:focus-visible { border-color: var(--accent); outline: none; }

/* Detail sheet (bottom sheet built on <dialog>) */
.sheet {
  border: none; padding: 0; margin: auto 0 0 0; width: 100%; max-width: 100%;
  background: var(--surface); color: var(--text);
  border-radius: 20px 20px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.25);
}
.sheet::backdrop { background: rgba(0,0,0,.45); }
@media (min-width: 640px) {
  .sheet { margin: auto; max-width: 480px; border-radius: 20px; }
}
.sheet-form { padding: 8px 20px 24px; max-width: 520px; margin: 0 auto; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet-title { margin: 0; font-size: 20px; }
.sheet-sub { margin: 2px 0 16px; color: var(--muted); font-size: 14px; }
.sheet-field { display: flex; flex-direction: column; gap: 6px; border: none; padding: 0; margin: 0 0 16px; min-width: 0; }
.sheet-field > span, .sheet-field legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
.sheet-field small { color: var(--muted); font-size: 12px; }
.sheet-field input[type="number"], .sheet-field input[type="text"] {
  font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%;
}
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented { display: flex; gap: 6px; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; text-align: center; padding: 9px 6px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
}
.segmented input:checked + span { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.sheet-actions { display: flex; gap: 8px; margin-top: 4px; }
.sheet-actions .primary { flex: 1; }
.sheet-actions .ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.sheet-actions .danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); margin-left: auto; }

/* Nav */
.nav-links { display: flex; align-items: center; gap: 14px; }
.nav-link.muted { color: var(--muted); }
.inline-form { display: inline; }
.link-button { background: none; border: none; padding: 0; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }

/* Auth + settings forms */
.hero { margin: 12px 0 20px; }
.hero h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--muted); }
.muted-line { color: var(--muted); font-size: 14px; margin: -6px 0 16px; }
.card-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input:not([type="checkbox"]), .field select {
  font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%;
}
.field small { color: var(--muted); font-size: 12px; }
.field small.error, .form-errors { color: var(--danger); }
.field.has-error input { border-color: var(--danger); }
.field-check label { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--text); }
.field-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-errors { list-style: none; padding: 0; margin: 0 0 12px; font-size: 14px; }
button.wide { width: 100%; margin-top: 4px; }
.form-foot { margin: 14px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.sheet-field select {
  font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%;
}

.planned { color: var(--accent); font-weight: 600; }
.later-meta.empty-meta { opacity: .6; }

/* Steam import */
.import-controls { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
.import-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.import-controls select { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.import-controls button { margin-left: auto; }
.import-row { cursor: pointer; }
.import-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.import-row.already { opacity: .6; }
.library-notice { background: var(--pill-day-one-bg); color: var(--pill-day-one-fg); margin-bottom: 10px; line-height: 1.45; }
.library-notice strong { display: block; margin-bottom: 2px; }
.library-import .import-controls { border-color: var(--ok); }
.library-import .import-controls button { background: var(--ok); }
.library-dest { font-size: 12px; font-weight: 600; color: var(--ok); text-transform: uppercase; letter-spacing: .05em; }

/* Waiting for a sale */
.bucket-sale { border-color: var(--pill-wait-fg); border-style: dashed; }
.bucket-hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.pill-sale { background: var(--pill-day-one-bg); color: var(--pill-day-one-fg); margin-left: 4px; }

/* Linked Steam profile */
.linked { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.linked-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.linked-body { font-weight: 600; margin: 4px 0 2px; word-break: break-all; }
.linked-id { color: var(--muted); font-weight: 500; font-size: 13px; }
.linked-meta { color: var(--muted); font-size: 13px; }

/* Discover */
.when-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
.when { flex: 1; text-align: center; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; }
.when.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.nav-links { gap: 12px; }
@media (max-width: 420px) { .nav-link.muted { font-size: 13px; } }

/* Share settings */
.share-card { margin-top: 0; }
.share-status { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.share-status.on { color: var(--text); }
.share-url { display: flex; gap: 8px; margin-bottom: 10px; }
.share-url input { flex: 1; font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-width: 0; }
.share-url .ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 8px 14px; }
.share-actions { display: flex; gap: 16px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.share-actions .link-button { color: var(--accent); font-size: 14px; }
.share-actions .danger-text { color: var(--danger); }

/* ---------- Desktop layout ----------
   Phones keep the single column above. From 900px the calendar splits into the month
   (left) and Coming up / sale pool (right); list pages get a wider, two-column grid. */
@media (min-width: 720px) {
  body { font-size: 16px; }
  .topnav { max-width: 1120px; padding: 16px 24px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .brand { font-size: 16px; }
  .nav-links { gap: 20px; }
  .nav-link, .link-button { font-size: 15px; }
  .flash { max-width: 1120px; padding: 0 24px; }
  .page { padding: 8px 24px 64px; }
  .layout-list .page { max-width: 880px; }
  .layout-narrow .page { max-width: 520px; }
}
@media (min-width: 900px) {
  .layout-calendar .page {
    max-width: 1120px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 0 40px;
    align-items: start;
  }
  .layout-calendar .col-side { position: sticky; top: 16px; }
  .layout-calendar .col-side .section-title:first-child { margin-top: 12px; }
  .layout-calendar .month-header h1 { font-size: 28px; }
  .layout-calendar .total { font-size: 48px; }
  .layout-list .page { max-width: 1120px; }
  .layout-list .row.result { margin-bottom: 0; }
  .layout-list main > .row.result, .layout-list main > form > .row { margin-bottom: 10px; }
  .results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero h1 { font-size: 32px; }
}

.brand, .nav-link { white-space: nowrap; }
@media (max-width: 480px) { .nav-note .long { display: none; } }

/* Sheet outbound links */
.sheet-title a { color: var(--text); text-decoration: none; }
.sheet-title a:hover { color: var(--accent); }
.sheet-links { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
.sheet-links a { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.sheet-links a:hover { color: var(--accent); border-color: var(--accent); }

/* Subscriptions */
.summary-split { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.day-header .day-meta { float: right; text-transform: none; letter-spacing: 0; font-weight: 500; }
.cover-sub { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.row-sub .row-price small { font-size: 11px; color: var(--muted); font-weight: 500; }
.subs-hint { color: var(--muted); font-size: 13px; margin: 8px 4px 16px; }
.subs-note { color: var(--muted); font-weight: 400; }
.sub-add .sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub-add small.muted-line { display: block; margin: -4px 0 12px; }
.sub-controls { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin-top: 8px; }
.sub-controls label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.sub-controls label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); padding-bottom: 8px; }
.sub-controls input[type="number"], .sub-controls select { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 110px; }
.sub-controls input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
button.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
button.small.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.sub-row.inactive .row-title { color: var(--muted); text-decoration: line-through; }
.primary-link { font-weight: 600; }
.sub-controls input[type="text"] { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 140px; }

/* Subscription brand tiles */
.cover-sub { display: grid; place-items: center; flex-shrink: 0; }
.cover-sub img { width: 26px; height: 26px; }
.cover-mono { color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.sub-row { align-items: flex-start; }
.sub-row .cover-sub { margin-top: 2px; }

/* One-tap add buttons */
.add-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.add-quick { display: inline; }
.plat { padding: 6px 11px; font-size: 13px; border-radius: 8px; border: 1px solid transparent; color: #fff; }
.plat-pc { background: #1b2838; }
.plat-ps5 { background: #0070d1; }
.plat-xbox { background: #107c10; }
.plat-switch2, .plat-switch { background: #e60012; }
.plat-own { background: transparent; color: var(--accent); border-color: var(--accent); }
.plat:hover { filter: brightness(1.15); }
.setup-hint { font-size: 12px; color: var(--muted); }
.pill-owned-status, .pill-owned { }
.pill-owned { background: var(--accent-soft); color: var(--accent); }
.critic { font-weight: 600; }
.critic.good { color: #16a34a; }
.critic.mixed { color: #d97706; }
.critic.bad { color: #dc2626; }
.pill.critic { background: transparent; border: 1px solid currentColor; margin-left: 4px; }
.check-list ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.check-list li label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text); }
.check-list input { width: 16px; height: 16px; accent-color: var(--accent); }
.spent { color: var(--accent); }
.bought .day-header { color: var(--accent); }

/* ---------- Mobile fixes ----------
   Nothing may push the page wider than the screen. */
html, body { max-width: 100%; overflow-x: hidden; }
.page, .row, .row-main, .sheet-field, .sheet-grid > *, .results-grid > *, .import-controls, .sub-controls { min-width: 0; }
img, svg { max-width: 100%; }

/* Header: brand + logout on the first row, links on a wrapping second row */
.topnav { display: block; padding: 10px 16px 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.navrow { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin: 0 -16px 4px; padding-left: 16px; padding-right: 16px; }
.navrow .nav-link { color: var(--muted); font-size: 14px; padding: 4px 0; }
.navrow .nav-link.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.navrow .nav-link:first-child { color: var(--text); }
.nav-links { display: contents; }
@media (min-width: 720px) {
  .topnav { display: flex; align-items: center; gap: 28px; padding: 14px 24px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .topbar { order: 0; }
  .navrow { order: 1; flex: 1; border: none; margin: 0; padding: 0; gap: 20px; }
  .topbar .inline-form { order: 2; }
  .topnav .topbar { flex: 0 0 auto; gap: 24px; }
  .topnav { justify-content: flex-start; }
  .topnav .topbar .inline-form { position: absolute; right: 24px; }
  .topnav { position: relative; }
}

/* Detail / info sheets on phones */
.sheet { box-sizing: border-box; }
.sheet-form { box-sizing: border-box; width: 100%; padding: 8px 16px 20px; }
.sheet-field input, .sheet-field select { min-width: 0; box-sizing: border-box; }
@media (max-width: 440px) {
  .sheet-grid { grid-template-columns: 1fr; }
  .segmented { flex-wrap: wrap; }
  .segmented label { flex: 1 1 45%; }
  .sheet-actions { flex-wrap: wrap; }
  .sheet-actions .primary { flex: 1 1 100%; }
  .sheet-actions .danger { margin-left: 0; }
  .sub-add .sub-grid { grid-template-columns: 1fr; }
}

/* Info sheet (search / discover) */
.result-tappable { cursor: pointer; }
.result-tappable:hover, .result-tappable:focus-visible { border-color: var(--accent); outline: none; }
.info-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.info-cover { width: 64px; height: 86px; border-radius: 8px; flex-shrink: 0; }
.info-text { min-width: 0; }
.info-text .sheet-sub { margin: 2px 0 0; }
.info-actions { margin: 4px 0 14px; }
.info-actions .add-actions { margin-top: 0; }
.pill-library { background: var(--pill-day-one-bg); color: var(--pill-day-one-fg); }

/* Explicit theme choice (header toggle) beats the device setting */
:root[data-theme="dark"] {
    --bg: #0f1014; --surface: #1a1b22; --text: #f2f2f5; --muted: #9a9aa6; --line: #2a2b35;
    --accent: #818cf8; --accent-soft: #2b2f57; --danger: #f87171; --danger-soft: #4a1d1d;
    --pill-day-one-bg: #14532d; --pill-day-one-fg: #bbf7d0;
    --pill-wait-bg: #713f12;    --pill-wait-fg: #fde68a;
    --pill-maybe-bg: #374151;   --pill-maybe-fg: #e5e7eb;
    --green: #4ade80; --green-strong-bg: #166534; --green-strong-fg: #dcfce7;
    --deal: #0f9f8f;
    --viz-planned: #6d75f0; --viz-spent: var(--deal); --viz-budget: #f2f2f5;
  }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Visual pass ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.theme-toggle { background: var(--surface); border: 1px solid var(--line); color: var(--muted); width: 32px; height: 32px; border-radius: 50%; padding: 0; display: grid; place-items: center; font-size: 15px; line-height: 1; cursor: pointer; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun, .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .moon { display: inline; } }
:root[data-theme="light"] .theme-toggle .sun { display: inline; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .theme-toggle .sun { display: inline; } }

/* Summary card with cover-art backdrop */
.summary-hero { position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(135deg, #312e81, #4c1d95); border-color: transparent; color: #fff; }
.summary-hero .of-budget, .summary-hero .under-line, .summary-hero .summary-split { color: rgba(255,255,255,.8); }
.summary-hero .bar { background: rgba(255,255,255,.18); }
.summary-hero .bar-fill { background: #fff; }
.summary-hero.over .bar-fill { background: #fca5a5; }
.summary-hero .over-line { color: #fecaca; }
.summary-hero .spent { color: #c7d2fe; }
.hero-covers { position: absolute; inset: -20px; display: flex; z-index: -2; filter: blur(22px) saturate(1.3); opacity: .55; }
.hero-covers img { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(20,18,50,.85), rgba(20,18,50,.55)); }

/* Platform colour dots */
.plat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--muted); }
.plat-dot-pc { background: #60a5fa; }
.plat-dot-ps5 { background: #0070d1; }
.plat-dot-xbox { background: #107c10; }
.plat-dot-switch2, .plat-dot-switch { background: #e60012; }

/* Covers and rows */
.cover { box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.result .cover { width: 56px; height: 76px; }
.row { transition: transform .12s ease, border-color .12s ease; }
.row-tappable:hover, .result-tappable:hover { transform: translateY(-1px); }
.day-header { color: var(--accent); }
.day-group.vague .day-header { color: var(--muted); }

/* Cover strip, second pass: bolder */
.summary-hero { padding: 18px 16px 16px; }
.hero-covers { inset: -12px; filter: blur(7px) saturate(1.4) brightness(.9); opacity: .95; }
.hero-shade { background: linear-gradient(180deg, rgba(18,16,48,.82) 0%, rgba(18,16,48,.55) 55%, rgba(18,16,48,.8) 100%); }
.summary-hero .total, .summary-hero .of-budget, .summary-hero .over-line, .summary-hero .under-line, .summary-hero .summary-split { text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.hero-row { display: flex; gap: 6px; margin: 12px 0 4px; }
.hero-row img { width: 40px; height: 54px; object-fit: cover; border-radius: 5px; box-shadow: 0 2px 10px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.25); }
@media (min-width: 900px) { .hero-row img { width: 48px; height: 65px; } }

/* Sheet close button */
.sheet-form { position: relative; }
.sheet-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 22px; line-height: 1; padding: 0; display: grid; place-items: center; cursor: pointer; }
.sheet-close:hover { color: var(--text); border-color: var(--accent); }
.sheet-title, .info-head { padding-right: 40px; }

/* Header, bolder */
.topnav { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 0 6px 24px rgba(0,0,0,.12); }
.topnav::before { content: ""; display: block; height: 3px; margin: -10px -16px 10px; background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899); }
@media (min-width: 720px) { .topnav::before { position: absolute; top: 0; left: 0; right: 0; margin: 0; } }
.brand { font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.brand-mark { width: 26px; height: 26px; box-shadow: 0 2px 8px rgba(99,102,241,.45); }
.navrow { border-bottom: none; gap: 6px; }
.navrow .nav-link { padding: 6px 12px; border-radius: 999px; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.navrow .nav-link:first-child { color: var(--muted); }
.navrow .nav-link:hover { color: var(--text); background: var(--bg); }
.navrow .nav-link.active { color: #fff; background: var(--accent); border-color: var(--accent); border-bottom: 1px solid var(--accent); }
.source-toggle { margin: 10px 0 14px; }
.source-toggle input { display: none; }
.source-toggle .when { cursor: pointer; }
.source-toggle .when.disabled { opacity: .45; cursor: not-allowed; }

/* Room in your budget */
.suggest { margin: 22px 0 6px; }
.suggest .day-header { color: var(--deal); }
.suggest-card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--deal); border-radius: var(--radius); padding: 10px 12px 4px; }
.suggest-intro { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.suggest .row { border: none; background: transparent; padding-left: 0; padding-right: 0; }
.suggest .plan-form { margin-left: 8px; }
.suggest .plan-form button { padding: 6px 10px; font-size: 12px; border-radius: 8px; white-space: nowrap; }
.row-with-action { display: flex; align-items: center; gap: 6px; }
.row-with-action .row { flex: 1; min-width: 0; margin-bottom: 4px; }

/* Landing */
.landing { max-width: 520px; margin: 0 auto; }
@media (min-width: 900px) {
  .landing { max-width: 1000px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
  .landing .hero { margin-top: 28px; }
  .landing .card-form { margin-top: 36px; }
}
.how { padding-left: 22px; margin: 18px 0 8px; display: grid; gap: 10px; color: var(--text); }
.how li { line-height: 1.45; }
.how li::marker { color: var(--accent); font-weight: 700; }
.how-foot { color: var(--muted); font-size: 14px; }

/* Footer */
.site-foot { max-width: 1120px; margin: 24px auto 0; padding: 16px 16px 28px; border-top: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--accent); }

/* Prose pages */
.prose { max-width: 640px; }
.prose h2 { font-size: 16px; margin: 22px 0 6px; }
.prose ul { padding-left: 20px; margin: 0; }
.prose li, .prose p { color: var(--text); line-height: 1.5; margin: 4px 0; }

/* Delete account */
.danger-card { border-color: var(--danger); }
.danger-solid { background: var(--danger); color: #fff; }
.danger-solid:hover { filter: brightness(1.1); }

/* Discover / search: poster cards */
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (min-width: 720px) { .results-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; } }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding: 0; margin: 0; min-width: 0; }
.card-cover { position: relative; aspect-ratio: 3 / 4; background: var(--line); }
.card-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-cover .cover-placeholder { display: grid; place-items: center; font-size: 40px; border-radius: 0; box-shadow: none; }
.card-badge { position: absolute; top: 8px; right: 8px; font-size: 12px; font-weight: 800; padding: 3px 7px; border-radius: 8px; background: rgba(10, 10, 14, .78); backdrop-filter: blur(4px); }
.card-badge.good { color: #4ade80; } .card-badge.mixed { color: #fbbf24; } .card-badge.bad { color: #f87171; }
.card-service { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(10, 10, 14, .78); color: #4ade80; border: 1px solid #4ade80; backdrop-filter: blur(4px); }
.card-service.included { background: var(--green-strong-bg); color: var(--green-strong-fg); border-color: var(--green-strong-bg); }
.card-service + .card-service { left: auto; right: 8px; }
.card-body { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px 10px; flex: 1; }
.card-title { font-weight: 700; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-note { font-size: 11px; font-weight: 600; color: var(--accent); }
.card .add-actions { margin-top: auto; padding-top: 6px; gap: 5px; }
.card .plat { padding: 5px 9px; font-size: 12px; }
.card .pill { align-self: flex-start; margin-top: auto; }
.card-more { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 4px 9px; font-size: 13px; border-radius: 8px; line-height: 1; }
.card-more:hover { color: var(--accent); border-color: var(--accent); }
.card-add { color: var(--accent); border-color: var(--accent); font-weight: 600; padding: 5px 11px; }
/* Own it, the hold tick box, the full form and the setup hint live in the sheet, not on the card. */
.card .sheet-only { display: none; }
.info-actions .sheet-only { display: flex; }
.info-actions .card-more { display: none; }
.info-actions .add-actions { gap: 8px; }
.info-actions .plat { padding: 7px 12px; font-size: 13px; }
.info-actions .add-form.sheet-only { display: flex; }
.info-actions .hold-toggle.sheet-only { display: flex; }
.info-actions .setup-hint.sheet-only { display: inline; }
.result-tappable.card:hover { border-color: var(--accent); }

/* Site stats */
.stats { max-width: 760px; margin: 0 auto; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 8px 10px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.stat-col { flex: 1; display: flex; flex-direction: column-reverse; height: 100%; min-width: 0; }
.stat-bar { background: var(--viz-planned); border-radius: 3px 3px 0 0; min-height: 0; }
.stat-bar-anon { background: var(--line); border-radius: 3px 3px 0 0; }
.stat-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 0 0 16px; padding: 4px 10px; background: var(--surface); border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius) var(--radius); }
.stats-two { display: grid; gap: 16px; }
@media (min-width: 720px) { .stats-two { grid-template-columns: 1fr 1fr; } }
.stats-table th { font-weight: 500; }
.stats-table code { font-size: 12px; }

/* Support (tip jar) */
.support-link { font-weight: 600; color: var(--accent); }
.support-button { display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.support-button:hover { filter: brightness(1.1); }

/* Search: your own matches */
.mine-rows { margin-bottom: 6px; }

/* Find a game on the calendar */
[hidden] { display: none !important; }  /* the hidden attribute must beat .row { display: flex } and friends */
.find { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.find input { flex: 1; font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); min-width: 0; }
.find input:focus { outline: none; border-color: var(--accent); }
.find-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
body.finding .col-main > .empty, body.finding .empty-card { display: none; }
@media (min-width: 900px) { .find { max-width: 420px; } }

/* Library */
.library-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 10px; }
.library-rows .row { margin-bottom: 0; }
.library-rows .cover { width: 52px; height: 70px; }
.library-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.library-posters .row { flex-direction: column; align-items: stretch; padding: 0; gap: 0; overflow: hidden; margin: 0; }
.library-posters .cover { width: 100%; height: auto; aspect-ratio: 3 / 4; border-radius: 0; box-shadow: none; }
.library-posters .cover-placeholder { font-size: 40px; }
.library-posters .row-main { padding: 8px 10px 2px; }
.library-posters .row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.25; }
.library-posters .row-sub { font-size: 12px; }
.library-posters .row-sub .sep { display: none; }
.library-posters .row-sub > span { display: block; }
.library-posters .row-price { padding: 2px 10px 10px; font-size: 14px; margin-top: auto; }
.library-posters .pill { margin: 4px 0 0; }
@media (max-width: 599px) {
  .library-rows { grid-template-columns: 1fr; gap: 6px; }
  .library-posters { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* Playing */
.pill-playing { background: var(--accent); color: #fff; }
.plat-play { background: var(--green-strong-bg); color: var(--green-strong-fg); }
.sheet-check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.sheet-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.sheet-check > span { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; }
.sheet-check small { flex-basis: 100%; }

/* Not interested */
.hide-form button { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.hide-form button:hover { color: var(--danger); border-color: var(--danger); }
.info-actions .hide-form { display: flex; flex-basis: 100%; margin-top: 4px; }
.chip-hidden { margin-left: auto; color: var(--muted); }
.hidden-note { margin-top: 0; }
.row > form { margin-left: auto; }

/* Steam purchase history paste */
.history-steps .how { margin: 0 0 14px; }
.history-steps textarea { width: 100%; box-sizing: border-box; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: var(--text); resize: vertical; margin-bottom: 10px; }
.history-link { margin-top: 4px; }
.history-link .linked-meta { color: var(--muted); font-size: 13px; }
.import-controls .check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.import-controls .check input { width: 16px; height: 16px; accent-color: var(--accent); }
.row-sub-inline { font-weight: 400; color: var(--muted); font-size: 13px; }
.history-unmatched { margin-top: 16px; }

/* Empty and loading states */
.empty-card { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px 18px; text-align: center; margin: 8px 0 20px; }
.empty-card h2 { font-size: 17px; margin: 0 0 6px; }
.empty-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; }
.searching { margin: -8px 0 14px; font-size: 13px; color: var(--accent); font-weight: 600; }
.searching::before { content: ""; display: inline-block; width: 10px; height: 10px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; margin-right: 8px; vertical-align: -1px; animation: spin .8s linear infinite; }
.is-loading { opacity: .45; pointer-events: none; transition: opacity .2s; }
.chip.is-busy, .when.is-busy { outline: 2px solid var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sale alerts */
.pill-alert { background: transparent; color: var(--deal); border: 1px solid var(--deal); margin-left: 4px; }
.pill-alert.hit { background: var(--deal); color: #fff; }
.sheet-alert { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 6px; }
.sheet-alert > legend { padding: 0 4px; }
.sheet-alert .sheet-grid { margin-bottom: 0; }
.sheet-alert .sheet-field { margin-bottom: 6px; }

/* Year overview */
.year { max-width: 720px; margin: 0 auto; }
.title-link { color: inherit; }
.title-link:hover { color: var(--accent); }
.year-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.year-stat { display: flex; flex-direction: column; gap: 2px; }
.year-stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.year-stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.year-stat-sub { font-size: 12px; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.swatch-planned { background: var(--viz-planned); }
.swatch-spent { background: var(--viz-spent); }
.swatch-budget { width: 2px; height: 12px; border-radius: 1px; background: var(--viz-budget); }
.year-months { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.year-month { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.year-month.current { border-color: var(--accent); }
.year-month.past { opacity: .85; }
.year-month-link { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; color: var(--text); min-height: 32px; }
.ym-label { font-weight: 700; font-size: 14px; }
.year-month.current .ym-label { color: var(--accent); }
.ym-bars { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 3px 0; }
.ym-bar { display: block; height: 8px; border-radius: 0 4px 4px 0; min-width: 0; }
.ym-planned { background: var(--viz-planned); }
.ym-spent { background: var(--viz-spent); }
.ym-budget { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--viz-budget); opacity: .7; border-radius: 1px; }
.ym-nums { display: flex; flex-direction: column; align-items: flex-end; gap: 0; font-size: 12px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ym-num-planned { color: var(--text); }
.ym-num-spent { color: var(--muted); }
.ym-meta { display: block; font-size: 12px; color: var(--muted); margin: 2px 0 0 46px; }
.ym-over { color: var(--danger); font-weight: 600; }
.year-month.over { border-color: var(--danger-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.year-table-wrap summary { font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.year-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.year-table th, .year-table td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.year-table th:first-child, .year-table td:first-child { text-align: left; }
.year-table thead th { color: var(--muted); font-weight: 600; font-size: 12px; }

/* First-run setup */
.welcome { max-width: 560px; margin: 0 auto; }
.welcome-head h1 { font-size: 24px; }
.skip-link { color: var(--muted); font-size: 13px; }
.welcome-steps { list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 6px; }
.welcome-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.welcome-steps li.current { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.welcome-steps li.done { color: var(--text); }
.step-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); font-size: 12px; }
.welcome-steps li.current .step-num { background: var(--accent); color: #fff; }
.welcome-steps li.done .step-num { background: var(--accent-soft); color: var(--accent); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.tile { position: relative; cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-body { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 14px; font-weight: 600; color: var(--text); min-height: 44px; }
.tile input:checked + .tile-body { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tile input:focus-visible + .tile-body { outline: 2px solid var(--accent); }
.tile.have .tile-body { opacity: .6; }
.sub-pick { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sub-tile .cover-sub { width: 36px; height: 36px; border-radius: 9px; }
.sub-tile .cover-sub img { width: 20px; height: 20px; }
.tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-name { font-size: 14px; line-height: 1.25; }
.tile-meta { font-size: 12px; font-weight: 500; color: var(--muted); }
.tile input:checked + .tile-body .tile-meta { color: var(--accent); }
.welcome-cards { display: grid; gap: 10px; margin-bottom: 16px; }
.welcome-card h2 { font-size: 16px; margin: 0 0 6px; }
.welcome-card p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.welcome-card .search-form { margin: 0; }
.welcome-done { display: block; text-align: center; padding: 12px; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 600; }
@media (max-width: 480px) { .welcome-steps li { font-size: 12px; padding: 7px 8px; } .welcome-steps li span + * { } }

/* Waiting to leave a subscription */
.sheet-pass { border: 1px solid var(--green); border-radius: 12px; padding: 10px 12px; margin: 0 0 16px; }
.sheet-pass p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.sheet-pass button { width: 100%; }
.pill-left { background: var(--pill-wait-bg); color: var(--pill-wait-fg); margin-left: 4px; }
.day-group.left-notice .day-header { color: var(--pill-wait-fg); }
.sheet-pass[data-state="dismiss"] { border-color: var(--pill-wait-fg); }
.sheet-pass[data-state="release"] { background: var(--pill-day-one-bg); border-color: transparent; }
.sheet-pass[data-state="release"] p { color: var(--pill-day-one-fg); }
.today-jump { text-align: center; margin: -6px 0 12px; font-size: 13px; font-weight: 600; }
.hold-pool { margin-top: 20px; }
.pass-move { border: 1px solid var(--green); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.pass-move p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.pass-move button { width: 100%; font-size: 13px; }
.hold-toggle { flex-basis: 100%; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--green); cursor: pointer; padding: 4px 0; }
.hold-toggle input { width: 16px; height: 16px; accent-color: var(--green); }
.sheet-grid[hidden], .sheet-pass[hidden] { display: none; }

/* Subscription catalog pills */
.pill-service { background: transparent; color: var(--green); border: 1px solid var(--green); margin-left: 4px; }
.pill-service.included { background: var(--green-strong-bg); color: var(--green-strong-fg); border-color: var(--green-strong-bg); }

/* ---------- Mobile density pass ---------- */
.suggest-summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; padding: 8px 4px; margin: 0; border-radius: 10px; }
.suggest-summary::-webkit-details-marker { display: none; }
.suggest-summary:hover { background: var(--surface); }
.suggest-title::before { content: "\25B8"; display: inline-block; width: 14px; color: var(--deal); transition: transform .15s; }
.suggest[open] .suggest-title::before { transform: rotate(90deg); }
.suggest-count { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.suggest[open] .suggest-card { margin-top: 2px; }

@media (max-width: 599px) {
  /* Header: one tighter row of pills */
  .topnav { padding-top: 8px; }
  .topbar { min-height: 28px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 22px; height: 22px; }
  .navrow { gap: 4px; padding: 6px 0 8px; }
  .navrow .nav-link { padding: 4px 9px; font-size: 13px; }
  /* Month header + hero */
  .month-header { margin: 2px 0 8px; }
  .month-header h1 { font-size: 19px; }
  .month-nav { width: 32px; height: 32px; }
  .summary-hero { padding: 12px 14px 12px; margin-bottom: 14px; }
  .summary-hero .total { font-size: 32px; }
  .summary-hero .of-budget { font-size: 13px; }
  .summary-hero .under-line, .summary-hero .over-line, .summary-hero .summary-split { font-size: 12px; }
  .summary-hero .bar { height: 5px; margin: 8px 0 6px; }
  .hero-row { gap: 5px; margin: 8px 0 2px; }
  .hero-row img { width: 30px; height: 41px; border-radius: 4px; }
  /* Rows */
  .day-group { margin-bottom: 12px; }
  .day-header { margin-bottom: 4px; }
  .row { gap: 10px; padding: 8px 10px; margin-bottom: 6px; }
  .cover { width: 40px; height: 54px; }
  .row-sub { font-size: 12px; margin: 1px 0 3px; }
  .pill { font-size: 10.5px; padding: 2px 7px; }
  .row-price { font-size: 15px; }
  .section-title { margin-top: 20px; }
  .bucket { padding: 0 10px; }
  .later-summary { padding: 9px 0; }
  /* Suggestions: full-width row, button underneath on the right */
  .suggest .row-with-action { flex-wrap: wrap; gap: 0; }
  .suggest .row-with-action .row { flex: 1 1 100%; margin-bottom: 0; padding-bottom: 4px; }
  .suggest .plan-form { margin: 0 0 8px auto; }
  .suggest .plan-form button { padding: 6px 12px; }
  .suggest .row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
  .suggest-card { padding: 8px 10px 2px; }
  .subs-hint, .past-note { font-size: 12px; }
}
