/* RTA Business Support agent: shared stylesheet.
   Tokens, type and components follow https://rtamobility.com/business-support/
   (WordPress + Bricks + Automatic.css). See docs/UI_STYLE_GUIDE.md for the
   mapping from the site's variables to these tokens. Keep colours in :root. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand colours (Automatic.css names on the RTA site) */
  --base: #0f2d52;            /* navy: nav, hero overlay, headings on light */
  --base-dark: #143b6c;
  --base-ultra-dark: #08182b;
  --base-medium: #2877d7;
  --base-light: #bed6f3;
  --base-ultra-light: #e9f1fb;
  --base-light-trans-80: rgba(190, 214, 243, 0.8);
  --base-dark-trans-90: rgba(20, 59, 108, 0.9);

  --secondary: #188c88;       /* teal: links on light, focus rings */
  --secondary-dark: #126d6a;
  --secondary-light: #bef4f2;

  --accent: #ffcb05;          /* yellow: alert bar, highlights */
  --accent-dark: #806600;
  --accent-light: #fff0b3;

  --action: #5ca545;          /* green: success states, sidebar widgets */
  --action-dark: #325a26;
  --action-light: #d0e8c9;
  --action-ultra-light: #eff7ed;

  --shade: #36445d;           /* blue-grey: muted text, borders */
  --shade-dark: #2f3b51;
  --shade-ultra-dark: #121824;
  --shade-light: #ced6e3;
  --shade-ultra-light: #eff1f6;

  --neutral-dark: #404040;
  --neutral-light: #d9d9d9;
  --white: #fff;
  --black: #000;

  --success: #29a745;
  --danger: #dc3545;
  --warning: #ffc10a;
  --info: #18a2b8;

  --text-dark: var(--shade-ultra-dark);
  --text-dark-muted: var(--neutral-dark);
  --text-light: var(--white);
  --link: var(--base);
  --link-hover: var(--secondary);
  --border-color: rgba(0, 0, 0, 0.2);

  /* Type: Inter, light body text, bold headings (site: text weight 300, headings 700) */
  --font: "Inter", "Segoe UI", Arial, sans-serif;
  --text-xs: 0.8rem;
  --text-s: 0.9rem;
  --text-m: 1.125rem;         /* 18px body */
  --text-l: 1.25rem;
  --h1: clamp(1.75rem, 1.2rem + 2vw, 2.65rem);
  --h2: clamp(1.45rem, 1.15rem + 1.2vw, 2rem);
  --h3: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  --h4: 1.125rem;

  /* Shape and spacing */
  --radius-xs: 4px;
  --radius-s: 7px;
  --radius-m: 10px;
  --radius-l: 15px;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.25rem;
  --space-xl: 3rem;
  --section-space: 3.5rem;
  --content-width: 1180px;
  --gutter: 1.5rem;
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-m);
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-dark);
  background: var(--white);
}
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin: 0 0 var(--space-s); color: var(--text-dark); text-wrap: pretty; }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); margin-top: var(--space-l); }
h3 { font-size: var(--h3); margin-top: var(--space-m); }
h4 { font-size: var(--h4); }
p, ul, ol { margin: 0 0 var(--space-s); max-width: 80ch; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover, a:focus-visible { color: var(--link-hover); }
a.ext::after { content: " \2197"; font-size: 0.8em; }
strong { font-weight: 700; }
small, .muted { color: var(--text-dark-muted); font-size: var(--text-s); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(var(--content-width), calc(100% - var(--gutter) * 2)); margin-inline: auto; }

/* Header: white, logo left, navy nav, double rule beneath (site: fr-header-alpha) */
.site-header { background: var(--white); padding-top: var(--space-s); }
.site-header__top { display: flex; justify-content: flex-end; gap: var(--space-m); font-size: var(--text-s); font-weight: 400; padding-bottom: var(--space-xs); }
.site-header__top a { text-decoration: none; }
.site-header__inner {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-m); flex-wrap: wrap;
  border-bottom: 10px double var(--base-light-trans-80); padding-bottom: 0;
}
.site-header__logo { width: 250px; padding-bottom: var(--space-s); display: block; }
.site-header__logo img { display: block; width: 100%; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: block; padding: 0.7em 1em; font-size: 1.05rem; font-weight: 400; text-decoration: none;
  color: var(--base); border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.site-nav a:hover, .site-nav a:focus-visible { background: var(--base-ultra-light); }
.site-nav a[aria-current="page"] { background: var(--base); color: var(--text-light); }
.site-nav .is-role { display: none; }           /* shown by app.js after /api/auth/me */
.site-nav .is-role.show { display: block; }

/* Alert bar (site: #alertbar, accent yellow) */
.alert-bar { margin: var(--space-s) auto 0; background: var(--accent); color: var(--text-dark); border-radius: var(--radius-s);
  padding: var(--space-s) var(--space-m); text-align: center; font-weight: 400; }
.alert-bar a { color: inherit; }

/* Hero (site: fr-blog-hero-echo, photo with navy overlay, white heading) */
.hero { position: relative; margin-top: var(--space-s); color: var(--text-light); isolation: isolate; }
.hero__bg { position: absolute; inset: 0; z-index: -1; background: url("img/hero-pima-county.jpg") center/cover no-repeat; }
.hero__bg::before { content: ""; position: absolute; inset: 0; background: var(--base-dark-trans-90); }
.hero__inner { padding: var(--section-space) 0; display: grid; gap: var(--space-m); grid-template-columns: 1fr; align-items: center; }
.hero__inner.has-media { grid-template-columns: 1.4fr 1fr; }
.hero h1 { color: var(--text-light); margin: 0; }
.hero p { color: var(--text-light); font-size: var(--text-l); margin: var(--space-s) 0 0; opacity: 0.95; }
.hero__media { border-radius: var(--radius-s); overflow: hidden; background: var(--white); }
.hero__media img { display: block; }
.hero--compact .hero__inner { padding: var(--space-l) 0; }

/* Page body: content + sidebar (site: page-body, news widgets) */
.page-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-xl); padding: var(--space-l) 0 var(--section-space); }
.page-body.single { grid-template-columns: minmax(0, 1fr); }
.page-body > main { min-width: 0; }
.widget { background: var(--action-ultra-light); border-radius: var(--radius-xs); padding: var(--space-s) var(--space-s) var(--space-m); margin-bottom: var(--space-m); font-size: var(--text-s); }
.widget h2, .widget h3 { font-size: var(--h4); text-align: center; margin: 0 0 var(--space-s); }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 0.5em 0; border-top: 1px solid var(--action-light); }
.widget li:first-child { border-top: 0; }
.widget .when { display: block; color: var(--text-dark-muted); font-size: var(--text-xs); }
.widget--contact { background: var(--base-ultra-light); }
.widget--contact li { border-color: var(--base-light); }

/* Cards (project cards, resource cards) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-m); margin: var(--space-m) 0; }
.card { background: var(--white); border: 1px solid var(--shade-light); border-top: 6px solid var(--base); border-radius: var(--radius-s); padding: var(--space-m); display: flex; flex-direction: column; gap: var(--space-xs); }
.card h3 { margin: 0; font-size: var(--h4); }
.card p { margin: 0; font-size: var(--text-s); }
.card .card__meta { color: var(--text-dark-muted); font-size: var(--text-xs); }
.card .card__actions { margin-top: auto; display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.badge { display: inline-block; font-size: var(--text-xs); font-weight: 700; padding: 0.2em 0.6em; border-radius: var(--radius-xs); background: var(--shade-ultra-light); color: var(--shade-dark); }
.badge--construction { background: var(--accent-light); color: var(--accent-dark); }
.badge--design { background: var(--base-ultra-light); color: var(--base-dark); }
.badge--complete { background: var(--action-light); color: var(--action-dark); }
.badge--danger { background: #f4bec3; color: #410b11; }

/* Buttons (site: btn, weight 700, radius-s, 0.25rem border) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: inherit; font-weight: 700; line-height: 1; text-decoration: none; cursor: pointer;
  padding: 0.75em 1.5em; border-radius: var(--radius-s); border: 3px solid var(--base);
  background: var(--base); color: var(--text-light);
}
.btn:hover, .btn:focus-visible { background: var(--base-dark); border-color: var(--base-dark); color: var(--text-light); }
.btn--outline { background: transparent; color: var(--base); }
.btn--outline:hover { background: var(--base-ultra-light); color: var(--base); }
.btn--action { background: var(--action); border-color: var(--action); }
.btn--action:hover { background: var(--action-dark); border-color: var(--action-dark); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--text-dark); }
.btn--accent:hover { background: var(--accent-light); border-color: var(--accent-light); color: var(--text-dark); }
.btn--danger { background: transparent; color: #a11824; border-color: #a11824; }        /* deleting: outlined red, filled on hover */
.btn--danger:hover, .btn--danger:focus-visible { background: #a11824; border-color: #a11824; color: var(--text-light); }
.btn--sm { padding: 0.5em 1em; font-size: var(--text-s); border-width: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form { display: grid; gap: var(--space-s); max-width: 640px; }
.form label { display: grid; gap: 0.3em; align-content: start; font-weight: 400; font-size: var(--text-s); }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 300; padding: 0.6em 0.75em; border: 1px solid var(--border-color); border-radius: var(--radius-xs);
  background: var(--white); color: var(--text-dark); width: 100%;
}
/* One box size for every text field and dropdown, in a form or beside a chat or a map */
.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), .form select,
.chat__scope select, .chat__form input, .map-tools select { height: 2.75rem; padding: 0 0.75em; }
.form textarea { min-height: 8em; resize: vertical; }
.form label:has(> input[type="checkbox"]:first-child) { display: flex; align-items: center; gap: 0.5em; }   /* a tick box beside its words */
.form input[type="checkbox"], .form input[type="radio"] { width: auto; min-height: 0; }
/* Fields side by side. The label text, the box and the hint under it are three tracks shared by the whole row (subgrid),
   so a hint or a long label on one field cannot push its box out of line with its neighbour's. */
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-s); align-items: start; }
.form .row--3 { grid-template-columns: repeat(3, 1fr); }
.form .row > .actions { align-self: end; }
.form .row > .actions .btn { min-height: 2.75rem; padding-top: 0; padding-bottom: 0; }     /* as tall as the box beside it */
.form .row > label > input, .form .row > label > select { align-self: start; }               /* a taller neighbour does not stretch a box */
@supports (grid-template-rows: subgrid) {
  .form .row { row-gap: 0.3em; }
  .form .row > label:not(:has(> input[type="checkbox"]:first-child)) { grid-row: span 3; grid-template-rows: subgrid; }
  .form .row > label > .hint { grid-row: 3; }
  .form .row > .actions { grid-row: 2; align-self: center; }       /* a button beside a field sits on the line of the boxes */
  .form .row > label + .actions { grid-column: 2; }                /* ... and stays to the right of that field */
}
.form .actions { display: flex; gap: var(--space-s); align-items: center; flex-wrap: wrap; }
/* Buttons that sit side by side always keep a gap, also when they wrap or fill the width on a phone */
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-s); align-items: center; }
p.btn-row { max-width: none; }
td .btn-row { gap: var(--space-xs); }
.form .hint { color: var(--text-dark-muted); font-size: var(--text-xs); }
.hp { position: absolute; left: -9999px; }      /* honeypot field */
.notice { padding: var(--space-s) var(--space-m); border-radius: var(--radius-xs); border-left: 6px solid var(--info); background: var(--shade-ultra-light); margin: var(--space-s) 0; font-size: var(--text-s); }
.notice--success { border-color: var(--success); background: var(--action-ultra-light); }
.notice--warning { border-color: var(--warning); background: var(--accent-light); }
.notice--danger { border-color: var(--danger); background: #fbe9ea; }

/* Chat */
.chat { display: grid; gap: var(--space-s); }
.chat__scope { display: flex; gap: var(--space-s); align-items: center; flex-wrap: wrap; font-size: var(--text-s); }
.chat__scope select { font: inherit; padding: 0.4em 0.6em; border: 1px solid var(--border-color); border-radius: var(--radius-xs); }
.chat__log { display: grid; gap: var(--space-s); min-height: 240px; padding: var(--space-m); background: var(--shade-ultra-light); border-radius: var(--radius-s); }
.msg { max-width: 85%; padding: var(--space-s) var(--space-m); border-radius: var(--radius-m); font-size: var(--text-s); }
.msg--user { justify-self: end; background: var(--base); color: var(--text-light); border-bottom-right-radius: var(--radius-xs); }
.msg--bot { justify-self: start; background: var(--white); border: 1px solid var(--shade-light); border-bottom-left-radius: var(--radius-xs); }
.msg--refusal { border-left: 6px solid var(--warning); }
.msg .cite { font-weight: 700; color: var(--secondary); text-decoration: none; }
.citations { margin: var(--space-xs) 0 0; padding-left: 1.4em; font-size: var(--text-xs); color: var(--text-dark-muted); }
.citations li { margin: 0.2em 0; }
/* A reply from Business Support as the business reads it (RTA.renderReply): the letter, its sources, the attached table */
.letter__text { white-space: pre-wrap; }
.letter .cite { font-weight: 700; color: var(--secondary); text-decoration: none; }
.letter__sources { margin: var(--space-s) 0 0; font-size: var(--text-xs); }
.reply-table { margin-top: var(--space-s); padding-top: var(--space-s); border-top: 1px solid var(--shade-light); }
.reply-table p { margin: 0 0 0.3em; max-width: none; }
.reply-table .table-wrap { margin: 0.3em 0 0.5em; }
.reply-table table { width: auto; min-width: min(100%, 26rem); }
.reply-table td:last-child, .reply-table th:last-child { text-align: right; }
.reply-table td:last-child { white-space: nowrap; }                /* a percentage stays on one line; its heading may wrap on a phone */
.letter { min-width: 0; overflow-wrap: anywhere; }
.card > details, .chat__log > .msg { min-width: 0; }               /* a reply with a table may not widen its card or the page */
.reply-table__weighted td { background: var(--shade-ultra-light); }
.nav-count { display: inline-block; min-width: 1.5em; padding: 0.1em 0.45em; border-radius: 999px; background: var(--accent); color: var(--text-dark); font-size: var(--text-xs); font-weight: 700; text-align: center; line-height: 1.3; }
.chat__form { display: grid; grid-template-columns: 1fr auto; gap: var(--space-xs); align-items: center; }
.chat__form .btn { min-height: 2.75rem; padding-top: 0; padding-bottom: 0; }      /* as tall as the question box */
.chat__form input { font: inherit; font-weight: 300; height: 2.75rem; padding: 0 0.9em; border: 1px solid var(--border-color); border-radius: var(--radius-xs); }
.suggestions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.suggestions button { font: inherit; font-size: var(--text-xs); font-weight: 400; padding: 0.4em 0.8em; border-radius: 999px; border: 1px solid var(--base-light); background: var(--base-ultra-light); color: var(--base-dark); cursor: pointer; }
.suggestions button:hover { background: var(--base-light); }

/* Tables (consoles) */
.table-wrap { overflow-x: auto; margin: var(--space-s) 0 var(--space-m); }
table { border-collapse: collapse; width: 100%; font-size: var(--text-s); }
th, td { text-align: left; padding: 0.6em 0.75em; border-bottom: 1px solid var(--shade-light); vertical-align: top; }
th { font-weight: 700; background: var(--shade-ultra-light); color: var(--shade-dark); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: var(--base-ultra-light); }

/* Stat tiles, charts, tabs */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-s); margin: var(--space-s) 0 var(--space-m); }
.stat { background: var(--base-ultra-light); border-radius: var(--radius-s); padding: var(--space-s) var(--space-m); }
.stat b { display: block; font-size: 1.8rem; font-weight: 700; color: var(--base); line-height: 1.1; }
.stat span { font-size: var(--text-xs); color: var(--text-dark-muted); }
.chart { min-height: 260px; background: var(--white); border: 1px solid var(--shade-light); border-radius: var(--radius-s); padding: var(--space-s); margin-bottom: var(--space-m); }
.map { height: 380px; border-radius: var(--radius-s); border: 1px solid var(--shade-light); background: var(--shade-ultra-light); margin: var(--space-s) 0 var(--space-m); }
/* Impact analysis: the tick boxes with which staff choose what the reply gives; what is unticked is greyed */
.in-reply { display: inline-flex !important; align-items: center; gap: 0.4em; font-weight: 700; margin-right: var(--space-s); }
.in-reply input { flex: 0 0 auto; }
/* the score (0 to 100) the agent suggests for giving a result in the reply, after that result's tick box */
.score { display: inline-block; font-size: var(--text-xs); font-weight: 700; padding: 0.1em 0.6em; border-radius: 999px; background: var(--action-light); color: var(--action-dark); white-space: nowrap; }
.score--low { background: var(--shade-ultra-light); color: var(--shade-dark); }
.in-reply-row { margin: 0.3em 0 0.6em; display: flex; flex-wrap: wrap; gap: 0.2em var(--space-s); }
td .in-reply { font-weight: 400; margin: 0 0 0.2em; display: flex !important; }
[data-measure]:has([name="use"]:not(:checked)) td:not(:first-child),
[data-words] div:has(> .in-reply input:not(:checked)) textarea,
.in-reply:has(input:not(:checked)) { opacity: 0.5; }
[data-words][data-off] { opacity: 0.5; }            /* the note and comment of a result that is left out */

/* The spotlight: the block staff publish on the Projects page (questions and answers, cards, or a numbered list) */
#spotlight { margin-top: var(--space-l, 2rem); }
.spotlight__intro { color: var(--text-dark-muted); }
.spotlight--faq { display: grid; gap: var(--space-xs); }
.spotlight__item { border: 1px solid var(--shade-light); border-radius: var(--radius-s); background: var(--white); padding: 0.7em 1em; }
.spotlight__item summary { font-weight: 700; color: var(--base); cursor: pointer; }
.spotlight__item[open] summary { margin-bottom: 0.5em; }
.spotlight--cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-s); }
.spotlight--list { padding-left: 1.3em; display: grid; gap: var(--space-s); }
.spotlight--list li strong { display: block; color: var(--base); }
.spotlight p { margin: 0 0 0.5em; }
.spotlight ul { margin: 0 0 0.5em; padding-left: 1.2em; }
.spotlight__source { font-size: var(--text-xs); color: var(--text-dark-muted); margin: 0.4em 0 0 !important; }
.spotlight-preview { border: 2px dashed var(--shade-light); border-radius: var(--radius-s); padding: var(--space-s); background: var(--shade-ultra-light); }
.spotlight-preview h2 { margin-top: 0; }
.spotlight-edit { list-style: none; padding: 0; display: grid; gap: var(--space-s); }
.spotlight-edit li { border: 1px solid var(--shade-light); border-radius: var(--radius-s); padding: var(--space-s); background: var(--white); }
.spotlight-edit li[data-off] { opacity: 0.6; }

/* Staff maps: a taller map, and a legend whose entries also switch a status on and off */
.map--tall { height: 520px; }
.map-tools { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-s); align-items: end; }
.map-tools label { display: grid; gap: 0.2em; font-size: var(--text-s); }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.4em; }
.map-legend__item { font: inherit; font-size: var(--text-xs); display: inline-flex; align-items: center; gap: 0.4em; padding: 0.35em 0.75em; border: 1px solid var(--shade-light); border-radius: 999px; background: var(--white); color: var(--text-dark); cursor: pointer; }
.map-legend__item[aria-pressed="false"] { opacity: 0.5; text-decoration: line-through; }
.map-legend__dot { width: 0.85em; height: 0.85em; border-radius: 50%; border: 1px solid var(--base); display: inline-block; flex: 0 0 auto; }
/* a verified business: a check on its circle, and the same mark in the legend and the popup. Navy with a white ring:
   none of the status colours, so it reads on every circle and on the basemap */
.map-check { width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; background: var(--base); color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55); font-size: 14px; font-weight: 700; line-height: 18px; text-align: center; pointer-events: none; }
.map-check--inline { display: inline-block; width: 1.25em; height: 1.25em; line-height: calc(1.25em - 4px); font-size: 0.85em; vertical-align: middle; flex: 0 0 auto; }
.map-legend__key { display: inline-flex; align-items: center; gap: 0.4em; font-size: var(--text-xs); padding: 0.35em 0.4em; color: var(--text-dark); }
.map-chip { display: inline-flex; align-items: center; gap: 0.35em; font-size: var(--text-xs); }
/* the registration map's business-impact legend: a continuous colour scale, no classes */
.map-ramp { display: inline-block; width: 9rem; max-width: 40vw; height: 0.85rem; border-radius: 999px; border: 1px solid var(--base); vertical-align: middle; }
.map-popup__list { margin: 0.5em 0; padding-left: 1.1em; }
.map-popup__list li { margin-bottom: 0.35em; }
.leaflet-popup-content .btn--sm { margin-top: 0.3em; }
.leaflet-popup-content .btn-row { margin-top: 0.4em; gap: 0.4em; }
.leaflet-popup-content .btn-row .btn--sm { margin-top: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 3px solid var(--base-light); margin-bottom: var(--space-m); flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 400; padding: 0.6em 1em; border: 0; background: transparent; color: var(--base); cursor: pointer; border-radius: var(--radius-xs) var(--radius-xs) 0 0; }
.tabs button[aria-selected="true"] { background: var(--base); color: var(--text-light); font-weight: 700; }
.panel[hidden] { display: none; }

/* Progress bar (RTA.progress): downloads, ingest jobs, builds, uploads */
.progress { display: grid; gap: 0.3em; min-width: 11rem; flex: 1 1 14rem; margin: 0.35em 0; }
.progress__track { height: 0.7rem; border-radius: 999px; background: var(--shade-light); overflow: hidden; }
.progress__fill { height: 100%; border-radius: 999px; background: var(--secondary); transition: width 0.4s ease; }
.progress small { font-size: var(--text-xs); color: var(--text-dark-muted); }
.progress--unknown .progress__fill { width: 35%; animation: progress-slide 1.4s ease-in-out infinite alternate; }
@keyframes progress-slide { from { margin-left: 0; } to { margin-left: 65%; } }
@media (prefers-reduced-motion: reduce) { .progress__fill { transition: none; } .progress--unknown .progress__fill { animation: none; width: 100%; opacity: 0.5; } }

/* Resource list (site: Business Resources) */
.resources { list-style: none; padding: 0; margin: 0 0 var(--space-m); columns: 2; column-gap: var(--space-l); }
.resources li { break-inside: avoid; padding: 0.35em 0; }
@media (max-width: 700px) { .resources { columns: 1; } }

/* Footer (site: fr-footer-delta) */
.site-footer { margin-top: var(--section-space); border-top: 10px double var(--base-light-trans-80); padding: var(--space-l) 0 var(--space-m); text-align: center; font-size: var(--text-s); font-weight: 400; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-s) var(--space-m); margin-bottom: var(--space-s); }
.site-footer nav a { text-decoration: underline; }
.site-footer p { max-width: none; }            /* the general 80ch limit on a paragraph would pin these lines to the left of the centred links */
.site-footer .legal { font-size: var(--text-xs); color: var(--text-dark-muted); margin-top: var(--space-s); }
.site-footer .legal a { display: inline-block; margin: 0 0.4em; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 900px) {
  .page-body { grid-template-columns: 1fr; gap: var(--space-l); }
  .hero__inner.has-media { grid-template-columns: 1fr; }
  .site-header__inner { align-items: center; }
  .site-nav a { font-size: 1rem; padding: 0.6em 0.8em; }
  .form .row, .form .row--3 { grid-template-columns: 1fr; row-gap: var(--space-s); }      /* one field per line: no shared tracks */
  .form .row > label:not(:has(> input[type="checkbox"]:first-child)) { grid-row: auto; grid-template-rows: none; }
  .form .row > label > .hint, .form .row > .actions, .form .row > label + .actions { grid-row: auto; grid-column: auto; }
  .msg { max-width: 100%; }
}
/* Phones and narrow tablets: the navigation folds behind a Menu button (app.js), the tabs scroll sideways */
.nav-toggle { display: none; align-items: center; gap: 0.5em; font: inherit; font-weight: 700; color: var(--base); background: var(--white);
  border: 2px solid var(--base); border-radius: var(--radius-s); padding: 0.55em 0.9em; margin-bottom: var(--space-s); cursor: pointer; }
.nav-toggle::before { content: ""; width: 1.1em; height: 0.85em; border-top: 2px solid; border-bottom: 2px solid;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; }
.nav-toggle[aria-expanded="true"] { background: var(--base); color: var(--text-light); }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-header__inner nav { flex-basis: 100%; }
  .site-nav { display: none; flex-direction: column; gap: 0; padding-bottom: var(--space-xs); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.85em 0.75em; border-radius: var(--radius-xs); border-top: 1px solid var(--base-ultra-light); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; padding: 0.75em 1em; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; --section-space: 2.25rem; }
  body { overflow-wrap: break-word; }
  .site-header__logo { width: 180px; }
  .site-header__top { display: none; }
  .hero--compact .hero__inner { padding: var(--space-m) 0; }
  .hero p { font-size: var(--text-m); }
  .page-body { padding-top: var(--space-m); }
  .chat__form { grid-template-columns: 1fr; }
  .chat__log { padding: var(--space-s); }
  .card { padding: var(--space-s); }
  .notice { padding: var(--space-xs) var(--space-s); }
  .map { height: 300px; }
  .map--tall { height: 400px; }
  .map-tools label, .map-tools select { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  th, td { padding: 0.5em 0.6em; }
  .table-wrap th:first-child, .table-wrap td:first-child { min-width: 8.5em; }   /* the row's name stays readable while the table scrolls sideways */
  pre { max-width: 100% !important; overflow-x: auto; }
  input, select, textarea { font-size: 1rem !important; max-width: 100%; }   /* 16 px: a phone does not zoom the page when a field is tapped */
  input[type="checkbox"], input[type="radio"], .form input[type="checkbox"], .form input[type="radio"] { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; vertical-align: middle; }
  .btn { width: 100%; min-height: 2.75rem; }
  .btn--sm { width: auto; }                        /* small buttons sit side by side in cards and tables */
  .form .actions .btn--sm, .card__actions .btn--sm { flex: 1 1 auto; }
  .card__actions label, .form .actions label:has(select) { display: grid; gap: 0.3em; flex: 1 1 100%; min-width: 0; }   /* a select with long options */
  .card__actions select, .form .actions select { width: 100%; }
}
@media print {
  .site-header, .alert-bar, .site-footer, .chat__form, .suggestions { display: none; }
  .hero__bg { display: none; }
  .hero h1, .hero p { color: var(--text-dark); }
}
