/* bb-scope-ledger - style sheet. No external fonts or libraries: system fonts only, so the page works on a Pi without internet.

   Design idea: a ledger. Every list row has a margin TICK on its left (solid = pays, dashed = bounty unknown, pale = no bounty).
   Three change colours, each with one meaning: NEW = green tag (.mk), REMOVED = rose tag (.gone), OUT OF SCOPE = amber row (.t-out).
   Cautions (guesses, hobby-project reminder) use .notice.caution / .site-note. Four themes: Auto (follows the system), Light, Dark, Fiesta.
   Tokens first (light, dark), then layout (desktop rail / mobile top bar + tab bar), then components. */

:root {
  --bg: #E7ECEF; --surface: #F6F8F9; --raised: #FFFFFF; --ink: #0F1B24; --muted: #566877; --rule: #CAD5DB; --rule-soft: #DCE4E8;
  --accent: #2B3AD9; --accent-ink: #FFFFFF; --accent-soft: #E3E6FB; --marker: #FFE14D; --marker-ink: #3A2F00;
  --good: #0B8A66; --good-soft: #D8F0E8; --bad: #B8322A; --bad-soft: #F6DEDB; --warn: #9A5B00; --warn-soft: #FBEBCF;
  --pb-bg-s: 55%; --pb-bg-l: 90%; --pb-fg-s: 55%; --pb-fg-l: 28%;
  /* three change colours, each with its own meaning: NEW = green, REMOVED = rose, OUT OF SCOPE = amber */
  --new: #0E9F6E; --new-soft: #DDF6EA; --new-ink: #05603F; --gone: #C98A00; --gone-soft: #FFF3CC; --gone-ink: #6B4A00; --oos: #D1304A; --oos-soft: #FDE3E6; --oos-ink: #8F1A2C;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --rail-w: 232px; --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B131A; --surface: #111C25; --raised: #16232E; --ink: #E5ECF1; --muted: #93A5B2; --rule: #263642; --rule-soft: #1C2A35;
    --accent: #8C99FF; --accent-ink: #0B131A; --accent-soft: #1D2547; --marker: #E9CC3A; --marker-ink: #1E1700;
    --good: #43C9A0; --good-soft: #10312A; --bad: #FF8A80; --bad-soft: #3A1A18; --warn: #F0B35A; --warn-soft: #382812;
    --pb-bg-s: 35%; --pb-bg-l: 20%; --pb-fg-s: 70%; --pb-fg-l: 78%;
    --new: #3DD6A0; --new-soft: #0F3A2D; --new-ink: #8CF0CB; --gone: #F5C542; --gone-soft: #3A3010; --gone-ink: #FFE08A; --oos: #FF6B7D; --oos-soft: #3F1A20; --oos-ink: #FFB3BC;
  }
}
:root[data-theme="dark"] {
  --bg: #0B131A; --surface: #111C25; --raised: #16232E; --ink: #E5ECF1; --muted: #93A5B2; --rule: #263642; --rule-soft: #1C2A35;
  --accent: #8C99FF; --accent-ink: #0B131A; --accent-soft: #1D2547; --marker: #E9CC3A; --marker-ink: #1E1700;
  --good: #43C9A0; --good-soft: #10312A; --bad: #FF8A80; --bad-soft: #3A1A18; --warn: #F0B35A; --warn-soft: #382812;
  --pb-bg-s: 35%; --pb-bg-l: 20%; --pb-fg-s: 70%; --pb-fg-l: 78%;
  --new: #3DD6A0; --new-soft: #0F3A2D; --new-ink: #8CF0CB; --gone: #F5C542; --gone-soft: #3A3010; --gone-ink: #FFE08A; --oos: #FF6B7D; --oos-soft: #3F1A20; --oos-ink: #FFB3BC;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, .mono { font-family: var(--mono); font-size: .92em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4.2vw, 36px); }
h2 { font-size: 21px; margin: 38px 0 12px; }
h3 { font-size: 17px; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 16px; background: var(--surface); border-right: 1px solid var(--rule); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--ink); text-decoration: none; font: 600 19px/1 var(--serif); }
.brand .mark { width: 28px; height: 28px; flex: none; }
.mark rect:first-child { fill: var(--accent); } .mark path { stroke: var(--accent-ink); stroke-width: 2.6; stroke-linecap: round; fill: none; } .mark .hl { fill: var(--marker); }
#nav { display: grid; gap: 2px; }
#nav a, .tabbar a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 500; }
#nav a:hover { background: var(--rule-soft); color: var(--ink); }
#nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.fresh { font-size: 13px; color: var(--muted); padding: 0 8px; }
.fresh b { color: var(--ink); font-weight: 600; }
.fresh.stale { color: var(--warn); } .fresh.stale b { color: var(--warn); }
.ghost { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; background: none; border-radius: 7px; color: var(--muted); font-weight: 500; text-align: left; }
.ghost:hover { background: var(--rule-soft); color: var(--ink); }
.main { padding: 30px clamp(18px, 3.2vw, 44px) 90px; max-width: 1280px; width: 100%; outline: none; }
.topbar, .tabbar, .scrim { display: none; }
[hidden] { display: none !important; }
i[data-ic] { display: inline-flex; width: 19px; height: 19px; flex: none; }
i[data-ic] svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 899px) {
  .app { display: block; }
  .rail { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(290px, 84vw); transform: translateX(-102%); transition: transform .18s ease; visibility: hidden; }
  .rail.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(5, 12, 18, .5); }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 10; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--rule); }
  .topbar .fresh { margin-left: auto; padding: 0; font-size: 12px; text-align: right; }
  .brand.sm { font-size: 17px; padding: 0; } .brand.sm .mark { width: 24px; height: 24px; }
  .icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--rule); background: var(--raised); border-radius: 9px; }
  .main { padding: 18px 14px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 10; inset: auto 0 0 0; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--rule); }
  .tabbar a { flex-direction: column; gap: 3px; padding: 8px 2px 7px; font-size: 11.5px; border-radius: 0; }
  .tabbar a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
  h2 { margin-top: 30px; }
}

/* ---------- small pieces ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 24px; margin-bottom: 20px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 14px; border: 1px solid var(--rule); background: var(--raised); border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--rule-soft); color: var(--muted); white-space: nowrap; }
.badge.pb { --h: 215; background: hsl(var(--h) var(--pb-bg-s) var(--pb-bg-l)); color: hsl(var(--h) var(--pb-fg-s) var(--pb-fg-l)); }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.acc { background: var(--accent-soft); color: var(--accent); }
.badge.new { background: var(--new-soft); color: var(--new-ink); box-shadow: inset 0 0 0 1px var(--new); }
.badge.gone { background: var(--gone-soft); color: var(--gone-ink); box-shadow: inset 0 0 0 1px var(--gone); }
.badge.oos { background: var(--oos-soft); color: var(--oos-ink); box-shadow: inset 0 0 0 1px var(--oos); }
/* NEW values: a soft green tag (never struck through, never hides the text). REMOVED values: a rose tag. */
.mk { background: var(--new-soft); color: var(--new-ink); border-radius: 5px; padding: 1px 7px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--new) 55%, transparent); }
.gone { background: var(--gone-soft); color: var(--gone-ink); border-radius: 5px; padding: 1px 7px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gone) 55%, transparent); }
.notice { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--surface); margin: 0 0 18px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); } .notice.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.notice.good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.notice b { color: inherit; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--rule); border-radius: var(--radius); }
.empty b { display: block; color: var(--ink); font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 9px; font-size: 14px; transition: opacity .15s, transform .15s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ---------- forms ---------- */
.field, select.field { min-height: 40px; padding: 7px 11px; border: 1px solid var(--rule); background: var(--raised); border-radius: 8px; width: 100%; }
.field:focus { border-color: var(--accent); outline-offset: 0; }
select.field { width: auto; max-width: 100%; padding-right: 8px; }
textarea.field { min-height: 130px; font-family: var(--mono); font-size: 13.5px; resize: vertical; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.filters .search { flex: 1 1 240px; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--raised); }
.seg button { border: 0; background: none; padding: 8px 12px; min-height: 40px; color: var(--muted); font-weight: 500; font-size: 14px; border-right: 1px solid var(--rule); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.check { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; color: var(--muted); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- ledger rows (tables that become stacked lists on a phone) ---------- */
.ledger { background: var(--raised); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.row { position: relative; display: grid; grid-template-columns: var(--cols, 1fr); gap: 4px 14px; align-items: center; padding: 10px 14px 10px 18px; border-top: 1px solid var(--rule-soft); }
.row.head { border-top: 0; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; padding-top: 8px; padding-bottom: 8px; }
.row::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--tc, transparent); }
.row.t-pay { --tc: var(--accent); } .row.t-free { --tc: var(--rule); }
.row.t-unk::before { background: repeating-linear-gradient(to bottom, var(--accent) 0 3px, transparent 3px 6px); }
a.row, .row.click { color: inherit; text-decoration: none; cursor: pointer; }
a.row:hover, .row.click:hover { background: var(--accent-soft); }
.row .num { text-align: right; font-variant-numeric: tabular-nums; }
.row .host { font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; word-break: break-word; }
.row .name { font-weight: 600; overflow-wrap: anywhere; }
.row a.name { color: var(--ink); text-decoration: none; } .row a.name:hover { color: var(--accent); text-decoration: underline; }
.row .meta { display: none; }
.row .sub { color: var(--muted); font-size: 13px; }
.row details > summary { list-style: none; cursor: pointer; }
.row details > summary::-webkit-details-marker { display: none; }
.detail { grid-column: 1 / -1; padding: 8px 0 4px; display: grid; gap: 6px; font-size: 13.5px; }
.detail .raw { font-family: var(--mono); font-size: 12.5px; padding: 8px 10px; background: var(--surface); border-radius: 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 14px; }
@media (max-width: 719px) {
  .row { grid-template-columns: minmax(0, 1fr) auto !important; padding: 11px 12px 11px 16px; }
  .row.head { display: none; }
  .row .c-x { display: none; }
  .row .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
  .row .c-end { grid-column: 2; grid-row: 1; }
}

/* ---------- home ---------- */
.hero { padding: 6px 0 10px; }
.hero h1 { max-width: 20ch; }
.ask { position: relative; margin: 18px 0 8px; max-width: 760px; }
.ask input { width: 100%; min-height: 58px; padding: 12px 16px 12px 52px; font: 500 19px/1.2 var(--mono); border: 2px solid var(--ink); background: var(--raised); border-radius: 12px; }
.ask input:focus { outline: 4px solid var(--marker); outline-offset: 0; border-color: var(--ink); }
.ask i[data-ic] { position: absolute; left: 17px; top: 18px; width: 22px; height: 22px; color: var(--muted); }
.ask-out { max-width: 760px; margin-top: 10px; }
.verdict { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--raised); margin-bottom: 8px; }
.verdict .dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; background: var(--rule); }
.verdict.yes .dot { background: var(--good); } .verdict.maybe .dot { background: var(--marker); box-shadow: 0 0 0 2px var(--marker-ink) inset; } .verdict.no .dot { background: var(--bad); }
.verdict b { font-weight: 600; }
.verdict .why { grid-column: 2; color: var(--muted); font-size: 14px; }
.progs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; grid-column: 2; }
.progs a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--rule); border-radius: 99px; text-decoration: none; color: var(--ink); font-size: 13px; background: var(--surface); }
.progs a:hover { border-color: var(--accent); }
.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--raised); overflow: hidden; }
.glance > a { display: block; padding: 14px 16px; border-right: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); min-width: 0; color: inherit; text-decoration: none; }
.glance > a:hover { background: var(--accent-soft); }
.glance .v { font: 600 30px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.glance .l { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.glance svg.spark { width: 100%; height: 34px; margin-top: 8px; color: var(--accent); display: block; }
@media (max-width: 719px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } .glance .v { font-size: 25px; } }
.spark path.line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spark path.area { fill: currentColor; opacity: .12; stroke: none; }
.spark circle { fill: currentColor; }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--rule-soft); min-width: 60px; }
.bar i { display: block; height: 100%; } .bar .b-new { background: var(--marker); } .bar .b-rem { background: var(--bad); } .bar .b-pay { background: var(--accent); }
.days { display: flex; align-items: flex-end; gap: 3px; height: 64px; margin: 0 0 16px; overflow-x: auto; padding-bottom: 2px; }
.days button { flex: 1 0 14px; max-width: 34px; min-width: 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; border: 0; background: none; padding: 0; border-radius: 3px; position: relative; }
.days button i { display: block; width: 100%; border-radius: 2px 2px 0 0; }
.days .n { background: var(--new); } .days .r { background: var(--gone); }
.days button[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: var(--accent); border-radius: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; scrollbar-width: thin; }
.tabs a, .tabs button { display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; padding: 7px 12px; border: 1px solid var(--rule); border-radius: 99px; background: var(--raised); color: var(--ink); text-decoration: none; font-size: 14px; min-height: 36px; }
.tabs [aria-current="true"], .tabs [aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tabs .n { color: var(--muted); font-variant-numeric: tabular-nums; } .tabs [aria-current="true"] .n, .tabs [aria-pressed="true"] .n { color: inherit; opacity: .75; }
pre.code { margin: 0; padding: 12px 14px; background: #0E1820; color: #DCE8F0; border-radius: var(--radius); overflow-x: auto; font: 13px/1.55 var(--mono); position: relative; }
pre.code .c { color: #7F95A5; }
.snippet { position: relative; margin: 8px 0 14px; }
.snippet pre.code { padding-right: 84px; }
.snippet .btn { position: absolute; top: 6px; right: 6px; min-height: 30px; padding: 3px 10px; font-size: 13px; background: #1B2B37; color: #DCE8F0; border-color: #2E4252; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 899px) { .cols2 { grid-template-columns: 1fr; } }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--rule-soft), var(--rule), var(--rule-soft)); background-size: 200% 100%; animation: sk 1.2s linear infinite; margin: 14px 0; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ======================================================================= additions: watchlist, exclusions, share bar, theme switcher */
.row[data-href] { cursor: pointer; } .row[data-href]:hover { background: var(--accent-soft); }
.star { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; color: var(--muted); padding: 0; }
.star:hover { background: var(--rule-soft); color: var(--ink); }
.star svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.star[aria-pressed="true"] { color: var(--marker-ink); } .star[aria-pressed="true"] svg { fill: var(--marker); stroke: var(--marker-ink); }
.star-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.star-btn[aria-pressed="true"] svg { fill: var(--marker); stroke: var(--marker-ink); }
.star-btn .on, .star-btn[aria-pressed="true"] .off { display: none; } .star-btn[aria-pressed="true"] .on { display: inline; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.chip { border: 1px solid var(--rule); background: var(--raised); border-radius: 99px; padding: 3px 11px; font: 500 13px/1.4 var(--mono); max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.quiet { color: var(--muted); }
/* what a program EXCLUDES (out of scope): amber tick, soft amber row, amber tab. The text stays fully readable. */
.row.t-out { --tc: var(--oos); background: color-mix(in srgb, var(--oos-soft) 55%, var(--raised)); }
.row.t-gone { --tc: var(--gone); }
.oos-v { color: var(--oos-ink); }
.tabs .oos { border-color: var(--oos); color: var(--oos-ink); background: var(--oos-soft); } .tabs .oos[aria-current="true"], .tabs .oos[aria-pressed="true"] { background: var(--oos); border-color: var(--oos); color: #fff; }
.progs a.ex { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
/* platform share bar on the overview */
.share { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--rule-soft); gap: 2px; margin: 4px 0 8px; }
.share a { display: block; height: 100%; background: hsl(var(--h) 62% 50%); min-width: 4px; } .share a:hover { filter: brightness(1.15); }
.share-key { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); margin: 0 0 14px; }
.share-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: hsl(var(--h) 62% 50%); }
/* theme switcher */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0 4px; }
.themes button { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid var(--rule); background: var(--raised); border-radius: 8px; font-size: 13px; color: var(--muted); }
.themes button:hover { color: var(--ink); border-color: var(--accent); }
.themes button[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); flex: none; }
.sw.sys { background: linear-gradient(90deg, #fff 50%, #16232E 50%); } .sw.lt { background: #fff; } .sw.dk { background: #16232E; }
.sw.fi { border: 0; background: conic-gradient(#FF3D81, #FF9F1C, #FFE14D, #2EC4B6, #3A86FF, #8338EC, #FF3D81); }

/* ======================================================================= FIESTA: the colourful theme
   Violet-to-magenta-to-orange side rail, a confetti-tinted page, every stat tile and every asset type in its own colour,
   gradient buttons. Same layout as the other themes; only colours change, so nothing moves. */
:root[data-theme="fiesta"] {
  color-scheme: light;
  --bg: #FFF3FA; --surface: #FFFFFF; --raised: #FFFFFF; --ink: #1F0F4A; --muted: #5B4A8A; --rule: #DCCBFF; --rule-soft: #F1E8FF;
  --accent: #B5179E; --accent-ink: #FFFFFF; --accent-soft: #FFE2F6; --marker: #FFD60A; --marker-ink: #3B2A00;
  --good: #008A57; --good-soft: #C9F7E1; --bad: #D90F45; --bad-soft: #FFD9E3; --warn: #B54700; --warn-soft: #FFE6B8;
  --pb-bg-s: 95%; --pb-bg-l: 86%; --pb-fg-s: 85%; --pb-fg-l: 26%;
  --new: #00B26E; --new-soft: #CCF7E3; --new-ink: #006B40; --gone: #F5B700; --gone-soft: #FFF0B8; --gone-ink: #7A5600; --oos: #E5173F; --oos-soft: #FFD6DC; --oos-ink: #A0102B;
  --grad: linear-gradient(120deg, #4B1FD1 0%, #B5179E 55%, #FF6B1A 100%);
}
:root[data-theme="fiesta"] body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 8% 0%, #FFD9F0 0, transparent 38%), radial-gradient(circle at 96% 8%, #CFF1FF 0, transparent 34%),
                    radial-gradient(circle at 80% 100%, #FFF1B8 0, transparent 40%), radial-gradient(circle at 0% 90%, #DCD0FF 0, transparent 36%);
  background-attachment: fixed;
}
[data-theme="fiesta"] .rail { background: linear-gradient(175deg, #3A12B8 0%, #8E1AA8 55%, #E8466E 100%); border-right: 0; color: #fff; }
[data-theme="fiesta"] .rail .brand, [data-theme="fiesta"] .rail .fresh, [data-theme="fiesta"] .rail .fresh b { color: #fff; }
[data-theme="fiesta"] .rail #nav a { color: rgba(255,255,255,.86); }
[data-theme="fiesta"] .rail #nav a:hover { background: rgba(255,255,255,.16); color: #fff; }
[data-theme="fiesta"] .rail #nav a[aria-current="page"] { background: #fff; color: #5A12B0; }
[data-theme="fiesta"] .rail .mark rect:first-child { fill: #FFD60A; } [data-theme="fiesta"] .rail .mark path { stroke: #3A12B8; } [data-theme="fiesta"] .rail .mark .hl { fill: #FF3D81; }
[data-theme="fiesta"] .rail .themes button { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
[data-theme="fiesta"] .rail .themes button[aria-pressed="true"] { background: #fff; color: #3A12B8; box-shadow: none; }
[data-theme="fiesta"] .topbar, [data-theme="fiesta"] .tabbar { background: #fff; border-color: var(--rule); }
[data-theme="fiesta"] .tabbar a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
[data-theme="fiesta"] h1 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="fiesta"] .btn.primary, [data-theme="fiesta"] .seg button[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }
[data-theme="fiesta"] .tabs [aria-current="true"], [data-theme="fiesta"] .tabs [aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }
[data-theme="fiesta"] .tabs .oos[aria-current="true"], [data-theme="fiesta"] .tabs .oos[aria-pressed="true"] { background: linear-gradient(120deg, #FF8A00, #FF5A3C); }
[data-theme="fiesta"] .ledger, [data-theme="fiesta"] .glance { border-color: var(--rule); box-shadow: 0 6px 22px -14px rgba(120, 30, 160, .45); }
[data-theme="fiesta"] .row.head { background: linear-gradient(90deg, #F3E9FF, #FFE9F6); color: #4A2A8C; }
[data-theme="fiesta"] .row.t-pay { --tc: linear-gradient(#6A2CF0, #E6007E); }
[data-theme="fiesta"] .row.t-free { --tc: #C9B8F2; }
[data-theme="fiesta"] .row::before { background: var(--tc, transparent); }
[data-theme="fiesta"] .row.t-unk::before { background: repeating-linear-gradient(to bottom, #E6007E 0 3px, transparent 3px 6px); }
[data-theme="fiesta"] .row.t-out::before { background: var(--oos); }
[data-theme="fiesta"] .row.t-gone::before { background: var(--gone); }
/* each headline tile gets its own colour */
[data-theme="fiesta"] .glance > a { --g: #FFE2F1; --gi: #9A0E6E; background: var(--g); border-color: rgba(255,255,255,.7); }
[data-theme="fiesta"] .glance > a:nth-child(9n+1) { --g: #FFE2F1; --gi: #9A0E6E; } [data-theme="fiesta"] .glance > a:nth-child(9n+2) { --g: #DDF1FF; --gi: #0B5C99; }
[data-theme="fiesta"] .glance > a:nth-child(9n+3) { --g: #DFF9D2; --gi: #1F6B0B; } [data-theme="fiesta"] .glance > a:nth-child(9n+4) { --g: #FFF0B8; --gi: #7A5200; }
[data-theme="fiesta"] .glance > a:nth-child(9n+5) { --g: #E9DEFF; --gi: #4B1FB0; } [data-theme="fiesta"] .glance > a:nth-child(9n+6) { --g: #FFE0CF; --gi: #A3400B; }
[data-theme="fiesta"] .glance > a:nth-child(9n+7) { --g: #D3F7F0; --gi: #0B6B5E; } [data-theme="fiesta"] .glance > a:nth-child(9n+8) { --g: #FFD9E3; --gi: #A50F3B; }
[data-theme="fiesta"] .glance > a:nth-child(9n+9) { --g: #E0E7FF; --gi: #2B3AA6; }
[data-theme="fiesta"] .glance > a:hover { filter: brightness(.97); }
[data-theme="fiesta"] .glance .v, [data-theme="fiesta"] .glance svg.spark { color: var(--gi); } [data-theme="fiesta"] .glance .l { color: var(--gi); opacity: .85; }
[data-theme="fiesta"] .badge.acc { background: #E9DEFF; color: #4B1FB0; }
[data-theme="fiesta"] .verdict { border-width: 2px; } [data-theme="fiesta"] .verdict.yes { border-color: var(--good); background: #EFFFF7; } [data-theme="fiesta"] .verdict.no { border-color: var(--bad); background: #FFF1F5; } [data-theme="fiesta"] .verdict.maybe { border-color: #E0A800; background: #FFFBE6; }
[data-theme="fiesta"] .ask input { border-color: #6A2CF0; box-shadow: 6px 6px 0 #FF3D81; } [data-theme="fiesta"] .ask input:focus { outline-color: #FFD60A; border-color: #6A2CF0; }
[data-theme="fiesta"] .share a:nth-child(6n+1) { background: #6A2CF0; } [data-theme="fiesta"] .share a:nth-child(6n+2) { background: #FF3D81; } [data-theme="fiesta"] .share a:nth-child(6n+3) { background: #FF9F1C; }
[data-theme="fiesta"] .share a:nth-child(6n+4) { background: #2EC4B6; } [data-theme="fiesta"] .share a:nth-child(6n+5) { background: #3A86FF; } [data-theme="fiesta"] .share a:nth-child(6n+6) { background: #8AC926; }
[data-theme="fiesta"] pre.code { background: #2A1166; color: #FDEBFF; } [data-theme="fiesta"] pre.code .c { color: #B9A3F5; }
[data-theme="fiesta"] .snippet .btn { background: #4B1FD1; border-color: #7A55F0; color: #fff; }
[data-theme="fiesta"] .toast { background: #4B1FD1; color: #fff; }
[data-theme="fiesta"] .days .n { background: linear-gradient(#2EE59D, #00B26E); } [data-theme="fiesta"] .days .r { background: linear-gradient(#FF5C8A, #E0245E); opacity: .9; }
[data-theme="fiesta"] .empty { border-color: #C9B8F2; background: rgba(255,255,255,.6); }

/* ---------- phone: filters in two columns so the list starts on the first screen ---------- */
@media (max-width: 719px) {
  .filters { gap: 6px; }
  .filters .search { flex: 1 1 100%; }
  .filters select.field { flex: 1 1 calc(50% - 6px); min-width: 0; width: auto; }
  .filters .seg { flex: 1 1 100%; } .filters .seg button { flex: 1; padding: 8px 4px; }
  .filters .check { flex: 1 1 calc(50% - 6px); min-height: 34px; }
  .page-head p { font-size: 14px; }
}

/* ---------- insights: small horizontal bars ---------- */
.bar-row { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) 4em; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; }
.bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t { height: 10px; background: var(--rule-soft); border-radius: 5px; overflow: hidden; } .bar-t i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
[data-theme="fiesta"] .bar-row:nth-child(5n+1) .bar-t i { background: #6A2CF0; } [data-theme="fiesta"] .bar-row:nth-child(5n+2) .bar-t i { background: #FF3D81; }
[data-theme="fiesta"] .bar-row:nth-child(5n+3) .bar-t i { background: #FF9F1C; } [data-theme="fiesta"] .bar-row:nth-child(5n+4) .bar-t i { background: #2EC4B6; } [data-theme="fiesta"] .bar-row:nth-child(5n+5) .bar-t i { background: #3A86FF; }
.row .btn-row.c-end { justify-content: flex-end; }
.fresh .ver{opacity:.6;font-size:.85em;margin-left:.4em}

/* ---- warnings (1.9.0) */
.notice.caution { font-size: 14px; padding: 9px 13px; margin: 0 0 14px; line-height: 1.45; }
.notice.caution b { font-weight: 650; }
.site-note { margin-top: 36px; padding-top: 14px; border-top: 1px dashed var(--rule); color: var(--muted); max-width: 70ch; }
.site-note b { color: var(--ink); font-weight: 600; }
.verify-line { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.fresh .ago { color: var(--muted); font-weight: 400; font-size: .92em; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }                                   /* keyboard users: first Tab shows it */
.chips .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* 1.10.0 - the "Update data" button (only present when site/serve.py offers it) */
.runbox { padding: 8px 8px 0; }
.runbtn { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.runbtn:hover:not(:disabled) { border-color: var(--accent, var(--ink)); }
.runbtn:disabled { cursor: progress; opacity: .8; }
.runbtn i { width: 16px; height: 16px; display: inline-flex; } .runbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.runbtn:disabled svg { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .runbtn:disabled svg { animation: none; } }
.runmsg { font-size: 12px; color: var(--muted); padding: 6px 2px 0; line-height: 1.35; }
[data-theme="fiesta"] .runbtn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); } [data-theme="fiesta"] .runmsg { color: #fff; }
