/* ---------- fonts (self-hosted: the security policy only allows files from this site) ---------- */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #faf7f1;
  --text: #121a2b;
  --muted: #5c6374;
  --border: #e7e1d5;
  --border-strong: #d6cdbb;

  --ink: #0d1830;          /* deep navy used for the brand panel and top bar */
  --ink-2: #172a4f;
  --on-ink: #f4efe4;
  --on-ink-muted: #b9c0d0;

  --primary: #13234a;
  --primary-strong: #0a1631;
  --on-primary: #ffffff;

  --gold: #d29a3c;
  --gold-strong: #b98128;
  --gold-soft: #f7ecd8;
  --gold-text: #87570f;

  --accent: var(--gold-text);
  --accent-soft: var(--gold-soft);

  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --focus: #2f5bd3;

  --shadow-sm: 0 1px 2px rgba(18, 26, 43, 0.06);
  --shadow: 0 1px 2px rgba(18, 26, 43, 0.05), 0 10px 30px -12px rgba(18, 26, 43, 0.14);
  --shadow-lg: 0 2px 4px rgba(18, 26, 43, 0.04), 0 30px 60px -20px rgba(13, 24, 48, 0.28);
  --radius: 16px;
  --radius-sm: 10px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235c6374' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1b;
    --surface: #111827;
    --surface-2: #161f31;
    --text: #ebeef5;
    --muted: #9ba5b9;
    --border: #232e45;
    --border-strong: #2f3b55;

    --ink: #070c18;
    --ink-2: #111d38;

    --primary: #e3b45c;
    --primary-strong: #efc678;
    --on-primary: #10172a;

    --gold: #e3b45c;
    --gold-strong: #efc678;
    --gold-soft: #2a2416;
    --gold-text: #ecc272;

    --danger: #f2877d;
    --danger-soft: #3a1c1a;
    --warn: #f1c26b;
    --warn-soft: #3a2e14;
    --focus: #8fb0ff;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px -12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239ba5b9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  letter-spacing: -0.02em;
}
h2 { font-size: 1.05rem; font-weight: 650; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--gold-strong); }

.muted { color: var(--muted); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

[hidden] { display: none !important; }

/* ---------- logo ---------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.logo:hover { color: inherit; }
.logo svg { flex: none; width: 34px; height: 34px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 6px 18px -8px rgba(13, 24, 48, 0.55);
}
.btn.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--on-primary); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b1408; }
.btn.gold:hover { background: var(--gold-strong); border-color: var(--gold-strong); color: #1b1408; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 0.82rem; }
.btn.block { width: 100%; min-height: 54px; font-size: 1rem; }
.btn.block .arrow { transition: transform 0.2s; }
.btn.block:hover .arrow { transform: translateX(3px); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* ---------- forms ---------- */

.field { margin-bottom: 18px; }
.field label, .label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: 0.9rem;
}
.hint { margin: -3px 0 7px; font-size: 0.84rem; color: var(--muted); }

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 15px center;
  cursor: pointer;
}
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent);
}
input[readonly] { background: var(--surface-2); color: var(--muted); cursor: default; box-shadow: none; }
[aria-invalid="true"] { border-color: var(--danger); }
[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent); border-color: var(--danger); }

.error { margin: 7px 0 0; color: var(--danger); font-size: 0.85rem; }
.error:empty { display: none; }
.form-error { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); margin: 0 0 20px; }

.subfield {
  margin: -4px 0 18px;
  padding: 16px 16px 2px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  background: var(--gold-soft);
  border-radius: var(--radius-sm);
}

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- public pages: split layout ---------- */

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 960px) {
  .shell { grid-template-columns: minmax(380px, 0.9fr) minmax(0, 1.1fr); }
}

.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 20px 28px;
  background:
    radial-gradient(120% 70% at 50% 115%, rgba(230, 160, 70, 0.55) 0%, rgba(230, 160, 70, 0.12) 45%, transparent 70%),
    radial-gradient(60% 40% at 85% 0%, rgba(80, 110, 190, 0.25), transparent 70%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  color: var(--on-ink);
}
/* Rising-sun rings */
.brand-panel::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -340px;
  width: 620px;
  height: 620px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1px solid rgba(242, 196, 120, 0.3);
  box-shadow:
    0 0 0 60px rgba(242, 196, 120, 0.025),
    0 0 0 61px rgba(242, 196, 120, 0.16),
    0 0 0 130px rgba(242, 196, 120, 0.015),
    0 0 0 131px rgba(242, 196, 120, 0.1);
  pointer-events: none;
}
.brand-panel > * { position: relative; z-index: 1; }
.brand-panel .logo { color: var(--on-ink); }

.brand-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.partner-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid rgba(242, 196, 120, 0.35);
  border-radius: 999px;
  color: var(--on-ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.partner-link svg { width: 15px; height: 15px; color: #f0c27a; }
.partner-link:hover { color: var(--on-ink); background: rgba(255, 255, 255, 0.08); border-color: rgba(242, 196, 120, 0.6); }

.brand-copy { max-width: 440px; }
.brand-copy .eyebrow { color: #f0c27a; }
.display {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.display em { font-style: italic; color: #f3c57c; font-weight: 400; }
.brand-lead { margin: 16px 0 0; color: var(--on-ink-muted); font-size: 1.02rem; max-width: 380px; }

.assurances {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.assurances li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: center;
  font-size: 0.95rem;
  color: var(--on-ink);
}
.assurances .ico {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f0c27a;
}
.assurances .ico svg { width: 17px; height: 17px; }
.assurances small { display: block; color: var(--on-ink-muted); font-size: 0.83rem; }

.brand-foot { margin: auto 0 0; font-size: 0.8rem; color: var(--on-ink-muted); letter-spacing: 0.02em; }

/* On phones the brand panel becomes a compact header. */
@media (max-width: 959px) {
  .brand-panel { padding: 20px 20px 34px; }
  .brand-panel::after { width: 420px; height: 420px; bottom: -300px; }
  .brand-panel .assurances, .brand-panel .brand-foot, .brand-lead { display: none; }
  .display { font-size: 1.85rem; }
}
@media (min-width: 960px) {
  .brand-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 40px 48px;
    justify-content: space-between;
  }
  .brand-copy { margin-top: auto; }
  .brand-foot { margin-top: 0; }
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 48px;
}
@media (min-width: 960px) {
  .stage { justify-content: center; padding: 56px 48px; }
}

.card {
  width: 100%;
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}
@media (max-width: 959px) {
  .shell .card { margin-top: -18px; position: relative; z-index: 2; }
}
@media (max-width: 480px) {
  .card { padding: 24px 18px; }
}

.form-head { margin-bottom: 26px; }
.form-head h1 { margin: 10px 0 8px; }
.form-head p { margin: 0; }

.form-section + .form-section {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.step {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-text);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.section-head h2 { font-size: 1rem; }
.section-head p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }

.form-actions { margin-top: 26px; }

.privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}
.privacy svg { flex: none; width: 14px; height: 14px; color: var(--gold-text); }

/* ---------- public pages: single centred card (login, thanks, not found) ---------- */

.solo {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 40px;
  background:
    radial-gradient(90% 55% at 50% -10%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 70%),
    var(--bg);
}
.solo-top {
  width: 100%;
  max-width: 460px;
  padding: 36px 0 26px;
  display: flex;
  justify-content: center;
}
.solo .card { max-width: 460px; }
.solo .logo { color: var(--text); }

.center { text-align: center; }
.center .eyebrow { justify-content: center; }
.center .eyebrow::before { display: none; }
.center h1 { margin: 10px 0 10px; }
.center p { margin: 0 0 12px; }

.tick {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 4px auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #f3c57c, var(--gold-strong));
  color: #1b1408;
  box-shadow: 0 0 0 10px var(--gold-soft), 0 14px 30px -10px rgba(185, 129, 40, 0.6);
  animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.tick svg { width: 32px; height: 32px; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tick { animation: none; } }

.footnote { margin-top: 20px; text-align: center; font-size: 0.8rem; color: var(--muted); }

/* ---------- dashboard ---------- */

.app { background: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 28px;
  background: linear-gradient(90deg, var(--ink), var(--ink-2));
  color: var(--on-ink);
  border-bottom: 1px solid rgba(242, 196, 120, 0.18);
}
.topbar .brand { display: flex; align-items: center; gap: 14px; }
.topbar .logo { color: var(--on-ink); font-size: 1.1rem; }
.topbar .logo svg { width: 30px; height: 30px; }
.topbar .divider { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.18); }
.topbar .brand strong { font-size: 0.9rem; font-weight: 550; color: var(--on-ink-muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-actions form { margin: 0; }
.topbar .btn.ghost { color: var(--on-ink); }
.topbar .btn.ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); color: var(--on-ink); }
.who { font-size: 0.84rem; color: var(--on-ink-muted); margin-right: 6px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 28px; }

[data-role="partner"] .admin-only, [data-role="admin"] .partner-only { display: none !important; }
@media (min-width: 901px) {
  [data-role="partner"] .filters { grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(150px, 1fr)) auto; }
}

.page-lead { margin: 6px 0 0; }

.link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
}
.link-box code {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
  font: 600 0.88rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--text);
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); margin-top: 8px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat .k { font-size: 0.78rem; color: var(--muted); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
.stat .v {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 520;
  line-height: 1.1;
  margin-top: 8px;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
}
.stat .s { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.stat.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 100% 120%, rgba(230, 160, 70, 0.55), transparent 60%),
    linear-gradient(160deg, var(--ink-2), var(--ink));
  border-color: transparent;
  color: var(--on-ink);
  box-shadow: var(--shadow);
}
.stat.hero .k { color: #f0c27a; }
.stat.hero .s { color: var(--on-ink-muted); }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 22px;
  margin-bottom: 22px;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.panel h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 560; letter-spacing: -0.01em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel > h2 { margin-bottom: 14px; }
.panel > .hint { margin: 0 0 12px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.count { font-family: var(--font-sans); font-weight: 500; color: var(--muted); font-size: 0.9rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table th:first-child { border-top-left-radius: 8px; }
.table th:last-child { border-top-right-radius: 8px; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background-color 0.12s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td, .table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr.active td { background: var(--gold-soft); }
.table .addr { min-width: 180px; max-width: 280px; white-space: pre-line; color: var(--muted); }
.table .nowrap { white-space: nowrap; }
.table .actions { white-space: nowrap; text-align: right; }
.table a { color: var(--text); text-decoration-color: var(--border-strong); }
.sub { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.empty { padding: 32px 10px; text-align: center; color: var(--muted); }

.code {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-text);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  font: 600 0.78rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.7rem;
  font-weight: 650;
  vertical-align: 1px;
}

.bars { list-style: none; margin: 0; padding: 0; }
.bars li { margin-bottom: 8px; }
.bars button {
  display: block;
  padding: 6px 8px;
  margin: 0 -8px;
  width: calc(100% + 16px);
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.bars button:hover, .bars button.active { background: var(--surface-2); }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; margin-bottom: 6px; }
.bar-label b { font-variant-numeric: tabular-nums; }
.bar-track { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.bar-fill { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--gold-strong), var(--gold)); border-radius: 4px; transition: width 0.5s ease; }

.filters {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
}
.filters input, .filters select { min-height: 42px; padding-top: 8px; padding-bottom: 8px; font-size: 0.9rem; box-shadow: none; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column: 1 / -1; } }
@media (max-width: 520px) { .filters { grid-template-columns: 1fr; } }

@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats .hero { grid-column: 1 / -1; }
  .stat { padding: 14px 16px; }
  .stat .v { font-size: 1.8rem; }
  .topbar { padding: 10px 16px; }
  .topbar .divider, .topbar .brand strong { display: none; }
  .wrap { padding: 16px; }
  .panel { padding: 16px; }
  .who { display: none; }
}

/* ---------- dialogs & toast ---------- */

dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  padding: 26px;
}
dialog::backdrop { background: rgba(8, 13, 26, 0.55); backdrop-filter: blur(3px); }
dialog h3 { margin-bottom: 8px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 560; }
dialog p { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  border: 1px solid rgba(242, 196, 120, 0.25);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}
