:root {
  --bg: #FBF7F1; --surface: #FFFFFF; --sunk: #F3EEE6;
  --ink: #18181B; --muted: #57534E; --faint: #6B6560;
  --line: #ECE5DA; --line-strong: #DCD3C6; --divider: #F1EBE2;
  --brand: #0F7A5C; --brand-ink: #FFFFFF; --brand-soft: #DDF3EA;
  --radius: 22px;
  color-scheme: light dark;

  /* Tones: soft background + readable ink (≥4.5:1 on its background). */
  --teal-bg: #CCFBF1;    --teal: #115E59;
  --violet-bg: #EDE9FE;  --violet: #5B21B6;
  --rose-bg: #FFE4E6;    --rose: #9F1239;
  --green-bg: #DCFCE7;   --green: #166534;
  --pink-bg: #FCE7F3;    --pink: #9D174D;
  --orange-bg: #FFEDD5;  --orange: #9A3412;
  --indigo-bg: #E0E7FF;  --indigo: #3730A3;
  --sky-bg: #E0F2FE;     --sky: #075985;
  --yellow-bg: #FEF9C3;  --yellow: #854D0E;
  --fuchsia-bg: #FAE8FF; --fuchsia: #86198F;
  --amber-bg: #FEF3C7;   --amber: #92400E;
  --red-bg: #FEE2E2;     --red: #991B1B;
  --deadline: #C2410C;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131210; --surface: #1C1B18; --sunk: #25231F;
    --ink: #F5F3EE; --muted: #BDB7AE; --faint: #A8A29A;
    --line: #2E2C27; --line-strong: #3D3A34; --divider: #282621;
    --brand: #34D399; --brand-ink: #062B1F; --brand-soft: #0E2F24;
    --teal-bg: #0F2F2C;    --teal: #5EEAD4;
    --violet-bg: #251B45;  --violet: #C4B5FD;
    --rose-bg: #3A1520;    --rose: #FDA4AF;
    --green-bg: #12301D;   --green: #86EFAC;
    --pink-bg: #3A1429;    --pink: #F9A8D4;
    --orange-bg: #3A1E0E;  --orange: #FDBA74;
    --indigo-bg: #1E1F4A;  --indigo: #A5B4FC;
    --sky-bg: #0E2A3D;     --sky: #7DD3FC;
    --yellow-bg: #332B0B;  --yellow: #FDE047;
    --fuchsia-bg: #36123D; --fuchsia: #F0ABFC;
    --amber-bg: #36260A;   --amber: #FCD34D;
    --red-bg: #3B1414;     --red: #FCA5A5;
    --deadline: #FB923C;
  }
}
.t-teal { --t-bg: var(--teal-bg); --t: var(--teal); }
.t-violet { --t-bg: var(--violet-bg); --t: var(--violet); }
.t-rose { --t-bg: var(--rose-bg); --t: var(--rose); }
.t-green { --t-bg: var(--green-bg); --t: var(--green); }
.t-pink { --t-bg: var(--pink-bg); --t: var(--pink); }
.t-orange { --t-bg: var(--orange-bg); --t: var(--orange); }
.t-indigo { --t-bg: var(--indigo-bg); --t: var(--indigo); }
.t-sky { --t-bg: var(--sky-bg); --t: var(--sky); }
.t-yellow { --t-bg: var(--yellow-bg); --t: var(--yellow); }
.t-fuchsia { --t-bg: var(--fuchsia-bg); --t: var(--fuchsia); }
.t-amber { --t-bg: var(--amber-bg); --t: var(--amber); }
.t-red { --t-bg: var(--red-bg); --t: var(--red); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
svg { flex: none; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Badges: the label system used everywhere */
.badge {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 9px 2px 7px;
  border-radius: 999px; background: var(--t-bg); color: var(--t);
  font-size: 12px; font-weight: 700; letter-spacing: .01em; line-height: 1.2; white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge.solid { background: var(--deadline); color: #FFFFFF; }
@media (prefers-color-scheme: dark) { .badge.solid { color: #1C0D03; } }
.badge.lg { min-height: 32px; padding: 4px 12px 4px 10px; font-size: 13px; }
.badge.lg svg { width: 15px; height: 15px; }

/* Shell */
.top, .foot { width: 100%; max-width: 1120px; margin: 0 auto; padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; min-height: 44px; font-size: 17px; }
.dots { display: inline-flex; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg); margin-left: -5px; }
.dots i:first-child { margin-left: 0; background: #F472B6; }
.dots i:nth-child(2) { background: #FBBF24; }
.dots i:nth-child(3) { background: #34D399; }
.top .flags { display: flex; gap: 6px; }
.foot { font-size: 13px; color: var(--faint); }
.foot a { color: var(--faint); }
main { flex: 1; width: 100%; margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 24px; position: relative; z-index: 1; }
.narrow { max-width: 720px; }
.medium { max-width: 780px; }

h1 { margin: 0; font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; font-size: clamp(32px, 5vw, 46px); }
.lede { margin: 0; font-size: 18px; color: var(--muted); }
.sub { margin: 0; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.sub a { color: var(--ink); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Decorative blobs (home + results banner) */
.blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; }
.blobs i:nth-child(1) { width: 260px; height: 260px; background: #FBCFE8; top: -80px; right: 8%; }
.blobs i:nth-child(2) { width: 180px; height: 180px; background: #FDE68A; top: 120px; right: -60px; }
.blobs i:nth-child(3) { width: 220px; height: 220px; background: #A7F3D0; top: 260px; left: -90px; }
.blobs i:nth-child(4) { width: 120px; height: 120px; background: #C7D2FE; top: 40px; left: 12%; }
@media (prefers-color-scheme: dark) { .blobs i { opacity: .14; } }

.hero { padding-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-size: clamp(38px, 6.4vw, 60px); }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, #FDE68A 62%); padding: 0 4px; border-radius: 4px; }
@media (prefers-color-scheme: dark) { .hero h1 em { background: linear-gradient(transparent 62%, #6B4E0A 62%); } }

/* Controls */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 12px 40px -18px rgba(80, 60, 20, .25); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: var(--sunk); border-radius: 14px; padding: 4px; border: 0; margin: 0; min-width: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 11px; font-size: 15px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.14); }
.seg input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 0; }
.field select, .field input, .search input {
  min-height: 48px; border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 0 14px;
  font-size: 16px; font-weight: 400; color: var(--ink); background: var(--surface); width: 100%;
}
.field select:focus, .field input:focus, .search input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.hint { min-height: 24px; margin: -6px 0 0; }
.btn {
  min-height: 54px; border: 0; border-radius: 16px; background: var(--brand); color: var(--brand-ink);
  font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none; box-shadow: 0 8px 20px -10px var(--brand);
}
.btn:disabled { background: var(--sunk); color: var(--faint); cursor: not-allowed; box-shadow: none; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 1.5px solid var(--line-strong);
  border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer;
}
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--t); }
.pill.t-teal, .pill.t-violet, .pill.t-rose, .pill.t-green, .pill.t-pink, .pill.t-orange, .pill.t-indigo, .pill.t-sky, .pill.t-yellow, .pill.t-fuchsia { color: var(--t); border-color: var(--t-bg); background: var(--surface); }
.pill.t-teal svg, .pill.t-violet svg, .pill.t-pink svg, .pill.t-orange svg, .pill.t-green svg, .pill.t-indigo svg, .pill.t-sky svg, .pill.t-yellow svg, .pill.t-fuchsia svg { width: 16px; height: 16px; }
.pill[aria-pressed="true"], .pill[aria-current="page"] { background: var(--t, var(--ink)); color: var(--surface); border-color: var(--t, var(--ink)); }
.pill[aria-pressed="true"] .dot, .pill[aria-current="page"] .dot { background: var(--surface); }
.pill:disabled { opacity: .5; cursor: not-allowed; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); }

/* Results banner */
.banner { position: relative; overflow: hidden; border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(120deg, #FCE7F3 0%, #FEF3C7 45%, #DCFCE7 100%); }
@media (prefers-color-scheme: dark) { .banner { background: linear-gradient(120deg, #3A1429 0%, #36260A 50%, #12301D 100%); } }
.banner .sub { color: var(--ink); }

/* Search */
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 15px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 44px; }

/* List */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list > li { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.list > li[hidden], .list[hidden] { display: none; }
.list > li:has(details[open]) { border-color: var(--t); box-shadow: 0 10px 28px -16px var(--t); }
summary { list-style: none; cursor: pointer; min-height: 76px; padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-radius: 18px; }
summary::-webkit-details-marker { display: none; }
.tile { width: 46px; height: 46px; border-radius: 14px; background: var(--t-bg); color: var(--t); display: grid; place-items: center; flex: none; }
.tile svg { width: 22px; height: 22px; }
.what { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.value { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.amount { display: inline-block; padding: 6px 12px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; max-width: 230px; line-height: 1.3; }
.chev { color: var(--faint); transition: transform .2s ease; }
details[open] .chev { transform: rotate(180deg); }
.detail { padding: 0 18px 18px 78px; display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
@media (max-width: 560px) { .detail { padding-left: 18px; } }
.detail p { margin: 0; color: var(--muted); line-height: 1.6; }
.detail dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; line-height: 1.5; padding: 14px; border-radius: 14px; background: var(--sunk); }
.detail dt { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
.detail dd { margin: 0; font-weight: 500; }
.note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--t-bg); color: var(--t); font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.note svg { width: 16px; height: 16px; margin-top: 2px; }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.go a.pill { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.go small { font-size: 12px; color: var(--faint); }
.empty { padding: 48px 24px; border: 2px dashed var(--line-strong); border-radius: var(--radius); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--surface); }
.empty[hidden] { display: none; }
.fine { margin: 0; font-size: 13px; color: var(--faint); }

/* Index pages */
.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.links a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; font-weight: 600; }
.links .tile { width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: 13px; }
.links .count { margin-left: auto; }

@media (hover: hover) and (pointer: fine) {
  .list > li:hover { border-color: var(--t); transform: translateY(-2px); box-shadow: 0 12px 28px -18px var(--t); }
  .links a:hover { border-color: var(--brand); transform: translateY(-1px); }
  .pill:not(:disabled):not([aria-pressed="true"]):not([aria-current="page"]):hover { border-color: var(--t, var(--ink)); }
}
@media (prefers-reduced-motion: reduce) { .chev, .list > li { transition: none; } .list > li:hover { transform: none; } }
.badge[hidden] { display: none; }

/* privacy and other text pages */
.prose { padding-block: 40px 24px; }
.prose h2 { font-size: 1.05rem; margin: 28px 0 6px; }
.prose p { color: var(--muted, inherit); line-height: 1.6; margin: 0 0 10px; }
