/* The FNW Flow design system, on the web.
 *
 * One product across three surfaces: this desk portal, the customer portal,
 * and the phone app. The tokens below have counterparts in
 * app-universal/ui/theme/Color.kt — change one, change both, or an operator
 * who uses the phone in the field and the desk in the office is looking at
 * two products that happen to share a database.
 *
 * What this is FOR shapes every choice here. It is an instrument panel for
 * someone running a fibre network: they are chasing money that is owed and
 * watching equipment that may be down. So the design serves scanning rather
 * than reading — state readable in shape as well as colour, numbers that line
 * up in columns, and one loud thing per screen rather than six.
 */

/* ── typefaces ───────────────────────────────────────────────────────
 *
 * Self-hosted, not linked from Google. This page holds an operator's session
 * token and its CSP is "default-src 'self'"; a stylesheet from another origin
 * would be the one exception in a page that otherwise has none, and a font is
 * not worth that. Served from the same origin, font-src inherits 'self' and
 * nothing needs relaxing.
 *
 * IBM Plex throughout, in four weights, plus IBM Plex Mono for machine
 * identifiers — account numbers, IPs, serials, MAC addresses, the things a
 * human reads one character at a time.
 *
 * This started as a two-family pairing with Sora carrying the display layer.
 * Sora does not contain U+20B9, the rupee sign. Neither does the "latin"
 * subset Google Fonts serves for anything, which is how the first version of
 * this shipped with the single most-rendered glyph in an Indian ISP's
 * software silently falling back to a system face MID-NUMBER — a ₹ in one
 * typeface against digits in another, on every amount on every screen.
 *
 * So: one superfamily, subset from the upstream IBM/plex sources rather than
 * from a font CDN's idea of "latin", covering Latin, Latin-1, Latin
 * Extended-A, General Punctuation, the whole Currency Symbols block, arrows
 * and a few maths signs. 386 glyphs, ~26KB a face.
 *
 * The display layer is now weight and tracking rather than a second family.
 * Plex is a good enough face to carry that: it is an engineering typeface
 * with real letterforms rather than a neutral one, and its family includes
 * Devanagari, which matters for a product shipping in twelve Indian
 * languages.
 *
 * Indic scripts fall through to the system faces, which every platform this
 * runs on ships. Bundling eight more would cost more than it buys.
 */
@font-face { font-family: "Plex"; src: url("fonts/plex-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/plexmono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --font-display: "Plex", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Plex", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "PlexMono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Ground and ink.
   *
   * The neutrals are pulled a few degrees toward the violet rather than being
   * pure grey. Pure grey beside a saturated accent reads as unconsidered —
   * two palettes sharing a page instead of one. */
  --bg:            #F5F4F9;
  --surface:       #FFFFFF;
  --surface-2:     #FAF9FD;   /* table heads, inputs, inset panels */
  --surface-3:     #F0EEF6;   /* hover ground */
  --ink:           #14111C;
  --ink-2:         #463F57;   /* FNWInk2Light — body copy that is not the headline */
  --dim:           #6A6480;
  --line:          #E7E4EF;
  --line-strong:   #D8D3E4;
  --sunk:          #EFEDF6;   /* FNWSunkLight — the well a search or a segmented control sits in */

  /* The identity. Same violet the phone app uses, and now used the way the
   * phone uses it: on the one thing to press and on where you are. It was
   * also a gradient painted behind the primary button and the sign-in art,
   * which made the colour that means "act" into the colour that means
   * "background". */
  --primary:       #7C3AED;
  --primary-deep:  #5B21B6;   /* violet text on a light ground needs to go darker */
  --primary-ink:   var(--primary-deep);
  --primary-fg:    #FFFFFF;
  --grad-start:    #7C3AED;
  --grad-end:      #A855F7;
  --primary-tint:  rgba(124, 58, 237, 0.08);
  --primary-tint-2:rgba(124, 58, 237, 0.16);

  /* Status. Fill and ink — see Color.kt for why one value cannot do both. */
  --good:          #0B8A5E;
  --good-ink:      #06683F;
  --good-tint:     rgba(11, 138, 94, 0.10);
  --warn:          #C27400;
  --warn-ink:      #8A5200;
  --warn-tint:     rgba(194, 116, 0, 0.12);
  --bad:           #C81E1E;
  --bad-ink:       #A01717;
  --bad-tint:      rgba(200, 30, 30, 0.09);
  /* One blue, not two. The app already has an accent sky; a second blue
   * invented for the web would be a colour that means the same thing and
   * does not match. */
  --sky:           #0EA5E9;   /* FNWAccentSky */
  --teal:          #1DBA9F;   /* FNWAccentTeal */
  --secondary:     #EFEDF6;   /* FNWSecondary — the app's quiet fill */
  --info:          #0369A1;   /* FNWInfo — neither good nor bad news */
  --info-ink:      #075985;
  --info-tint:     rgba(3, 105, 161, 0.10);

  /* The one deep surface: the rail, and the panel that carries the figure a
   * page is for. FNWDeep in the app — the phone's drawer and hero are this
   * same colour, so the product has one dark, not three that nearly match. */
  --deep:          #17122A;
  --deep-raised:   #211A3A;
  --deep-ink:      #F1EDFB;
  --deep-dim:      #A79FC4;
  --deep-edge:     #A78BFA;

  /* Which network a page is about. Our own hues and letters — never a
   * provider's logo or brand colour. FNWNet* in the app. */
  --net-own:       #7C3AED;
  --net-bsnl:      #0369A1;
  --net-airtel:    #4F46E5;
  --net-railwire:  #047857;
  --net-gtpl:      #B45309;
  --net-height8:   #0F766E;
  --net-other:     #475569;

  /* The rail. */
  --rail-bg:       #17122A;
  --rail-bg-2:     #110D20;
  --rail-fg:       #D9D3E8;
  --rail-fg-dim:   #8E85A8;
  /* A warning that has to read on the rail's own deep ground. The page's
   * --warn-ink is mixed for a light surface and disappears against #17122A,
   * which is the whole reason this one exists rather than reusing it. */
  --rail-warn:     #F5B544;
  /* The brand violet at full strength, asked for directly.
   *
   * It is now the same value as the active-page marker, so the heading no
   * longer carries less weight than the destination it heads. That is fine
   * here only because the current page is separated by three other things —
   * a filled background, white text and semibold weight — and not by its
   * stripe alone. Colour was never doing that job by itself. */
  --rail-heading:  #A855F7;
  --rail-rule:     rgba(168, 85, 247, 0.35);
  --rail-line:     rgba(255, 255, 255, 0.07);
  --rail-active:   rgba(255, 255, 255, 0.10);

  /* Elevation. Layered, and tinted toward the violet: a grey shadow under a
   * violet-biased ground reads as dirt rather than depth. */
  --shadow-1: 0 1px 0 rgba(20, 17, 28, 0.04), 0 1px 2px rgba(20, 17, 28, 0.04);
  --shadow-2: 0 1px 0 rgba(20, 17, 28, 0.03), 0 12px 32px -14px rgba(46, 22, 102, 0.22);
  --shadow-3: 0 24px 64px -20px rgba(24, 12, 60, 0.45);
  --ring: 0 0 0 3px var(--primary-tint-2);

  --radius:        18px;
  --radius-lg:     22px;
  --radius-sm:     12px;
  --radius-xs:     9px;
  --radius-pill:   999px;

  --rail-w:        252px;
  /* One curve for the whole product: fast out, long settle. The app's
   * FNWEaseOut and the design canvas use the same one. */
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:   cubic-bezier(0.34, 1.4, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0C0A13;
    --surface:       #15121F;
    --surface-2:     #1A1626;
    --surface-3:     #221C33;
    --sunk:          #100D19;
    --ink:           #EFEBF8;
    --ink-2:         #C9C2DC;
    --dim:           #9B94B3;
    --line:          #262036;
    --line-strong:   #342C48;

    --primary:       #8B5CF6;
    --primary-deep:  #C4B5FD;
    --grad-start:    #7C3AED;
    --grad-end:      #A855F7;
    --primary-tint:  rgba(139, 92, 246, 0.14);
    --primary-tint-2:rgba(139, 92, 246, 0.24);

    /* Lifted, because a colour tuned for white becomes mud on near-black. */
    --good:          #34D399;
    --good-ink:      #6EE7B7;
    --good-tint:     rgba(52, 211, 153, 0.14);
    --warn:          #FBBF24;
    --warn-ink:      #FCD34D;
    --warn-tint:     rgba(251, 191, 36, 0.14);
    --bad:           #F87171;
    --bad-ink:       #FCA5A5;
    --bad-tint:      rgba(248, 113, 113, 0.14);
    --info:          #38BDF8;
    --info-ink:      #7DD3FC;
    --info-tint:     rgba(56, 189, 248, 0.14);

    --deep:          #1C1631;
    --rail-bg:       #100C1C;
    --rail-bg-2:     #17112A;
    --rail-fg:       #D9D3E8;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.40);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.40), 0 8px 20px -6px rgba(0, 0, 0, 0.55);
    --shadow-3: 0 8px 16px rgba(0, 0, 0, 0.45), 0 24px 48px -12px rgba(0, 0, 0, 0.70);
  }
}

:root[data-theme="dark"] {
  --bg: #0C0A13; --surface: #15121F; --surface-2: #1A1626; --surface-3: #221C33; --sunk: #100D19;
  --ink: #EFEBF8; --ink-2: #C9C2DC; --dim: #9B94B3; --line: #262036; --line-strong: #342C48;
  --deep: #1C1631;
  --primary: #8B5CF6; --primary-deep: #C4B5FD;
  --primary-tint: rgba(139,92,246,.14); --primary-tint-2: rgba(139,92,246,.24);
  --good: #34D399; --good-ink: #6EE7B7; --good-tint: rgba(52,211,153,.14);
  --warn: #FBBF24; --warn-ink: #FCD34D; --warn-tint: rgba(251,191,36,.14);
  --bad: #F87171; --bad-ink: #FCA5A5; --bad-tint: rgba(248,113,113,.14);
  --info: #38BDF8; --info-ink: #7DD3FC; --info-tint: rgba(56,189,248,.14);
  --rail-bg: #100C1C; --rail-bg-2: #17112A;
  --shadow-1: 0 1px 2px rgba(0,0,0,.40);
  --shadow-2: 0 2px 4px rgba(0,0,0,.40), 0 8px 20px -6px rgba(0,0,0,.55);
  --shadow-3: 0 8px 16px rgba(0,0,0,.45), 0 24px 48px -12px rgba(0,0,0,.70);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary-deep); text-underline-offset: 2px; }

/* Numbers that mean quantities line up in columns, everywhere, without each
 * page having to remember. */
.num, td.num, th.num, .tile .v, .money { font-variant-numeric: tabular-nums; }

/* ── app frame ────────────────────────────────────────────────────────
 * A rail and a column. The nav used to be seventeen pills wrapping onto two
 * rows above the content, which cost 140px of every screen and told an
 * operator nothing about where they were among seventeen places. */
#app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

.rail {
  background: linear-gradient(180deg, var(--rail-bg) 0%, var(--rail-bg-2) 100%);
  color: var(--rail-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}

/* The operator's own footer line, set in Business details.
 *
 * margin-top:auto pushes it to the bottom of the rail's flex column, so it
 * sits under the menu however short the menu is, rather than floating
 * directly beneath the last item on a tenant with four pages.
 *
 * Dimmed and small: it is a signature, not a control. word-break keeps a
 * long one inside the rail instead of widening it. */
.rail-footer {
  margin: auto 0 0;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--rail-line);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--rail-fg-dim);
  overflow-wrap: anywhere;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--rail-line);
}
.rail-brand .mark { flex: 0 0 auto; display: block; }
/* The product's own mark carries a deep ground of its own, a shade off the
   rail's. Rounded and hairlined so it reads as a mark rather than a patch of
   slightly wrong colour. A tenant's uploaded logo is handled just below. */
.rail-brand svg.mark { border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
/* The tenant's own mark, where they have uploaded one.
 * object-fit so a wide logo is not stretched into a square, and a radius so
 * a square one sits in the same shape the product's mark does. */
.rail-brand .brand-logo { width: 30px; height: 30px; object-fit: contain; border-radius: 7px; }

/* A brand colour too close to the page leaves the primary button as a label
 * floating in space. The gateway works out when that is true; this is what it
 * does about it. */
.brand-edge .btn.primary { border: 1px solid var(--line-strong); }
.rail-brand b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #fff;
  display: block;
  line-height: 1.15;
}
.rail-brand small {
  display: block;
  font-size: 11.5px;
  color: var(--rail-fg-dim);
  font-weight: 400;
  margin-top: 1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

nav { padding: 12px 10px 20px; display: block; }
nav .group { margin-top: 22px; }
nav .group:first-child { margin-top: 4px; }

/* A section heading has to be a landmark, not a footnote.
 *
 * These started at 10.5px in the dimmest colour on the rail, which made them
 * quieter than the items they were supposed to organise — an operator
 * scanning nineteen entries read one undifferentiated column and the grouping
 * did no work at all.
 *
 * Three things fix it without letting a heading compete with a destination:
 * more contrast, wider tracking so short uppercase words read as a label
 * rather than a shouted item, and a rule running out to the rail's edge that
 * says plainly where one group stops and the next begins. The rule fades so
 * it reads as a boundary rather than a border. */
nav .group > h6 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rail-heading);
}
nav .group > h6::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--rail-rule), transparent);
}
nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  margin-bottom: 1px;
  border-radius: var(--radius-xs);
  border: 0;
  background: transparent;
  color: var(--rail-fg);
  opacity: 0.78;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.35;
  transition: background 140ms var(--ease), opacity 140ms var(--ease);
}
nav button:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }
nav button[aria-current="true"] {
  opacity: 1;
  font-weight: 600;
  color: #fff;
  background: var(--rail-active);
  /* Where you are, readable without relying on colour alone. */
  box-shadow: inset 2px 0 0 var(--grad-end);
}
/* A door that opens onto the phone app is dimmer, not hidden. */
nav button[data-soon] { opacity: 0.42; }

.shell { display: flex; flex-direction: column; min-width: 0; }

/* ── top bar ─────────────────────────────────────────────────────────
 * Only the things that are true of every page: who you are, what language,
 * and the way out. Navigation lives in the rail. */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 26px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 58px;
}
.topbar .spacer { flex: 1 1 auto; }
.topbar .who { display: flex; align-items: center; gap: 10px; }
.topbar .user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar .user span { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 12.5px; letter-spacing: 0;
}
.rail-toggle { display: none; }

/* A compact select, not the browser's 360px default. */
select.compact, #uilang {
  width: auto;
  min-width: 0;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: right 12px center, right 7px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
}

main { padding: 26px 26px 72px; max-width: 1320px; width: 100%; }

/* ── page heading ─────────────────────────────────────────────────── */
h1 {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 3px;
  text-wrap: balance;
}
h1 + .sub { margin: 0 0 20px; color: var(--dim); font-size: 14px; max-width: 68ch; }
.sub { color: var(--dim); font-size: 14px; }
h2 { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 2px; }
h3 { font-size: 14.5px; font-weight: 600; margin: 0 0 2px; }

/* ── card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.card.stack > * + * { margin-top: 13px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

/* ── buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 140ms var(--ease), background 140ms var(--ease),
              box-shadow 140ms var(--ease), transform 90ms var(--ease);
}
.btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-deep); background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn.primary {
  /* Flat. The gradient read as decoration; a flat violet with a violet glow
   * under it reads as the one thing on the page to press. */
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
  font-weight: 600;
  padding: 10px 19px;
  box-shadow: 0 8px 20px -10px rgba(124, 58, 237, 0.8);
}
.btn.primary:hover:not(:disabled) {
  /* Both halves of the pair restated, not inherited.
     `.btn:hover:not(:disabled)` is one pseudo-class more specific than
     `.btn.primary`, so without this a hovered primary button took the plain
     button's pale background and kept its white label — the text vanished
     under the pointer, on every primary button in the product. */
  background: color-mix(in srgb, var(--primary) 88%, #000);
  color: var(--primary-fg);
  box-shadow: 0 10px 24px -10px rgba(124, 58, 237, 0.9);
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.btn.danger { color: var(--bad-ink); border-color: var(--bad); background: var(--surface); }
.btn.danger:hover:not(:disabled) { background: var(--bad-tint); color: var(--bad-ink); border-color: var(--bad); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--radius-xs); }

/* One visible focus treatment for everything that takes focus. */
:is(nav button, .btn, input, select, textarea, .tabs button, a):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
.rail :focus-visible { outline-color: var(--grad-end); }

/* ── form fields ──────────────────────────────────────────────────── */
/* Sentence case, not uppercase.
 *
 * Uppercase reads well on a one- or two-word column heading, where it is a
 * texture rather than words. A field label here is often a whole sentence —
 * "Search name, mobile or account" — and uppercase at that length removes the
 * ascenders and descenders a reader uses to recognise word shapes, so it is
 * slower to read AND louder than the field it describes. */
label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 500;
}
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease), background 140ms var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 0.75; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); background: var(--surface); }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  outline: none;
  box-shadow: var(--ring);
}
textarea { min-height: 130px; resize: vertical; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row .grow { flex: 1 1 190px; min-width: 0; }

/* ── tables ───────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13.8px; }

/* A table runs to the card's edges rather than floating inside its padding —
 * that is what stops a data card reading as a form that happens to contain
 * rows. The card clips, so the table's bottom corners follow its radius.
 *
 * Done by moving the padding onto the card's OTHER children rather than by
 * bleeding the table out with negative margins. Negative margins have to
 * know the padding they are cancelling, and pages here set their own: the
 * collections card carries an inline padding:0, so a -20px bleed dragged its
 * table clean outside the card, clipped the header and pushed the Collect
 * button past the right edge. This way the padding is never guessed at.
 *
 * Tables arrive both bare and wrapped in .table-scroll, so both shapes count.
 */
.card:has(> table), .card:has(> .table-scroll) { padding: 0; overflow: hidden; }
.card:has(> table, > .table-scroll) > :not(table):not(.table-scroll) {
  padding-left: 20px;
  padding-right: 20px;
}
.card:has(> table, > .table-scroll) > :first-child:not(table):not(.table-scroll) {
  padding-top: 18px;
}
.card:has(> table, > .table-scroll) > :last-child:not(table):not(.table-scroll) {
  padding-bottom: 18px;
}
/* A table under a heading needs the rule; one that IS the card does not. */
.card > table:not(:first-child),
.card > .table-scroll:not(:first-child) { margin-top: 14px; border-top: 1px solid var(--line); }

th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 11px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
/* No sticky header here on purpose. Both wrappers a table can arrive in —
 * .table-scroll (overflow-x) and a clipping card (overflow: hidden) — are
 * scroll containers, so "position: sticky; top: 58px" offsets the header
 * DOWN inside its own container and parks it on top of the first row. It
 * looked like the data had vanished. A sticky header is worth having only
 * once the page itself is the scroller. */
td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
td.num, th.num { text-align: right; }
td.muted { color: var(--dim); }
tbody tr { transition: background 120ms var(--ease); }
tbody tr:hover td { background: var(--surface-3); }
/* Identifiers are read one character at a time. */
td code, .mono { font-family: var(--font-mono); font-size: 12.6px; color: var(--ink-2); }
.table-scroll { overflow-x: auto; }

/* ── status chips ─────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--dim);
  white-space: nowrap;
  line-height: 1.5;
}
/* A dot before the word, so state survives a monochrome print, a projector,
 * and the ~8% of men who cannot separate the green one from the red one. */
.pill::before {
  content: "";
  width: 6px; height: 6px; flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.good { background: var(--good-tint); color: var(--good-ink); }
.pill.warn { background: var(--warn-tint); color: var(--warn-ink); }
.pill.bad  { background: var(--bad-tint);  color: var(--bad-ink); }
.pill.info { background: var(--info-tint); color: var(--info-ink); }

/* ── notes ────────────────────────────────────────────────────────── */
.note {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 14px;
  font-size: 13.8px;
  box-shadow: var(--shadow-1);
}
/* The stripe is what makes severity readable at a glance in a column of
 * cards, without the whole panel shouting. */
.note.err  { color: var(--bad-ink);  background: var(--bad-tint);  border-color: transparent; box-shadow: inset 3px 0 0 var(--bad); }
.note.ok   { color: var(--good-ink); background: var(--good-tint); border-color: transparent; box-shadow: inset 3px 0 0 var(--good); }
.note.warn { color: var(--warn-ink); background: var(--warn-tint); border-color: transparent; box-shadow: inset 3px 0 0 var(--warn); }

.muted { color: var(--dim); }
.tiny { font-size: 12.8px; }
.stack > * + * { margin-top: 13px; }
.hidden { display: none !important; }

/* ── tabs ─────────────────────────────────────────────────────────── */
.tabs {
  display: inline-flex;
  gap: 3px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  padding: 3px;
  background: var(--secondary);
  border-radius: var(--radius-sm);
}
.tabs button {
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

/* ── stat tiles ───────────────────────────────────────────────────── */
.tiles {
  display: grid;
  /* Explicit twelve-column bed rather than auto-fit. auto-fit with six tiles
   * produced five across and one orphan on its own row — an accident that
   * reads as a mistake, because it is one. */
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.tile {
  grid-column: span 3;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px 16px;
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
  transition: box-shadow 180ms var(--ease), transform 180ms var(--ease);
}
/* A tile is a button now — it goes to the page its number is about. These
 * undo the browser's own button styling, which would otherwise centre the
 * text, shrink the font and give it a system border. The hover lift was here
 * long before the tile could be pressed, which was the trap. */
button.tile {
  display: block;
  width: 100%;
  text-align: inherit;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.tile:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.tile:focus-visible, tr.clickable:focus-visible {
  outline: 2px solid var(--primary, currentColor);
  outline-offset: 2px;
}
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  .tile:hover { transform: none; }
}
/* Six tiles: three and three, instead of five and a stray. */
.tiles:has(.tile:nth-child(6)):not(:has(.tile:nth-child(7))) .tile { grid-column: span 4; }
.tiles:has(.tile:nth-child(5)):not(:has(.tile:nth-child(6))) .tile:nth-child(-n+2) { grid-column: span 6; }
.tiles:has(.tile:nth-child(5)):not(:has(.tile:nth-child(6))) .tile:nth-child(n+3) { grid-column: span 4; }
.tiles:has(.tile:nth-child(3)):not(:has(.tile:nth-child(4))) .tile { grid-column: span 4; }
.tiles:has(.tile:nth-child(2)):not(:has(.tile:nth-child(3))) .tile { grid-column: span 6; }
.tiles:has(.tile:first-child):not(:has(.tile:nth-child(2))) .tile { grid-column: span 12; }

.tile .k {
  font-size: 12.5px;
  color: var(--dim);
  font-weight: 500;
}
/* Figures in the mono face, as on the phone. Tiles are read across a row,
 * and a proportional 1 beside a proportional 8 makes equal amounts look
 * unequal. */
.tile .v {
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 8px;
}
.tile .v.good { color: var(--good-ink); }
.tile .v.bad  { color: var(--bad-ink); }
.tile .v.warn { color: var(--warn-ink); }
.tile .n { font-size: 12.5px; color: var(--dim); margin-top: 4px; }
/* A hairline of the tile's own colour along the top, so a wall of tiles has
 * a shape to it rather than being six identical white rectangles. */
.tile::after {
  content: "";
  /* Inset from the corners: an edge-to-edge bar is cut by the radius into
   * something that looks clipped, an inset one reads as a mark. */
  position: absolute; inset: 0 16px auto 16px; height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--line-strong);
}
.tile:has(.v.good)::after { background: var(--good); }
.tile:has(.v.warn)::after { background: var(--warn); }
.tile:has(.v.bad)::after  { background: var(--bad); }

.problems { max-height: 280px; overflow: auto; }

/* ── the deep panel ───────────────────────────────────────────────────
 * The figure a page is for, on the product's one dark surface, with a
 * hairline of violet light along its top. One per page. */
.deep {
  background: var(--deep);
  color: var(--deep-ink);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.deep::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--deep-edge) 70%, transparent), transparent);
}
.deep .k { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--deep-dim); }
.deep .v { font-family: var(--font-mono); font-size: 40px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.deep .n { font-size: 13px; color: var(--deep-dim); margin-top: 4px; }
/* State on the deep ground uses the lifted inks — the light-ground ones are
 * mud on near-black, which is the whole reason the app keeps a dark pair. */
.deep .v.bad  { color: #FCA5A5; }
.deep .v.warn { color: #FCD34D; }
.deep .v.good { color: #6EE7B7; }

/* ── network marks ────────────────────────────────────────────────────
 * Two letters on our own hue. Never a provider's logo or brand colour. */
.netmark {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: var(--radius-pill);
  display: inline-grid; place-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  color: #fff;
  background: var(--net-other);
}
.netmark.lg { width: 40px; height: 40px; flex-basis: 40px; font-size: 13px; border-radius: var(--radius-sm); }
.netmark[data-net="own"]      { background: var(--net-own); }
.netmark[data-net="bsnl"]     { background: var(--net-bsnl); }
.netmark[data-net="airtel"]   { background: var(--net-airtel); }
.netmark[data-net="railwire"] { background: var(--net-railwire); }
.netmark[data-net="gtpl"]     { background: var(--net-gtpl); }
.netmark[data-net="height8"]  { background: var(--net-height8); }

/* ── which network the desk is working in ─────────────────────────────
 * At the top of the rail, above everything it changes the meaning of. */
.rail-net { position: relative; padding: 12px 12px 0; }
.rail-net > button {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--rail-fg);
  cursor: pointer;
  text-align: left;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}
.rail-net > button:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); }
.rail-net .net-label { display: block; font-size: 11px; color: var(--rail-fg-dim); }
.rail-net .net-name { display: block; font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-net .net-text { flex: 1 1 auto; min-width: 0; }
.rail-net .net-menu {
  position: absolute; left: 12px; right: 12px; top: calc(100% + 6px);
  z-index: 70;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-3);
  padding: 8px;
  animation: fnw-pop 240ms var(--ease) both;
}
.rail-net .net-menu p { margin: 4px 8px 8px; font-size: 12px; color: var(--dim); }
.rail-net .net-menu button {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--ink);
  cursor: pointer; text-align: left; font-size: 13.5px;
}
.rail-net .net-menu button:hover { background: var(--surface-3); }
.rail-net .net-menu button[aria-current="true"] { background: var(--primary-tint); font-weight: 600; }
.rail-net .net-menu small { display: block; font-size: 11.5px; color: var(--dim); font-weight: 400; }

/* ── motion ───────────────────────────────────────────────────────────
 * A page's blocks rise into place in a short stagger, capped so a long page
 * is not still arriving after its first half has been read. Nothing loops.
 * The reduced-motion rule at the end of this file turns all of it off. */
@keyframes fnw-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fnw-pop  { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
main#view > * { animation: fnw-rise 420ms var(--ease) both; }
main#view > *:nth-child(2) { animation-delay: 50ms; }
main#view > *:nth-child(3) { animation-delay: 100ms; }
main#view > *:nth-child(4) { animation-delay: 150ms; }
main#view > *:nth-child(5) { animation-delay: 200ms; }
main#view > *:nth-child(n+6) { animation-delay: 250ms; }
.tiles > .tile { animation: fnw-rise 420ms var(--ease) both; }
.tiles > .tile:nth-child(2) { animation-delay: 40ms; }
.tiles > .tile:nth-child(3) { animation-delay: 80ms; }
.tiles > .tile:nth-child(4) { animation-delay: 120ms; }
.tiles > .tile:nth-child(n+5) { animation-delay: 160ms; }

/* ── sign in ──────────────────────────────────────────────────────── */
.center { max-width: 420px; margin: 10vh auto; padding: 0 20px; }

.signin-wrap { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.signin-art {
  /* The deep surface, with one soft light rather than a wash of three. */
  background:
    radial-gradient(80% 60% at 15% 10%, rgba(168, 85, 247, 0.22) 0%, transparent 60%),
    var(--deep);
  color: #fff;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.signin-art .art-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
/* The mark brings its own deep ground; a hairline keeps it from merging
   into the art panel behind it. */
.signin-art .art-brand svg { border-radius: 14px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.signin-art .art-brand b { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.signin-art .art-copy { position: relative; z-index: 1; max-width: 26em; }
.signin-art .art-copy p { max-width: 34ch; }
.signin-art h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin: 0 0 12px;
  color: #fff;
  text-wrap: balance;
}
.signin-art p { margin: 0; color: rgba(255, 255, 255, 0.62); font-size: 14.5px; line-height: 1.6; }
.signin-art .art-foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255, 255, 255, 0.42); }
/* The strand: light travelling down a fibre, drawn rather than decorated. */
.signin-art .strands { position: absolute; inset: 0; opacity: 0.5; z-index: 0; }

.signin-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.signin-form .inner { width: 100%; max-width: 348px; }
.signin-form h1 { font-size: 26px; margin-bottom: 6px; }
.signin-form .field + .field { margin-top: 14px; }
.signin-form .btn.primary { width: 100%; margin-top: 20px; padding: 12px 20px; font-size: 14.5px; }
.signin-form .foot { margin-top: 18px; font-size: 12.8px; color: var(--dim); }

/* ── responsive ───────────────────────────────────────────────────── */
@media (max-width: 980px) {
  #app { grid-template-columns: 1fr; }
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 240ms var(--ease);
    box-shadow: var(--shadow-3);
  }
  #app.rail-open .rail { transform: none; }
  #app.rail-open::after {
    content: "";
    position: fixed; inset: 0;
    background: rgba(11, 9, 18, 0.5);
    z-index: 50;
  }
  .rail-toggle { display: inline-flex; }
  main { padding: 20px 16px 64px; }
  .topbar { padding: 10px 16px; }
  .topbar .user span { display: none; }
  .tile { grid-column: span 6 !important; }
  .signin-wrap { grid-template-columns: 1fr; }
  .signin-art { display: none; }
}
@media (max-width: 560px) {
  .tile { grid-column: span 12 !important; }
}


/* ── The board kit (v2) ────────────────────────────────────────────────
 *
 * The pieces the design boards are built from, named as the boards name
 * them, so a page written against a board reads like the board. Where the
 * desk already had a class with that name doing something else (.row,
 * .stack, .avatar) the board's version has a different name: .hrow, .vstack,
 * .av. UiKit.kt in the app has one composable for each of these.
 */
.t-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.t-caption { font-size: 12.5px; line-height: 1.45; color: var(--dim); }
.t-body    { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.t-strong  { font-size: 15px; font-weight: 600; color: var(--ink); }
.t-title   { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; text-wrap: balance; }
.t-h1      { font-size: 26px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.15; text-wrap: balance; }
.t-display { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.num       { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ink2      { color: var(--ink-2); }

.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hrow    { display: flex; align-items: center; gap: 12px; }
.vstack  { display: flex; flex-direction: column; }
.grid2   { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3   { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4   { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.split   { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.hair    { height: 1px; background: var(--line); flex-shrink: 0; }
@media (max-width: 1100px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px)  { .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); } }

.card.flat   { box-shadow: none; }
.card.raised { box-shadow: var(--shadow-2); }
.card.tight  { padding: 12px 14px; }
.card.link   { cursor: pointer; color: inherit; text-decoration: none; display: block;
               transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms; }
.card.link:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.card.on     { border: 1.5px solid var(--primary); }
.grid2 > .card, .grid3 > .card, .grid4 > .card, .split > .card { margin-bottom: 0; }

/* Stat: the figure is the largest thing; the tone is a hairline on top. */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; position: relative; overflow: hidden; box-shadow: var(--shadow-1); }
.stat::before { content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 2px; border-radius: 0 0 2px 2px; background: var(--line-strong); }
.stat.good::before { background: var(--good); } .stat.warn::before { background: var(--warn); }
.stat.bad::before  { background: var(--bad); }  .stat.brand::before { background: var(--primary); }
.stat .l { font-size: 12px; color: var(--dim); font-weight: 500; }
.stat .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 500; letter-spacing: -0.03em; margin-top: 6px; color: var(--ink); }
.stat .n { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
a.stat { color: inherit; text-decoration: none; transition: transform 200ms var(--ease), box-shadow 200ms var(--ease); }
a.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }

/* List: one surface, rows split by hairlines. */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-1); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.li:last-child { border-bottom: 0; }
a.li:hover, .li.clickable:hover { background: var(--surface-2); }
.li .main { flex-grow: 1; min-width: 0; }
.li .name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .meta { font-size: 12.5px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av { width: 38px; height: 38px; border-radius: 12px; background: var(--sunk); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.av.brand { background: var(--primary-tint); color: var(--primary-ink); }
.av.xl { width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }

/* Chip: state as a word with a dot, never colour alone. */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.9; }
.chip.plain::before { display: none; }
.chip.good  { background: var(--good-tint); color: var(--good-ink); }
.chip.warn  { background: var(--warn-tint); color: var(--warn-ink); }
.chip.bad   { background: var(--bad-tint);  color: var(--bad-ink); }
.chip.info  { background: var(--info-tint); color: var(--info-ink); }
.chip.brand { background: var(--primary-tint); color: var(--primary-ink); }

/* Filters and the segmented control. Both are buttons underneath. */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.filter .num { font-size: 12.5px; }
.filter.on, .filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--sunk); border-radius: 12px; padding: 4px; gap: 4px; }
.seg > * { height: 34px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.seg > .on, .seg > [aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }

.textlink { font-size: 13.5px; font-weight: 600; color: var(--primary-ink); display: inline-flex; align-items: center; gap: 4px; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.textlink:hover { color: var(--primary); }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--dim); background: var(--surface); }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); cursor: pointer; flex-shrink: 0; }
.iconbtn:hover { background: var(--sunk); }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Quick tile: an icon over a short label, three or four to a row. */
.quick { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: inherit; text-decoration: none; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; text-align: left; transition: transform 200ms var(--ease), box-shadow 200ms var(--ease); }
.quick:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.quick .ico { color: var(--primary); }
.quick.on { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.quick.on .ico { color: var(--primary-fg); }

/* Meters and steps. */
.meter { height: 6px; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transform-origin: left; animation: fnw-grow 900ms var(--ease) both 200ms; }
.meter.good > i { background: var(--good); } .meter.warn > i { background: var(--warn); } .meter.bad > i { background: var(--bad); }
.deep .meter { background: rgba(255, 255, 255, 0.10); }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.steps > i { height: 4px; border-radius: 999px; background: var(--line-strong); }
.steps > i.on { background: var(--primary); }

/* Live: the one thing that animates forever. */
.live { width: 8px; height: 8px; border-radius: 999px; background: var(--good); position: relative; flex-shrink: 0; display: inline-block; }
.live::after { content: ""; position: absolute; inset: -4px; border-radius: 999px; border: 2px solid var(--good); animation: fnw-ping 1.8s var(--ease) infinite; }
.live.off { background: var(--line-strong); } .live.off::after { display: none; }
.live.bad { background: var(--bad); } .live.bad::after { border-color: var(--bad); }

.skel { background: linear-gradient(90deg, var(--sunk) 0%, var(--line) 40%, var(--sunk) 80%); background-size: 240% 100%; border-radius: 8px; animation: fnw-shimmer 1.6s linear infinite; min-height: 14px; }

/* Charts. */
.spark { stroke: var(--primary); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: fnw-draw 1400ms var(--ease) forwards 300ms; }
.spark-fill { fill: var(--primary-tint); opacity: 0; animation: fnw-fade 900ms ease forwards 900ms; }
.deep .spark { stroke: #C4B5FD; }
.deep .spark-fill { fill: rgba(167, 139, 250, 0.16); }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 230px; }
.bars > i { flex-grow: 1; background: var(--primary-tint-2); border-radius: 6px 6px 2px 2px; transform-origin: bottom; animation: fnw-bar 800ms var(--ease) both; min-height: 2px; }
.bars > i.on { background: var(--primary); }

/* The deep panel, in the board's words as well as the desk's first ones. */
.deep .lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--deep-dim); }
.deep .sub { font-size: 12.5px; color: var(--deep-dim); }
.deep .num { color: var(--deep-ink); }

/* The desk's search box in the top bar. */
.search { height: 40px; border-radius: 12px; background: var(--sunk); display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--dim); font-size: 13.5px; width: min(380px, 40vw); border: 1px solid transparent; }
.search:focus-within { border-color: var(--primary); box-shadow: var(--ring); background: var(--surface); }
.search input { border: 0; background: transparent; outline: none; flex: 1 1 auto; min-width: 0; font: inherit; color: var(--ink); padding: 0; height: auto; box-shadow: none; }

/* A board table: uppercase heads on the second surface, numbers right. */
table.board { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.board th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.board td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
table.board tr:last-child td { border-bottom: 0; }
table.board td.strong { color: var(--ink); font-weight: 600; }
table.board td.r, table.board th.r { text-align: right; }

/* Entrance: children rise in a short stagger, never more than ~400ms. */
.enter > * { animation: fnw-rise 560ms var(--ease) both; }
.enter > *:nth-child(1) { animation-delay: 40ms; }  .enter > *:nth-child(2) { animation-delay: 90ms; }
.enter > *:nth-child(3) { animation-delay: 140ms; } .enter > *:nth-child(4) { animation-delay: 190ms; }
.enter > *:nth-child(5) { animation-delay: 240ms; } .enter > *:nth-child(6) { animation-delay: 290ms; }
.enter > *:nth-child(7) { animation-delay: 330ms; } .enter > *:nth-child(n+8) { animation-delay: 370ms; }
.pop { animation: fnw-spring 520ms var(--ease-spring) both 120ms; }

@keyframes fnw-grow    { from { transform: scaleX(0); } to { transform: none; } }
@keyframes fnw-bar     { from { transform: scaleY(0); } to { transform: none; } }
@keyframes fnw-draw    { to { stroke-dashoffset: 0; } }
@keyframes fnw-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fnw-ping    { 0% { transform: scale(0.6); opacity: 0.9; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes fnw-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes fnw-spring  { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/* With the draw-in gone the line must start drawn, not hidden. */
@media (prefers-reduced-motion: reduce) {
  .spark { stroke-dashoffset: 0; }
  .spark-fill { opacity: 1; }
}

@media print {
  .rail, .topbar { display: none; }
  #app { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}
