/* One stylesheet, hand-written. The Streamlit interface this replaces styled
   itself by reaching into private data-testid attributes; three separate bugs
   came from that, one of which silently hid every form in the application. */
:root {
  --ground:#F4F7F8; --surface:#FFFFFF; --line:#D6E1E7; --text:#0B2130;
  --muted:#5B7887; --accent:#B86A21; --ink:#071A24; --amber:#F2A65A;
  /* Semantic state colours, deliberately NOT the amber accent: amber says
     "look here", these say "this is how it IS" — a different axis, and
     conflating them makes every status compete with every call to action. */
  --good:#136B4E; --good-wash:rgba(19,107,78,.09); --good-line:rgba(19,107,78,.32);
  --risk:#A6402F; --risk-wash:rgba(166,64,47,.08); --risk-line:rgba(166,64,47,.34);
  --pending:#4F6B7A; --pending-wash:rgba(79,107,122,.07); --pending-line:rgba(79,107,122,.36);
  --surface-2:#F8FBFC;   /* row hover and header band, a shade off --surface */
  --line-soft:#E6EDF0;   /* separates rows; --line frames panels */
  --focus-ring:rgba(184,106,33,.18);
  /* No webfont is loaded and none may be (no CDN, no vendored binaries), so
     these name only families that are actually present. Naming IBM Plex here
     meant two people at the same demo saw different typography. */
  --sans:ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;
}
*{box-sizing:border-box}
body{margin:0;background:var(--ground);color:var(--text);font-family:var(--sans);font-size:15px;line-height:1.55}

.layout{display:grid;grid-template-columns:232px 1fr;min-height:100vh}
.sidebar{background:var(--ink);color:#E8F1F2;display:flex;flex-direction:column;gap:22px;padding:20px 16px}
.brand{display:flex;align-items:center;gap:9px;font-weight:700;letter-spacing:.22em;font-size:14px}
.brand-dot{width:9px;height:9px;border-radius:50%;background:var(--amber);box-shadow:0 0 14px 2px rgba(242,166,90,.5)}
.sidebar nav{display:flex;flex-direction:column;gap:2px}
.sidebar nav a{color:#A9C2CD;text-decoration:none;padding:8px 10px;border-radius:7px;font-size:14px}
.sidebar nav a:hover{background:rgba(255,255,255,.06);color:#E8F1F2}
/* Sections that are planned but not built. Shown so the shape of the finished
   tool is legible, dimmed and unclickable so nobody hunts for a dead link. */
.sidebar nav .soon{color:#4E6B79;padding:8px 10px;font-size:14px;cursor:default}
.sidebar nav a.active{background:rgba(242,166,90,.14);color:var(--amber);font-weight:600}
.sidebar-foot{margin-top:auto;display:flex;flex-direction:column;gap:9px;font-size:12.5px}
.sidebar-foot .who{display:flex;flex-direction:column;color:#A9C2CD}
.sidebar-foot .who em{font-style:normal;font-family:var(--mono);font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:#6E8B99}
.sidebar-foot button{background:transparent;border:1px solid #1C3E4E;color:#A9C2CD;border-radius:7px;padding:6px 10px;cursor:pointer;font:inherit;font-size:12.5px}
.sidebar-foot button:hover{border-color:var(--amber);color:var(--amber)}

/* min-width:0 is load-bearing, not tidying. A grid item's automatic minimum
   size is its content's, so this 1fr track refused to shrink below the widest
   thing in it and a wide table pushed the whole page — sidebar included —
   sideways, instead of scrolling inside its own .table-scroll panel. */
.content{padding:26px 30px 60px;min-width:0}
/* Title and the page's primary action on one line, the action pushed right;
   they stack again when there is no room for both. */
.page-head{display:flex;align-items:center;justify-content:space-between;
  gap:16px;flex-wrap:wrap;margin:0 0 18px}
.page-head h1{margin:0;font-size:23px;letter-spacing:-.01em}
.page-head .page-actions,.page-head p{margin:0}
.muted{color:var(--muted)}

/* A plain inline link with no more specific rule of its own — the
   "Configuration & competitors" crumb and the never-scanned notice's link
   on dashboard/city.html, both new prose this stage, and any future one
   like them. Every other link context in this file (nav, table cells,
   advisory list, pager, evidence chips…) sets its own colour via a more
   specific selector and outranks this one; without this rule a bare <a> in
   ordinary prose falls back to the browser's default blue, which reads as
   simply unstyled next to everything else on the page. */
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}

/* Login — the one dark surface, marking the threshold into the app. */
.login-page{display:grid;place-items:center;min-height:100vh;
  background:radial-gradient(900px 520px at 50% 10%,#10394A 0%,rgba(16,57,74,0) 62%),var(--ink)}
.login-card{width:min(400px,92vw);text-align:center;color:#E8F1F2}
.scope{position:relative;width:110px;height:110px;margin:0 auto 14px;display:grid;place-items:center}
.scope span{position:absolute;inset:0;border-radius:50%;border:1px solid var(--amber);opacity:0;
  animation:ping 4.2s cubic-bezier(.22,.61,.36,1) infinite}
.scope span:nth-child(2){animation-delay:1.4s}
.scope span:nth-child(3){animation-delay:2.8s}
.scope::after{content:"";width:9px;height:9px;border-radius:50%;background:var(--amber);
  box-shadow:0 0 20px 4px rgba(242,166,90,.45)}
@keyframes ping{0%{transform:scale(.28);opacity:0}12%{opacity:.85}100%{transform:scale(1);opacity:0}}
@media (prefers-reduced-motion:reduce){.scope span{animation:none;opacity:.28}}
.wordmark{font-size:2.3rem;font-weight:700;letter-spacing:.34em;text-indent:.34em;margin:0 0 6px}
.tagline{font-family:var(--mono);font-size:.68rem;letter-spacing:.13em;text-transform:uppercase;color:#7D99A6;margin:0 0 22px}
.login-card form{display:flex;flex-direction:column;gap:6px;text-align:left;background:#0E2733;
  border:1px solid #1C3E4E;border-radius:13px;padding:20px}
.login-card label{font-family:var(--mono);font-size:.66rem;letter-spacing:.13em;text-transform:uppercase;color:#7D99A6}
.login-card input{background:#071A24;border:1px solid #1C3E4E;border-radius:8px;color:#E8F1F2;
  padding:9px 11px;font:inherit;margin-bottom:8px}
.login-card input:focus{outline:none;border-color:var(--amber);box-shadow:0 0 0 3px rgba(242,166,90,.16)}
.login-card button{margin-top:6px;background:var(--amber);color:#0A1F2B;border:0;border-radius:8px;
  padding:10px;font:inherit;font-weight:600;cursor:pointer}
.login-card button:hover{filter:brightness(1.07)}
.error{background:rgba(214,92,76,.12);border:1px solid rgba(214,92,76,.4);color:#F6C9C0;
  border-radius:8px;padding:9px 12px;font-size:13.5px;margin:0 0 14px}

/* Prose is for reading, tables are for scanning — a paragraph running the full
   width of a 1440px demo screen is neither. */
.content p{max-width:78ch}

/* Section heading. Same uppercase mono micro-label as .tagline and the sidebar
   role, extended with a hairline so it divides as well as names. */
.section{display:flex;align-items:center;gap:12px;margin:32px 0 12px;
  font-family:var(--mono);font-size:11px;font-weight:600;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted)}
.section::after{content:"";flex:1;height:1px;background:var(--line)}

/* ---- data tables -------------------------------------------------------
   Most of this panel is one person scanning rows for the thing that needs
   attention, so the table is treated as the product: a panel on the ground,
   hairline row separation (no zebra — hover already tracks the eye), and
   figures aligned so a column of counts can be read as a shape. */
.table-scroll{overflow-x:auto;background:var(--surface);border:1px solid var(--line);
  border-radius:12px;box-shadow:0 1px 2px rgba(11,33,48,.05)}
table.data{border-collapse:collapse;width:100%;font-size:14px}
table.data th,table.data td{text-align:left;padding:12px 16px;vertical-align:middle;
  border-bottom:1px solid var(--line-soft)}
table.data thead th{background:var(--surface-2);border-bottom:1px solid var(--line);
  font-family:var(--mono);font-size:10.5px;font-weight:600;letter-spacing:.11em;
  text-transform:uppercase;color:var(--muted);white-space:nowrap}
table.data tbody tr:last-child td{border-bottom:0}
table.data tbody tr:hover{background:var(--surface-2)}
table.data th a{color:inherit;text-decoration:none}
table.data th a:hover{color:var(--accent)}
/* The drill-in link is the row's subject; it should look like the way in. */
table.data td a{color:var(--text);text-decoration:none;font-weight:600}
table.data td a:hover{color:var(--accent);text-decoration:underline}
table.data td.num,table.data th.num{text-align:right;
  font-variant-numeric:tabular-nums}   /* digits line up column-wise */

/* Which column is sorting, and which way, has to be answerable without
   reading: colour plus a rule on the live column, not the arrow alone. */
table.data thead th.sorted{color:var(--accent);background:rgba(184,106,33,.07);
  box-shadow:inset 0 2px 0 var(--accent)}
table.data thead th.sorted a{color:var(--accent)}
table.data thead th.sorted span{margin-left:6px;font-size:8px;vertical-align:2px}

table.data td.empty{text-align:center;color:var(--muted);padding:46px 16px}

/* Row controls sit right so they form their own column and never crowd the
   data; quiet until pointed at, because they are destructive. */
.actions,.row-actions{white-space:nowrap;text-align:right}
.actions{display:flex;gap:6px;justify-content:flex-end;align-items:center}
.actions form,.row-actions form{display:inline;margin:0}
.actions button,.actions .button{padding:5px 11px;font-size:13px}
.actions a,.row-actions a{display:inline-block;padding:5px 9px;border-radius:6px;
  font-size:13px;font-weight:500;color:var(--muted);text-decoration:none}
.actions a:hover,.row-actions a:hover{color:var(--risk);background:var(--risk-wash)}

.table-filter{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 0 14px}
.table-filter input[type="search"]{flex:0 1 300px;padding:8px 12px;font:inherit;
  font-size:14px;background:var(--surface);color:var(--text);
  border:1px solid var(--line);border-radius:8px}
.table-filter input[type="search"]::placeholder{color:var(--muted)}
.table-filter .clear{font-size:13px;color:var(--muted);text-decoration:none;
  border-bottom:1px solid transparent}
.table-filter .clear:hover{color:var(--accent);border-bottom-color:var(--accent)}

.pager{display:flex;gap:16px;align-items:center;margin-top:14px;font-size:13px;color:var(--muted)}
.pager a{color:var(--accent);text-decoration:none;font-weight:600}
.pager a:hover{text-decoration:underline}

/* ---- state, not emphasis -----------------------------------------------
   An unverified competitor or an uncovered brand has to be visible at a
   glance, so state is carried by shape as well as hue: a filled dot for
   settled, a hollow dot and a dashed ring for still-pending. That survives a
   colour-blind reader and a projector that eats saturation. */
.chips{list-style:none;display:flex;flex-wrap:wrap;gap:8px;padding:0;margin:0 0 12px}
.chip,.pill{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;
  padding:3px 11px;border-radius:999px;border:1px solid;line-height:1.55;
  font-size:11.5px;font-weight:600;letter-spacing:.02em}
.chip::before,.pill::before{content:"";flex:none;width:6px;height:6px;
  border-radius:50%;background:currentColor}
.chip.ok,.pill.ok{color:var(--good);background:var(--good-wash);border-color:var(--good-line)}
/* .chip.gap (a brand with zero competitors tracked) stays the softer wash —
   a coverage gap to fill in, not a failure. .pill.gap now also flags a
   FAILED scan (app/web/dashboard.py's _freshness) and a disabled account
   (users/list.html) — both "this is broken/off", not merely "attention" —
   so it gets solid fill rather than a wash: the strongest tone on the page,
   one notch past .pill.stale's amber "look at this soon". Splitting the
   selector (rather than just leaving .chip.gap along for the ride) keeps
   the brand-coverage chip at its original, calmer weight. */
.chip.gap{color:var(--risk);background:var(--risk-wash);border-color:var(--risk-line)}
.pill.gap{color:#fff;background:var(--risk);border-color:var(--risk);font-weight:700}
.pill.wait{color:var(--pending);background:var(--pending-wash);
  border-color:var(--pending-line);border-style:dashed}
.pill.wait::before{background:transparent;box-shadow:inset 0 0 0 1.5px currentColor}
/* A city overdue for a scan but not (yet) failing outright — the accent
   colour, because it means "look here", one notch under .pill.gap's "this
   broke" red. Also runs/list.html's "Interrupted" row (app/web/runs.py's
   _display_status): a `running` row whose process died without a trace is
   the same register — worth a look, but not the asserted failure .pill.gap
   would claim for a row that never got to report one. */
.pill.stale{color:var(--accent);background:rgba(184,106,33,.09);border-color:rgba(184,106,33,.32)}
/* Also runs/list.html's Status column for a run the DATA PROVIDER refused
   (ad_intel_agent/storage.py's is_run_refused) — SearchApi's 429 mid-run. Deliberately
   the SAME class as "Interrupted" above rather than a new colour: both are
   "look at this soon", neither is an asserted failure of our own code, and
   the row's status_label text ("Refused" vs "Interrupted") is what actually
   tells them apart, not the colour. */

/* Task 2's STATUS_RESTING (ad_intel_agent/pipeline.py) — a page deliberately
   skipped by the scan-economy feature because it has been empty long enough,
   still re-checked on schedule. Neutral on purpose: this is the feature
   working as designed, not a problem to flag, so it gets the calmest tone on
   the page rather than borrowing wait/stale/gap's "look at this" registers. */
.pill.resting{color:var(--muted);background:var(--surface-2);border-color:var(--line)}

/* runs/list.html's per-row failure reason (the 02:30 cron is the case that
   matters: a scan fails overnight, nobody is watching, and the next
   morning's history table is the only place left to ask why). This is the
   most valuable thing on the page when it exists, so it reads as a real
   callout once opened — not a muted "show more" toggle — matching the
   weight .advisory-caveats gives insufficient_evidence_notes, but in --risk
   rather than --pending since this IS a failure, not the model qualifying
   itself. Capped width + overflow-wrap so a raw exception string (long, and
   often one unbroken token — a stack frame path, a URL) wraps inside the
   panel instead of stretching the whole table; only ever rendered when a
   row actually has a message, so a run that didn't fail shows no widget at
   all (see runs.py's runs_rows: error_message is None for every other
   status). */
.run-error{margin-top:6px}
.run-error summary{cursor:pointer;display:inline-flex;align-items:center;gap:5px;
  font-family:var(--mono);font-size:11px;font-weight:600;letter-spacing:.08em;
  text-transform:uppercase;color:var(--risk)}
.run-error summary::marker{color:var(--risk)}
.run-error summary:hover{text-decoration:underline}
.run-error[open] summary{margin-bottom:8px}
.run-error p{margin:0;max-width:52ch;white-space:pre-wrap;overflow-wrap:anywhere;
  color:var(--text);font-size:13px;padding:10px 12px;border-radius:8px;
  background:var(--risk-wash);border:1px solid var(--risk-line);
  border-left:3px solid var(--risk)}

/* ---- run status ----------------------------------------------------------
   runs/_status.html's poll fragment (starting/running/complete/error,
   later joined by abandoned) and runs/list.html's Start-scan control —
   both left unstyled by earlier stages on purpose, since this is the task
   that was meant to design them.

   Five states, one component: colour is assigned by the SAME axis the rest
   of this file already uses (see the --good/--risk/--pending/--accent
   comment at the top), not a fifth invented palette —
     starting   → --accent  ("look here", the direct result of the click
                  someone just made, same family as .notice)
     running    → --pending ("this is how it is right now", an ongoing fact,
                  same family as .pill.wait and .advisory-caveats)
     complete   → --good
     error      → --risk, the strongest of the four, matching .pill.gap
     abandoned  → --accent again, but dashed and hollow-dotted like
                  .pill.wait's "still pending" mark rather than starting's
                  solid one — same "look here" family as starting (someone
                  should go check on this), but visibly not a fresh
                  in-progress state; it must not borrow --risk, which would
                  assert a definite failure this row was never able to
                  report (see runs.py's _lock_is_live docstring).
   A running scan is deliberately NOT animated: someone leaves this page
   open for the ten-plus minutes a real scan takes, and a spinner throbbing
   in the corner of a page they're trying to read is worse than a static
   label that just tells the truth ("Scanning Delhi — started 4 minutes
   ago."). If motion is ever added here, it must stay behind
   prefers-reduced-motion like every other animation in this file.

   Scoped to [data-state] specifically, not the bare .run-status class: the
   container div (runs/list.html's #run-status-active /
   #run-status-trigger-{id}) renders with no state before the poller's first
   response lands, and JS replaces its innerHTML with a NESTED .run-status
   element that carries data-state — the outer wrapper never gets it. Empty
   containers on first paint must show no box at all, so the boxed
   treatment below applies only once there is something to say. */
.run-status[data-state]{margin:10px 0 16px;padding:11px 16px 11px 34px;
  position:relative;border-radius:10px;border:1px solid var(--line);
  font-size:13.5px;max-width:60ch}
.run-status[data-state] p{margin:0;overflow-wrap:anywhere}
.run-status[data-state]::before{content:"";position:absolute;left:14px;top:16px;
  width:8px;height:8px;border-radius:50%}
.run-status[data-state="starting"]{border-color:rgba(184,106,33,.32);
  background:rgba(184,106,33,.07)}
.run-status[data-state="starting"]::before{background:var(--accent)}
.run-status[data-state="running"]{border-color:var(--pending-line);
  background:var(--pending-wash)}
.run-status[data-state="running"]::before{background:transparent;
  box-shadow:inset 0 0 0 1.5px var(--pending)}
.run-status[data-state="complete"]{border-color:var(--good-line);
  background:var(--good-wash)}
.run-status[data-state="complete"]::before{background:var(--good)}
.run-status[data-state="error"]{border-color:var(--risk-line);
  background:var(--risk-wash);border-left:3px solid var(--risk);
  padding-left:33px}
.run-status[data-state="error"]::before{background:var(--risk)}
.run-status[data-state="abandoned"]{border-color:rgba(184,106,33,.32);
  background:rgba(184,106,33,.07);border-style:dashed}
.run-status[data-state="abandoned"]::before{background:transparent;
  box-shadow:inset 0 0 0 1.5px var(--accent)}
/* p.error also matches the bare .error rule above (login page's dark-card
   error banner) — that rule's pale pink text and its own nested
   background/border/margin are tuned for the login page's dark surface,
   wrong on this light one and redundant with the box .run-status already
   draws. Reset every box property .error sets so this is plain text inside
   the ONE box, not a red banner nested inside a red banner. */
.run-status[data-state="error"] p.error{background:none;border:0;
  border-radius:0;padding:0;margin:0;color:var(--text)}
/* charts.js's setPollNote: "lost contact, retrying…" or the 20-minute
   give-up notice — a connectivity aside about the poll itself, not a new
   state, so it stays visually quieter than the box above rather than
   competing with it. */
.run-status-note{margin:5px 0 0 2px;font-size:12px;color:var(--muted)}

/* The Start-scan list (runs/list.html, admin-only): one row per configured
   city, each a trigger button and its own status slot. list-style:none
   because this is a set of controls, not prose to bullet. */
.run-triggers{list-style:none;margin:0 0 8px;padding:0;display:flex;
  flex-wrap:wrap;gap:8px}
/* A row that wraps, not a column: these are a handful of short, equal-weight
   buttons, and one per line read as a list of things to do rather than a set
   to pick from. Each item stacks its own status slot underneath its button,
   so a running scan reports under the city it belongs to instead of shoving
   the next button along. */
.run-triggers li{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.run-trigger{margin:0}
/* Plain, NOT button.primary: users/list.html's Edit/Reset password buttons
   set the precedent for a repeated per-row action — one button per city
   here, same as one per user row there — and .button.primary is reserved
   for the single, unrepeated "the one thing on this page" action (Add a
   city, Add a user). Four-plus solid amber blocks stacked in a column
   would spend that colour's "look here" meaning on every row at once and
   leave nothing for it to mean the one time it actually matters. */
/* initRunTriggers (charts.js) disables the button the moment a scan starts
   and deliberately never re-enables it — see that function's own comment —
   so "disabled" has to read as a settled, intentional state here, not a
   button that's merely waiting on something. This is also the only
   :disabled rule in the file; nothing else in the app currently disables a
   button via JS. */
button:disabled,.button:disabled{opacity:.55;cursor:not-allowed;filter:none}

/* ---- dashboard: headline figures and charts -----------------------------
   These are the first thing anyone sees on either dashboard page, so they
   have to read as FIGURES — one ledger of numbers a reader scans left to
   right — not as four separate cards that each happen to hold a number.
   One shared panel (the border/radius/shadow lives on .stat-grid itself)
   with a hairline between tiles does that; putting the same chrome on each
   .stat-card individually is exactly the "card with a number in it" look
   this is meant to avoid. */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:0;margin:0 0 8px;background:var(--surface);border:1px solid var(--line);
  border-radius:12px;box-shadow:0 1px 2px rgba(11,33,48,.05);overflow:hidden}
.stat-card{padding:18px 22px;display:flex;flex-direction:column;gap:3px}
.stat-card+.stat-card{border-left:1px solid var(--line-soft)}
/* Proportional figures, not tabular-nums: tabular-nums exists so a COLUMN of
   numbers aligns digit-for-digit (table cells, axis ticks — see table.data
   td.num above). A standalone headline figure has no neighbour to align
   with; forcing every digit to a fixed width just makes "1" sit as wide as
   "184" and reads loose at display size. */
.stat-value{font-size:34px;font-weight:700;letter-spacing:-.015em;color:var(--text)}
.stat-label{font-family:var(--mono);font-size:10.5px;font-weight:600;letter-spacing:.11em;
  text-transform:uppercase;color:var(--muted)}
.stat-sub{font-size:12px;color:var(--muted)}

/* A chart's own panel, matching .table-scroll's surface treatment so charts
   and tables read as the same family of "data panel" rather than two
   different visual languages on one page.

   A real height, not min-height: Chart.js is responsive by default, which
   means it resizes the canvas on every window/container resize — and
   without maintainAspectRatio:false (set in charts.js's drawFromData) it
   derives that height FROM THE CURRENT WIDTH, so a min-height would let the
   chart's own height drift on every resize instead of holding the frame
   this panel is meant to give it. flex-direction:column plus canvas's own
   flex:1 lets a .chart-note (see charts.js's partial-failure case) take a
   fixed sliver of the same box without the two fighting over height. */
.chart-panel{position:relative;background:var(--surface);border:1px solid var(--line);
  border-radius:12px;box-shadow:0 1px 2px rgba(11,33,48,.05);padding:18px;
  height:280px;display:flex;flex-direction:column;align-items:stretch;
  justify-content:center;gap:6px}
.chart-panel canvas{width:100%!important;flex:1 1 auto;min-height:0}
.chart-message{margin:auto;color:var(--muted);font-size:14px;text-align:center}
.chart-message-error{color:var(--risk)}
/* A chart that drew real data, but not from every city it asked — see
   renderNetworkActivity/renderNetworkOffers's `failed` handling. Sits below
   the canvas rather than replacing it: partial data is still worth showing,
   just not silently as if it were complete. */
.chart-note{flex:0 0 auto;margin:0;color:var(--muted);font-size:12px;text-align:center}

/* Two charts side by side on the city results page (dashboard/city.html) —
   share of voice next to theme pressure, offer landscape next to models
   pushed — matching the two-column layout the Streamlit per-city dashboard
   used. Collapses to one column below the point a chart-panel's fixed
   height would otherwise squeeze a narrow chart unreadably thin. */
.chart-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:820px){.chart-grid{grid-template-columns:1fr}}

/* Every piece of advisory text below — executive_summary, each dealer_tips
   entry, also_worth_watching, insufficient_evidence_notes, and the evidence
   chips further down — is free text an LLM wrote, not admin-typed copy, and
   ANY of it can contain a single token too long to break at a word boundary
   (a run-on compound, a stray ID with no spaces). overflow-wrap:anywhere is
   applied to all of it uniformly for that reason: stating the rule in a
   comment and then applying it to only some of these would leave the next
   person assuming it holds everywhere it visibly doesn't. .content
   p{max-width:78ch} (above) sets a comfortable reading width but does not
   by itself stop that one long token from overflowing the column. */
/* The advisory's one lead sentence — the reason the whole block exists — so
   it needs to outweigh the tips/caveats under it rather than reading as one
   more bold paragraph among several. Text colour, not --accent: it is the
   most important sentence on the page, not a call to action. */
.advisory-summary{overflow-wrap:anywhere;font-size:16.5px;line-height:1.5;margin:0 0 14px}

/* The three numbered next-ad recommendations at the top of the city results
   page — plain <ol> markers rather than .advisory-list's card-per-item
   treatment, which is built for "the same fact about several cities" (the
   overview's latest-advisories list), not "three tips about one city". */
.advisory-tips{margin:0 0 18px;padding-left:22px}
.advisory-tips li{margin-bottom:6px;overflow-wrap:anywhere}

.advisory-subhead{margin:0 0 6px;font-family:var(--mono);font-size:11px;font-weight:600;
  letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.advisory-watch{margin:0 0 18px;padding-left:20px;color:var(--muted)}
.advisory-watch li{margin-bottom:4px;overflow-wrap:anywhere}

/* The advisory qualifying itself (insufficient_evidence_notes) — real
   visual weight, but --pending (a neutral "this is how it is" tone, same
   family as .pill.wait), not --risk: this is the model being careful, not
   something that broke. overflow-wrap:anywhere for the same reason as
   .advisory-summary above — see that comment. */
.advisory-caveats{margin:0 0 18px;padding:12px 16px;border-radius:10px;
  border:1px solid var(--pending-line);background:var(--pending-wash);
  border-left:3px solid var(--pending)}
.advisory-caveats h3{margin:0 0 6px;font-family:var(--mono);font-size:11px;font-weight:600;
  letter-spacing:.1em;text-transform:uppercase;color:var(--pending)}
.advisory-caveats ul{margin:0;padding-left:18px}
.advisory-caveats li{margin-bottom:4px;overflow-wrap:anywhere}

/* Evidence IDs the advisory cites, each linking back into the evidence
   table (see dashboard/city.html) — chips rather than a comma-joined
   sentence, so a long list wraps cleanly instead of overflowing its
   container edge to edge. */
.evidence-cites{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 18px;padding:0;list-style:none}
.evidence-cites a{display:inline-block;font-family:var(--mono);font-size:12px;padding:3px 9px;
  border-radius:6px;border:1px solid var(--line);background:var(--surface);color:var(--text);
  text-decoration:none;overflow-wrap:anywhere}
.evidence-cites a:hover{border-color:var(--accent);color:var(--accent)}

.advisory-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.advisory-list li{background:var(--surface);border:1px solid var(--line);border-radius:10px;
  padding:12px 16px}
.advisory-list li>a{font-weight:600;color:var(--text);text-decoration:none;margin-right:8px}
.advisory-list li>a:hover{color:var(--accent);text-decoration:underline}
.advisory-list li>.muted{font-family:var(--mono);font-size:11px;letter-spacing:.04em}
.advisory-list li>p{margin:6px 0 0;max-width:none}

/* A result of what you just did — amber, because it is where to look, and it
   is transient rather than a standing state. */
.notice{margin:0 0 6px;padding:10px 14px;font-size:14px;border-radius:8px;
  background:rgba(184,106,33,.08);border:1px solid rgba(184,106,33,.26);
  border-left:3px solid var(--accent)}

/* The same component when the result was a success rather than something to
   look at — green, the --good end of the axis the rest of this file uses, so
   "saved" does not read with the same urgency as "this city has never been
   scanned". */
.notice.done{background:var(--good-wash);border-color:var(--good-line);
  border-left-color:var(--good)}

/* ---- controls ----------------------------------------------------------- */
button,.button{display:inline-flex;align-items:center;gap:6px;font:inherit;font-size:14px;
  line-height:1.35;padding:8px 14px;border:1px solid var(--line);border-radius:8px;
  background:var(--surface);color:var(--text);text-decoration:none;cursor:pointer;
  transition:background .12s,border-color .12s,color .12s}
button:hover,.button:hover{border-color:var(--muted);background:var(--surface-2)}
button.primary,.button.primary{background:var(--accent);border-color:var(--accent);
  color:#fff;font-weight:600}
button.primary:hover,.button.primary:hover{background:var(--accent);
  border-color:var(--accent);filter:brightness(1.08)}
/* Outlined, not filled: removing a city is consequential, but this is an
   admin panel doing normal work, not an error to be alarmed by. */
button.danger,.button.danger{color:var(--risk);border-color:var(--risk-line);font-weight:600}
button.danger:hover,.button.danger:hover{background:var(--risk-wash);border-color:var(--risk)}
.confirm{display:flex;gap:10px;align-items:center;margin-top:22px}

.inline-add{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:16px 0 4px}
.inline-add input,.inline-add select{padding:8px 12px;font:inherit;font-size:14px;
  background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px}
.inline-add input{flex:0 1 300px}
.inline-add input::placeholder{color:var(--muted)}

/* Settings: one section per page, sub-nav on the left, the section on the
   right. 200px is the narrowest column that holds "Brands & places" on one
   line, which is the point of a fixed track — a fluid one would rewrap the
   nav every time the section beside it changed width. min-width:0 on the body
   is load-bearing: without it a grid item refuses to shrink below its content,
   so one wide <pre> or table would push the whole layout sideways instead of
   scrolling inside its own panel. */
.settings-layout{display:grid;grid-template-columns:200px 1fr;gap:22px;align-items:start}
.settings-body{min-width:0}
.settings-nav{display:flex;flex-direction:column;gap:1px;background:var(--surface);
  border:1px solid var(--line);border-radius:12px;padding:6px;
  box-shadow:0 1px 2px rgba(11,33,48,.05)}
.settings-nav a{padding:8px 11px;border-radius:8px;font-size:13.5px;
  color:var(--muted);text-decoration:none}
.settings-nav a:hover{background:var(--surface-2);color:var(--text)}
/* The accent wash, not the ink sidebar's amber-on-dark: this nav sits on a
   white panel, where that amber has nowhere near enough contrast to read as
   selected. Same accent hue, opposite ground. */
.settings-nav a.active{background:rgba(184,106,33,.09);color:var(--accent);font-weight:600}
/* Side by side needs roughly 700px of content before the section panel starts
   squeezing its own fields; below that the nav goes back to a full-width band
   above the section, which is how it reads on a phone anyway. */
@media (max-width:820px){.settings-layout{grid-template-columns:1fr}}

/* A section's panel. .list-editors (the brand/places textareas) is the same
   label -> muted note -> field rhythm as every other section, so it shares
   every rule here and adds only the one thing that differs: a wider,
   monospaced box. */
.settings-form fieldset{border:1px solid var(--line);border-radius:12px;
  padding:6px 20px 20px;margin:0 0 18px;background:var(--surface)}
.settings-form legend{padding:0 8px;font-family:var(--mono);font-size:11px;
  font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.settings-form label{display:block;margin-top:24px;
  font-weight:600;font-size:13.5px}
.settings-form input,.settings-form select,.settings-form textarea{margin-top:6px;
  padding:8px 12px;font:inherit;font-size:14px;background:var(--surface);
  color:var(--text);border:1px solid var(--line);border-radius:8px;
  width:100%;max-width:340px}
/* A list of brand/place names reads better in a monospace column than in the
   body sans, and a wider box than a text input needs, since a whole list is
   meant to be scanned down, not read across one line. */
.list-editors textarea{max-width:460px;font-family:var(--mono);
  font-size:13.5px;resize:vertical}
.settings-form p{margin:8px 0}
.settings-form code{font-family:var(--mono);font-size:.92em}

/* One key per row: name, then its masked value, with a hairline between rows
   so a short list of secrets reads as a small table rather than a stack of
   loose paragraphs. ".settings-form p.key-row", not just ".key-row" — it
   needs to out-rank .settings-form p's own margin, not lose to it by arriving
   later in a tie it doesn't actually win. */
.settings-form p.key-row{margin:0;padding:10px 0;font-size:14px;
  border-bottom:1px solid var(--line-soft)}
.key-row:last-of-type{border-bottom:0;padding-bottom:0}
.key-row strong{font-weight:600}
.key-row code{color:var(--muted)}

/* The bar a form's primary action sits in — Save, Add a user — set off from
   the fields above it rather than butting straight up against the last one.
   "p.page-actions", not just ".page-actions": every instance today is a <p>,
   and that one extra element in the selector is what out-ranks .settings-form
   p's own margin instead of losing to it. */
p.page-actions{margin:22px 0 0;display:flex;gap:10px}

/* A checkbox row is its own short sentence ("Account is active"), not a field
   label naming what comes after it, so .modal label.check (one class more
   specific than .modal label alone) overrides the uppercase micro-label
   treatment and lays the box and its text out on one line instead of
   stacked. accent-color, not a painted box, so the native control still
   matches the OS/browser's own checkbox chrome. */
.check,.modal label.check{display:flex;align-items:center;gap:8px;
  text-transform:none;font-family:var(--sans);font-size:14px;
  letter-spacing:normal;color:var(--text)}
.check input[type="checkbox"]{width:16px;height:16px;margin:0;accent-color:var(--accent)}

/* Keyboard focus, carried through from the login card: amber edge plus a soft
   ring on fields, a plain amber outline where there is no border to tint. */
a:focus-visible,button:focus-visible,.button:focus-visible{outline:2px solid var(--accent);
  outline-offset:2px;border-radius:8px}
input:focus-visible,select:focus-visible{outline:none;border-color:var(--accent);
  box-shadow:0 0 0 3px var(--focus-ring)}

/* ---- modal --------------------------------------------------------------
   Native <dialog>: the browser supplies focus trapping, Escape-to-close and
   the backdrop, none of which we then have to write. All it needs from us is
   the surface treatment it does not have by default. */
dialog{border:1px solid var(--line);border-radius:14px;background:var(--surface);
  color:var(--text);box-shadow:0 26px 60px -16px rgba(7,26,36,.4)}
dialog::backdrop{background:rgba(7,26,36,.44)}  /* dims the page, does not black it out */
dialog[open]{animation:dialog-in .16s cubic-bezier(.22,.61,.36,1)}
@keyframes dialog-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){dialog[open]{animation:none}}
.modal{width:min(460px,92vw);padding:24px}
.modal h2{margin:0 0 2px;font-size:17px;letter-spacing:-.01em}
.modal form{display:flex;flex-direction:column;gap:0}
.modal label{margin-top:14px;font-family:var(--mono);font-size:10px;letter-spacing:.13em;
  text-transform:uppercase;color:var(--muted)}
.modal input,.modal select{margin-top:5px;padding:9px 11px;font:inherit;font-size:14px;
  background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;
  width:100%}
.modal menu{display:flex;gap:9px;justify-content:flex-end;padding:0;margin:22px 0 0}

/* ---- tips ---------------------------------------------------------------
   One card per tip, stacked. Not the .table-scroll treatment the rest of the
   panel uses: a tip is a sentence to read, not a row to scan across, and a
   table would set the lead and the detail in the same visual weight when the
   whole point is that the lead comes first. */
.tips-meta{margin:0 0 12px;font-size:13.5px}
.tip-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.tip-card{background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:14px 16px;box-shadow:0 1px 2px rgba(11,33,48,.05)}
.tip-lead{margin:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  font-weight:600;font-size:14.5px;color:var(--text)}
.tip-text{margin:6px 0 0;font-size:14px;line-height:1.55;color:var(--muted)}
.tip-foot{margin:10px 0 0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12.5px}
.tip-foot code{font-family:var(--mono);font-size:12px;padding:3px 8px;border-radius:6px;
  background:rgba(184,106,33,.09);color:var(--accent);font-weight:600}
/* Activate / Approve buttons sit inline with the row's other actions. */
form.inline{display:inline;margin:0}
.settings-body h3{font-size:15px;margin:20px 0 8px}
