/* Styles for the React pages: Builder cards (/builder/[n]) and /admin.
   Same tokens as the landing page (css/style.css), dark only. */
:root {
  --bg: #07090D; --bg-2: #0D1117; --panel: #11161D;
  --line: rgba(245,247,250,.08); --line-2: rgba(245,247,250,.14); --line-3: rgba(245,247,250,.26);
  --text: #F5F7FA; --muted: #8B949E; --dim: #5A636D;
  --accent: #0076C6; --accent-hover: #0A86DC; --accent-fg: #3FA2E8;
  --ok: #3FA2E8; --warn: #D6B56A; --err: #F07171;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; }
.mono { font-family: var(--mono); }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px; border-radius: 2px; border: 1px solid transparent; font: 600 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s; }
.btn--sm { height: 38px; padding: 0 14px; font-size: 12px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-3); }
.btn--ghost:hover { border-color: var(--text); }

/* ---------- Builder page ---------- */
.bpage { min-height: 100dvh; max-width: 560px; margin: 0 auto; padding: 40px 20px 64px; display: grid; align-content: center; gap: 28px; }
.bpage__brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.bpage__title { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.bpage__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.bpage__fine { margin: 0; font-size: 13px; color: var(--muted); }


/* ---------- Admin dashboard ---------- */
.ad { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100dvh; }
.dim { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* sidebar */
.ad-side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 24px; padding: 20px 14px; background: var(--bg-2); border-right: 1px solid var(--line); }
.ad-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; border-bottom: 1px solid var(--line); }
.ad-brand span { display: grid; line-height: 1.2; }
.ad-brand b { font-size: 14px; font-weight: 600; }
.ad-brand small { font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.ad-nav { display: grid; gap: 2px; }
.ad-nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 3px; font-size: 14px; color: var(--muted); text-decoration: none; transition: background-color .15s, color .15s; }
.ad-nav a:hover { color: var(--text); background: rgba(245,247,250,.04); }
.ad-nav a.is-on { color: var(--text); background: rgba(0,118,198,.14); }
.ad-nav a.is-on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 2px; background: var(--accent); }
.ad-nav a.is-on svg { color: var(--accent-fg); }
.ad-side__foot { margin-top: auto; display: grid; gap: 10px; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.ad-link { background: none; border: 0; padding: 0; color: var(--muted); font: 13px var(--sans); text-align: left; text-decoration: none; cursor: pointer; }
.ad-link:hover { color: var(--text); }

/* main */
.ad-main { min-width: 0; padding: 28px clamp(20px, 3vw, 40px) 72px; width: 100%; display: grid; gap: 20px; align-content: start; }
.ad-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.ad-top h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.025em; }
.ad-top p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.ad-top__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-banner { padding: 12px 16px; font-size: 14px; color: var(--warn); background: rgba(214,181,106,.07); border: 1px solid rgba(214,181,106,.3); border-radius: 3px; }
.ad-main code, .ad-gate code { font-family: var(--mono); font-size: 12.5px; color: var(--accent-fg); }

/* buttons */
.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 3px; border: 1px solid transparent; font: 600 13px var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.ad-btn:active { transform: translateY(1px); }
.ad-btn--primary { background: var(--accent); color: #fff; }
.ad-btn--primary:hover { background: var(--accent-hover); }
.ad-btn--ghost { background: transparent; color: var(--text); border-color: var(--line-3); }
.ad-btn--ghost:hover { border-color: var(--text); }
.ad-btn--danger { background: transparent; color: var(--err); border-color: rgba(240,113,113,.35); }
.ad-btn--danger:hover { background: rgba(240,113,113,.08); }
.ad-btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
.ad-btn--block { width: 100%; height: 44px; }

/* KPIs */
.ad-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ad-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ad-kpi { display: grid; gap: 8px; align-content: start; padding: 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; }
.ad-kpi__label { font: 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ad-kpi__value { font: 500 clamp(22px, 2.2vw, 28px)/1.1 var(--mono); letter-spacing: -.02em; }
.ad-kpi__sub { font-size: 12.5px; color: var(--muted); }
.ad-kpi__bar { display: block; height: 4px; background: rgba(245,247,250,.08); border-radius: 2px; overflow: hidden; }
.ad-kpi__bar i { display: block; height: 100%; background: var(--accent); min-width: 2px; }

/* cards */
.ad-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.ad-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: 18px; min-width: 0; }
.ad-card--flush { padding: 0; overflow: hidden; }
.ad-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ad-card--flush .ad-card__head { padding: 16px 18px 0; }
.ad-card__head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.ad-card__meta { font-size: 12.5px; color: var(--muted); }

/* chart */
.ad-bars svg { display: block; width: 100%; height: 180px; }
.ad-bars rect { fill: rgba(0,118,198,.55); }
.ad-bars rect.is-today { fill: var(--accent-fg); }
.ad-bars rect:hover { fill: var(--accent-fg); }
.ad-bars__axis { display: flex; justify-content: space-between; margin-top: 8px; font: 11px var(--mono); color: var(--dim); }

/* needs attention */
.ad-attn { list-style: none; margin: 0; padding: 0; display: grid; }
.ad-attn a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.ad-attn li:last-child a { border-bottom: 0; }
.ad-attn a:hover { color: var(--text); }
.ad-attn b { font: 500 16px var(--mono); color: var(--text); }
.ad-attn b.is-warn { color: var(--warn); }

/* tables */
.ad-scroll { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ad-card--flush .ad-card__head + .ad-table, .ad-card--flush .ad-card__head + .ad-empty { margin-top: 0; }
.ad-table th { position: sticky; top: 0; text-align: left; font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ad-table tbody tr:last-child td { border-bottom: 0; }
.ad-table tbody tr:hover td { background: rgba(245,247,250,.025); }
.ad-table .r { text-align: right; }
.ad-table .mono { font-family: var(--mono); font-size: 12.5px; }
.ad-table .ad-pill { margin-left: 8px; }
.ad-table td:first-child .ad-pill, .ad-table td > .ad-pill:only-child { margin-left: 0; }

.ad-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font: 500 11px var(--sans); white-space: nowrap; border: 1px solid; }
.ad-pill--success { color: #7CC7F2; background: rgba(0,118,198,.14); border-color: rgba(0,118,198,.35); }
.ad-pill--accent { color: var(--accent-fg); background: rgba(0,118,198,.1); border-color: rgba(0,118,198,.28); }
.ad-pill--pending { color: var(--warn); background: rgba(214,181,106,.08); border-color: rgba(214,181,106,.3); }
.ad-pill--failed { color: var(--err); background: rgba(240,113,113,.08); border-color: rgba(240,113,113,.3); }
.ad-pill--neutral { color: var(--muted); background: rgba(245,247,250,.04); border-color: var(--line-2); }

/* toolbar, search, pager */
.ad-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ad-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.ad-seg a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 3px; font-size: 13px; color: var(--muted); text-decoration: none; }
.ad-seg a span { font: 11px var(--mono); color: var(--dim); }
.ad-seg a.is-on { color: var(--text); background: var(--panel); box-shadow: 0 0 0 1px var(--line-2); }
.ad-seg a.is-on span { color: var(--accent-fg); }
.ad-search input { width: min(320px, 70vw); }
.ad-filter { padding: 10px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.ad-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ad-pager div { display: flex; align-items: center; gap: 12px; }

/* forms */
.ad-form { display: grid; gap: 14px; }
.ad-form--row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ad-form label { display: grid; gap: 6px; min-width: 140px; }
.ad-form label.grow { flex: 1 1 260px; }
.ad-form label > span { font-size: 12px; font-weight: 500; color: var(--muted); }
.ad-main input, .ad-main select, .ad-main textarea, .ad-gate input {
  width: 100%; height: 40px; padding: 0 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-3); border-radius: 3px; font: 14px var(--sans); transition: border-color .15s, box-shadow .15s;
}
.ad-main textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.ad-main input::placeholder, .ad-main textarea::placeholder, .ad-gate input::placeholder { color: var(--dim); }
.ad-main input:focus, .ad-main select:focus, .ad-main textarea:focus, .ad-gate input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,118,198,.22); }
.ad-main input[type=date] { color-scheme: dark; }
.ad-error { margin: 0; font-size: 13px; color: var(--err); }

/* editable rows (budget, index) */
.ad-rows { display: grid; }
.ad-rows__row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.ad-rows__row:first-child { padding-top: 0; }
.ad-rows__row:last-child { border-bottom: 0; padding-bottom: 0; }
.ad-rows__pct { min-width: 56px; height: 40px; display: inline-flex; align-items: center; font-size: 13px; color: var(--muted); }
.ad-meter { flex: 0 0 140px; height: 6px; margin-bottom: 17px; background: rgba(245,247,250,.08); border-radius: 3px; overflow: hidden; }
.ad-meter i { display: block; height: 100%; background: var(--accent); }

/* milestones stepper */
.ad-steps { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; display: grid; }
.ad-steps::before { content: ''; position: absolute; left: 5px; top: 30px; bottom: 30px; width: 1px; background: var(--line-2); }
.ad-step { position: relative; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ad-step:first-child { padding-top: 0; } .ad-step:last-child { border-bottom: 0; padding-bottom: 0; }
.ad-step__dot { position: absolute; left: -22px; bottom: 28px; width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--line-3); background: var(--bg-2); }
.ad-step--in-progress .ad-step__dot { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, var(--bg-2) 50%); }
.ad-step--complete .ad-step__dot { border-color: var(--accent); background: var(--accent); }
.ad-step .ad-pill { height: 40px; border-radius: 3px; padding: 0 12px; }

/* updates timeline */
.ad-timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.ad-timeline li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ad-timeline li:first-child { padding-top: 0; } .ad-timeline li:last-child { border-bottom: 0; padding-bottom: 0; }
.ad-timeline__date { font-size: 12px; color: var(--muted); padding-top: 2px; }
.ad-timeline b { font-weight: 600; }
.ad-timeline p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* empty states */
.ad-empty { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 48px 20px; }
.ad-empty b { font-weight: 600; }
.ad-empty p { margin: 0; max-width: 42ch; font-size: 14px; color: var(--muted); }

/* toast */
.ad-toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; padding: 12px 16px; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 3px; box-shadow: 0 12px 40px rgba(0,0,0,.45); animation: ad-toast 4.5s ease forwards; }
@keyframes ad-toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; visibility: hidden; } }

/* sign-in */
.ad-gate { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 20px; padding: 24px; }
.ad-gate__card { width: min(400px, 100%); display: grid; gap: 14px; padding: 32px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 4px; }
.ad-gate__card h1 { margin: 8px 0 0; font-size: 22px; letter-spacing: -.02em; }
.ad-gate__card p { margin: 0; font-size: 14px; color: var(--muted); }
.ad-gate__card .ad-form { margin-top: 8px; }
.ad-gate__foot { margin: 0; font: 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

/* responsive */
@media (max-width: 1100px) { .ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ad-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .ad { grid-template-columns: 1fr; }
  .ad-side { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .ad-brand { padding: 0 8px 0 0; border-bottom: 0; flex: none; }
  .ad-brand span { display: none; }
  .ad-nav { display: flex; gap: 2px; flex: none; }
  .ad-nav a { padding: 8px 10px; white-space: nowrap; font-size: 13px; }
  .ad-nav a.is-on::before { left: 10px; right: 10px; top: auto; bottom: -11px; width: auto; height: 2px; }
  .ad-side__foot { margin: 0; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--line); flex: none; display: flex; gap: 14px; white-space: nowrap; }
  .ad-kpis--3 { grid-template-columns: 1fr; }
  .ad-timeline li { grid-template-columns: 1fr auto; }
  .ad-timeline__date { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .ad-kpis { grid-template-columns: 1fr; } .ad-form label { min-width: 100%; } .ad-meter { flex-basis: 100%; margin-bottom: 0; } }

/* ---------- custom select ---------- */
.ad-select { position: relative; min-width: 180px; }
.ad-select__btn {
  width: 100%; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 10px 0 12px; background: var(--bg); color: var(--text); text-align: left;
  border: 1px solid var(--line-3); border-radius: 3px; font: 14px var(--sans); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.ad-select__btn:hover { border-color: rgba(245,247,250,.4); }
.ad-select__btn:focus-visible, .ad-select[data-open] .ad-select__btn { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,118,198,.22); }
.ad-select__btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-select__btn svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease, stroke .15s; }
.ad-select[data-open] .ad-select__btn svg { transform: rotate(180deg); stroke: var(--accent-fg); }
.ad-select__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); min-width: max-content;
  max-height: 264px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
  animation: ad-pop .14s ease-out;
}
.ad-select__list li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 10px; border-radius: 3px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none;
}
.ad-select__list li.is-active { background: rgba(245,247,250,.06); color: var(--text); }
.ad-select__list li[aria-selected="true"] { color: var(--text); }
.ad-select__list li svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--accent-fg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes ad-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- number stepper ---------- */
.ad-num {
  display: flex; align-items: stretch; height: 40px; min-width: 140px;
  background: var(--bg); border: 1px solid var(--line-3); border-radius: 3px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.ad-num:hover { border-color: rgba(245,247,250,.4); }
.ad-num:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,118,198,.22); }
.ad-num > button:first-of-type { order: -1; border-right: 1px solid var(--line-2); }
.ad-num > button:last-of-type { border-left: 1px solid var(--line-2); }
.ad-num > button {
  flex: none; width: 38px; display: grid; place-items: center; padding: 0; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; touch-action: manipulation;
  transition: background-color .12s, color .12s;
}
.ad-num > button:hover:not(:disabled) { background: rgba(245,247,250,.05); color: var(--text); }
.ad-num > button:active:not(:disabled) { background: rgba(0,118,198,.18); color: var(--accent-fg); }
.ad-num > button:disabled { opacity: .35; cursor: not-allowed; }
.ad-num > button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ad-num__field { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; cursor: text; }
.ad-main .ad-num__field input {
  height: 100%; min-width: 1ch; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font: 500 14px var(--mono); text-align: center;
}
.ad-main .ad-num__field input:focus { box-shadow: none; }
.ad-main .ad-num__field input::placeholder { font-family: var(--sans); font-weight: 400; }
.ad-num__field span { font: 500 14px var(--mono); color: var(--muted); }

/* ---------- date inputs ---------- */
.ad-main input[type=date] { font-family: var(--mono); font-size: 13px; }
.ad-main input[type=date]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .55; padding: 4px; margin-right: -4px; border-radius: 3px;
  filter: invert(1); transition: opacity .15s, background-color .15s;
}
.ad-main input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; background-color: rgba(0,0,0,.08); }
.ad-main input[type=date]::-webkit-datetime-edit-fields-wrapper { padding: 0; }

/* ---------- Builder card ----------
   One design, used on the success screen (index.html) and the Builder page (/builder/[n]).
   Always dark, like a physical card. Every size is in cqi, so it scales as one object. */
.bc {
  container-type: inline-size;
  position: relative; width: 100%; aspect-ratio: 3 / 2;
  color: #F5F7FA; background-color: #0A0D12;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px);
  border: 1px solid rgba(245,247,250,.13); border-radius: 4.2% / 6.3%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 32px 64px -24px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.3);
  overflow: hidden; text-align: left;
}
.bc__in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 6.2cqi 6.8cqi 5.6cqi; }
.bc__top { display: flex; justify-content: space-between; align-items: center; }
.bc__brand { font: 500 max(1.9cqi, 10px) var(--mono); letter-spacing: .28em; color: rgba(245,247,250,.62); }
.bc__logo { width: 6.2cqi; height: auto; display: block; }

.bc__mid { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 4cqi; }
.bc__im { margin: 0; font: 600 8.6cqi/.94 var(--sans); letter-spacing: -.045em; }
.bc__name { margin: 2.4cqi 0 0; font: 400 2.9cqi var(--sans); color: rgba(245,247,250,.7); }
.bc__name:empty { display: none; }
.bc__wall { flex: none; width: 34cqi; height: auto; overflow: hidden; }
.bc__wall rect { fill: rgba(245,247,250,.035); stroke: rgba(245,247,250,.14); stroke-width: .5; }
.bc__wall rect.is-laid { fill: #0076C6; stroke: #0A86DC; }
.bc__wall rect.is-last { fill: #3FA2E8; stroke: #7CC4F4; }

.bc__rule { height: max(1px, .25cqi); margin: 0 0 3.2cqi; background: #0076C6; }
.bc__stats { display: flex; gap: 7cqi; margin: 0; }
.bc__stats div { display: grid; gap: 1cqi; }
.bc__stats dt { font: 500 max(1.55cqi, 10px) var(--mono); letter-spacing: .22em; color: rgba(245,247,250,.5); }
.bc__stats dd { margin: 0; font: 500 3.3cqi var(--mono); letter-spacing: -.01em; }
.bc__stats dd.is-accent { color: #3FA2E8; }
.bc__foot { display: flex; justify-content: space-between; gap: 2cqi; margin-top: 3.4cqi; font: 500 max(1.55cqi, 10px) var(--mono); letter-spacing: .22em; color: rgba(245,247,250,.5); }
.bc__foot span:last-child { color: rgba(245,247,250,.85); letter-spacing: .12em; }

/* the Builder's bricks are laid one by one when the card appears */
.bc__wall rect.is-laid { transform-box: fill-box; transform-origin: center; animation: bc-lay .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(350ms + var(--i, 0) * 45ms); }
@keyframes bc-lay { from { opacity: 0; transform: translateY(-140%); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bc__wall rect.is-laid { animation: none; } }

/* ---------- Legal pages (/terms, /privacy) ---------- */
.legal { max-width: 1080px; margin: 0 auto; padding: 28px 24px 80px; }
.legal a { color: var(--accent-fg); text-underline-offset: 3px; }
.legal__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.legal__top .bpage__brand { color: var(--muted); }
.legal__back { font-size: 13px; color: var(--muted) !important; text-decoration: none; }
.legal__back:hover { color: var(--text) !important; }
.legal__head { padding: clamp(40px, 7vw, 80px) 0 clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.legal__kicker { margin: 0; font: 500 11px var(--mono); letter-spacing: .2em; color: var(--muted); }
.legal__head h1 { margin: 14px 0 0; font-size: clamp(36px, 6vw, 60px); font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.legal__meta { margin: 16px 0 0; font: 12px var(--mono); letter-spacing: .08em; color: var(--dim); }
.legal__intro { max-width: 62ch; margin-top: 28px; padding-left: 16px; border-left: 2px solid var(--accent); }
.legal__intro p { margin: 0; font-size: 18px; line-height: 1.6; color: var(--text); }

.legal__layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); padding-top: 48px; }
.legal__toc { position: sticky; top: 24px; align-self: start; }
.legal__toc p { margin: 0 0 12px; font: 500 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.legal__toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.legal__toc li { counter-increment: toc; }
.legal__toc a { display: flex; gap: 10px; padding: 6px 0; font-size: 13.5px; color: var(--muted) !important; text-decoration: none; }
.legal__toc a::before { content: counter(toc, decimal-leading-zero); font: 11px/1.8 var(--mono); color: var(--dim); }
.legal__toc a:hover { color: var(--text) !important; }

.legal__body { max-width: 68ch; }
.legal__body section { padding-bottom: 40px; scroll-margin-top: 24px; }
.legal__body h2 { display: flex; align-items: baseline; gap: 14px; margin: 0 0 16px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.legal__body h2 span { font: 500 12px var(--mono); color: var(--accent-fg); }
.legal__body p, .legal__body li { font-size: 15.5px; line-height: 1.7; color: rgba(245,247,250,.82); }
.legal__body p { margin: 0 0 14px; }
.legal__body ul { margin: 0 0 14px; padding-left: 20px; }
.legal__body li { margin-bottom: 8px; }
.legal__body li::marker { color: var(--accent-fg); }
.legal__body strong { color: var(--text); font-weight: 600; }
.legal__callout { padding: 16px 18px; background: rgba(0,118,198,.08); border: 1px solid rgba(0,118,198,.3); border-radius: 3px; color: var(--text) !important; }
.legal__table { width: 100%; margin: 4px 0 18px; border-collapse: collapse; font-size: 14px; }
.legal__table th { text-align: left; padding: 10px 12px; font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); border-bottom: 1px solid var(--line-2); }
.legal__table td { padding: 12px; vertical-align: top; line-height: 1.55; color: rgba(245,247,250,.82); border-bottom: 1px solid var(--line); }
.legal__table td:first-child { color: var(--text); width: 45%; }
.legal__foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.legal__foot span:last-child { display: flex; gap: 20px; }

@media (max-width: 820px) {
  .legal__layout { grid-template-columns: 1fr; padding-top: 32px; }
  .legal__toc { position: static; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .legal__table td:first-child { width: auto; }
}
.bpage__fine a { color: var(--accent-fg); margin-left: 10px; text-underline-offset: 3px; }

/* Builder card on phones: a slightly taller card with larger type, so the
   small labels stay readable (at 3:2 they shrank to about 5px). */
@media (max-width: 600px) { .bc { aspect-ratio: 1 / .82; } }
@container (max-width: 460px) {
  .bc__in { padding: 7cqi 7cqi 6cqi; }
  .bc__brand { font-size: max(2.9cqi, 9px); letter-spacing: .2em; }
  .bc__logo { width: 9cqi; }
  .bc__im { font-size: 11cqi; }
  .bc__name { font-size: max(4.2cqi, 12px); margin-top: 3cqi; }
  .bc__wall { width: 30cqi; }
  .bc__rule { margin-bottom: 4cqi; }
  .bc__stats { gap: 5cqi; }
  .bc__stats div { gap: 1.4cqi; }
  .bc__stats dt { font-size: max(2.8cqi, 9px); letter-spacing: .16em; }
  .bc__stats dd { font-size: 5cqi; }
  .bc__foot { margin-top: 4cqi; font-size: max(2.8cqi, 9px); letter-spacing: .12em; }
  .bc__foot span:last-child { letter-spacing: .06em; }
}

/* ---------- mobile polish: Builder page, legal pages, admin ---------- */
html { -webkit-tap-highlight-color: transparent; }
@media (max-width: 640px) {
  .bpage { padding: calc(20px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); align-content: start; gap: 24px; }
  .bpage__brand { min-height: 44px; }
  .bpage__cta { display: grid; grid-template-columns: 1fr; }
  .bpage__cta .btn { width: 100%; min-height: 50px; }
  .bpage__fine a { display: inline-flex; align-items: center; min-height: 44px; }

  .legal { padding: 12px 16px calc(56px + env(safe-area-inset-bottom)); }
  .legal__top { padding-bottom: 12px; }
  .legal__top .bpage__brand span { display: none; }
  .legal__back { display: inline-flex; align-items: center; min-height: 44px; }
  .legal__head h1 { font-size: 38px; }
  .legal__intro p { font-size: 16.5px; }
  .legal__toc a { min-height: 44px; align-items: center; padding: 0; font-size: 15px; }
  .legal__toc a::before { line-height: 1; }
  .legal__toc p, .legal__table th { font-size: 11px; }
  .legal__body h2 { font-size: 20px; }
  .legal__body p, .legal__body li { font-size: 16px; }
  .legal__table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .legal__foot { flex-direction: column; }
  .legal__foot span:last-child { flex-direction: column; gap: 0; }
  .legal__foot a { display: inline-flex; align-items: center; min-height: 44px; }

  /* admin: 16px inputs (no iOS zoom), 44px controls */
  .ad-main input, .ad-main select, .ad-main textarea, .ad-gate input, .ad-select__btn { font-size: 16px; min-height: 44px; }
  .ad-num { height: 44px; }
  .ad-num > button { width: 44px; }
  .ad-btn { min-height: 44px; }
  .ad-search input { width: 100%; }
  .ad-gate__foot { font-size: 11px; }
  .ad-nav a, .ad-seg a, .ad-link { min-height: 44px; }
  .ad-seg a { display: inline-flex; align-items: center; }
}

/* ---------- admin: settings view ---------- */
.ad-help { margin: 0 0 16px; max-width: 70ch; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.ad-kpis--inline { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.ad-kpis--inline .ad-kpi { background: var(--bg); }
.ad-danger { display: grid; gap: 4px; padding: 18px; border: 1px solid rgba(240,113,113,.35); border-radius: 3px; background: rgba(240,113,113,.05); }
.ad-danger b { display: block; margin-bottom: 6px; font-size: 15px; }
.ad-danger .ad-help { margin-bottom: 14px; }
.ad-danger .ad-error { margin: 12px 0 0; }
.legal__body .legal__sub { margin: 24px 0 10px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- admin: saving feedback ---------- */
.ad-ok { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid #3FB950; background: rgba(63,185,80,.08); border-radius: 3px; font-size: 13.5px; color: var(--text); }
.ad-error code, .ad-ok code { font: 12.5px var(--mono); }
.ad-btn[disabled] { opacity: .75; cursor: progress; }
.ad-spin { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ad-spin .7s linear infinite; }
@keyframes ad-spin { to { transform: rotate(360deg); } }

/* ---------- admin: system alerts ---------- */
.ad-alerts { list-style: none; margin: 0; padding: 0; }
.ad-alerts li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); }
.ad-alerts li:first-child { border-top: 0; }
.ad-alerts p { margin: 0; font-size: 14px; line-height: 1.5; }
.ad-alerts code { display: block; margin-top: 6px; font: 12px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.ad-alerts time { font-size: 12.5px; }
.ad-alerts .ad-pill { justify-self: start; }
@media (max-width: 640px) {
  .ad-alerts li { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- admin: confirmation window (replaces the browser's pop-up) ---------- */
.ad-modal { padding: 0; border: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); }
.ad-modal::backdrop { background: rgba(3, 4, 6, .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ad-modal[open] { animation: ad-modal-in .18s ease-out; }
.ad-modal__card { width: min(420px, calc(100vw - 32px)); padding: 24px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.ad-modal__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(240, 113, 113, .12); color: var(--err); }
.ad-modal__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ad-modal h2 { margin: 16px 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.ad-modal p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.ad-modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.ad-btn--danger-solid { background: #D84F4F; color: #FFFFFF; border-color: #D84F4F; }
.ad-btn--danger-solid:hover { background: #C43F3F; border-color: #C43F3F; }
@keyframes ad-modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .ad-modal__actions .ad-btn { flex: 1; } }

/* ---------- admin: emails and daily check ---------- */
.ad-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.ad-actions > .ad-form { flex: 0 0 auto; }
.ad-actions .ad-ok, .ad-actions .ad-error { flex-basis: 100%; }
#automation { scroll-margin-top: 24px; }
/* sign out link while it is working */
.ad-link .ad-spin { display: inline-block; margin-right: 6px; vertical-align: -2px; }
.ad-link[disabled] { opacity: .75; cursor: progress; }

/* ---------- admin: full-width tables, grouped cells, details panel ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ad-stack { display: grid; gap: 3px; min-width: 0; line-height: 1.35; }
.ad-stack b { font-weight: 600; }
.ad-stack--r { justify-items: end; }
.ad-break { overflow-wrap: anywhere; }
.ad-ref { display: inline-flex; align-items: center; gap: 6px; }
.ad-ref code { font: 12px var(--mono); color: var(--muted); }

/* clickable rows open the details panel */
.ad-table--rows tbody tr { cursor: pointer; }
.ad-table--rows tbody tr:hover td { background: rgba(0, 118, 198, .06); }
.ad-table--rows tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.ad-copy { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line-2); border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, background-color .15s; }
.ad-copy:hover { color: var(--text); border-color: var(--line-3); }
.ad-copy.is-done { color: #3FB950; border-color: rgba(63, 185, 80, .5); }
.ad-copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* details panel, sliding in from the right */
.ad-drawer { position: fixed; inset: 0 0 0 auto; width: min(460px, 100vw); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); }
.ad-drawer::backdrop { background: rgba(3, 4, 6, .55); }
.ad-drawer[open] { animation: ad-drawer-in .22s ease-out; }
.ad-drawer__panel { height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0, 0, 0, .45); }
.ad-drawer__head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ad-drawer__head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.ad-drawer__head p { margin: 4px 0 0; font: 13px var(--mono); color: var(--muted); }
.ad-drawer__close { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 3px; background: transparent; color: var(--text); cursor: pointer; }
.ad-drawer__close:hover { border-color: var(--line-3); }
.ad-drawer__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ad-drawer__list { margin: 0; padding: 8px 22px 28px; }
.ad-drawer__list > div { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ad-drawer__list dt { font: 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ad-drawer__list dd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
@keyframes ad-drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* phones and narrow screens: each row becomes a card, no sideways scrolling */
@media (max-width: 860px) {
  .ad-table--cards thead { display: none; }
  .ad-table--cards, .ad-table--cards tbody { display: block; }
  .ad-table--cards tr { display: grid; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .ad-table--cards td { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; padding: 0; border: 0; text-align: left; }
  .ad-table--cards td::before { content: attr(data-label); font: 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
  .ad-table--cards td[data-label=""]::before { content: none; }
  .ad-table--cards td[data-label=""] { grid-template-columns: 1fr; justify-items: start; }
  .ad-table--cards td.r { text-align: left; }
  .ad-table--cards .ad-stack--r { justify-items: start; }
  .ad-table--cards tbody tr:hover td { background: transparent; }
  .ad-drawer { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) { .ad-drawer[open] { animation: none; } }

/* ======================================================================
   ADMIN ON PHONES: top bar + bottom tab bar, thumb-sized controls
   ====================================================================== */
.ad-mtop, .ad-tabs { display: none; }
.ad-sheet { padding: 0; border: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }

@media (max-width: 860px) {
  .ad { align-content: start; }   /* rows hug their content; short pages no longer stretch the top bar */
  .ad-side { display: none; }   /* replaced by the top bar and bottom tabs (mobile-nav.tsx) */

  /* top bar */
  .ad-mtop {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    background: rgba(13, 17, 23, .88); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
  }
  .ad-mtop__brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; }
  .ad-mtop__brand span { display: grid; line-height: 1.2; }
  .ad-mtop__brand b { font-size: 14.5px; font-weight: 600; }
  .ad-mtop__brand small { font-size: 12px; color: var(--muted); }
  .ad-mtop__site { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; color: var(--text); }
  .ad-mtop__site:active { background: rgba(245, 247, 250, .06); }

  /* bottom tab bar */
  .ad-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: rgba(13, 17, 23, .92); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid var(--line-2);
  }
  .ad-tabs a, .ad-tabs button {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 54px; padding: 4px 2px;
    border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 500 11.5px var(--sans); text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: color .15s, background-color .15s;
  }
  .ad-tabs span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ad-tabs a:active, .ad-tabs button:active { background: rgba(245, 247, 250, .06); }
  .ad-tabs .is-on { color: var(--accent-fg); }
  .ad-tabs .is-on::before { content: ''; position: absolute; top: -7px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--accent); }

  /* "More" bottom sheet */
  .ad-sheet[open] { position: fixed; inset: auto 0 0 0; width: 100%; margin: 0; animation: ad-sheet-in .24s cubic-bezier(.2, .8, .2, 1); }
  .ad-sheet::backdrop { background: rgba(3, 4, 6, .6); }
  .ad-sheet__panel { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); }
  .ad-sheet__grip { display: block; width: 40px; height: 4px; margin: 4px auto 12px; border-radius: 2px; background: var(--line-3); }
  .ad-sheet__list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ad-sheet__list a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 15px; }
  .ad-sheet__list a:active { background: rgba(245, 247, 250, .05); }
  .ad-sheet__list a.is-on { border-color: rgba(0, 118, 198, .6); background: rgba(0, 118, 198, .1); color: var(--accent-fg); }
  .ad-sheet__foot { display: grid; gap: 8px; }
  .ad-sheet__foot form { margin: 0; }
  .ad-sheet__foot .ad-btn { min-height: 48px; }

  /* page body: room for the tab bar, comfortable spacing */
  .ad-main { padding: 16px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); gap: 16px; }
  .ad-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .ad-top h1 { font-size: 24px; }
  .ad-top p { font-size: 14px; }
  .ad-top__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ad-top__actions .ad-btn:only-child { grid-column: 1 / -1; }
  .ad-toast { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); text-align: center; }
  .ad-banner { font-size: 14px; }

  /* cards and headings */
  .ad-card { padding: 16px; }
  .ad-card--flush { padding: 0; }
  .ad-card__head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .ad-card__meta { font-size: 13px; }

  /* figures: two across, readable */
  .ad-kpis, .ad-kpis--3, .ad-kpis--inline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ad-kpis--3 > .ad-kpi:first-child { grid-column: 1 / -1; }
  .ad-kpi { padding: 14px; }
  .ad-kpi__label { font-size: 11.5px; }
  .ad-kpi__value { font-size: 22px; overflow-wrap: anywhere; }
  .ad-kpi__sub { font-size: 12.5px; }

  /* forms: one field per row, full-width buttons */
  .ad-form--row { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .ad-form label { min-width: 0; width: 100%; }
  .ad-form .ad-btn, .ad-actions .ad-btn, .ad-actions > .ad-form { width: 100%; }
  .ad-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .ad-btn { min-height: 48px; font-size: 14.5px; }
  .ad-btn--sm { min-height: 40px; }
  .ad-select { min-width: 0; width: 100%; }
  .ad-select__btn, .ad-num { height: 48px; }

  /* contributions toolbar: full-width tabs, then search */
  .ad-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .ad-seg { display: grid; grid-template-columns: repeat(3, 1fr); }
  .ad-seg a { justify-content: center; min-height: 44px; }
  .ad-seg a span { font-size: 12px; }
  .ad-search, .ad-search input { width: 100%; }
  .ad-pager { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
  .ad-pager > div { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }

  /* lists */
  .ad-attn li a { min-height: 48px; }
  .ad-link { display: inline-flex; align-items: center; min-height: 44px; }
  .ad-table--cards tr { padding: 14px 16px; }
  .ad-table--cards td { grid-template-columns: 104px minmax(0, 1fr); }
  .ad-table--cards td::before { font-size: 11.5px; }
  .ad-pill { font-size: 12px; }
  .ad-danger { padding: 14px; }
}
@media (max-width: 380px) {
  .ad-kpis, .ad-kpis--3, .ad-kpis--inline { grid-template-columns: 1fr; }
  .ad-top__actions { grid-template-columns: 1fr; }
  .ad-sheet__list { grid-template-columns: 1fr; }
  .ad-tabs a, .ad-tabs button { font-size: 11px; }
}
@keyframes ad-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .ad-sheet[open] { animation: none; } }

/* ---------- admin: automatic-check warning ---------- */
.ad-banner--warn { display: block; line-height: 1.6; color: var(--text); border-color: rgba(214, 181, 106, .55); border-left: 3px solid #D6B56A; }
.ad-banner--warn b { color: #D6B56A; }
.ad-banner--warn code { font: 12.5px var(--mono); }
.ad-card .ad-banner--warn { margin-bottom: 14px; }
#automation .ad-kpis--inline { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
