/* ============================================================================
   LoopCore — design tokens

   The Loop. palette as of 9 Oct 2026 — ink black and Electric Indigo, the same
   brand as weclosetheloop.studio — on both grounds. Markup names the job, never the
   colour: there are two grounds here, so a rule that says "bone" is a bug waiting
   for somebody to press the theme switch.

   Dark is the default. Light is a choice, remembered in localStorage under
   loop:theme and applied by the inline script in the layout head BEFORE first
   paint — read it later and every page paints ink and then flips.
   ========================================================================= */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/inter-latin-400-500.woff2") format("woff2");
}

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

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-mono-var-latin.woff2") format("woff2-variations"), url("/fonts/geist-mono-var-latin.woff2") format("woff2");
}

/* LoopCore theme, 5 Nov 2026 (owner approved). Light: white page, black ink, one black
   inverse card. Dark: true black with blue light. The old --color-* names stay, so every
   screen written against them follows; the new names below are for the shell and cards.
   The tower canvases on the dashboard keep the old palette on purpose: see .dash-tower
   in theme.css. */
:root {
  /* Fixed marks. Signal is the FILL colour and carries white text (4.9:1 or better on
     both grounds); text that needs the brand colour uses --color-accent instead. */
  --color-ink: #0a0a0b;
  --color-bone: #fafafa;
  --color-signal: #3563f5;
  --color-slate: #6b6b74;
  --color-mist: #d4d4d8;

  /* Dark ground: black, with surfaces stepping up in lightness instead of borders. */
  --color-page: #000000;
  --color-body: #ffffff;
  --color-muted: #b4b4bc;
  --color-faint: #82828c;
  --color-line: #1f1f24;
  --color-line-strong: #2c2c32;
  --color-raised: rgb(255 255 255 / 0.05);
  --color-raised-2: rgb(255 255 255 / 0.08);
  --color-accent: #8ab0ff;

  --color-ok: #4ade80;
  --color-warn: #fbbf24;
  --color-breach: #f87171;
  --color-ok-bg: rgb(74 222 128 / 0.12);
  --color-warn-bg: rgb(251 191 36 / 0.12);
  --color-breach-bg: rgb(248 113 113 / 0.13);

  --bg-2: #050506;
  --surface: #0d0d10;
  --surface-2: #141417;
  --hover: #1b1b1f;
  --solid: #ffffff;
  --on-solid: #0a0a0b;
  --ai-1: #3b82f6;
  --ai-2: #5b8cff;
  --ai-3: #8b7bff;
  --ai-wash: linear-gradient(135deg, rgb(59 130 246 / 0.13), rgb(91 140 255 / 0.09) 60%, rgb(139 123 255 / 0.07));
  --inv-bg: radial-gradient(120% 160% at 0% 0%, #103070 0%, #0a1840 40%, #050812 100%);
  --inv-field: #060b1c;
  --inv-ink: #fafafa;
  --inv-2: #a6a8ba;
  --inv-line: rgb(91 140 255 / 0.2);
  --glow: rgb(59 130 246 / 0.42);
  --sh-1: 0 0 0 1px rgb(255 255 255 / 0.01);
  --sh-2: 0 0 0 1px rgb(255 255 255 / 0.04), 0 16px 40px -8px rgb(0 0 0 / 0.7);
  --sh-pop: 0 0 0 1px rgb(255 255 255 / 0.08), 0 24px 64px -8px rgb(0 0 0 / 0.8);
  --edge: inset 0 1px 0 rgb(255 255 255 / 0.06);
  --sheen: 0.035;
  --scrim: rgb(0 0 0 / 0.62);

  --font-display: "Inter Var", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Inter Var", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", "Consolas", monospace;

  --shell-nav: 15rem;
  --radius: 10px;
  --r-card: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
}

:root[data-theme="light"] {
  --color-signal: #4c5bff;
  --color-page: #ffffff;
  --color-body: #0a0a0b;
  --color-muted: #52525b;
  --color-faint: #71717a;
  --color-line: #ededf0;
  --color-line-strong: #e1e1e6;
  --color-raised: rgb(10 10 11 / 0.03);
  --color-raised-2: rgb(10 10 11 / 0.06);
  --color-accent: #3b49e6;

  --color-ok: #15803d;
  --color-warn: #b45309;
  --color-breach: #d92d20;
  --color-ok-bg: #ecfdf3;
  --color-warn-bg: #fff6e5;
  --color-breach-bg: #fef1f0;

  --bg-2: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --hover: #f3f3f5;
  --solid: #0a0a0b;
  --on-solid: #ffffff;
  --ai-wash: linear-gradient(135deg, #f0f4ff, #f3f2ff 60%, #f6f2ff);
  --inv-bg: #0a0a0b;
  --inv-field: #151517;
  --inv-line: #26262b;
  --inv-2: #a1a1aa;
  --glow: rgb(76 91 255 / 0.22);
  --sh-1: 0 1px 2px rgb(10 10 11 / 0.04);
  --sh-2: 0 1px 2px rgb(10 10 11 / 0.04), 0 12px 32px -8px rgb(10 10 11 / 0.1);
  --sh-pop: 0 0 0 1px rgb(10 10 11 / 0.06), 0 20px 50px -10px rgb(10 10 11 / 0.18), 0 4px 12px rgb(10 10 11 / 0.05);
  --edge: inset 0 1px 0 rgb(255 255 255 / 0);
  --sheen: 0;
  --scrim: rgb(10 10 11 / 0.32);
}

/* ------------------------------------------------------------------- reset */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

html[data-theme="light"] { color-scheme: light; }

body {
  background: var(--color-page);
  color: var(--color-body);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --------------------------------------------------------------- typography */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1, h2, h3, h4 { font-weight: 400; line-height: 1.2; }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* Uppercase lives here and nowhere else. Everything else is sentence case,
   including buttons and headings. */
.eyebrow {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-faint);
  font-weight: 500;
}

.muted { color: var(--color-muted); }
.faint { color: var(--color-faint); }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.num { font-variant-numeric: tabular-nums; }

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { text-decoration: none; }

/* Focus is visible everywhere. This is a system people use at 03:00 on a
   keyboard, and an invisible focus ring is an accessibility failure before it is
   a usability one. */
:focus-visible {
  outline: 2px solid var(--color-signal);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------------- helpers */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--color-signal);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus { inset-inline-start: 1rem; top: 1rem; }

/* ---------------------------------------------------------- language switch */

.lang-switch { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--color-line); border-radius: var(--radius); overflow: hidden; }
.lang-switch .lang-opt { background: transparent; border: 0; padding: .25rem .55rem; font-size: .75rem; color: var(--color-muted); cursor: pointer; line-height: 1.4; }
.lang-switch .lang-opt + .lang-opt { border-inline-start: 1px solid var(--color-line); }
.lang-switch .lang-opt:hover { color: var(--color-body); }
.lang-switch .lang-opt.is-current { color: var(--color-body); background: var(--color-line); cursor: default; }
.lang-switch-nav { display: flex; margin-bottom: .75rem; }
.lang-switch-nav .lang-opt { flex: 1; }
.lang-switch-login { margin: 1.25rem 0 0; }
@media (max-width: 62rem) { .lang-switch-head { display: none; } }
@media (min-width: 62.0625rem) { .lang-switch-nav { display: none; } }

/* ------------------------------------------- locations, custom fields, approvals (P1a) */

.loc-picker { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.loc-tree { max-height: min(55vh, 28rem); overflow: auto; border: 1px solid var(--color-line); overscroll-behavior: contain; }
.loc-row { display: flex; align-items: center; gap: .4rem; min-height: 2.25rem; border-bottom: 1px solid var(--color-line); padding-inline-end: .5rem; }
.loc-row:last-child { border-bottom: 0; }
.loc-toggle { width: 2rem; height: 2rem; flex: none; border: 0; background: none; color: var(--color-muted); cursor: pointer; }
.loc-toggle:disabled { cursor: default; }
.loc-pick { display: flex; align-items: center; gap: .45rem; flex: 1; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.loc-pick-one { flex: 1; min-width: 0; text-align: start; border: 0; background: none; color: inherit; padding: .45rem 0; cursor: pointer; overflow-wrap: anywhere; }
.loc-pick-one:hover, .loc-pick-one:focus-visible { color: var(--color-accent); }
.loc-kind { font-size: .7rem; flex: none; }
.loc-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.loc-chip { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--color-line); padding: .15rem .45rem; font-size: .78rem; max-width: 100%; overflow-wrap: anywhere; }
.loc-chip button { border: 0; background: none; color: var(--color-muted); cursor: pointer; padding: 0 .15rem; }
.loc-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; margin-bottom: .75rem; }
.loc-actions { gap: .5rem; justify-content: flex-end; }
.loc-filter-wrap { gap: .25rem; min-width: 0; }
.loc-filter { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.approval-state { font-weight: 600; }
.approval-state.late, .wf-late { color: var(--color-breach); }
.setup-list { display: flex; flex-direction: column; gap: 1rem; }
.setup-card { border: 1px solid var(--color-line); padding: 1rem; min-width: 0; }
.setup-card h2 { font-size: 1rem; margin: 0 0 .25rem; }
.setup-card .row { flex-wrap: wrap; gap: .5rem; }
.wf-stage { border-inline-start: 3px solid var(--color-accent); padding-inline-start: .75rem; margin: .5rem 0; }
@media (max-width: 40rem) {
  .loc-filter { max-width: 60vw; }
  .setup-card { padding: .75rem; }
}
