/* NomadicExperts — web app design system, theme "Night Caravan".
 *
 * Jörg, 2026-11-06 (docs/decisions.md): a themed identity analogous to Monkeynme's
 * "Neon-Jungle / Go bananas", replacing the plain petrol look. Night desert: a navy
 * night sky as surface, sand-gold as the accent (glow, highlights, primary buttons with
 * dark text), terracotta for the strongest calls to action and for danger, warm
 * off-white text. Claim: "Go nomad."
 *
 * The STRUCTURE is still TenderYeti's grammar (ported earlier the same day): a mono
 * eyebrow above a page heading, headings that end in an accent period, 20px cards on a
 * hairline, 4px controls, the system grotesque, a dark band that re-points the tokens
 * inside itself, and every component class name the templates and tests use. Only the
 * tokens and the surface treatment changed. site.css adds the website's starfield,
 * glow, glass cards, dunes and the camel; this file (the logged-in app and the admin
 * area) stays calm: no starfield behind content, glow only on the wordmark star and the
 * primary button's focus/hover, solid cards for readable tables, forms and listings.
 *
 * Light/dark: DARK ONLY (website and app). Sand-gold is a light colour; on a light
 * ground it would be 1.9:1 and need a second, darker gold for every text use, which
 * would no longer be the brand. One dark theme, measured below, instead of a light
 * variant that is half-AA. `color-scheme: dark` makes form controls and scrollbars match.
 *
 *     #0B1530  night        (page ground)
 *     #070E22  deep night   (bands, header, footer, inputs on the website)
 *     #101C40  dusk         (alternate ground, table heads, hovers)
 *     #142049  night card   (cards, listings, tables)
 *     #F5B942  sand-gold    (accent, links, primary buttons with dark text, glow)
 *     #E0603A  terracotta   (strongest call to action, danger; dark text on it)
 *     #F4EFE6  moonlight    (text)
 *     #C2BBAE  sand-grey    (muted text)
 *
 * Contrast, measured with the WCAG 2.x formula (AA: 4.5:1 text, 3:1 large text and UI):
 *
 *     #F4EFE6 ink    on #0B1530 15.75   on #142049 13.76   on #070E22 16.75
 *     #C2BBAE ink-2  on #0B1530  9.46   on #142049  8.26   on #101C40 8.73   on #070E22 10.06
 *     #9BA3C0 ink-3  on #070E22  7.67   on #0B1530  7.21   on #142049 6.30  (small notes)
 *     #F5B942 gold   on #0B1530 10.22   on #142049  8.93   on #101C40 9.43   on #070E22 10.87
 *     #0B1530 on gold #F5B942 10.22;  on hover gold #F8CB6A 11.80
 *     #0B1530 on terracotta #E0603A 5.07;  on hover #E8794F 6.25
 *       (white on #E0603A is only 3.56 -> terracotta always carries dark text)
 *     #E0603A as text on #142049 4.43 -> never small text; error text is #F2876A:
 *     #F2876A on #142049 6.34, on #0B1530 7.26, on its tint #352A47 5.37
 *     #7D86A8 control border on #142049 4.39, on #0B1530 5.02, on #070E22 5.34 (1.4.11)
 *     chips: #F5B942 on plate #383848 6.51;  #C2BBAE on #383848 6.03
 *     alerts: ok #5FD3B0 on #1E3957 6.43;  info #8DB8FF on #253562 5.91;
 *             warn #F5B942 on #383848 6.51;  error #F2876A on #352A47 5.37;
 *             #F4EFE6 body text on each tint >= 10.03
 *     website glow (site.css): the hottest point of the gold radial glow is #302F33;
 *             #F4EFE6 on it 11.51, #C2BBAE 6.91, #F5B942 7.47
 *     glass cards (site.css) composite to #111D42..#142049; #C2BBAE on #1E2645 7.76
 *     focus ring: 2px #F5B942 outline, 10.22 against the night ground
 *     score badge: high = gold fill, #0B1530 number 10.22; middle = gold outline and
 *             gold number on the card 8.93; low = grey outline, #C2BBAE number 8.26.
 *             The number is always written out; fill/outline/dashes repeat it.
 *
 * Hairlines #26305A / #3A4573 are decorative (cards are not controls); every control
 * boundary uses #7D86A8 or the gold.
 *
 * No webfont and no external request: the CSP is 'self' only. No inline style anywhere
 * (style-src-attr 'none'). The camel for empty states is /static/camel.svg (a mask).
 */

:root {
  color-scheme: dark;

  --brand: #F5B942;            /* sand-gold */
  --brand-hover: #F8CB6A;
  --brand-ink: #F5B942;        /* links and gold text */
  --brand-glow: rgba(245, 185, 66, 0.28);
  --brand-pale: #383848;       /* chip plate: 16 % gold on the card */
  --brand-pale-ink: #F5B942;
  --on-brand: #0B1530;

  --terra: #E0603A;            /* terracotta */
  --terra-hover: #E8794F;
  --terra-ink: #F2876A;        /* terracotta-family TEXT on navy */
  --on-terra: #0B1530;

  --ground: #0B1530;
  --ground-alt: #101C40;
  --surface: #142049;
  --ground-dark: #070E22;
  --ground-deep: #050A19;

  --ink: #F4EFE6;
  --ink-2: #C2BBAE;
  --ink-3: #9BA3C0;
  --on-dark: #F4EFE6;
  --on-dark-2: #C2BBAE;
  --on-dark-3: #9BA3C0;

  --rule: #26305A;
  --rule-strong: #3A4573;
  --rule-dark: rgba(245, 185, 66, 0.14);
  --ctl-border: #7D86A8;
  --sand-line: rgba(245, 185, 66, 0.18);   /* the glass cards' hairline */

  --highlight: #302F33;

  --ok: #5FD3B0;      --ok-bg: #1E3957;      --ok-edge: #5FD3B0;
  --info: #8DB8FF;    --info-bg: #253562;    --info-edge: #8DB8FF;
  --warn: #F5B942;    --warn-bg: #383848;    --warn-edge: #F5B942;
  --error: #F2876A;   --error-bg: #352A47;   --error-edge: #E0603A;

  --r-ctl: 4px;
  --r-card: 20px;
  --r-tile: 12px;
  --r-pill: 999px;

  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;

  --shell: 1180px;
  --gut: 2rem;
  --focus: 0 0 0 2px var(--ground), 0 0 0 4px var(--brand);
}

@media (max-width: 640px) { :root { --gut: 1rem; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; background: var(--ground); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brand); color: var(--on-brand); }

/* ─── a11y helpers ─────────────────────────────────────────────────────── */

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -999px; top: 0.5rem; z-index: 100;
  background: var(--brand); color: var(--on-brand);
  padding: 0.5rem 0.9rem; border-radius: var(--r-ctl); font-weight: 600;
}
.skip:focus { left: 0.5rem; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { border-radius: var(--r-ctl); }

/* ─── shell ────────────────────────────────────────────────────────────── */

.wrap { width: 100%; max-width: var(--shell); margin: 0 auto; padding-left: var(--gut); padding-right: var(--gut); }
.page { flex: 1 0 auto; padding-top: 2.5rem; padding-bottom: 4rem; }
.page--narrow { max-width: 52rem; }
@media (max-width: 640px) { .page { padding-top: 1.5rem; padding-bottom: 3rem; } }

/* A dark band: the deep night, the tokens stay light-on-dark. */
.band--dark {
  background: var(--ground-dark);
  --ink: var(--on-dark);
  --ink-2: var(--on-dark-2);
  --ink-3: var(--on-dark-3);
  --rule: var(--rule-dark);
  color: var(--on-dark);
}

/* ─── type ─────────────────────────────────────────────────────────────── */

h1, h2, h3, h4 { font-family: var(--sans); color: var(--ink); text-wrap: balance; }
h1 {
  font-weight: 650;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.08; letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}
h2 { font-weight: 600; font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.018em; margin: 0 0 0.9rem; }
h3 { font-weight: 600; font-size: 1.05rem; line-height: 1.3; letter-spacing: -0.012em; margin: 0 0 0.4rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-ink); text-underline-offset: 0.16em; }
a:hover { text-decoration-thickness: 2px; }
code {
  font-family: var(--mono); font-size: 0.86em; word-break: break-all;
  background: var(--ground-alt); border: 1px solid var(--rule); border-radius: var(--r-ctl);
  padding: 0.1em 0.35em;
}
strong { font-weight: 650; }

/* The trailing period in sand-gold: decorative, it is the sentence's own period. */
.hdg-dot::after { content: "."; color: var(--brand); }

/* `✦ Matches` above a page heading: a small gold star (drawn, not a character, so it
   is never read out) instead of TenderYeti's slashes. The words are in the markup. */
.eyebrow {
  display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.75rem;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--brand-ink);
}
.eyebrow::before {
  content: ""; flex: 0 0 auto; width: 0.7rem; height: 0.7rem; background: var(--brand);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.deck { font-size: 1.06rem; color: var(--ink-2); margin: 0; max-width: 62ch; text-wrap: pretty; }
.muted, .meta { color: var(--ink-2); }
.hint { font-size: 0.86rem; color: var(--ink-2); margin: 0.35rem 0 0; }

.page-head { margin: 0 0 2rem; }
.page-head .deck { margin-top: 0.25rem; }
.back-link { display: inline-block; margin: 0 0 1rem; font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ─── wordmark: "Nomadic" in moonlight, "Experts" in sand, a glowing star ── */

.wordmark {
  display: inline-flex; align-items: center; direction: ltr; unicode-bidi: isolate;  /* the name reads LTR in Arabic too */
  font-weight: 700; font-size: 1.12rem; letter-spacing: -0.025em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.wordmark-accent { color: var(--brand); }
.wordmark-mark {
  position: relative; flex: 0 0 auto; width: 0.95rem; height: 0.95rem; margin-inline-end: 0.5rem;
  background: radial-gradient(circle, var(--brand-glow) 0, transparent 70%);
}
.wordmark-mark::before {
  content: ""; position: absolute; inset: 0; background: var(--brand);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.wordmark--on-dark { color: var(--on-dark); font-size: 1.3rem; }
.wordmark--on-dark .wordmark-mark { width: 1.1rem; height: 1.1rem; }

/* ─── app header ───────────────────────────────────────────────────────── */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ground-dark) 90%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--rule);
}
@supports not (backdrop-filter: blur(1px)) { .site-head { background: var(--ground-dark); } }
.head-row { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }

/* The menu is a <details>: on a phone it is a "Menu" button that opens a panel, with
   no script. Wide screens show its content always (::details-content); a browser
   without that pseudo-element keeps the Menu button on every width. The public site
   (site.css) opens it from a wider breakpoint, because its nav carries sub-labels. */
.head-menu { margin-left: auto; }
.head-menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.85rem; border: 1px solid var(--ctl-border); border-radius: var(--r-ctl);
  font-weight: 600; font-size: 0.92rem; color: var(--ink);
}
.head-menu > summary::-webkit-details-marker { display: none; }
.head-menu > summary::before {
  content: ""; width: 1rem; height: 0.7rem;
  border-top: 2px solid currentColor; border-bottom: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}
.head-menu > summary:hover { border-color: var(--brand); }
.head-menu[open] > summary { background: var(--ground-alt); border-color: var(--brand); }
.head-menu-body {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--ground-dark); border-bottom: 1px solid var(--rule);
  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.7);
  padding: 0.75rem var(--gut) 1.25rem;
}
.site-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.site-nav a {
  display: block; padding: 0.6rem 0.75rem; border-radius: var(--r-ctl);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.site-nav a:hover { color: var(--ink); background: var(--ground-alt); }
.site-nav a[aria-current="page"] { color: var(--brand-ink); background: var(--brand-pale); font-weight: 600; }
.who {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  margin-top: 0.75rem; padding: 0.75rem 0.75rem 0; border-top: 1px solid var(--rule);
  font-size: 0.86rem; color: var(--ink-2); min-width: 0;
}
.who-name { overflow-wrap: anywhere; }
.who form { margin: 0; }

@supports selector(::details-content) {
  @media (min-width: 900px) {
    .site-head:not(.site-head--public) .head-menu { flex: 1; margin-left: 0; }
    .site-head:not(.site-head--public) .head-menu > summary { display: none; }
    .site-head:not(.site-head--public) .head-menu::details-content { content-visibility: visible; }
    .site-head:not(.site-head--public) .head-menu-body {
      position: static; display: flex; align-items: center; gap: 1rem;
      padding: 0; background: none; border: 0; box-shadow: none;
    }
    .site-head:not(.site-head--public) .site-nav { flex-direction: row; gap: 0.25rem; }
    .site-head:not(.site-head--public) .site-nav a { padding: 0.45rem 0.7rem; font-size: 0.92rem; white-space: nowrap; }
    .site-head:not(.site-head--public) .site-nav a[aria-current="page"] { background: none; box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
    .who { margin: 0 0 0 auto; padding: 0; border: 0; flex-wrap: nowrap; }
    .who-name { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  }
}

/* ─── footer ───────────────────────────────────────────────────────────── */

.site-foot { border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 0.84rem; padding: 1.25rem 0; background: var(--ground-dark); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; }
.site-foot p { margin: 0; }
.site-foot .wordmark { font-size: 0.9rem; }
.foot-links a { color: inherit; }
.foot-links a:hover { color: var(--brand-ink); }

/* ─── signed-out pages ("Basecamp"): a card under the stars ───────────── */

body.auth {
  background-color: var(--ground);
  background-image:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(245, 185, 66, 0.10), transparent 70%),
    radial-gradient(circle, rgba(244, 239, 230, 0.55) 0.6px, transparent 1.2px),
    radial-gradient(circle, rgba(245, 185, 66, 0.35) 0.8px, transparent 1.6px);
  background-size: 100% 100%, 37px 41px, 113px 97px;
  background-position: 0 0, 0 0, 19px 23px;
}
.auth-shell {
  flex: 1 0 auto; width: 100%; max-width: 30rem; margin: 0 auto;
  padding: 3.5rem var(--gut) 2.5rem; display: flex; flex-direction: column;
}
.auth-head { text-align: center; margin-bottom: 1.75rem; color: var(--on-dark); }
.auth-tagline { margin: 0.6rem 0 0; color: var(--on-dark-2); font-size: 1rem; text-wrap: balance; }
.auth-card {
  background: var(--surface); border: 1px solid var(--sand-line); border-radius: var(--r-card);
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.8), 0 0 60px -30px var(--brand-glow);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 1.25rem; }
.auth-links { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 0.92rem; color: var(--ink-2); }
.auth-links a { font-weight: 500; }
body.auth .site-foot { border-top-color: var(--rule-dark); color: var(--on-dark-2); background: transparent; }
body.auth .site-foot .wrap { justify-content: center; text-align: center; }
@media (max-width: 480px) {
  .auth-shell { padding-top: 2rem; }
  .auth-card { padding: 1.5rem 1.25rem; border-radius: var(--r-tile); }
}

/* The dune line above a footer (inline SVG in the templates; decorative). */
.dune-line { display: block; width: 100%; height: 2.25rem; color: var(--ground-dark); }
.dune-line .dl-back { fill: var(--surface); }
.dune-line .dl-front { fill: currentColor; }
.dune-line .dl-ridge { fill: none; stroke: var(--brand); stroke-opacity: 0.45; stroke-width: 1.2; }

/* ─── buttons (TenderYeti .btn grammar, app-sized) ────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.3rem; min-height: 2.75rem;
  border-radius: var(--r-ctl); border: 1px solid transparent;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 650; line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .2s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
/* Sand-gold with night-blue text, never white (10.22:1). */
.btn-primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); box-shadow: 0 0 22px -4px var(--brand-glow); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ctl-border); }
.btn-secondary:hover { background: rgba(245, 185, 66, 0.08); border-color: var(--brand); }
/* Terracotta: danger in the app, the strongest call to action on the website. */
.btn-danger, .btn-terra { background: var(--terra); color: var(--on-terra); border-color: var(--terra); }
.btn-danger:hover, .btn-terra:hover { background: var(--terra-hover); border-color: var(--terra-hover); }
.btn-ghost { background: transparent; color: var(--brand-ink); border-color: transparent; padding-left: 0.6rem; padding-right: 0.6rem; }
.btn-ghost:hover { background: var(--ground-alt); }
.btn-sm { padding: 0.5rem 0.85rem; min-height: 2.25rem; font-size: 0.86rem; }
.btn-block { width: 100%; }

.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--brand); border-color: var(--brand); box-shadow: none; }

/* Busy: app.js / auth.js set aria-busy on the form while its request runs. The
   status line beside the button says what is happening in words. */
form[aria-busy="true"] .btn[type="submit"]::before {
  content: ""; width: 0.95em; height: 0.95em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: ne-spin 0.8s linear infinite;
}
form[aria-busy="true"] .btn[type="submit"]:disabled { opacity: 0.8; cursor: progress; }
@keyframes ne-spin { to { transform: rotate(360deg); } }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.form-stack > .actions, .form-grid > .actions { margin-top: 0.25rem; }
.actions .status { flex-basis: 100%; }

/* ─── forms ────────────────────────────────────────────────────────────── */

.form-stack { display: grid; gap: 1.1rem; max-width: 36rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; max-width: 52rem; }
.form-grid .field--wide, .form-grid fieldset, .form-grid .actions { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 0.9rem; margin: 0 0 0.35rem; color: var(--ink); }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--ground); border: 1px solid var(--ctl-border); border-radius: var(--r-ctl);
  padding: 0.62rem 0.75rem; min-height: 2.75rem;
}
textarea { min-height: 12rem; line-height: 1.55; resize: vertical; }
select { padding-right: 2rem; }
input::placeholder, textarea::placeholder { color: var(--ink-2); opacity: 0.85; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand);
}
input:user-invalid, select:user-invalid, textarea:user-invalid, [aria-invalid="true"] {
  border-color: var(--error-edge); box-shadow: 0 0 0 1px var(--error-edge);
}
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; }

input[type="checkbox"], input[type="radio"] {
  width: 1.1rem; height: 1.1rem; margin: 0; flex: 0 0 auto; accent-color: var(--brand);
}
.check { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 500; font-size: 0.95rem; cursor: pointer; }
.check-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; }

fieldset { border: 1px solid var(--rule-strong); border-radius: var(--r-tile); padding: 0.9rem 1rem 1rem; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: 0.9rem; padding: 0 0.35rem; }

input[type="file"] {
  font: inherit; font-size: 0.92rem; color: var(--ink-2); width: 100%;
  padding: 1rem; border: 1.5px dashed var(--ctl-border); border-radius: var(--r-tile); background: var(--ground);
}
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--ink);
  margin-right: 0.9rem; padding: 0.55rem 0.95rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--ctl-border); border-radius: var(--r-ctl);
}
input[type="file"]:hover { border-color: var(--brand); }
input[type="file"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.form-stack--wide { max-width: none; }
.form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.filter-inline { margin: 0 0 1.5rem; max-width: 24rem; }
.inline-controls { display: flex; gap: 0.5rem; }
.inline-controls input { flex: 1; min-width: 0; }
.regenerate { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.regenerate .actions { margin-top: 0.75rem; }

/* ─── alerts and the live status line ─────────────────────────────────── */

.alert {
  display: block; margin: 0 0 1.5rem;
  padding: 0.85rem 1rem 0.85rem 1.05rem;
  border: 1px solid var(--info-edge); border-left-width: 4px; border-radius: var(--r-ctl);
  background: var(--info-bg); color: var(--ink); font-size: 0.95rem;
}
.alert-title { display: block; font-weight: 650; margin-bottom: 0.15rem; }
.alert a { font-weight: 600; }
.alert--info { border-color: var(--info-edge); background: var(--info-bg); }
.alert--success { border-color: var(--ok-edge); background: var(--ok-bg); }
.alert--warning { border-color: var(--warn-edge); background: var(--warn-bg); }
.alert--error { border-color: var(--error-edge); background: var(--error-bg); }
.alert > :last-child { margin-bottom: 0; }

/* .status is filled by the scripts; empty it takes no room, so the live region can
   stay in the tree (an element shown only when it has text may not be announced). */
.status { margin: 0; font-size: 0.92rem; color: var(--ink-2); }
.status:empty { display: block; height: 0; overflow: hidden; }
.status:not(:empty) {
  padding: 0.6rem 0.85rem; border-radius: var(--r-ctl);
  border-left: 4px solid var(--info-edge); background: var(--info-bg); color: var(--ink);
}
.status.error:not(:empty) { border-left-color: var(--error-edge); background: var(--error-bg); color: var(--ink); }
.status.error:not(:empty)::before { content: "Error: "; font-weight: 650; color: var(--error); }

/* ─── cards and sections ──────────────────────────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-card);
  padding: 1.6rem 1.75rem;
}
.page .card, .page .empty, .page .table-wrap { margin-bottom: 1.5rem; }
.layout-split > aside.card { margin-bottom: 0; }
.stack-gap { margin-top: 1rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.card-lead { color: var(--ink-2); margin: -0.4rem 0 1.1rem; font-size: 0.95rem; }
.card--danger { border-color: color-mix(in srgb, var(--terra) 55%, var(--rule)); }
.card--danger h2 { color: var(--error); }
.card--plain { background: transparent; }
@media (max-width: 640px) { .card { padding: 1.25rem 1.1rem; border-radius: var(--r-tile); } }

.confirm-box {
  margin-top: 1rem; padding: 1rem 1.1rem; border-radius: var(--r-tile);
  background: var(--error-bg); border: 1px solid color-mix(in srgb, var(--error-edge) 60%, transparent);
}
.confirm-box > p:first-child { margin-top: 0; }

.layout-split { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.layout-split > aside { position: sticky; top: 5rem; }
@media (max-width: 960px) {
  .layout-split { grid-template-columns: 1fr; gap: 1.5rem; }
  .layout-split > aside { position: static; }
  /* after a search, the results come first on narrow screens (E2E usability finding) */
  .layout-split--results-first > section { order: -1; }
}
.only-narrow { display: none; }
@media (max-width: 960px) { .only-narrow { display: inline-flex; } }

/* ─── chips ────────────────────────────────────────────────────────────── */

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.65rem; border-radius: var(--r-pill);
  font-size: 0.82rem; font-weight: 500; line-height: 1.5;
  background: var(--ground-alt); color: var(--ink); border: 1px solid var(--rule-strong);
  overflow-wrap: anywhere;
}
.chip--brand { background: var(--brand-pale); color: var(--brand-pale-ink); border-color: transparent; font-weight: 600; }
.chip--outline { background: transparent; border-color: var(--rule-strong); color: var(--ink-2); }
.chip--mode-remote::before, .chip--mode-hybrid::before, .chip--mode-onsite::before {
  content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor;
}
.chip--mode-hybrid::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); border: 1px solid currentColor; }
.chip--mode-onsite::before { background: transparent; border: 1.5px solid currentColor; }

/* ─── listing cards (matches, search, saved-search runs) ──────────────── */

.result-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.result-count { margin: 0; font-weight: 600; }
.result-count a { font-weight: 500; margin-left: 0.5rem; }

.listing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.listing {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 1.25rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-tile);
  padding: 1.15rem 1.3rem;
  transition: border-color .15s ease;
}
.listing:hover { border-color: var(--sand-line); }
.listing-title { grid-column: 1; margin: 0; font-size: 1.06rem; line-height: 1.35; overflow-wrap: anywhere; }
.listing-title a { color: var(--ink); text-decoration: none; }
.listing-title a:hover { color: var(--brand-ink); text-decoration: underline; }
.listing-title a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.listing-org { grid-column: 1; margin: 0; color: var(--ink-2); font-size: 0.92rem; overflow-wrap: anywhere; }
.listing-score { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.listing-facts {
  grid-column: 1 / -1; list-style: none; margin: 0.45rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem;
  font-size: 0.88rem; color: var(--ink-2);
}
.listing-facts li { display: inline-flex; align-items: center; gap: 0.3rem; }
.fact-label { font-weight: 600; color: var(--ink); }
.listing-summary {
  grid-column: 1 / -1; margin: 0.65rem 0 0; padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--brand); background: var(--ground);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  font-size: 0.92rem; color: var(--ink); overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .listing { padding: 1rem; grid-template-columns: minmax(0, 1fr); }
  .listing-score { grid-column: 1; grid-row: auto; order: -1; justify-self: start; }
}

/* The score badge: the number is always written out; fill and outline only reinforce
   it. >= 70 high (solid sand-gold, night-blue number 10.22:1), 40-69 middle (gold
   outline, gold number 8.93:1), below 40 low (grey outline, sand-grey number 8.26:1),
   not scored (dashed). TenderYeti's dashboard uses the same 70/40 steps. */
.score {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 4.1rem; padding: 0.35rem 0.6rem; border-radius: var(--r-tile);
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-2);
  line-height: 1.1; text-align: center;
}
.score-n { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.score-l { font-family: var(--mono); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.1rem; }
.score--high { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 0 16px -6px var(--brand-glow); }
.score--mid { background: var(--surface); border: 1.5px solid var(--brand); color: var(--brand-ink); }
.score--low { background: transparent; border-color: var(--ctl-border); color: var(--ink-2); }
.score--none { border-style: dashed; border-color: var(--ctl-border); background: transparent; color: var(--ink-2); }
.score--none .score-n { font-size: 0.8rem; font-weight: 600; }

/* ─── table (saved searches) ──────────────────────────────────────────── */

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-tile); background: var(--surface); }
.table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.8rem 1rem; border-bottom: 1px solid var(--rule); }
.table thead th {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-2); background: var(--ground-alt); white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #1B2A5C; }   /* #C2BBAE on it 7.19 */
.table td a { font-weight: 600; }
.nowrap { white-space: nowrap; }

/* ─── definition lists ────────────────────────────────────────────────── */

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.55rem 1.5rem; margin: 0; }
.facts dt { font-weight: 600; color: var(--ink-2); font-size: 0.9rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; gap: 0.1rem; }
  .facts dd { margin-bottom: 0.6rem; }
}

/* ─── CV profile view ─────────────────────────────────────────────────── */

.profile-headline {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.25; margin: 0 0 0.35rem; color: var(--ink);
}
.profile-sub { color: var(--ink-2); margin: 0 0 1.4rem; }
.profile-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.1rem 2rem; margin: 0 0 1.5rem; }
.profile-groups dt {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 0.45rem;
}
.profile-groups dd { margin: 0; }
.subhead { font-size: 1rem; margin: 1.6rem 0 0.75rem; }
.file-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.badge {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: var(--r-pill);
  font-size: 0.8rem; font-weight: 600; border: 1px solid var(--rule-strong); color: var(--ink-2);
}
.badge--ok { background: var(--ok-bg); border-color: var(--ok-edge); color: var(--ok); }
.badge--warn { background: var(--warn-bg); border-color: var(--warn-edge); color: var(--warn); }
.badge--error { background: var(--error-bg); border-color: var(--error-edge); color: var(--error); }

/* ─── pager ────────────────────────────────────────────────────────────── */

.pager { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 1.75rem; }
.pager-current { font-size: 0.9rem; color: var(--ink-2); padding: 0 0.5rem; }

/* ─── empty states: the camel waits for something to carry ─────────────── */

.empty {
  text-align: center; padding: 2.75rem 1.5rem;
  background: var(--surface); border: 1.5px dashed var(--rule-strong); border-radius: var(--r-card);
}
/* The camel is /static/camel.svg used as a MASK, so its colour is a token (and
   CanvasText in forced colours). Decorative: the span is aria-hidden. */
.empty-mark {
  display: block; width: 4.5rem; height: 3.75rem; margin: 0 auto 1rem;
  background: var(--brand);
  -webkit-mask: url("/static/camel.svg") center / contain no-repeat;
  mask: url("/static/camel.svg") center / contain no-repeat;
}
.empty .eyebrow { justify-content: center; }
.empty h2, .empty h3 { margin-bottom: 0.4rem; }
.empty p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 1.25rem; }
.empty .actions { justify-content: center; margin-top: 0; }

/* ─── motion ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  form[aria-busy="true"] .btn[type="submit"]::before { animation: none; border-right-color: currentColor; opacity: 0.6; }
}

/* High-contrast / forced colours: keep the boundaries the tints drew. */
@media (forced-colors: active) {
  .chip, .score, .alert, .status:not(:empty), .card, .listing { border: 1px solid CanvasText; }
  .wordmark-mark::before, .eyebrow::before, .empty-mark { background: CanvasText; }
}

/* Multi-select filters in the search side panel (work mode, engagement). */
.checks { display: grid; gap: 0.45rem; }
.checks .help { margin: 0.2rem 0 0; }

/* ─── admin area (/app/admin) ──────────────────────────────────────────── */
/* Built from the tokens above only: the sub-nav repeats the site-nav grammar, the stat
   tiles are small cards, row actions are compact forms. */

.admin-nav { margin: -0.5rem 0 1.75rem; border-bottom: 1px solid var(--rule); }
.admin-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.admin-nav a {
  display: inline-block; padding: 0.5rem 0.75rem; font-size: 0.92rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none; border-radius: var(--r-ctl) var(--r-ctl) 0 0;
}
.admin-nav a:hover { color: var(--ink); background: var(--ground-alt); }
.admin-nav a[aria-current="page"] { color: var(--brand-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--brand); }
/* second tab bar of the Scraping area (Fetch · Sources · Runs · Scoring) */
.admin-subnav { margin: -1rem 0 1.5rem; border-bottom: 0; }
.admin-subnav ul { gap: 0.4rem; }
.admin-subnav a {
  padding: 0.35rem 0.85rem; font-size: 0.88rem; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface);
}
.admin-subnav a[aria-current="page"] { box-shadow: none; border-color: var(--brand); background: var(--ground-alt); }
.table tr.row-current td { background: var(--ground-alt); }
.err-more summary { cursor: pointer; }
.err-more[open] summary { margin-bottom: 0.3rem; }

.stat-grid { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.75rem; }
.stat {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-tile);
  padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.stat-n { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-l { font-family: var(--mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.stat-s { font-size: 0.85rem; color: var(--ink-2); }
.stat--warn { border-color: var(--warn-edge); background: var(--warn-bg); }
.stat--error { border-color: var(--error-edge); background: var(--error-bg); }

.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: flex-start; }
.row-actions form { margin: 0; display: inline-flex; flex-direction: column; gap: 0.3rem; }
.row-actions .status:not(:empty) { max-width: 22rem; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .err { color: var(--error); overflow-wrap: anywhere; max-width: 28rem; }
.code-area { font-family: var(--mono); font-size: 0.85rem; min-height: 28rem; }
.pre-text {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 0.9rem 1rem;
  background: var(--ground); border: 1px solid var(--rule); border-radius: var(--r-tile); font-size: 0.92rem;
}
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; }
.filter-row .field { min-width: 12rem; }
.inline-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }

/* ─── right-to-left (Arabic app and sign-in pages, dir="rtl") ─────────────
 * NE (2026-11-16): the rules above that name a physical side, mirrored. Flex and grid
 * rows follow the direction by themselves. */
[dir="rtl"] .skip { left: auto; right: -999px; }
[dir="rtl"] .skip:focus { right: 0.5rem; }
[dir="rtl"] .head-menu { margin-left: 0; margin-right: auto; }
@supports selector(::details-content) {
  @media (min-width: 900px) {
    [dir="rtl"] .site-head:not(.site-head--public) .head-menu { margin-right: 0; }
  }
}
[dir="rtl"] select { padding-right: 0.75rem; padding-left: 2rem; }
[dir="rtl"] input[type="file"]::file-selector-button { margin-right: 0; margin-left: 0.9rem; }
[dir="rtl"] .alert { border-left-width: 1px; border-right-width: 4px; padding: 0.85rem 1.05rem 0.85rem 1rem; }
[dir="rtl"] .status:not(:empty) { border-left: 0; border-right: 4px solid var(--info-edge); }
[dir="rtl"] .status.error:not(:empty) { border-right-color: var(--error-edge); }
[dir="rtl"] .result-count a { margin-left: 0; margin-right: 0.5rem; }
[dir="rtl"] .listing-summary { border-left: 0; border-right: 3px solid var(--brand); border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }
[dir="rtl"] .table td.num, [dir="rtl"] .table th.num { text-align: left; }
