/* ==========================================================================
   Industry — design system tokens and component classes.
   Ported from the Claude Design project "Industry"
   (_ds/industry-eaf70cb2-2c71-45ce-b0bb-f2eb2a1c4d53/styles.css) plus its
   theme-dark.css variant. This file is the source of truth for the look;
   retune the tokens here and every page follows.

   Industry is a wireframe: steel-blue on a light technical ground, Barlow
   Condensed headings over Barlow, a modular grid, and cards/figures/buttons
   framed as blueprint objects — square-cornered, hairline-bordered, with "+"
   registration marks at the corners.

   Fonts are SELF-HOSTED (latin woff2 subsets), not pulled from Google Fonts.
   The upstream sheet opens with an @import from fonts.googleapis.com; that is
   deliberately dropped here. See the sprint-98 note at the top of ledger.css:
   loading webfonts off-origin pushed FCP 1.6s -> 4.0s on throttled mobile.
   ========================================================================== */

/* ---------- Fonts (local, OFL) ---------- */
@font-face{font-family:"Barlow";src:url("../fonts/barlow-400-latin.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Barlow";src:url("../fonts/barlow-500-latin.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:"Barlow";src:url("../fonts/barlow-700-latin.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:"Barlow Condensed";src:url("../fonts/barlowcond-500-latin.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:"Barlow Condensed";src:url("../fonts/barlowcond-600-latin.woff2") format("woff2");font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:"Barlow Condensed";src:url("../fonts/barlowcond-700-latin.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap}

/* ---------- Tokens ---------- */
:root {
  --color-bg: #f2f2f3;
  --color-surface: #e9e9ea;
  --color-text: #1d1f20;
  --color-accent: #5980a6;
  --color-accent-2: #728fab;
  --color-divider: color-mix(in srgb, #1d1f20 16%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f5f5f8;
  --color-neutral-200: #e7e7ea;
  --color-neutral-300: #d4d4d7;
  --color-neutral-400: #b7b7ba;
  --color-neutral-500: #98989b;
  --color-neutral-600: #7a7a7d;
  --color-neutral-700: #5d5d60;
  --color-neutral-800: #424244;
  --color-neutral-900: #2b2b2d;
  /* A scrim must always DARKEN the page behind it. The neutral ramp is
     mirrored in the dark theme, so deriving it from --color-neutral-900
     turned the overlay white and washed the whole page out. Fixed ink. */
  --scrim: rgba(23, 25, 26, .5);

  --color-accent-100: #eef6ff;
  --color-accent-200: #d6ebff;
  --color-accent-300: #b5d9fd;
  --color-accent-400: #94bce3;
  --color-accent-500: #749dc4;
  --color-accent-600: #597ea3;
  --color-accent-700: #416180;
  --color-accent-800: #2c455d;
  --color-accent-900: #1d2d3d;

  --color-accent-2-100: #eef6ff;
  --color-accent-2-200: #d6ebff;
  --color-accent-2-300: #bdd8f2;
  --color-accent-2-400: #9ebbd8;
  --color-accent-2-500: #7e9cb8;
  --color-accent-2-600: #627d98;
  --color-accent-2-700: #486077;
  --color-accent-2-800: #314457;
  --color-accent-2-900: #1f2d3a;

  --font-heading: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Barlow", system-ui, -apple-system, Helvetica, Arial, sans-serif;

  --space-1: 3.4px;
  --space-2: 6.8px;
  --space-3: 10.2px;
  --space-4: 13.6px;
  --space-6: 20.4px;
  --space-8: 27.2px;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 7px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, ambient darkness on a dark one. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2b2b2d 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2b2b2d 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2b2b2d 22%, transparent);
}

/* ---------- Dark variant ----------
   Applied by js/theme.js, which stamps data-theme on <html> before first
   paint from the saved choice or the OS preference. The accent ramp is an
   exact mirror (100<->900, 200<->800, 300<->700, 500 fixed): accent-700 as
   text on the ground becomes light steel on dark; accent-700/800/900 as a
   fill paired with color:var(--color-bg) becomes a light fill with dark
   type; accent-100/200 tints with accent-900 type become dark tints with
   light type. Every accent use in this system falls into one of those three
   pairs, so the mirror holds. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #17191a;
  /* Recessed, not raised — the surface sits below the ground on dark. */
  --color-surface: #121314;
  --color-text: #eceded;
  --color-accent: #8fb3d4;
  --color-accent-2: #8fb3d4;
  --color-divider: color-mix(in srgb, #eceded 18%, transparent);

  --color-neutral-100: #2b2b2d;
  --color-neutral-200: #424244;
  --color-neutral-300: #5d5d60;
  --color-neutral-400: #7a7a7d;
  --color-neutral-500: #98989b;
  --color-neutral-600: #b7b7ba;
  --color-neutral-700: #d4d4d7;
  --color-neutral-800: #e7e7ea;
  --color-neutral-900: #f5f5f8;
  --scrim: rgba(0, 0, 0, .62);

  --color-accent-100: #1d2d3d;
  --color-accent-200: #2c455d;
  --color-accent-300: #416180;
  --color-accent-400: #597ea3;
  --color-accent-500: #749dc4;
  --color-accent-600: #94bce3;
  --color-accent-700: #b5d9fd;
  --color-accent-800: #d6ebff;
  --color-accent-900: #eef6ff;

  --color-accent-2-100: #1f2d3a;
  --color-accent-2-200: #2c4459;
  --color-accent-2-300: #41617e;
  --color-accent-2-400: #597ea1;
  --color-accent-2-500: #749dc2;
  --color-accent-2-600: #94bce1;
  --color-accent-2-700: #b5d9fb;
  --color-accent-2-800: #d6ebfd;
  --color-accent-2-900: #eef6ff;

  /* On a dark ground elevation reads as ambient depth, not an ink-tinted
     drop shadow. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 3px 12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 14px 38px rgba(0, 0, 0, .62);
}

/* The duotone wash is tuned to a light ground; on dark it must lighten
   rather than multiply so photographs do not go to mud. */
:root[data-theme="dark"] .duotone::after { mix-blend-mode: soft-light; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.55; font-weight: 400;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-900); }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* ---------- Blueprint frame ----------
   The wireframe object every card, figure and primary button wears:
   .blueprint + four <i class="corner tl|tr|bl|br"> children. */
.blueprint {
  position: relative;
  border: 1px solid var(--color-divider);
  border-radius: 0;
}
/* The overlay image treatments clip their overlay (overflow:hidden); a
   blueprint wrapper draws its marks outside the box, so when both classes
   share a wrapper the frame must win. */
.blueprint.halftone, .blueprint.plate, .blueprint.duotone { overflow: visible; }
.blueprint > .corner {
  position: absolute; width: 11px; height: 11px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.blueprint > .corner::before, .blueprint > .corner::after {
  content: ""; position: absolute; background: currentColor;
}
.blueprint > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.blueprint > .corner::after  { top: 5px; left: 0; width: 100%; height: 1px; }
.blueprint > .corner.tl { top: -6px; left: -6px; }
.blueprint > .corner.tr { top: -6px; right: -6px; }
.blueprint > .corner.bl { bottom: -6px; left: -6px; }
.blueprint > .corner.br { bottom: -6px; right: -6px; }

.duotone { position: relative; overflow: hidden; }
.duotone::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--color-accent); mix-blend-mode: color;
}

/* ---------- Rules ---------- */
.hr { height: 1px; border: 0; margin: var(--space-4) 0; background: var(--color-divider); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); color: var(--color-bg); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent-700); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* ---------- Forms ---------- */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
  background: transparent; border: 0; color: inherit; font-family: inherit;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked),
.seg-opt[aria-pressed="true"] { background: var(--color-accent-700); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):not([aria-pressed="true"]):hover {
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* ---------- Cards ---------- */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent-700); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent-700); }

/* ---------- Navigation ---------- */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent-700); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* ---------- Dialog ---------- */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: var(--space-4); overflow: auto;
  background: var(--scrim);
}
.dialog {
  width: min(560px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-bg); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ---------- Blueprint override ----------
   Components are wireframe objects: square, transparent, hairline-bordered.
   The solid accent primary button is the one deliberate exception. */
.card, .btn, .input, .tag, .seg, .dialog { border-radius: 0; }
.card, .dialog { background: transparent; border: 1px solid var(--color-divider); }
.dialog { background: var(--color-bg); }
.btn { border: 1px solid var(--color-divider); }
.btn-primary { border-color: var(--color-accent); }
.btn-ghost { border-color: transparent; }

/* ==========================================================================
   Site layer — patterns the artboards use that are not in the DS component
   sheet: the page shell, the site header, the worklog row, the meter strip
   and the blueprint FAB. Named nx-* so they never collide with the DS
   classes above or with the ledger classes still in play on other pages.
   ========================================================================== */

.nx-page { min-height: 100vh; font-family: var(--font-body); color: var(--color-text); font-size: 15px; }
.nx-wrap { max-width: 1720px; margin: 0 auto; padding: clamp(18px, 3vw, 34px) clamp(14px, 4vw, 40px) 80px; }
.nx-wrap-narrow { max-width: 1240px; }

/* — site header — */
.nx-head {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 13px clamp(14px, 4vw, 40px);
  border-bottom: 1px solid var(--color-divider);
}
/* Brand lockup, matching the artboards: uppercase at 0.08em beside a plain
   solid accent square. The first pass drew the mark outlined-with-an-inset;
   every board actually uses the flat square. */
.nx-brand {
  font-family: var(--font-heading); font-weight: 700; font-size: 19px;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-right: auto; text-decoration: none;
  color: var(--color-text); display: flex; align-items: center; gap: 10px;
}
.nx-brand:hover { color: var(--color-text); }
.nx-mark {
  display: inline-block; width: 13px; height: 13px;
  background: var(--color-accent-700); flex: none;
}
.nx-nav {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  font-family: var(--font-heading); font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.nx-nav a { text-decoration: none; color: color-mix(in srgb, var(--color-text) 78%, transparent); }
.nx-nav a:hover { color: var(--color-text); }
.nx-nav a[aria-current="page"] {
  color: var(--color-text); border-bottom: 2px solid var(--color-accent); padding-bottom: 2px;
}

/* — the thin rule strip above the masthead (publication metadata) — */
.nx-strip {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between;
  padding: 7px clamp(14px, 4vw, 40px);
  border-bottom: 1px solid var(--color-divider);
  font-family: var(--font-heading); font-size: 11.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.nx-strip a { color: inherit; text-decoration: none; }
.nx-strip a:hover { color: var(--color-accent-700); }
.nx-strip .nx-cur { color: var(--color-text); }

/* — section kickers and page heads — */
.nx-kicker {
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}
.nx-kicker-accent { color: var(--color-accent-700); }
.nx-pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 22px; flex-wrap: wrap; padding-bottom: 11px;
  border-bottom: 1px solid var(--color-text);
}
.nx-pagehead h1 { font-size: clamp(30px, 4.6vw, 46px); margin: 0; text-transform: uppercase; letter-spacing: 0.005em; }
.nx-lede { margin: 0; max-width: 52ch; font-size: 14px; line-height: 1.5; color: color-mix(in srgb, var(--color-text) 78%, transparent); }
.nx-sechead {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid var(--color-text);
}
.nx-sechead h2 { font-size: 20px; margin: 0; text-transform: uppercase; }
.nx-note { font-size: 12px; line-height: 1.6; color: color-mix(in srgb, var(--color-text) 78%, transparent); }

/* — worklog / ledger rows — */
.nx-log { list-style: none; margin: 0; padding: 0; }
.nx-lrow {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; width: 100%;
  padding: 11px 8px 11px 4px;
  border: 0; border-bottom: 1px solid var(--color-divider);
  background: transparent; font: inherit; text-align: left; color: inherit;
}
button.nx-lrow { cursor: pointer; }
.nx-lrow:hover { background: color-mix(in srgb, var(--color-accent) 6%, transparent); }
.nx-lrow:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.nx-ts {
  flex: 0 0 104px; font-family: var(--font-heading); font-variant-numeric: tabular-nums;
  font-size: 13.5px; letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--color-text) 78%, transparent); text-align: left;
}
.nx-ag {
  flex: 0 0 90px; font-family: var(--font-heading); font-size: 11px;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--color-accent-700); text-align: left;
}
.nx-ms { flex: 1 1 240px; min-width: 180px; text-align: left; line-height: 1.45; font-size: 14px; }
.nx-badge {
  flex: 0 0 auto; margin-left: auto; font-family: var(--font-heading); font-size: 11px;
  letter-spacing: 0.09em; text-transform: uppercase; padding: 2px 9px; white-space: nowrap;
  background: transparent; border: 1px solid var(--color-divider);
  color: color-mix(in srgb, var(--color-text) 82%, transparent);
}
.nx-badge-held {
  background: var(--color-accent-100); color: var(--color-accent-900);
  border: 1px dashed var(--color-accent-700);
}
.nx-badge-esc {
  background: var(--color-accent-800); color: var(--color-bg);
  border: 1px solid var(--color-accent-800);
}

/* — meter strip — */
.nx-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.nx-meter { padding: 13px 14px; }
.nx-meter-label {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}
.nx-meter-value {
  font-family: var(--font-heading); font-size: 34px; line-height: 1.05;
  font-variant-numeric: tabular-nums; margin-top: 4px;
}
.nx-meter-sub { font-size: 12px; color: color-mix(in srgb, var(--color-text) 70%, transparent); margin-top: 3px; }

/* — grids — */
.nx-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.nx-grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* — toggle switch (role=switch rows) — */
.nx-switch {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 1px solid var(--color-divider);
  background: transparent; color: inherit; font: inherit; font-size: 13.5px;
  cursor: pointer; text-align: left; border-radius: 0;
}
.nx-switch:hover:not(:disabled) { background: color-mix(in srgb, var(--color-accent) 7%, transparent); }
.nx-switch:disabled { opacity: .45; cursor: not-allowed; }
.nx-switch:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.nx-switch-track {
  flex: none; width: 30px; height: 14px; border: 1px solid var(--color-accent-700);
  position: relative; background: transparent;
}
.nx-switch-track::after {
  content: ""; position: absolute; top: 1px; left: 1px; width: 12px; bottom: 1px;
  background: color-mix(in srgb, var(--color-text) 40%, transparent);
  transition: left .12s linear, background .12s linear;
}
.nx-switch[aria-checked="true"] .nx-switch-track::after { left: 15px; background: var(--color-accent-700); }
.nx-switch-word {
  font-family: var(--font-heading); font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 78%, transparent);
}
.nx-switch-hint { margin-left: auto; font-size: 11.5px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
@media (prefers-reduced-motion: reduce) { .nx-switch-track::after { transition: none; } }

/* — empty / dashed state boxes — */
.nx-empty {
  border: 1px dashed var(--color-divider); padding: 22px;
  font-size: 14px; line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}

/* — the live dot and fresh-row animations — */
@keyframes nx-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes nx-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes nx-sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
.nx-fresh { animation: nx-in .45s ease-out; }
.nx-dot {
  width: 7px; height: 7px; background: var(--color-accent-700);
  display: inline-block; animation: nx-blink 1.6s ease-in-out infinite;
}
.nx-sweep { animation: nx-sweep 1.4s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .nx-fresh, .nx-dot, .nx-sweep { animation: none; }
}

/* — floating action menu (square blueprint object) — */
.nx-fab { position: fixed; right: 18px; bottom: 18px; z-index: 80; }
.nx-fab-btn {
  width: 46px; height: 46px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--color-accent-700); border-radius: 0;
  background: var(--color-accent); color: var(--color-bg); cursor: pointer;
  box-shadow: var(--shadow-md); transition: background .12s linear;
}
.nx-fab-btn:hover { background: var(--color-accent-700); }
.nx-fab-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.nx-fab-panel {
  position: absolute; right: 0; bottom: 58px; width: min(268px, calc(100vw - 36px));
  padding: 14px; background: var(--color-bg); box-shadow: var(--shadow-lg);
}
.nx-fab-title {
  font-family: var(--font-heading); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 70%, transparent);
  margin-bottom: 9px;
}
.nx-fab-list { list-style: none; margin: 0; padding: 0; }
.nx-fab-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 6px;
  text-decoration: none; color: var(--color-text); font-size: 14px;
}
.nx-fab-item:hover { background: var(--color-accent-100); color: var(--color-text); }
.nx-fab-item:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.nx-fab-item .nx-mark { width: 9px; height: 9px; }
.nx-fab-foot {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--color-divider);
  font-size: 11.5px; color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
@media (prefers-reduced-motion: reduce) { .nx-fab-btn { transition: none; } }
@media print { .nx-fab { display: none; } }

/* — theme toggle — */
/* padding:0 is load-bearing, not tidiness: css/ledger-blog.css styles the bare
   `button` element with padding:10px 18px, which on blog and demo pages
   collapsed this 32px box's content area and clipped the icon out of sight. */
.nx-theme-btn {
  width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--color-divider); border-radius: 0;
  background: transparent; color: var(--color-text); cursor: pointer; flex: none;
  font: inherit;
}
/* Pages with no header furniture to hang the control off (the two standalone
   demo pages: a bare <header> holding a heading and a paragraph) get it as a
   fixed control, so no page is left without a way to switch theme. It sits
   top-right; the FAB is bottom-right, so they never collide. */
.nx-theme-btn-float {
  position: fixed; top: 12px; right: 12px; z-index: 60;
  background: var(--color-bg);
}

.nx-theme-btn:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.nx-theme-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.nx-theme-btn .nx-sun { display: none; }
:root[data-theme="dark"] .nx-theme-btn .nx-sun { display: block; }
:root[data-theme="dark"] .nx-theme-btn .nx-moon { display: none; }
