﻿/* ============================================================
   Bandtide portal stylesheet.

   Shares the instrument-panel language of the marketing site:
   cool graphite ground, hairline structure instead of floating
   shadows, tabular monospace for every measured value, and one
   maroon accent reserved for the controlled value.

   Every class hook here is produced by portal/js/*.js via UI.el().
   ============================================================ */

:root {
  /*
    The "Ruled" system (2026-08 design handoff, nine client rounds):
    no cards, structure from hairline rules and alignment, IBM Plex,
    a rust accent, and every status carrying a symbol and a word.
    ONE owner amendment to the handoff: the ground stays WHITE - the
    prototypes' cream #fbf8f3 was explicitly declined - so the warm
    hairlines and inks sit on #fff and every contrast figure only
    improves.
  */

  /* Ground and surfaces. Surface === ground on purpose: content sits on
     the page, not on floating white boxes. 2026-08-31 owner retune: the
     original Ruled greys carried a brown cast that read as a yellow hue
     across the app, so every grey is now a true neutral - the rust
     accent is the only warmth on the page. */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-sunk: #f5f5f7;
  --line: #e5e5e9;
  --line-strong: #d4d4da;

  /* The dark rail: flat ink, no gradient. */
  --rail-grad: #18181b;
  --rail-raised: #27272c;
  --rail-text: rgba(255, 255, 255, .8);
  --rail-text-strong: #ffffff;
  --rail-hair: rgba(255, 255, 255, .14);
  --accent-lift: #e08a5a;
  --live-lift: #3fbf95;

  /* Ink. muted (#5f5f68) measures 7.0:1 on white; faint carries real
     copy in a few places, so it holds 5.6:1 rather than dropping to a
     disabled-only grey. */
  --ink: #18181b;
  --ink-body: #3f3f46;
  --muted: #5f5f68;
  --faint: #6e6e78;

  /* Accent: rust. Text and fills use --accent (7.2:1 on white);
     --accent-hot is reserved for peak-tier bars in the day tracks and
     week grids, exactly as the handoff reserves #a84a2a. */
  --accent: #8e3c20;
  --accent-hot: #a84a2a;
  --accent-deep: #6d2c14;
  --accent-wash: #f5ece6;
  --accent-line: #e3cbbc;

  /* Dark ground, used by toasts and the modal scrim */
  --night: #18181b;

  /* Signal. Savings green and failure maroon from the handoff; warn is
     reserved for genuine warnings - it is never an identity color. */
  --live: #1a5c40;
  --live-wash: #e8f0ec;
  --warn: #8a5a00;
  --warn-wash: #f7f1e2;
  --danger: #8a2419;
  --danger-wash: #f6eaea;
  --neutral-wash: #f0f0f3;

  /* Legacy aliases. Inline styles in the view modules still refer to
     var(--border), and older rules to --paper/--panel; keep both
     resolving to the current system. */
  --border: var(--line);
  --paper: var(--bg);
  --panel: var(--surface);
  --success: var(--live);

  /* Geometry: 8px rects for controls, pills only for chips and tags.
     --radius-panel survives for the few surfaces that still float
     (modals, menus, toasts). */
  --radius-panel: 12px;
  --radius-control: 8px;
  --radius-small: 8px;

  --lift-1: none;
  --lift-2: none;
  --lift-3: 0 16px 48px rgba(24, 24, 27, .2);
  --lift-hover: none;

  /* Type. IBM Plex Sans and IBM Plex Mono, self-hosted
     (/assets/fonts/fonts.css); system stacks stay behind them. Mono is
     for every speed, time, service ID, order number and dollar figure. */
  --font-body: 'IBM Plex Sans', -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-display: 'IBM Plex Sans', -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, "Cascadia Mono", "SF Mono", Consolas,
    "Liberation Mono", monospace;

  --sidebar-width: 240px;

  /* The Bandtide mark. Stroked black because it is used as a mask, where
     only the alpha matters and the colour comes from the element. */
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 18' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 13.5H7.5V4.5H16V13.5H24'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.018em;
}

p { margin: 0 0 1em; }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-small);
}

/* Measured values read as instrument output: mono, tabular, so digits
   line up down a column and between rows. */
.mono,
.metric-value,
.metric-card strong,
.savings-stat strong,
.meter-value,
.speed-meter-value,
.speed-meter .value,
.tier-hour-chip,
.identity-value,
.code-input,
.mono-box,
.recovery-codes {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- App shell ---------- */

.shell,
.portal-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* Visually hidden until a keyboard reaches it; without it every page costs
   15 rail tab stops before the first content control. */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-64px);
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus-visible {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  outline: 2px solid var(--accent-lift);
  outline-offset: 2px;
}
.content:focus { outline: none; }

/* The rail chrome never scrolls away: brand, org tile and footer are
   pinned, and only the link list scrolls when it must. Before this, the
   whole rail scrolled and the staff Sign out button sat fully below the
   fold at 900px viewports. Applies to the mobile drawer too - same DOM. */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  background: var(--rail-grad);
  color: var(--rail-text-strong);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar nav,
.sidebar .nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* ---------- Brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.brand-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand small,
.brand span.muted {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Bandtide mark: one working day's bandwidth profile drawn as a step.
   Masked rather than inlined so the JS-built sidebar and the static
   marketing pages share a single asset. */
.brand-mark {
  display: block;
  width: 26px;
  height: 18px;
  flex: none;
  background-color: var(--accent);
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
}

.brand-mark i { display: none; }

/* ---------- Navigation ---------- */

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--rail-text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--rail-text-strong);
  text-decoration: none;
}

/* Active: the lifted-maroon wash with an inset marker, per the redesign. */
.nav-item.active {
  background: rgba(232, 144, 156, .13);
  color: #f4c2c9;
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent-lift);
}

.nav-item.active:hover {
  background: rgba(232, 144, 156, .13);
  color: #f4c2c9;
}

/* ---------- User chip ---------- */

.sidebar-foot {
  margin-top: 12px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-chip {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--rail-hair);
  border-radius: 13px;
  font-size: 12.5px;
  min-width: 0;
}

.user-chip strong,
.user-name {
  display: block;
  color: var(--rail-text-strong);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip .muted,
.user-chip small {
  font-size: 11.5px;
  color: rgba(255, 255, 255, .5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Main content ---------- */

.content {
  min-width: 0;
  padding: 36px 56px 64px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Page enter: one orchestrated rise per navigation. */
.view { animation: bt-page .45s cubic-bezier(.22, 1, .36, 1) both; }

.view { min-width: 0; }

/* ---------- Page header ---------- */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

.page-header-text { min-width: 0; }

.page-header h1,
.page-header h2,
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.028em;
  line-height: 1.15;
}

.page-header p,
.page-header .subtitle,
.page-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 68ch;
}

.page-header .actions,
.page-header .page-actions,
.page-header .row,
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Panels ---------- */

.panel {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-panel);
  box-shadow: var(--lift-2);
  padding: 22px 26px;
}

.panel + .panel { margin-top: 16px; }

.panel h2,
.panel h3,
.panel-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.012em;
}

.panel > p.muted:first-of-type { margin-top: 0; }

.panel-note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.panel-head,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-head h2,
.panel-heading h2,
.panel-head h3,
.panel-heading h3,
.panel-head .panel-title { margin-bottom: 0; }

/* ---------- Metric cards ---------- */

.metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 52px;
  margin: 4px 0 24px;
}

/* Lumen accepted an order and has not applied it: a full-width note under
   the metrics, in the warn tone, naming Lumen support. */
.order-stalled {
  flex: 1 1 100%;
  border-left: 2px solid var(--warn);
  background: var(--warn-wash);
  color: var(--warn);
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.5;
}
.order-stalled p {
  margin: 4px 0 0;
}
.order-stalled a {
  color: inherit;
  text-decoration: underline;
}

/* Unboxed readings: the numbers carry the weight, nothing is framed. */
.metric-card {
  display: flex;
  flex-direction: column;
  background: none;
  padding: 0;
  min-width: 0;
}

.metric-card .metric-label,
.metric-card small {
  display: block;
  order: 2;
  margin-top: 3px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.metric-card .metric-value,
.metric-card strong {
  display: block;
  order: 1;
  font-family: var(--font-mono);
  color: var(--ink);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card .metric-note {
  order: 3;
  margin-top: 3px;
  font-size: 12px;
  color: var(--faint);
}

/* ---------- Sidebar groups ----------
   An admin sees eleven destinations. A flat column of eleven equal links
   makes the reader scan all of them every time; a heading per block means
   most visits only read one block. Set small and quiet, because the
   headings are signposts, not navigation. */

/* Group separation is carried by the SECTION (space plus a hairline), not
   by a label margin. The old `.nav-group:first-child { margin-top: 0 }`
   rule silently killed every label's top margin once the a11y rework made
   each label the first child of its .nav-section - measured at 2px of air
   above every group title, which is why they read as glued to the wrong
   rows ("titles mixed into the words"). */
.nav-group {
  margin: 0 0 6px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .52);
}

/* Each labelled group is its own flex column, because the group wrapper is
   now the nav's flex item rather than each link. */
.sidebar .nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rail-hair);
}
.sidebar .nav > .nav-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* ---------- Tabs ----------
   Used by the Logs page. A row of tabs rather than a select, because the
   set is small and fixed and the current one should be readable without
   opening anything. */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  /* Pull the tab's own border down onto the strip's, so the active one
     replaces the hairline rather than sitting above it. */
  margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
}

.tab:hover { color: var(--ink); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-small) var(--radius-small) 0 0;
}

/* ---------- Fact list ----------
   Label over value pairs, for the handful of dates and counts on the
   billing page. Grid rather than flex so the values line up. */

/* Bandtide price control: type, amount, unit on one line; stacks on a phone. */
.price-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.price-control .price-type { flex: 1 1 220px; min-width: 0; }
.price-control .price-value { flex: 0 1 110px; min-width: 0; font-variant-numeric: tabular-nums; }
.price-control .price-unit { font-size: 12.5px; }

.fact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.fact dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

.fact dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Plan inclusions ---------- */

.plan-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.plan-list li {
  position: relative;
  padding: 0 0 0 22px;
  margin-bottom: 9px;
  font-size: 13.5px;
  line-height: 1.55;
}

.plan-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Public shell ----------
   Help is readable without signing in, so it needs a frame that is not
   the app shell: a sidebar full of links that all bounce to sign in
   would be worse than no sidebar. Just the mark and a way in. */

.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.public-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

/* The brand carries the sidebar's bottom padding, which is wrong in a
   horizontal bar. */
.public-head .brand { padding: 0; }

.public-content {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

@media (max-width: 640px) {
  .public-head { padding: 12px 16px; }
  .public-content { padding: 20px 16px 40px; }
}

/* ---------- Revenue chart ----------
   Bars are divs. The CSP blocks external scripts and there is no build
   step, so a charting library is not available; twelve monthly figures
   do not need one. Heights are set inline as a percentage of the peak
   month, which is the only thing JavaScript contributes here. */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 2px 0;
  overflow-x: auto;
}

.chart-col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.chart-amount {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  white-space: nowrap;
}

/* Fixed height so short months still sit on a common baseline and the
   bars stay comparable at a glance. */
.chart-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 132px;
  background: var(--surface-sunk);
  border-radius: 3px;
  overflow: hidden;
}

.chart-bar {
  width: 100%;
  min-height: 2px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}

.chart-label {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--faint);
  white-space: nowrap;
}

/* ---------- Card grid ---------- */

.card-grid {
  display: grid;
  /* auto-fit, not auto-fill: auto-fill mints empty tracks on wide screens
     and strands two cards at minimum width beside half a page of nothing. */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.card-grid > .panel {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  /* Cards size to their content: the default stretch left the short
     Profile card ~60% empty beside its taller neighbour. */
  align-items: start;
}

/* ---------- Tables ---------- */

.table-scroll,
.table-wrap {
  /* Horizontal protection only. The old vertical cap (68vh) turned
     every table into a page-inside-the-page - the circuits list
     scrolled in a 640px box while the document sat still, which read
     as broken scrolling. Tables grow; the page scrolls. */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 0;
  border-radius: 0;
}

table.data,
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data thead th,
table.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  text-align: left;
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data tbody td,
table.table tbody td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

/* Hairlines and a hover band carry row tracking; zebra striping would
   add a second, competing rhythm. */
table.data tbody tr:hover,
table.table tbody tr:hover { background: var(--surface-sunk); }

table.data tbody tr:last-child td,
table.table tbody tr:last-child td { border-bottom: 0; }

table.data tbody tr[data-href],
table.data tbody tr.clickable,
table.table tbody tr[data-href],
table.table tbody tr.clickable,
table.data tbody tr.row-click,
table.table tbody tr.row-click { cursor: pointer; }

table.data td .btn + .btn,
table.table td .btn + .btn { margin-left: 6px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.55;
  white-space: nowrap;
  background: var(--neutral-wash);
  color: var(--muted);
}

.badge-neutral {
  background: var(--neutral-wash);
  color: var(--muted);
}

.badge-success {
  background: var(--live-wash);
  color: var(--live);
}

.badge-warn {
  background: var(--warn-wash);
  color: var(--warn);
}

.badge-danger {
  background: var(--danger-wash);
  color: var(--danger);
}

.badge-accent {
  background: var(--accent-wash);
  color: var(--accent);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover {
  background: var(--surface-sunk);
  border-color: var(--ink);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
}

/* The ink pill: for the action that changes state without being the
   brand moment (Change a speed, Apply). */
.btn-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-ink:hover {
  background: #2b2b33;
  border-color: #2b2b33;
}

/* Ghost buttons inside the dark rail. */
.sidebar .btn-ghost {
  border-color: var(--rail-hair);
  color: rgba(255, 255, 255, .7);
  background: transparent;
}

.sidebar .btn-ghost:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover { background: var(--surface-sunk); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #932018;
  border-color: #932018;
}

.btn:disabled,
.btn[disabled],
.btn.disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* setBusy() disables the button and swaps its label, so it inherits the
   disabled treatment. Hold it at higher opacity: it is working, not
   unavailable. */
.btn.is-busy {
  opacity: .8;
  cursor: progress;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  /* Same corner language as every other button: .btn is a pill, and the
     two sat side by side (Manage next to the bulk actions) disagreeing. */
  border-radius: 999px;
}

.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
}

.btn .spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.btn-primary .spinner,
.btn-accent .spinner,
.btn-danger .spinner {
  border-color: rgba(255, 255, 255, .35);
  border-top-color: #fff;
}

/* ---------- Forms ---------- */

label,
.field-label {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235c5c68' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(158, 36, 54, .12);
}

input::placeholder,
textarea::placeholder { color: var(--faint); }

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-sunk);
  color: var(--muted);
  cursor: not-allowed;
}

/* Read-only copy fields (reveal modal, signup links): distinct from
   editable inputs but full contrast so the value stays readable. */
input[readonly]:not(:disabled) {
  background: var(--surface-sunk);
  border-style: dashed;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.field {
  margin-bottom: 15px;
  min-width: 0;
}

.field:last-child { margin-bottom: 0; }

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.form-error,
.field-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border-left: 2px solid var(--danger);
  background: var(--danger-wash);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.terms-field { margin: 14px 0; }

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.55;
  cursor: pointer;
}

.terms-check input[type="checkbox"] {
  margin-top: 3px;
  flex: none;
}

.confirm-text {
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- Switch ---------- */

input[type="checkbox"].switch,
.switch > input[type="checkbox"],
label.switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 38px;
  height: 21px;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color .18s ease;
  vertical-align: middle;
}

input[type="checkbox"].switch::before,
.switch > input[type="checkbox"]::before,
label.switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 25, .3);
  transition: transform .18s ease;
}

input[type="checkbox"].switch:checked,
.switch > input[type="checkbox"]:checked,
label.switch input[type="checkbox"]:checked { background: var(--accent); }

input[type="checkbox"].switch:checked::before,
.switch > input[type="checkbox"]:checked::before,
label.switch input[type="checkbox"]:checked::before { transform: translateX(17px); }

input[type="checkbox"].switch:disabled,
.switch > input[type="checkbox"]:disabled,
label.switch input[type="checkbox"]:disabled {
  opacity: .5;
  cursor: not-allowed;
}

label.switch,
span.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Day chips ---------- */

.day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.6;
  user-select: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.day-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: 0;
}

label.day-chip {
  cursor: pointer;
  margin-bottom: 0;
}

.day-chip.active,
.day-chip.on,
.day-chip.selected,
.day-chip:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

label.day-chip:hover { border-color: var(--accent); }

.day-chip:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.day-chips,
.day-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Speed meter ---------- */

.speed-meter,
.meter { min-width: 0; }

.speed-meter + .speed-meter,
.meter + .meter { margin-top: 12px; }

.speed-meter-labels,
.speed-meter .labels,
.speed-meter .speed-meter-head,
.meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.speed-meter-label,
.speed-meter .label,
.meter-label {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
}

.speed-meter-value,
.speed-meter .value,
.meter-value {
  color: var(--muted);
  white-space: nowrap;
}

.speed-meter-track,
.speed-meter .track,
.meter-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--neutral-wash);
  overflow: hidden;
}

.speed-meter-fill,
.speed-meter .fill,
.meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
  min-width: 3px;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(20, 20, 25, .5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade-in .16s ease;
}

.modal-backdrop.closing {
  opacity: 0;
  transition: opacity .15s ease;
}

body.modal-open { overflow: hidden; }

.modal {
  width: 100%;
  max-width: 540px;
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--lift-3);
  animation: modal-pop .18s cubic-bezier(.22, 1, .36, 1);
  overflow: hidden;
}

/* The dialog node carries both classes; without this the .panel padding
   wraps the header and footer in an extra gutter. */
.modal.panel {
  padding: 0;
  box-shadow: var(--lift-3);
}

.modal-header,
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.modal-header h2,
.modal-header h3,
.modal-head h2,
.modal-head h3,
.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.018em;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-small);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 14px;
}

/* A form's own action row, pinned to the scrollport bottom so a tall form
   never opens with no visible buttons (on a phone the connection form's
   Save sat 470px below the fold). The negative margins bleed it across the
   body padding so scrolled content cannot peek past its edges. */
.modal-sticky-actions {
  position: sticky;
  bottom: -20px;
  margin: 6px -22px -20px;
  padding: 12px 22px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.modal-body > :last-child { margin-bottom: 0; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-sunk);
  flex: none;
}

/* ---------- Toasts ---------- */

#toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  padding: 12px 15px;
  border-radius: var(--radius-control);
  border-left: 2px solid var(--faint);
  background: var(--night);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: var(--lift-3);
  animation: toast-in .22s cubic-bezier(.22, 1, .36, 1);
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.toast-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast-info,
.toast.info { border-left-color: var(--faint); }

.toast-success,
.toast.success { border-left-color: #3fbf95; }

/* A failure has to read as one at a glance: heavier border, red icon
   disc, a FAILED headline above the reason, and its own close button.
   Same bottom-right home, same auto-dismiss (just slower, see ui.js). */
.toast-error,
.toast.error { border-left: 4px solid #e8695f; }

.toast-error .toast-icon {
  background: #e8695f;
  color: #fff;
}

.toast-title {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f2988f;
}

.toast-close {
  flex: none;
  margin: -4px -6px 0 0;
  padding: 2px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .75);
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
}

.toast-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.toast-close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.toast.hide,
.toast.out,
.toast-out {
  opacity: 0;
  transform: translateX(14px);
  transition: opacity .25s ease, transform .25s ease;
}

/* ---------- Empty state ---------- */

.empty-state {
  padding: 40px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-sunk);
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* An empty screen is an invitation to act, so the setup callout leans
   on the accent rather than reading as a dead end. */
.setup-callout {
  border-style: solid;
  border-color: var(--accent-line);
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.setup-callout strong { color: var(--accent); }

/* ---------- Spinner ---------- */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--neutral-wash);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  vertical-align: middle;
}

.loading,
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 0;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
}

/* ---------- Login and signup ---------- */

.login-wrap,
.signup-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.login-card {
  width: 100%;
  max-width: 408px;
  padding: 36px 34px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--lift-2);
}

.signup-card {
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 36px 34px 30px;
  box-shadow: var(--lift-2);
}

.login-card .brand { padding: 0 0 20px; }

.login-card h1,
.login-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.login-card h1 em,
.login-title em {
  color: var(--accent);
  font-style: normal;
}

.login-card > p,
.login-card .subtitle,
.login-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 20px;
}

.login-form .btn,
.login-card form .btn,
.signup-form .btn-block {
  width: 100%;
  padding: 11px 16px;
  margin-top: 4px;
}

/*
  Full-width buttons on the login card, including the ones appended
  straight to the card rather than into a form: the MFA method choice and
  the payment gate both do that, so a rule scoped to `form .btn` missed
  them and they sat flush against each other and against the callout
  above.
*/
.login-card > .btn-block {
  padding: 11px 16px;
  margin-top: 10px;
}

/* Stacked choices need real separation, or the primary and the secondary
   read as one control split by a hairline. */
.login-card > .btn-block + .btn-block {
  margin-top: 8px;
}

/* Never let a button sit flush against the message explaining why the
   last attempt failed. */
.login-card > .form-error + .btn-block {
  margin-top: 14px;
}

.login-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
}

.signup-link,
.staff-signin { font-size: 13px; }

.login-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.partner-disclaimer {
  color: var(--faint);
  font-size: 11.5px;
}

/* Divider with centred text, used on the login card for the staff
   sign-in link and between MFA options. */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  /* An <hr>: without this the UA border draws a second, darker rule on
     top of the ::before/::after hairlines. */
  border: 0;
  margin: 18px 0 14px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Setup wizard ---------- */

.wizard {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.wizard-rail {
  padding: 10px;
  position: sticky;
  top: 20px;
}

.wizard-body { min-width: 0; }

.wizard-body > .panel + .panel { margin-top: 16px; }

.wizard-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wizard-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease;
}

.wizard-step:hover { background: var(--surface-sunk); }

.wizard-step.active { background: var(--accent-wash); }

.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.step-dot.active,
.wizard-step.active .step-dot {
  border-color: var(--accent);
  color: var(--accent);
}

.step-dot.done,
.wizard-step .step-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.wizard-step-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.wizard-step-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.wizard-step-desc {
  font-size: 11.5px;
  color: var(--muted);
}

/* Import checklist rows inside the wizard. */

.import-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.import-item:hover { border-color: var(--accent-line); }

.import-item-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
}

.import-item-label input[type="checkbox"] {
  margin-top: 2px;
  flex: none;
}

.import-item .import-max {
  width: 110px;
  flex: none;
}

/* The two facts on the right of an import row, each with its own caption:
   the speed today and the editable ceiling. */
.import-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  flex: none;
}

.import-col-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted, #6b6b76);
  margin: 0;
}

/* Setup wizard: phases in the rail, optional tags, cards, pattern picker,
   preview, and the shared nav row. Panels stay hairline, no shadows. */

.wizard-phase {
  list-style: none;
  margin: 12px 0 4px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}

.wizard-phase:first-child { margin-top: 0; }

.wizard-step-tag {
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.wizard-nav { margin-top: 18px; align-items: center; }

.wizard-nav-hint { margin: 14px 0 0; font-size: 12.5px; }

.setup-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  background: var(--surface);
}

.setup-card + .setup-card { margin-top: 10px; }

.setup-card-head { margin-bottom: 8px; }

.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 14px;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.pattern-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.pattern-card[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.pattern-card strong { font-size: 13.5px; }

.pattern-card small { color: var(--muted); font-size: 12px; }

/* Day chips and the describe row reuse the portal's existing .day-chips,
   .day-chip (selected = .active), and .describe-row rules; nothing to add. */

.pattern-times { display: flex; gap: 12px; flex-wrap: wrap; }

.pattern-times .field { flex: 1 1 140px; }

.setup-preview {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.setup-words,
.setup-summary { margin: 0; padding-left: 18px; }

.setup-words li,
.setup-summary li { margin: 3px 0; }

.setup-warnings {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.setup-existing { margin-bottom: 10px; }

.apply-rest { margin-top: 14px; }

.apply-row { padding: 6px 0; }

/* ---------- Capability chips and provider badges ---------- */

.capability-chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 2px 8px;
  border-radius: var(--radius-small);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.6;
  white-space: nowrap;
}

.capability-chip.ok {
  background: var(--live-wash);
  color: var(--live);
}

.capability-chip.fail {
  background: var(--danger-wash);
  color: var(--danger);
}

/* Body face, not mono: this is a product NAME, not a measurement.
   "Lumen Ethernet On-Demand" in a monospace face at 10.5px was the least
   readable text in the product - mono has no proportional letterforms and
   no kerning, which is exactly what a 24-character phrase needs. Mono
   stays where it belongs, on speeds, IDs and times. */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-small);
  /* On the badge scale (11px / 23px tall) like every other badge; this one
     was a stray at 11.5px / 21.8px. */
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.55;
  white-space: nowrap;
  background: var(--accent-wash);
  color: var(--accent);
}

.provider-badge.lumen-eod {
  background: var(--accent-wash);
  color: var(--accent);
}

.provider-badge.lumen-iod {
  background: var(--live-wash);
  color: var(--live);
}

.provider-badge.simulated,
.provider-badge.badge-neutral {
  background: var(--neutral-wash);
  color: var(--muted);
}

.provider-info { min-width: 0; }

.order-line { font-size: 12.5px; }

.quota-note {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Savings ---------- */

.savings-panel .savings-stats,
.savings-stats {
  display: grid;
  gap: 10px;
}

.savings-stat {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  min-width: 0;
}

.savings-stat small {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

.savings-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.savings-stat .savings-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.savings-highlight {
  background: var(--accent-wash);
  border-color: var(--accent-line);
  margin-bottom: 12px;
}

.savings-highlight strong { color: var(--accent); }

.savings-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.savings-tiers { min-width: 0; }

.tier-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tier-hour-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-sunk);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.savings-assumptions {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

.savings-assumptions li { margin: 2px 0; }

/* ---------- Security panel and fine print ---------- */

.security-panel { min-width: 0; }

.identity-grid {
  display: grid;
  gap: 9px;
}

.identity-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.identity-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.identity-label {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  white-space: nowrap;
}

.identity-value {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.fine-print,
.disclaimer {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.6;
}

.signup-card .fine-print {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.copy-box input { min-width: 0; }

.copy-button { flex: none; }

/* ---------- MFA ---------- */

.mfa-flow { min-width: 0; }

.mfa-form,
.mfa-field { min-width: 0; }

.mfa-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.mfa-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mfa-status-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.mfa-strong { font-weight: 600; }

.mfa-hint,
.mfa-roadmap {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.mfa-warning {
  margin: 12px 0;
  padding: 11px 13px;
  border-radius: var(--radius-control);
  border-left: 2px solid var(--warn);
  background: var(--warn-wash);
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.6;
}

.mfa-resend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---------- Authenticator QR ----------
   The code carries its own white quiet zone and is drawn black on white
   regardless of the surrounding design. Tinting it to the maroon accent
   or letting a dark surface show through reduces the contrast a camera
   relies on, and an unscannable QR is worse than no QR. */

.mfa-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 14px;
}

.mfa-qr {
  display: block;
  /* A hairline, not a heavy frame: the quiet zone must stay visually
     part of the code rather than looking like padding to be cropped. */
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #fff;
  /* Never let a narrow viewport scale it below scanning size. */
  max-width: 100%;
  height: auto;
}

/* The typed key, collapsed under the QR. Someone enrolling on the same
   device they are reading has no second camera, so this must stay
   reachable, just not compete with the scan. */
.mfa-key-details {
  margin: 0 0 12px;
  font-size: 12.5px;
}

.mfa-key-details > summary {
  cursor: pointer;
  color: var(--muted);
  padding: 4px 0;
  list-style: none;
}

.mfa-key-details > summary::-webkit-details-marker { display: none; }

.mfa-key-details > summary::before {
  content: "+ ";
  font-family: var(--font-mono);
  color: var(--faint);
}

.mfa-key-details[open] > summary::before { content: "- "; }

.mfa-key-details > summary:hover { color: var(--ink); }

.mfa-key-details > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-small);
}

.mfa-resend,
.mfa-open-link { font-size: 12.5px; }

.mfa-secret {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  overflow-wrap: anywhere;
}

/* Six digit verification code input. */
input.code-input,
.code-input {
  font-size: 20px;
  letter-spacing: .35em;
  text-align: center;
}

/* One-time recovery codes, shown once after MFA enrollment. */
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 12px 0;
  padding: 14px;
  background: var(--surface-sunk);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-control);
  font-size: 13.5px;
  letter-spacing: .04em;
  text-align: center;
}

/* Read-only monospace value block (TOTP secret, otpauth link). */
.mono-box {
  font-size: 13px;
  padding: 10px 12px;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  overflow-wrap: anywhere;
  user-select: all;
}

/* Sits above Sign out, so the destructive action stays last. Same size as
   its neighbour - the footer buttons used to disagree by a pixel. */
.report-problem { font-size: 13px; }

/* ---------- Billing banner ---------- */

.content-col { min-width: 0; }

/* Matches the content column's own gutter so the banner lines up with the
   page below it. */
#billing-slot {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 40px 0;
}

#billing-slot:empty { display: none; }

.billing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: var(--radius-control);
  font-size: 13.5px;
  line-height: 1.55;
}

/* The trial countdown, which sits on screen for the whole trial rather
   than only at the end. Quieter than the warn and danger tones on
   purpose: it is telling the customer where they are, not that anything
   is wrong. --accent-deep rather than --accent so the text clears AA on
   the wash it sits on. */
.billing-banner.tone-accent {
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  color: var(--accent-deep);
}

.billing-banner.tone-warn {
  background: var(--warn-wash);
  border: 1px solid #eddcb4;
  color: var(--warn);
}

.billing-banner.tone-danger {
  background: var(--danger-wash);
  border: 1px solid #f0cdc9;
  color: var(--danger);
}

.billing-banner-text {
  min-width: 0;
  flex: 1 1 320px;
}

@media (max-width: 900px) {
  #billing-slot { padding: 18px 18px 0; }
}

@media (max-width: 600px) {
  #billing-slot { padding: 14px 14px 0; }
}

/* ---------- Help / knowledge base ---------- */

.kb-grid-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.kb-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 18px 20px 20px;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}

.kb-card:hover {
  border-color: var(--accent-line);
  background: var(--surface-sunk);
  text-decoration: none;
}

.kb-card-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

.kb-card-title {
  margin: 8px 0 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.018em;
  color: var(--ink);
}

.kb-card-summary {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* Numbered steps with a screenshot each, the shape a Scribe doc takes. */
.kb-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: kb;
}

.kb-step + .kb-step {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.kb-step-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.kb-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.kb-step-text {
  margin: 2px 0 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-body);
}

.kb-figure {
  margin: 14px 0 0 38px;
}

/* Screenshots are real captures, so they carry the portal's own chrome.
   A border keeps that from bleeding into the page around it. */
.kb-shot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-sunk);
}

.kb-caption {
  margin: 7px 0 0;
  font-size: 12.5px;
  color: var(--faint);
}

.kb-note { margin-top: 16px; }

.kb-next {
  margin: 18px 0 0;
  font-size: 13.5px;
}

@media (max-width: 600px) {
  .kb-figure { margin-left: 0; }
}

/* ---------- First-run tour ---------- */

body.tour-open { overflow: hidden; }

/* Swallows clicks so the highlighted element is shown, not operable. */
.tour-blocker {
  position: fixed;
  inset: 0;
  z-index: 199;
}

/* Only for steps with no target: those hide the spotlight, and the
   spotlight is what normally dims the page. */
.tour-blocker.dim { background: rgba(20, 20, 25, .55); }

/* The dimming is the spotlight's own outsized shadow, which keeps the
   cutout perfectly aligned with the element at any size. */
.tour-spot {
  position: fixed;
  z-index: 200;
  border-radius: var(--radius-control);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(20, 20, 25, .55);
  pointer-events: none;
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}

.tour-spot.no-anim { transition: none; }

.tour-card {
  position: fixed;
  z-index: 201;
  width: 310px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--lift-3);
  padding: 16px 18px 14px;
  transition: top .2s ease, left .2s ease;
}

.tour-card.no-anim { transition: none; }

.tour-count {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

.tour-title {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.018em;
  color: var(--ink);
}

.tour-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

.tour-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.tour-actions .btn:first-child { margin-right: auto; }

@media (max-width: 600px) {
  .tour-card { width: calc(100vw - 24px); }
}

/* ---------- Utilities ---------- */

.muted { color: var(--muted); }

.mono { font-size: .93em; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- Noscript ---------- */

.noscript-notice {
  max-width: 460px;
  margin: 12vh auto 0;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--lift-2);
  text-align: center;
}

/* ---------- Animations ---------- */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Responsive ---------- */

/* ---------- Mobile shell: topbar + drawer ----------
   Under 901px the rail detaches into an off-canvas drawer behind a
   scrim, and a dark topbar with a hamburger takes over. Same DOM at
   every width - CSS alone decides which chrome shows - so there is
   exactly one navigation to maintain. */

.mobile-topbar { display: none; }
.drawer-scrim { display: none; }

@media (max-width: 900px) {
  .shell,
  .portal-shell { display: block; }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--rail-grad);
  }
  .mobile-topbar .brand { padding: 0; color: var(--rail-text-strong); }
  .mobile-topbar .brand-mark { background-color: var(--accent-lift); }

  .topbar-menu {
    border: 0;
    background: transparent;
    padding: 10px;
    margin-left: -6px;
    cursor: pointer;
  }
  .topbar-menu-bars { display: block; width: 20px; }
  .topbar-menu-bars i {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    margin: 4px 0;
    transition: transform .2s ease, opacity .2s ease;
  }
  body.drawer-open .topbar-menu-bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.drawer-open .topbar-menu-bars i:nth-child(2) { opacity: 0; }
  body.drawer-open .topbar-menu-bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    width: min(300px, 86vw);
    height: 100%;
    transform: translateX(-105%);
    transition: transform .25s cubic-bezier(.22, 1, .36, 1);
  }
  body.drawer-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  }

  .drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 14, 17, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  body.drawer-open .drawer-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .content { padding: 22px 18px 48px; }

  /* Tabs scroll rather than wrap into a second row. */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab { flex: none; white-space: nowrap; }

  .wizard { grid-template-columns: 1fr; }

  .wizard-rail { position: static; }

  .wizard-steps {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wizard-steps li { flex: none; }

  .wizard-step {
    width: auto;
    align-items: center;
  }

  .wizard-step-desc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .drawer-scrim,
  .topbar-menu-bars i { transition: none !important; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }

  .content { padding: 18px 14px 44px; }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header h1,
  .page-header h2,
  .page-title { font-size: 23px; }

  .panel { padding: 18px 16px; }

  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .card-grid,
  .account-grid { grid-template-columns: 1fr; }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal { max-height: 92vh; }

  .modal-header,
  .modal-head,
  .modal-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .modal-actions {
    padding: 12px 18px;
    flex-wrap: wrap;
  }

  .modal-actions .btn { flex: 1 1 auto; }

  .identity-row {
    flex-direction: column;
    gap: 2px;
  }

  .identity-value { text-align: left; }

  #toasts {
    right: 12px;
    left: 12px;
    bottom: 14px;
    max-width: none;
    align-items: stretch;
  }
}

@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr; }
}

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

/* ---------------- Week planner ---------------- */
/* The planner draws the week the schedules actually produce: tinted segments
   are held speed (darker teal = faster), accent lines are the fires that
   change it. Segments and fires are absolutely positioned inside fixed-height
   day columns; the grid scrolls horizontally inside its own container so the
   page never scrolls sideways. */

.plan-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.plan-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(96px, 1fr));
  grid-template-rows: auto 1fr;
  min-width: 760px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.plan-corner {
  grid-row: 1;
  grid-column: 1;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunk);
}

.plan-day-head {
  grid-row: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface-sunk);
}

.plan-gutter {
  grid-row: 2;
  grid-column: 1;
  position: relative;
  background: var(--surface-sunk);
}

.plan-gutter-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--faint);
}

.plan-col {
  grid-row: 2;
  position: relative;
  border-left: 1px solid var(--line);
  touch-action: none; /* the column owns vertical drags for create and move */
  cursor: crosshair;
}

.plan-hourline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed color-mix(in srgb, var(--line) 55%, transparent);
  pointer-events: none;
}

.plan-seg {
  position: absolute;
  left: 0;
  right: 0;
  /* Segments take the pointer: a click opens the schedule that set them,
     and the column's drag-create still works because segment events
     bubble through the column's own listeners. Flex centers the speed
     pill in the block. */
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Raised bands carry a solid green bar; the floor - the week's lowest
   speed - is a gray hatch so off time reads as off. */
.plan-seg.is-raised {
  border-left: 3px solid var(--live);
}

.plan-seg.is-floor {
  background:
    repeating-linear-gradient(135deg,
      transparent 0 5px,
      color-mix(in srgb, var(--line-strong) 60%, transparent) 5px 6px),
    var(--surface-sunk);
}

/* The speed, centered as a pill, legible on any band. */
.plan-seg-label {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.plan-seg-label.lg { font-size: 12.5px; }

.plan-fire {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid var(--accent);
  cursor: grab;
  outline-offset: 4px;
}

.plan-fire:focus-visible {
  outline: 2px solid var(--accent);
}

.plan-fire.dragging {
  cursor: grabbing;
  border-top-style: dashed;
}

.plan-fire-chip {
  position: absolute;
  top: -9px;
  left: 4px;
  padding: 1px 7px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 11px;
  line-height: 15px;
  white-space: nowrap;
  pointer-events: none;
}

.plan-ghost {
  position: absolute;
  left: 2px;
  right: 2px;
  border: 1.5px dashed var(--accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  padding: 2px 6px;
  pointer-events: none;
  z-index: 2;
}

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.plan-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.plan-key-fill {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--live) 28%, var(--surface));
  border: 1px solid var(--line);
}

.plan-key-fill.floor {
  background:
    repeating-linear-gradient(135deg,
      transparent 0 5px,
      color-mix(in srgb, var(--line-strong) 60%, transparent) 5px 6px),
    var(--surface-sunk);
}

/* The schedule digest: the plan in words, above the grid. */
.plan-digest {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 2px 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-body);
}

.plan-digest-item strong {
  color: var(--ink);
  font-weight: 600;
}

.plan-key-fire {
  width: 14px;
  height: 0;
  border-top: 2px solid var(--accent);
}

/* Quick add: the day and time selectors that fill the grid. */
.plan-quickadd {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-sunk);
}

.plan-qa-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.plan-qa-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-qa-days .day-chips {
  margin: 0;
}

@media (max-width: 640px) {
  .plan-quickadd {
    align-items: stretch;
  }

  .plan-qa-field {
    flex: 1 1 140px;
  }
}

/* ---------------- Organisation switcher ---------------- */
/* Sits above the navigation because it changes what every link below it
   means. Only rendered for client users with more than one organisation. */

.org-switch-slot {
  margin: 2px 0 10px;
}

.org-switch {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.org-switch-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.org-switch-select {
  width: 100%;
  font-weight: 500;
}

/* ============================================================
   Redesign surfaces: motion, the tenant switcher, the split
   sign-in. Everything below is new vocabulary; the classes are
   produced by portal/js/app.js.
   ============================================================ */

/* ---------- Motion ---------- */

@keyframes bt-page {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-drop {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes bt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@keyframes bt-tide {
  0%, 42%, 100% { height: 14%; }
  50%, 92% { height: 78%; }
}

/* Cards rise in behind the page header, gently staggered. */
.view .panel { animation: bt-fade-up .5s cubic-bezier(.22, 1, .36, 1) both; }
.view .panel:nth-of-type(2) { animation-delay: .08s; }
.view .panel:nth-of-type(3) { animation-delay: .16s; }
.view .panel:nth-of-type(4) { animation-delay: .24s; }

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: bt-pulse 2.4s ease-in-out infinite;
}

/* ---------- Tenant switcher ---------- */

.org-tile-wrap { position: relative; margin: 0 0 6px; }

.org-tile {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--rail-hair);
  border-radius: 13px;
  color: var(--rail-text-strong);
  font-family: inherit;
  text-align: left;
  cursor: default;
}

button.org-tile { cursor: pointer; transition: background .15s ease; }
button.org-tile:hover { background: rgba(255, 255, 255, .1); }

.org-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.org-tile-text { min-width: 0; flex: 1; }
.org-tile-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-tile-sub {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: rgba(255, 255, 255, .5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-tile-chevron { flex: none; font-size: 11px; color: rgba(255, 255, 255, .5); }

.org-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--rail-raised);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  padding: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
  animation: bt-drop .18s ease both;
}

.org-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--rail-text-strong);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.org-option:hover { background: rgba(255, 255, 255, .07); }
.org-option .org-avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.org-option-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-option-sub {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, .45);
}
.org-option-check { flex: none; margin-left: auto; font-size: 12px; color: var(--live-lift); }

/* ---------- The rail savings tile ---------- */

.rail-savings {
  margin-bottom: 8px;
  padding: 13px 15px;
  background: rgba(18, 113, 90, .14);
  border: 1px solid rgba(63, 191, 149, .2);
  border-radius: 13px;
}
.rail-savings-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
}
.rail-savings-value {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--live-lift);
}
.rail-savings-value small { font-size: 11px; color: rgba(63, 191, 149, .7); }

/* ---------- Split sign-in ---------- */

.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: #fbfbfd;
}

.login-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 88px;
  animation: bt-page .45s cubic-bezier(.22, 1, .36, 1) both;
}

/* Inside the split, the card is not a card: the left column is the form,
   flat on the page. Every sign-in step (password, MFA, enrolment) renders
   into the same element, so they all inherit this. */
.login-split .login-card {
  width: 100%;
  max-width: 408px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.login-split .login-card .brand { padding: 0 0 26px; }
.login-split .login-title { font-size: 32px; letter-spacing: -.028em; margin-top: 8px; }

.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  background: linear-gradient(160deg, #17171c, #26262f);
  overflow: hidden;
}

.login-art-glow {
  position: absolute;
  top: -160px;
  right: -120px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 144, 156, .14), rgba(232, 144, 156, 0) 62%);
  animation: bt-drift 12s ease-in-out infinite;
}

@keyframes bt-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-28px, 18px); }
}

.login-art-body { position: relative; }

.login-tide {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
}
.login-tide .tide-bar {
  flex: 1;
  border-radius: 5px 5px 2px 2px;
  height: 14%;
}

.login-week {
  display: grid;
  grid-template-columns: 30px repeat(24, 1fr);
  gap: 2px;
  align-items: center;
  margin-top: 30px;
}
.login-week .lw-day {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, .4);
  text-transform: uppercase;
}
.login-week i {
  display: block;
  height: 12px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, .09);
}
.login-week i.is-peak { background: var(--accent-lift); }

.login-quote {
  margin: 36px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .85);
  max-width: 380px;
}
.login-quote-sub {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
}

@media (max-width: 980px) {
  .login-split { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-side { padding: 48px 24px; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .view,
  .view .panel,
  .org-menu,
  .login-side,
  .login-art-glow,
  .login-tide .tide-bar,
  .live-dot {
    animation: none !important;
  }
}

/* The brand on the dark rail reads white with the lifted mark; the same
   block on the sign-in page keeps its ink-on-light rendering. */
.sidebar .brand { color: var(--rail-text-strong); }
.sidebar .brand-mark { background-color: var(--accent-lift); }

/* Filled planner blocks are clickable: they open the schedule that set
   them. The hover ring says so before the click. */
.plan-seg.has-owner { cursor: pointer; }
/* The hover ring uses the control color: the click opens the schedule
   that controls the block, and green-on-green vanished on darker bands. */
.plan-seg.has-owner:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ---------- Rail rework: icons, contrast, rhythm ---------- */

.nav-icon {
  display: inline-flex;
  flex: none;
  width: 17px;
  height: 17px;
  opacity: .75;
}
.nav-icon svg { width: 100%; height: 100%; }
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Brighter resting text and a touch more size: the rail is read in the
   periphery, and .6 white at 13.5px was disappearing into the ground. */
.nav-item { color: rgba(255, 255, 255, .72); font-size: 14px; }

/* Only the LINK LIST scrolls now (see .sidebar .nav); the pale default
   scrollbar was reading as a broken border. Thin and dark, visible only
   while it matters. */
.sidebar .nav { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.sidebar .nav::-webkit-scrollbar { width: 6px; }
.sidebar .nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 3px; }
.sidebar .nav::-webkit-scrollbar-track { background: transparent; }

/* The global focus ring is the base maroon, which measures 2.35:1 on the
   dark rail - invisible to the keyboard user it exists for. WCAG 1.4.11
   wants 3:1; the lifted maroon gives 7.6:1 on the same ground. */
.sidebar :focus-visible { outline-color: var(--accent-lift); }

/* The two footer buttons agree on a size (12.5px vs 13.5px before). */
.sidebar .btn-ghost { font-size: 13px; }

/* The role badge in the user chip is an inline fact, not a bar. */
.user-chip .badge { align-self: flex-start; }

/* Header client switcher (staff, client detail): a compact select that
   jumps between clients without the list page. */
.client-switch { width: auto; min-width: 210px; }

/* ---------- Circuit page tabs ---------- */

.circuit-tabs { margin: 6px 0 18px; }

/* The circuit page runs to ~4000px on a phone; a sticky tab bar means
   switching tabs never requires scrolling back to the top. */
@media (max-width: 700px) {
  .circuit-tabs {
    position: sticky;
    top: 62px;
    z-index: 4;
    background: var(--bg);
  }
}

.tab-body > .panel:first-child { margin-top: 0; }

.speed-panel { margin-bottom: 22px; }

.provider-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 24px;
  margin-top: 4px;
}
.provider-fact small {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.provider-fact { font-size: 13.5px; }

/* ---------- Tags and policies ---------- */

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.circuit-tags { margin: -14px 0 18px; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-deep);
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 3px 10px;
}

.tag-chip-x {
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font-size: 13px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
  opacity: .6;
}
.tag-chip-x:hover { opacity: 1; }

/* Tag picker: a curated dropdown. The dashed chip opens a menu of the
   org's existing tags; clicking one applies it immediately. New tags are
   typed into the row at the bottom. */
.tag-chip.is-add {
  /* A tag is an identifier and reads in mono; this one is a button that
     says "Add tag", which is words. */
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  background: var(--surface);
  color: var(--muted);
  border-style: dashed;
  border-color: var(--line-strong);
}
.tag-chip.is-add:hover,
.tag-chip.is-add[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.tagpick { position: relative; display: inline-flex; }

.tagpick-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 70;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 30, 40, .16);
  padding: 6px;
}

.tagpick-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.tagpick-item:hover,
.tagpick-item:focus-visible { background: var(--accent-wash); color: var(--accent-deep); }

.tagpick-sep { height: 1px; background: var(--line); margin: 6px 4px; }

.tagpick-new { display: flex; gap: 6px; padding: 4px 2px 2px; }
.tagpick-new .input { flex: 1; min-width: 0; width: auto; padding: 7px 10px; font-size: 12.5px; }

.policy-schedule {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.policy-schedule + .policy-schedule { margin-top: 10px; }

/* ---------- Impersonation banner ---------- */
/* Fixed and unmissable: an admin browsing as someone else must never
   forget it. Bottom-center so it fights neither the rail nor the topbar. */

.imp-banner {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 680px);
  background: var(--accent-deep);
  color: #fff;
  font-size: 13px;
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(15, 14, 17, .35);
}
.imp-banner strong { color: #fff; }
.imp-banner .imp-exit {
  background: #fff;
  color: var(--accent-deep);
  border: 0;
  font-weight: 700;
  flex: none;
}

/* On a phone the pill wrapped its sentence into a ~200x145 ellipse floating
   dead center over the planner's Save button, so staff impersonating a
   client could not save. A slim full-width strip instead, and the proposal
   bar gets clearance above it. */
@media (max-width: 600px) {
  .imp-banner {
    left: 12px;
    right: 12px;
    bottom: 8px;
    transform: none;
    max-width: none;
    border-radius: var(--radius-control);
    padding: 8px 12px;
    font-size: 12px;
    gap: 10px;
  }
  body:has(.imp-banner) .wk-proposal { bottom: 62px; }
}
/* The floating viewing-as pill sat over the last row of every page. Give
   the page enough tail for content to scroll clear of it. */
body:has(.imp-banner) .content { padding-bottom: 110px; }

/* The sandbox banner rides the impersonation pill's chassis but reads as
   a safe place, not a warning: live green, same slot. If both ever show
   (an admin impersonating an AE in sandbox), the sandbox pill steps up. */
.sbx-banner { background: var(--live); }
body:has(.imp-banner):has(.sbx-banner) .sbx-banner { bottom: 64px; }

/* ---------- Circuits list toolbar and bulk actions ---------- */

.circuits-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}
.circuits-search { max-width: 280px; }
/* "Show demo & simulation" sits at the end of the toolbar, pushed right so
   it reads as a view option rather than another filter. */
.circuits-demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.circuits-demo-toggle input { cursor: pointer; }

.tag-chip.is-filter {
  cursor: pointer;
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line-strong);
}
.tag-chip.is-filter:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.is-filter.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
}

/* Column filter selects sit compact in the toolbar; sortable headers are
   buttons styled as the header text they replace. */
/* Same height and text size as the search input beside them - the toolbar
   used to pair a 43.6px input with 36.2px selects in one flex row. */
.circuits-filter { width: auto; min-width: 150px; padding: 11px 30px 11px 12px; font-size: 14px; }

.th-sort {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.th-sort:hover { color: var(--accent); }
.th-sort.on { color: var(--ink); }

.th-arrows { margin-left: 4px; opacity: .35; }
.th-sort:hover .th-arrows { opacity: .8; }
.th-sort.on .th-arrows { opacity: 1; color: var(--accent); }

/* Policy schedule fields: a strict grid so labels and inputs share
   baselines instead of zigzagging when flex wraps. */
.policy-grid {
  display: grid;
  /* The time column never shrinks below the native control's 12-hour
     rendering: a clipped "07:00 PM" reads as 07:00, and a user picked
     the wrong row to edit because open and close looked identical. */
  grid-template-columns: repeat(3, 1fr) minmax(150px, 1fr);
  gap: 2px 14px;
  align-items: start;
}
.policy-grid .field { margin: 0; }
.policy-grid .pg-name { grid-column: 1 / 4; }
.policy-grid .pg-time { grid-column: 4; }
/* A speed ladder is a wrapping row of steps, so each direction gets a full
   line. Half-width columns squeezed the steps into a ragged block. */
.policy-grid .pg-down { grid-column: 1 / 5; }
.policy-grid .pg-up { grid-column: 1 / 5; }
.policy-grid .pg-down,
.policy-grid .pg-up { margin-top: 8px; }

/* On a phone every field takes its own line: pairing Time with a speed
   ladder clipped both. */
@media (max-width: 640px) {
  .policy-grid { grid-template-columns: 1fr; }
  .policy-grid .pg-name,
  .policy-grid .pg-time,
  .policy-grid .pg-down,
  .policy-grid .pg-up { grid-column: 1; }
  .policy-grid .pg-time { margin-top: 8px; }
}

/* Holidays card: a compact row list above the add form. Appended for the
   holidays feature; reuses the panel, badge, and field styles. */
.holiday-row {
  display: flex;
  /* Wrapping is the fix for a real bug: the rule chips ("Every fourth
     Thursday of November, plus a day") cannot shrink, so without wrap the
     name column absorbed the whole squeeze - on a phone it collapsed to
     one word per line and its overflow painted UNDER the chip. When the
     row is tight the chips drop to their own line instead. */
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.holiday-row:first-child { padding-top: 0; }
.holiday-row-main { min-width: 0; }
.holiday-row .badge { flex: none; }
.holiday-row.is-past .holiday-row-main { opacity: .55; }
@media (max-width: 600px) {
  /* The name and date own the first line; chips and Delete share the next. */
  .holiday-row-main { flex: 1 1 100%; }
}
.holiday-add { margin-top: 12px; }
.holiday-add .field { margin-bottom: 4px; }

/* ---- Window-layer planner (v2) -------------------------------------- */

/* The column IS the baseline: hatch everywhere a band is not. */
.plan-col {
  background:
    repeating-linear-gradient(135deg,
      transparent 0 5px,
      color-mix(in srgb, var(--line-strong) 45%, transparent) 5px 6px),
    var(--surface-sunk);
}

.plan-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.plan-toolbar .btn:last-child { margin-left: auto; }

.plan-baseline {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.plan-baseline:hover { border-color: var(--accent); }
.plan-baseline.is-static { cursor: default; }
.plan-baseline.is-static:hover { border-color: var(--line-strong); }
.plan-baseline-edit { color: var(--accent); font-size: 12px; margin-left: 6px; }
.plan-tz { font-size: 12px; }

.plan-viewtoggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}
.plan-viewtoggle button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--muted);
}
.plan-viewtoggle button.on {
  background: var(--accent);
  color: #fff;
}

.plan-day-date { color: var(--muted); font-weight: 400; }

/* Bands: the windows themselves. */
.plan-band {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--live) 55%, var(--line));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  z-index: 2;
}
.plan-band.is-editable { cursor: grab; }
.plan-band.is-editable:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.plan-band.is-editable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.plan-band.dragging { opacity: .85; cursor: grabbing; z-index: 5; }

.plan-band.is-ghost {
  background: transparent;
  border: 1.5px dashed var(--line-strong);
  color: var(--muted);
}
.plan-band.is-policy {
  background: repeating-linear-gradient(45deg,
      color-mix(in srgb, var(--accent) 14%, transparent) 0 6px,
      color-mix(in srgb, var(--accent) 7%, transparent) 6px 12px),
    var(--surface);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.plan-band-name {
  font-size: 11px;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-grip {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  cursor: ns-resize;
  z-index: 3;
}
.plan-grip.top { top: -2px; }
.plan-grip.bottom { bottom: -2px; }
.plan-band.is-editable:hover .plan-grip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  top: 2px;
}

/* Raw fires the window layer cannot claim: visible, read-only markers. */
.plan-rawfire {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid var(--warn, #b05c00);
  z-index: 4;
}
.plan-rawfire .plan-fire-chip { position: absolute; top: -9px; left: 4px; }
.plan-rawfire.is-policy { border-top-color: var(--accent); }

/* Holiday strip + the This-week override day. */
.plan-holiday-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.plan-holiday-chip {
  font-size: 12.5px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  border-radius: 999px;
  padding: 4px 12px;
}
.plan-holiday-manage { font-size: 12.5px; }

.plan-holiday-day {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: 12px;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent-wash) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
}

/* Legend chips for the new states. */
.plan-key-fill.is-ghost {
  background: transparent;
  border: 1.5px dashed var(--line-strong);
}
.plan-key-fill.is-policy {
  background: repeating-linear-gradient(45deg,
      color-mix(in srgb, var(--accent) 14%, transparent) 0 4px,
      color-mix(in srgb, var(--accent) 7%, transparent) 4px 8px);
}

/* The window list under the grid. */
.win-list { margin-top: 16px; }
.win-list-title {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.win-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.win-row:last-child { border-bottom: 0; }
.win-row.is-paused .win-row-main { opacity: .55; }
.win-row-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.win-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.win-advanced { margin-top: 14px; }
.win-advanced summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.win-advanced summary:hover { color: var(--accent); }

/* Legacy truth bands: what will run, drawn softer than editable windows. */
.plan-band.is-legacy { cursor: pointer; }
.plan-band.is-legacy:hover { box-shadow: inset 0 0 0 2px var(--line-strong); }
.plan-band.is-legacy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- Speed ladders ---------------------------------------------------
   A circuit can only run at the steps its provider publishes, so speeds
   are picked, never typed. A wrapping row of steps shows the ceiling
   without opening anything, which also survives a phone better than a
   select. */
.speed-field { min-width: 0; }

.speed-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.speed-tier {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-body);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  white-space: nowrap;
}
.speed-tier:hover { border-color: var(--accent); color: var(--accent); }
.speed-tier:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.speed-tier.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Holiday preset picker: a checklist, because nothing is added for the org. */
.holiday-preset {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.holiday-preset:last-of-type { border-bottom: 0; }
.holiday-preset:hover { background: var(--surface-sunk); }
.holiday-preset.is-added { opacity: .55; cursor: default; }
.holiday-preset-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.holiday-preset-main small { font-size: 11.5px; }

/* ==== Week scheduler (2026-08-24 handoff) ============================
   The grid is the editor and the right panel edits what the grid shows.
   Color carries state only: maroon tint is a live window, grey is paused,
   hatched is managed elsewhere. */

.wk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wk-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.wk-baseline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-sunk);
  border-radius: 999px;
  padding: 5px 6px 5px 14px;
}
/* The sentence that stops "baseline" reading as jargon. Full width so it
   sits under the pill row rather than crowding the toggles. */
.wk-baseline-hint {
  flex-basis: 100%;
  order: 9;
  font-size: 12px;
  color: var(--muted);
}
.wk-baseline-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.wk-baseline-steps { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.wk-step {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.wk-step:hover:not(:disabled) { color: var(--ink); }
.wk-step.on { background: var(--ink); color: var(--surface); }
.wk-step.is-over { opacity: .4; text-decoration: line-through; cursor: not-allowed; }

.wk-viewtoggle {
  display: inline-flex;
  background: var(--surface-sunk);
  border-radius: 999px;
  padding: 3px;
}
.wk-viewtoggle button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.wk-viewtoggle button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(28, 27, 24, .08);
}

/* The one clock label, sitting as a quiet subtitle under "Your week". */
.wk-tz { display: block; margin: 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

.wk-pause {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--surface-sunk);
  color: var(--ink-body);
  cursor: pointer;
  margin-left: auto;
}
.wk-pause.is-paused { background: rgba(176, 120, 20, .13); color: #7a4f00; }

/* The sentence is the highest-value line here, so it is body text. */
.wk-summary {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  padding: 11px 14px;
  background: var(--surface-sunk);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.wk-summary-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
}

.wk-hints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
/* A phrase, so the body face. Only the 15 inside it is a value. */
.wk-hint-snap { font-size: 11px; }

.wk-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 22px;
  margin-top: 14px;
  align-items: start;
}
.wk-gridwrap { min-width: 0; overflow-x: auto; }

.wk-grid { min-width: 620px; }
.wk-grid-head,
.wk-cols {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(0, 1fr));
}
.wk-grid-head { border-bottom: 1px solid var(--line); }
.wk-dayhead {
  padding: 9px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--line);
}
.wk-dayhead.is-today { color: var(--accent); }
.wk-daydate { font-weight: 400; letter-spacing: 0; }

.wk-gutter { position: relative; }
.wk-tick {
  position: absolute;
  right: 10px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.wk-col {
  position: relative;
  border-left: 1px solid var(--line);
  cursor: crosshair;
  /* pan-y, never none: a finger must still scroll the page over the grid. */
  touch-action: pan-y;
}
.wk-col.is-weekend { background: var(--surface-sunk); }
.wk-hourline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  opacity: .6;
  pointer-events: none;
}
.wk-hourline.is-noon { opacity: 1; }
.wk-bare {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: .7;
  pointer-events: none;
}
.wk-now {
  position: absolute;
  left: -1px;
  right: -1px;
  height: 2px;
  background: var(--accent);
  z-index: 5;
  pointer-events: none;
}
.wk-now i {
  position: absolute;
  top: -3px;
  left: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Bands */
.wk-band {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 7px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  z-index: 2;
}
.wk-band.is-live {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--accent-deep);
}
.wk-band.is-paused {
  background: var(--surface-sunk);
  box-shadow: inset 3px 0 0 var(--line-strong);
  color: var(--ink-body);
}
.wk-band.is-draft {
  outline: 1.5px dashed var(--accent);
  outline-offset: -1.5px;
}
.wk-band.is-legacy {
  background: rgba(176, 120, 20, .12);
  box-shadow: inset 3px 0 0 #b07814;
  color: #7a4f00;
  cursor: pointer;
}
.wk-band.is-policy {
  background:
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 14%, transparent) 0 6px,
      transparent 6px 12px),
    var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--accent-deep);
}
.wk-band.is-editable { cursor: grab; }
.wk-band.is-editable:hover { box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px var(--accent); }
.wk-band.is-sel { box-shadow: inset 3px 0 0 var(--accent), 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.wk-band:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wk-band.dragging { opacity: .9; cursor: grabbing; z-index: 6; }

.wk-band-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The row wraps, the speed does not. A band is about 72px wide, so a speed
   and a tag cannot share a line: "500 Mbps PROPOSED" clipped the tag to
   "PROPOSE". Keeping the speed on one line and letting the tag drop beneath
   it reads properly at every band width. */
.wk-band-speedrow { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; min-width: 0; }
.wk-band-speed { font-family: var(--font-mono); font-size: 12px; font-weight: 500; white-space: nowrap; }
.wk-band-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(28, 27, 24, .09);
  white-space: nowrap;
}
/* A staged band, not a running one. Accent rather than grey, so "Proposed"
   does not read as just another piece of metadata. */
.wk-band-tag.is-draft {
  background: var(--accent);
  color: #fff;
}
.wk-band-range,
.wk-band-meta { font-family: var(--font-mono); font-size: 11px; opacity: .92; }
.wk-notches { display: flex; gap: 2px; margin-top: auto; }
.wk-notch {
  width: 5px;
  height: 5px;
  border-radius: 1.5px;
  background: rgba(28, 27, 24, .16);
}
.wk-notch.on { background: currentColor; }

.wk-grip { position: absolute; left: 0; right: 0; height: 8px; cursor: ns-resize; z-index: 4; }
.wk-grip.top { top: 0; }
.wk-grip.bottom { bottom: 0; }
.wk-grip-mark {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: .4;
  pointer-events: none;
}

.wk-ghost {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 7px;
  border: 1.5px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}

.wk-holiday-day {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: 11.5px;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent-wash) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
}

/* Panel */
.wk-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wk-card { background: var(--surface-sunk); border-radius: 12px; padding: 18px 20px; }
.wk-card-empty { text-align: center; padding: 30px 22px; }
.wk-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
/* An eyebrow heading reads as words, not as data. */
.wk-card-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
.wk-card-title { font-size: 15px; font-weight: 700; margin-top: 5px; }
.wk-close {
  width: 26px;
  height: 26px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}
.wk-close:hover { background: var(--line); color: var(--ink); }

.wk-row-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 13px;
  background: var(--surface);
  border-radius: 10px;
}
.wk-row-label { font-size: 12.5px; font-weight: 600; }
.wk-row-value { font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.wk-row-value small { font-size: 11px; color: var(--muted); }

.wk-field-label {
  font-size: 12.5px;
  font-weight: 600;
  margin: 18px 0 8px;
}
.wk-steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wk-stepper {
  display: flex;
  align-items: center;
  gap: 1px;
  background: var(--surface);
  border-radius: 999px;
  padding: 3px;
}
.wk-stepper button {
  width: 26px;
  height: 26px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.wk-stepper button:hover:not(:disabled) { background: var(--line); color: var(--ink); }
.wk-step-value {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
}
.wk-note { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 7px; }

.wk-daychips { display: flex; gap: 4px; flex-wrap: wrap; }
.wk-daychip {
  width: 32px;
  height: 29px;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.wk-daychip.on { background: var(--accent); color: #fff; box-shadow: none; }

.wk-facts { display: grid; gap: 8px; }
.wk-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wk-facts span { font-size: 12px; color: var(--muted); }
.wk-facts strong { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }

.wk-warn {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(176, 120, 20, .12);
  color: #7a4f00;
  font-size: 12px;
  font-weight: 600;
}

.wk-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.wk-delete {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #8f2222;
  cursor: pointer;
  padding: 0;
}

.wk-cost-hero {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.035em;
  margin-top: 8px;
}
.wk-cost-hero small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 6px;
}
.wk-cost-rows {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.wk-cost-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wk-cost-rows span { font-size: 12px; color: var(--ink-body); }
.wk-cost-rows strong { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.wk-saved {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  background: rgba(18, 113, 90, .09);
}
.wk-saved span { font-size: 12px; font-weight: 600; color: #0f5b48; }
.wk-saved strong { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: #0f5b48; }
.wk-cost-note { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }

/*
  The proposal bar. Sticks to the bottom of the scheduler card so it stays
  reachable while the 624px grid is scrolled: the whole point is that a week
  can be composed across several edits, and the way to commit it must not be
  somewhere you have to go looking for.
*/
.wk-proposal {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-small);
  background: var(--accent-wash);
}
.wk-proposal-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 260px;
}
.wk-proposal-text strong { font-size: 13.5px; color: var(--accent-deep); }
.wk-proposal-note {
  font-size: 12.5px;
  color: var(--ink-body);
  line-height: 1.5;
}
.wk-proposal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

@media (max-width: 600px) {
  /* Content above right-aligned actions, matching the other stacked rows. */
  .wk-proposal { align-items: stretch; }
  .wk-proposal-actions { justify-content: flex-end; }
}

.wk-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.wk-legend-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
.wk-key { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-body); }
.wk-sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; flex: none; }
.wk-sw.base { background: var(--surface-sunk); box-shadow: inset 0 0 0 1px var(--line-strong); }
.wk-sw.live { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); }
.wk-sw.paused { background: var(--surface-sunk); box-shadow: inset 3px 0 0 var(--line-strong); }
.wk-sw.policy {
  background: repeating-linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 14%, transparent) 0 4px, transparent 4px 8px);
  box-shadow: inset 3px 0 0 var(--accent);
}
.wk-legend-note { font-size: 12px; color: var(--muted); margin-left: auto; }

/* Phone: the panel stacks under the grid, and everything that relied on
   margin-left:auto stops pushing to a right edge that no longer exists. */
@media (max-width: 900px) {
  .wk-body { grid-template-columns: minmax(0, 1fr); }
  .wk-panel { order: 2; }
}
@media (max-width: 600px) {
  .wk-pause { margin-left: 0; }
  .wk-legend-note { margin-left: 0; }
  .wk-steppers { grid-template-columns: 1fr; }
  .wk-head { flex-direction: column; }
}
.wk-sw.legacy { background: rgba(176, 120, 20, .12); box-shadow: inset 3px 0 0 #b07814; }

/* Changes that set a speed already in force draw nothing, so they are
   named here instead of vanishing. */
.wk-inert {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.wk-inert-items { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Service diagnostics modal: each check is a badge + type on one line with
   its full message stacked under it, sorted worst-first. */
.diag-summary {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.diag-row {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.diag-row-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.diag-row-type { font-size: 13px; }
.diag-row-msg {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-body);
  overflow-wrap: anywhere;
}
.diag-row-msg.is-empty { color: var(--muted); font-style: italic; }
/* The Provider-tab "View report · <date>" link. */
.diag-viewlink {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.diag-viewlink:hover { color: var(--accent-deep, var(--accent)); }
.diag-viewlink:disabled { opacity: .6; cursor: default; text-decoration: none; }

/* Confirm-timezone callout on the Schedule tab: a calm prompt with an
   inline picker for staff, not a bare warning. */
.tz-confirm-banner {
  border-left: 3px solid var(--accent);
  background: var(--surface-sunk);
}
.tz-confirm-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.tz-confirm-row select { max-width: 320px; flex: 1 1 220px; }
.wk-inert-item {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-body);
  padding: 4px 10px;
  cursor: pointer;
}
.wk-inert-item:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------------------
   One-time changes: a dated exception to the week.

   Drawn in a cool slate rather than the accent maroon (a speed window) or
   the amber (an unpaired legacy row), so the three read apart at a glance
   without adding a fourth meaning to a colour already in use.
--------------------------------------------------------------------------- */
.wk-band.is-future {
  background: rgba(58, 90, 120, .13);
  box-shadow: inset 3px 0 0 #3a5a78;
  color: #274257;
  cursor: default;
}
.wk-band.is-future .wk-band-tag {
  background: rgba(58, 90, 120, .18);
  color: #274257;
}
.wk-band.is-future.is-running {
  background: rgba(58, 90, 120, .2);
  box-shadow: inset 3px 0 0 #3a5a78, 0 0 0 1px rgba(58, 90, 120, .35);
}
.wk-sw.future { background: rgba(58, 90, 120, .16); box-shadow: inset 3px 0 0 #3a5a78; }

.fut-panel .panel-head { align-items: flex-start; }
.fut-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.fut-row:first-child { border-top: 0; }
.fut-main { min-width: 0; flex: 1; }
.fut-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
}
.fut-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.fut-when, .fut-speed { font-family: var(--font-mono); }
.fut-speed { color: var(--ink); }
.fut-sep { opacity: .5; }
.fut-why { color: #8a3d3d; }
.fut-state {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--muted);
  font-weight: 600;
}
.fut-state.is-active, .fut-state.is-ending {
  background: rgba(58, 90, 120, .16);
  color: #274257;
}
.fut-state.is-failed { background: rgba(158, 34, 51, .12); color: var(--accent); }
.fut-past-head {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.fut-preview {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-sunk);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
}
@media (max-width: 600px) {
  .fut-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .fut-row .btn { align-self: flex-start; }
}

/* ---------------------------------------------------------------------------
   Quick actions: saved presets, read as cards.

   Each card has to answer three things at a glance - what it touches, what
   it sets them to, and what happens when it ends - so the target rows use a
   fixed four-column grid where the arrow always lands in the same place.
--------------------------------------------------------------------------- */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}
.qa-card { display: flex; flex-direction: column; gap: 12px; }
.qa-card.is-off { opacity: .6; }
.qa-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.qa-card-title { margin: 0; font-size: 16px; }
.qa-card-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
}
.qa-targets { display: flex; flex-direction: column; gap: 6px; }
.qa-target {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.qa-target-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-target-now { font-family: var(--font-mono); color: var(--muted); font-size: 12.5px; }
.qa-target-arrow { color: var(--faint); }
.qa-target-to {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
}
.qa-note {
  margin: 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-sunk);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-body);
}
.qa-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}
.qa-last { font-size: 12px; color: var(--muted); margin-left: auto; }

.qa-empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(20, 20, 30, .06);
}
.qa-empty h2 { margin: 0 0 6px; font-size: 16px; }
.qa-empty p {
  margin: 0 auto 16px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* The picker in the dialog: ticking a circuit reveals its own ladder,
   because the ladders differ per circuit. */
.qa-pick {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 320px;
  overflow-y: auto;
}
.qa-pick-row { border-top: 1px solid var(--line); padding: 9px 11px; }
.qa-pick-row:first-child { border-top: 0; }
.qa-pick-head {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
}
.qa-pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-pick-now {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.qa-pick-speed { margin-top: 8px; }
@media (max-width: 640px) {
  .qa-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Cost breakdown.

   The saving is the number this page exists for, so it gets width rather
   than a louder colour: a wider card at a larger size reads first without
   the screen looking like marketing. Figures line up on tabular numerals
   because the point of the table is that the rows add up to the header.
--------------------------------------------------------------------------- */
.cost-stats {
  display: grid;
  grid-template-columns: 1fr 1.7fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.cost-stat {
  background: var(--surface);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(20, 20, 30, .06);
}
.cost-stat-label {
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.cost-stat-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.cost-stat.is-hero .cost-stat-value { font-size: 46px; color: #1f7a52; }
.cost-chip {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(31, 122, 82, .12);
  color: #1f7a52;
}
.cost-stat-note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.cost-table { font-variant-numeric: tabular-nums; }
.cost-table td.num, .cost-table th.num { text-align: right; }
.cost-table th.num .th-sort { margin-left: auto; }
.cost-table td.mono { font-family: var(--font-mono); font-size: 12.5px; }
.cost-expand {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 9px;
  text-align: left;
}
.cost-caret {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 5px;
  background: var(--surface-sunk);
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
  text-align: center;
}
.cost-expand:hover .cost-caret { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.cost-name { font-weight: 600; }
.cost-loc { font-size: 12px; color: var(--muted); }
/* The bar sits behind the figure rather than in its own column, so the
   comparison costs no horizontal room. */
.cost-table td.num { position: relative; }
.cost-bar {
  position: absolute;
  left: 8px;
  right: auto;
  bottom: 8px;
  height: 3px;
  min-width: 56px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 34%, transparent);
}
.cost-monthly { position: relative; }
.cost-save { color: #1f7a52; }
.cost-row.is-open { background: var(--surface-sunk); }
.cost-detail-row > td { padding: 0 14px 14px 44px !important; background: var(--surface-sunk); }
.cost-tier-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cost-tier td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  color: var(--ink-body);
}
.cost-tier td.num { text-align: right; }
.cost-tier.is-total td { border-bottom: 0; font-weight: 600; color: var(--ink); }
.cost-basis {
  margin: 12px 2px 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 78ch;
}
.cost-skipped {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(176, 120, 20, .1);
  color: #7a4f00;
  font-size: 12.5px;
}
@media (max-width: 900px) {
  .cost-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .cost-stats { grid-template-columns: 1fr; }
  .cost-stat.is-hero .cost-stat-value { font-size: 38px; }
}

/* ---------------------------------------------------------------------------
   The week grid on a phone: one day at a time.

   Seven columns inside 390px gives 45px each, which is too thin to read a
   band's label in and too thin to drag inside. The alternative the old
   build used - a sideways scroller - hides most of the week behind a
   gesture nobody knows is there. So below 700px the grid renders a single
   full-width day behind a chip row, and the chips mark which days actually
   have windows so choosing one is not guesswork.

   The 700px here must match NARROW_PX in planner.js: the script decides
   how many columns to build, and this only has to lay them out.
--------------------------------------------------------------------------- */
/* Seven equal columns rather than a flex row: at 390px each chip gets
   about 48px, which fits "MON", and the whole week stays on one line so
   there is no wrapped seventh day dangling on its own. */
.wk-daychips {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.wk-daychip {
  min-width: 0;
  min-height: 42px;
  padding: 7px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-body);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
}
.wk-daychip .wk-daydate {
  font-size: 11px;
  letter-spacing: 0;
  color: var(--muted);
}
/* A dot, not a colour change: the chip's selected state already owns
   colour, and a day having windows is a separate fact from being open. */
.wk-daychip.has-windows::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.wk-daychip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wk-daychip.on .wk-daydate { color: rgba(255, 255, 255, .8); }
.wk-daychip.on.has-windows::after { background: #fff; }

/* Tap-to-edit scrolls the editor card into view on narrow screens; the
   margin keeps it clear of the 62px sticky topbar when it lands. */
.wk-card { scroll-margin-top: 76px; }

@media (max-width: 700px) {
  /* One column, so nothing needs a minimum width or a sideways scroll. */
  .wk-body.is-narrow .wk-grid { min-width: 0; }
  /* While a proposal is staged its sticky bar overlays the bottom of the
     editor card; this clearance keeps Update window tappable. */
  .wk-body.is-narrow.has-proposal .wk-panel { padding-bottom: 130px; }
  .wk-body.is-narrow .wk-grid-head,
  .wk-body.is-narrow .wk-cols { grid-template-columns: 46px minmax(0, 1fr); }
  .wk-body.is-narrow .wk-tick { right: 6px; }
  .wk-body.is-narrow .wk-dayhead {
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--ink);
  }
  /* Room to read a full label and to grab an edge with a finger. */
  .wk-body.is-narrow .wk-band { padding: 8px 10px; }
  .wk-body.is-narrow .wk-grip { height: 16px; }
}

/* ---------------------------------------------------------------------------
   Touch targets.

   Keyed on pointer: coarse OR a phone-width viewport. Coarse is the honest
   test - the problem is the finger, not the screen, and a tablet at 1024px
   needs these - but not every engine reports it reliably, and a phone-width
   window is enough on its own to justify a larger target. A narrow desktop
   window picking these up costs nothing; a phone missing them does not.

   The pattern throughout is to grow the HIT area without growing the mark,
   using padding or a pseudo-element, so the visual rhythm of a table header
   row or a tag chip stays as designed.
--------------------------------------------------------------------------- */
@media (pointer: coarse), (max-width: 700px) {
  /* Sortable headers were 16px tall. The label stays put; the button just
     reaches further. */
  .th-sort {
    padding: 9px 0;
    min-height: 34px;
  }

  /* A bare checkbox draws at 15px, which is under every touch guideline.
     It cannot carry a pseudo-element to pad its hit area - inputs are
     replaced elements and ::after never renders - so the box itself grows.
     22px matches what iOS and Android draw natively, so it reads as normal
     rather than oversized. Checkboxes wrapped in a label are left alone:
     the label is already the target and it is comfortably large. */
  table input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }

  /* Tag chips: the remove × was a 10px target inside a 22px chip. */
  .tag-chip { min-height: 32px; padding-top: 5px; padding-bottom: 5px; }
  .tag-chip-x {
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .tag-chip.is-add { min-height: 34px; }

  /* Speed tiers are pressed one after another while comparing prices, so
     they are worth a little more height than the 30px they draw at. The
     week scheduler's baseline steps are the same control under another
     name and were the smallest targets on the circuit page at 24px. */
  .speed-tier { min-height: 38px; }
  .wk-step { min-height: 34px; }
  .wk-daychip { min-height: 44px; }

  /* Small buttons stop being small. */
  .btn-sm { min-height: 36px; }

  /* A switch inside a label is tapped by the label, which is already big
     enough. A bare one - the Account page's notification switches - is a
     38x21 mark on its own, under the 24px minimum on the short side.
     Unlike a native checkbox this input sets appearance: none, so it is no
     longer a replaced element and a pseudo-element does render on it: the
     track keeps its designed size and gains an invisible 44px hit area.
     Clicks on a pseudo-element activate its host, so this is a real
     target, not a decoration. */
  label.switch { min-height: 36px; display: inline-flex; align-items: center; }
  input[type="checkbox"].switch { position: relative; }
  input[type="checkbox"].switch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
  }

  /* iOS zooms the whole page on focusing any control under 16px, and the
     user has to pinch back out after every field. Do NOT fix this with
     maximum-scale on the viewport meta - that kills pinch-zoom for people
     who need it. */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="time"], input[type="search"],
  input[type="url"], input[type="tel"], input[type="date"],
  select, textarea { font-size: 16px; }

  /* The window editor's time steppers: each tap is 15 minutes, so these
     get pressed a lot (44 taps from 19:00 to 08:00 before hold-to-repeat
     landed); 26x26 was the smallest control in the panel. */
  .wk-stepper button { min-width: 44px; min-height: 44px; }

  /* The only destructive control in the window editor measured 39x20 -
     under WCAG 2.5.8's 24px floor, and right beside Update window. The
     negative margin grows the target without moving the layout. */
  .wk-delete { min-height: 36px; padding: 8px 10px; margin: -8px 0; }

  /* Dismiss and close controls: the buttons that abandon a flow deserve
     more than a 23-27px square. */
  .modal-close, .wk-close {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .toast-close { min-width: 28px; min-height: 28px; }
  .plan-holiday-manage {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 6px;
    margin: -4px -6px;
  }

  /* Timeline paging: hit repeatedly to walk days and circuits, and 26px
     wide is a miss magnet. The rows have the space. */
  .tl-stepper .btn, .tl-daystep .btn { min-width: 44px; }
}

/* ---------------------------------------------------------------------------
   Schedule timeline.

   Rows are circuits, columns are hours. Every block states its speed, its
   name and its state in words, because a tint alone cannot be read by
   someone who cannot separate two tints, and "failed" is exactly the case
   where that matters most.

   State tints stay pale so the text on them keeps its contrast; the state
   is carried by a 3px inset rail down the left edge, which reads at a
   glance without dimming anything.
--------------------------------------------------------------------------- */
.tl-daystep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.tl-daylabel {
  font-size: 14px;
  font-weight: 600;
  min-width: 15ch;
}
.tl-viewtoggle {
  display: inline-flex;
  background: var(--surface-sunk);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.tl-viewtoggle button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 15px;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  min-height: 34px;
}
.tl-viewtoggle button.on {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 20, 30, .12);
}

.tl-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.tl-pill-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-body);
  cursor: pointer;
  min-height: 34px;
}
.tl-pill-btn.on { border-color: var(--ink); background: var(--ink); color: #fff; }

.tl-panel { padding-bottom: 12px; }
.tl-wrap { min-width: 0; }
.tl-scroll { overflow-x: auto; }
.tl-grid { display: inline-block; min-width: 100%; }

.tl-ruler { display: flex; height: 26px; }
/* Sticky, so scrolling to tonight does not scroll away the answer to
   "which circuit is this row". */
.tl-ruler-pad {
  width: var(--tl-label);
  flex: none;
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--surface);
}
.tl-ruler-lane { position: relative; flex: none; }
.tl-hour {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.tl-hour.is-major { color: var(--ink-body); font-weight: 500; }

.tl-row { display: flex; border-top: 1px solid var(--line); }
.tl-rowhead {
  width: var(--tl-label);
  flex: none;
  padding: 12px 14px 12px 0;
  min-width: 0;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--surface);
}
.tl-rowname {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-rowmeta {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}
.tl-rowspeed { font-family: var(--font-mono); }
/* The circuit's own zone, shown when it differs from the viewer's clock
   so a 5pm change sitting at the 4pm gridline reads as geography, not a
   glitch. */
.tl-rowtz {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  white-space: nowrap;
}

.tl-track { position: relative; flex: none; }
.tl-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-gridline.is-major { background: var(--line-strong); }
.tl-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: .75;
  z-index: 3;
}

/* top and height come from the script, which lane-packs the row, so they
   are deliberately absent here. */
.tl-block {
  position: absolute;
  border-radius: 8px;
  padding: 7px 9px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 2;
  min-width: 24px;
}
.tl-block:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tl-block-speed {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tl-block-name,
.tl-block-state {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* An explicit ink rather than opacity on the parent: dimming drops small
   text under 4.5:1 on these pale tints. */
.tl-block-name { color: var(--ink-body); }
.tl-block-state {
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 11px;
}

.tl-block.is-pending { background: rgba(58, 90, 120, .12); box-shadow: inset 3px 0 0 #3a5a78; }
.tl-block.is-pending .tl-block-state { color: #2c4a66; }
.tl-block.is-running { background: rgba(31, 122, 82, .14); box-shadow: inset 3px 0 0 #1f7a52; }
.tl-block.is-running .tl-block-state { color: #16603f; }
.tl-block.is-done { background: var(--surface-sunk); box-shadow: inset 3px 0 0 var(--line-strong); }
.tl-block.is-done .tl-block-state { color: var(--muted); }
.tl-block.is-failed { background: rgba(158, 36, 54, .13); box-shadow: inset 3px 0 0 var(--accent); }
.tl-block.is-failed .tl-block-state { color: var(--accent-deep); }
.tl-block.is-skipped { background: rgba(176, 120, 20, .12); box-shadow: inset 3px 0 0 #b07814; }
.tl-block.is-skipped .tl-block-state { color: #7a4f00; }
.tl-block.is-canceled { background: var(--surface-sunk); box-shadow: inset 3px 0 0 var(--line-strong); }
.tl-block.is-canceled .tl-block-name { text-decoration: line-through; }
.tl-block.is-unknown {
  background: repeating-linear-gradient(135deg,
    rgba(176, 120, 20, .1) 0 5px, transparent 5px 10px);
  box-shadow: inset 3px 0 0 #b07814;
}
.tl-block.is-unknown .tl-block-state { color: #7a4f00; }
/* A holiday hold spans the whole day, so it is hatched rather than solid:
   it is a state the day is in, not a change that happens at a moment. */
.tl-block.is-holiday {
  background: repeating-linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 11%, transparent) 0 6px, transparent 6px 12px);
  box-shadow: inset 3px 0 0 var(--accent);
}

.tl-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--muted);
}
.tl-pill.is-failed { background: rgba(158, 36, 54, .12); color: var(--accent); }
.tl-pill.is-pending { background: rgba(58, 90, 120, .14); color: #2c4a66; }
.tl-pill.is-running { background: rgba(31, 122, 82, .14); color: #16603f; }
.tl-pill.is-skipped,
.tl-pill.is-unknown { background: rgba(176, 120, 20, .13); color: #7a4f00; }
.tl-listrow { cursor: pointer; }

.tl-foot {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.tl-detail {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 7px 16px;
  margin: 0;
  font-size: 13px;
}
.tl-detail dt { color: var(--muted); }
.tl-detail dd { margin: 0; }
.tl-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-sunk);
  font-size: 12.5px;
  line-height: 1.55;
}
.tl-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 10px;
}
.tl-stepper-label { font-size: 13px; font-weight: 600; }

@media (max-width: 700px) {
  .tl-daystep { flex-wrap: wrap; }
  .tl-daylabel { min-width: 0; flex: 1; }
}

/* ---------------------------------------------------------------------------
   Describing the week in a sentence.

   The box is small on purpose: it is a shortcut to the grid, not a
   replacement for it, and it must not look like the primary way to build a
   schedule. What it read is shown in a dialog before anything is written,
   with the things it could not use called out in amber rather than hidden.
--------------------------------------------------------------------------- */
.describe-panel { padding-bottom: 18px; }
.describe-row { display: flex; gap: 8px; }
.describe-row .input { flex: 1; min-width: 0; }

.describe-echo {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-sunk);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-body);
}
.describe-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.85;
}
.describe-list .mono { font-family: var(--font-mono); }
.describe-none { margin: 0; color: var(--muted); font-size: 13px; }
.describe-examples { display: flex; flex-direction: column; gap: 6px; }
.describe-example {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 11px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
}
.describe-example:hover { border-color: var(--accent); color: var(--accent); }
.describe-warns {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(176, 120, 20, .1);
  color: #7a4f00;
}
.describe-warns-head {
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 5px;
}
.describe-warns ul { margin: 0; padding-left: 17px; font-size: 12.5px; line-height: 1.6; }
.describe-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
@media (max-width: 600px) {
  .describe-row { flex-direction: column; }
}

/* ---------------------------------------------------------------------------
   Telemetry sources and auto-boost tuning.

   The bars exist so somebody setting a threshold can see whether the
   circuit ever actually reaches it. The threshold lines are drawn across
   them for the same reason: a number in a field and a shape on a chart are
   only useful together.

   When no source is mapped the preset buttons are dimmed and disabled
   rather than hidden, so the reason is visible. A hidden control leaves a
   reader hunting for it; a live one would let them set a percentage that
   controls nothing.
--------------------------------------------------------------------------- */
.tel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.tel-row:first-child { border-top: 0; }
.tel-main { flex: 1; min-width: 0; }
.tel-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 13.5px;
}
.tel-kind {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--muted);
  font-weight: 600;
}
.tel-status {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--muted);
}
.tel-status.is-ok { background: rgba(31, 122, 82, .13); color: #16603f; }
.tel-status.is-failed { background: rgba(158, 36, 54, .12); color: var(--accent); }
.tel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}
.tel-actions { display: flex; gap: 6px; }
.tel-warn { color: #7a4f00; font-size: 12.5px; }
.tel-note {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-sunk);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-body);
}
.tel-mapped {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.tel-tuning {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tel-iface { margin-top: 8px; }

/* Bounded, because twelve bars stretched across a full-width panel become
   105px-wide slabs that read as blocks rather than as a trend. */
.tel-spark {
  position: relative;
  height: 74px;
  max-width: 440px;
  background: var(--surface-sunk);
  border-radius: 10px;
  padding: 8px 10px;
}
.tel-spark-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100%;
}
.tel-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  min-width: 4px;
  max-width: 30px;
}
.tel-bar.is-high { background: var(--accent); }
.tel-bar.is-low { background: color-mix(in srgb, var(--accent) 16%, transparent); }
/* Drawn inside the padded box, so a threshold line sits where the bars
   actually reach rather than at the edge of the card. */
.tel-line {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 0;
  border-top: 1px dashed var(--line-strong);
  margin-bottom: 8px;
}
.tel-line.is-high { border-top-color: var(--accent); opacity: .55; }
.tel-spark-foot {
  display: flex;
  justify-content: space-between;
  max-width: 440px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.tel-spark-now { font-family: var(--font-mono); color: var(--ink-body); }
.tel-spark-empty { margin: 0; font-size: 12.5px; color: var(--muted); }

.tel-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.tel-presets.is-inert { opacity: .5; }
.tel-preset {
  flex: 1 1 170px;
  text-align: left;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 52px;
}
.tel-preset:disabled { cursor: not-allowed; }
.tel-preset.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tel-preset-name { font-weight: 600; font-size: 13px; }
.tel-preset-blurb { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 600px) {
  .tel-row { flex-direction: column; align-items: flex-start; }
  .tel-preset { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------------------
   Integrations catalogue

   Reference, not controls, so it stays quieter than the cards above it: no
   shadow, no hover lift, nothing that invites a click on a vendor that is
   not built.

   Two shapes. Three connected vendors get cards, because they carry the
   detail somebody needs. Seven planned ones get one line each - the first
   version gave them equal-sized cards repeating "Not built yet.", which
   made the block twice as tall and said nothing.
   --------------------------------------------------------------------------- */

.vend-group-label {
  margin: 16px 0 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-head + .vend-group-label { margin-top: 14px; }

/* ---- Connected ---- */

.vend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vend-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.vend-head { display: flex; align-items: center; gap: 10px; }

/* The monogram, or a real logo once one is dropped in. Square, so a
   wordmark and an initial take the same footprint and the row of cards
   stays aligned. */
.vend-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-body);
}
/* A real logo brings its own shape, so the tile stops competing with it. */
.vend-mark.has-logo { background: none; border-color: transparent; }
.vend-mark img { width: 26px; height: 26px; object-fit: contain; }

/* A wordmark needs width, not a square. Same height as the square slot so
   the card head does not change line, roughly two and a half times as
   wide, which is what a 4.5:1 mark needs to be readable at all. */
.vend-mark.is-wide { width: 78px; border-radius: 6px; }
.vend-mark.is-wide img { width: 78px; height: 20px; }

.vend-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vend-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vend-signal {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--live);
}

.vend-detail {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-body);
}

/* ---- Coming soon ---- */

/* A grid, not a stack. Seven names in one column was the tallest block on
   the panel while carrying the least information in it; three across puts
   the same seven in three rows. Collapses to one column on a phone, where
   the width is not there to share. */
.vend-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-sunk);
}

/* One line, always. "Fortinet FortiGate" wrapped to two and made its row
   taller than the six beside it, which is the kind of thing that reads as
   broken rather than as long. */
.vend-row-name {
  font-size: 13px;
  color: var(--ink-body);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Which signal it would give, since that is the only thing worth knowing
   about one that is not built. */
.vend-row-signal {
  flex: 0 0 auto;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 600px) {
  .vend-grid,
  .vend-list { grid-template-columns: 1fr; }
}

/* ===========================================================================
   THE RULED PASS (2026-08-31). The design handoff's system, applied as one
   override layer so every page inherits it at once: no cards, hairline
   structure, 8px rect controls with 44px targets, IBM Plex, symbol+word
   statuses. Later rules win at equal specificity, which is the point -
   the component rules above keep their layout math and lose their chrome.
   =========================================================================== */

/* ---- 1. No cards. Content sits on the page ground; a hairline rule and
   space carry the structure. The FLOATING surfaces keep their chrome:
   dialogs, menus, toasts, and the mobile drawer are layers, not cards. */
.panel {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 22px 0;
}
.panel + .panel { margin-top: 6px; }
.card-grid > .panel { border-top: 1px solid var(--line); }

.modal.panel,
.modal {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-panel);
  box-shadow: var(--lift-3);
  padding: 0;
}
.org-menu { box-shadow: 0 14px 34px rgba(24, 24, 27, .18); }

/* ---- 2. Controls: 8px rects, 1.5px borders, 44px minimum targets.
   Primary is the rust fill; everything else is an outline that inks up
   on hover. */
.btn {
  border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  padding: 10px 18px;
  box-shadow: none;
}
.btn:hover {
  border-color: var(--ink);
  background: rgba(24, 24, 27, .04);
  box-shadow: none;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}
.btn-ghost { border-color: var(--line-strong); background: transparent; }
.btn-sm { min-height: 38px; padding: 7px 14px; border-radius: 8px; font-size: 14px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="time"], input[type="search"],
input[type="url"], input[type="tel"], input[type="date"],
select, textarea {
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ink);
  box-shadow: none;
}

/* ---- 3. Focus is a 3px ink outline everywhere; the rail flips it to the
   lifted rust because ink on ink is invisible. This is the catch-all the
   handoff insists on, so an unclassed control cannot ship without a ring.
   The input rule beats the base stylesheet's `outline: none`, which left
   bare checkboxes and switches with no ring at all. */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}
.sidebar :focus-visible { outline-color: var(--accent-lift); }

/* ---- 4. Labels: 12.5px/600 sans, .08em, sentence-case-off. The old
   system set micro-labels in 11px mono; the review called that unreadable
   and reserved mono for measured values. */
th,
.g-lab,
.wk-card-eyebrow,
.wk-baseline-label,
.wk-legend-label,
.wk-field-label {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- 5. The rail: flat ink, Ruled items (44px, 8px radius, rust fill on
   the active row), quieter labels in sans. */
.sidebar { background: var(--rail-grad); padding: 20px 14px; }
.nav-item {
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
  font-size: 15.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .8);
}
.nav-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active,
.nav-item.active:hover {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}
.nav-group {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .55);
}
.sidebar .brand-mark,
.mobile-topbar .brand-mark { background-color: var(--accent-lift); }
.org-tile {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
}
.org-avatar { background: var(--accent-hot); border-radius: 7px; }

/* ---- 6. Chips stay pills; a selected chip fills with ink, exactly the
   prototype's g-chip. Speed tiers are chips whose values read in mono. */
.speed-tier, .wk-step {
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-body);
  font-family: var(--font-mono);
  font-weight: 500;
}
.speed-tier:hover, .wk-step:hover { border-color: var(--ink); }
.speed-tier.on, .wk-step.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* ---- 7. Statuses keep their tones but read Ruled: 7px radius rects, the
   symbol+word pairing coming from the views. Failure fills solid so it can
   never be missed. */
.badge { border-radius: 7px; font-weight: 600; }
.badge-danger { background: var(--danger); color: #fff; }

/* ---- 8. Tables: rows on the ground, hairline-separated, no header fill. */
thead th { background: transparent; }
tbody tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: rgba(24, 24, 27, .025); }

/* ---- Circuit detail, control-and-record (no tabs). Things you change on
   the left; things you read in a sticky right column behind one hairline. */
.cd-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px 356px;
  grid-template-areas:
    "control rule record"
    "week    week week";
  gap: 0 30px;
  align-items: start;
  margin-top: 4px;
}
.cd-control { grid-area: control; min-width: 0; }
.cd-vrule { grid-area: rule; align-self: stretch; background: var(--line); width: 1px; }
/* Viewport-capped but NOT sticky. Chromium constrains a sticky grid
   item to the grid CONTAINER rather than its own grid area, so a sticky
   rail in row one slid down over the full-width week row while
   scrolling and floated over the transparent planner - the owner
   photographed exactly that. The cap alone keeps a long activity list
   from stretching the split; sticky returns only at the wide breakpoint
   below, where the rail spans both rows and the container IS its area. */
.cd-record {
  grid-area: record;
  min-width: 0;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.cd-week { grid-area: week; min-width: 0; }
/* The first section in each column sits flush under the split's top edge
   rather than doubling the rule. */
.cd-control > .panel:first-child,
.cd-record > div > .panel:first-child { border-top: 0; padding-top: 8px; }
/* Wide screens: the week rises into the control column and the record
   rail runs beside everything, so the page never shows a blank block
   between the speed controls and the planner. */
@media (min-width: 1780px) {
  .cd-split {
    grid-template-areas:
      "control rule record"
      "week    rule record";
  }
  /* Here the rail spans both rows, so sticky-with-a-viewport-cap is
     safe: its slide range is the full split, which is the design. */
  .cd-record {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
  /* The page cap is 1400px; beside a 356px rail that leaves the planner
     short of its seven days. Only the circuit page, and only at widths
     where the week sits beside the rail, gets the wider measure. */
  .content:has(.cd-split) { max-width: 1760px; }
}
@media (max-width: 1100px) {
  .cd-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "control" "record" "week";
  }
  .cd-vrule { display: none; }
  .cd-record { max-height: none; overflow: visible; }
}

/* Narrower planner columns beside the record rail: the band's status tag
   wraps under the speed instead of poking past the band's edge. */
.wk-band-speedrow { flex-wrap: wrap; }
.wk-band-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- The Ruled dashboard ---- */
.g-lab {
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.g-h2x { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 6px; }
.dash-h1 { margin: 6px 0 0; font-size: 29px; font-weight: 600; letter-spacing: -.028em; line-height: 1.2; }
.dash-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.dash-ink:hover { background: #000; border-color: #000; color: #fff; }

.dash-save {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px; align-items: end; padding: 26px 0 24px; border-bottom: 1px solid var(--line);
}
.dash-save-line { display: flex; align-items: baseline; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.dash-save-big { font-size: 52px; font-weight: 700; letter-spacing: -.045em; line-height: 1; color: var(--live); }
.dash-save-pct { font-size: 15px; font-weight: 600; color: var(--live); }
.dash-save-note { margin: 12px 0 0; max-width: 540px; font-size: 15px; line-height: 1.6; color: var(--ink-body); }
.dash-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-sunk); margin-top: 18px; max-width: 540px; }
.dash-bar i { display: block; background: var(--accent); }
.dash-bar-ends { display: flex; justify-content: space-between; max-width: 540px; margin-top: 7px; font-size: 14px; color: var(--muted); }
/* auto-fit, not a fixed four: a $4,078.33 in 26px mono needs ~130px, and
   four forced columns at laptop widths overlapped the figures. Columns
   wrap 4-3-2 as the row narrows and every figure keeps its room. */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 18px 20px; }
.dash-stat-v { margin: 8px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-family: var(--font-mono); }
.dash-stat-n { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

.dash-except {
  display: flex; align-items: center; gap: 16px; padding: 15px 0;
  border-bottom: 1px solid var(--line);
  /* A flat tint, not the prototype's gradient: the contrast auditor reads
     a gradient ground as its first stop at full opacity and cries wolf,
     and at 4% the eye cannot tell the difference anyway. */
  background: rgba(138, 36, 25, .04);
}
.dash-except-flag {
  flex: none; font-size: 14px; font-weight: 700; color: var(--danger);
  border-left: 4px solid var(--danger); padding: 2px 0 2px 12px;
}
.dash-except-text { flex: 1; min-width: 0; font-size: 15px; line-height: 1.55; }

.dash-split { display: grid; grid-template-columns: minmax(0, 1fr) 1px 300px; gap: 0 28px; align-items: start; margin-top: 26px; }
.dash-side { position: sticky; top: 24px; min-width: 0; }
.dash-board-head { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; }
.dash-board-head .g-h2x { flex: 1; }

.dash-row {
  display: flex; align-items: center; gap: 16px; padding: 13px 6px;
  border-top: 1px solid var(--line); color: inherit; text-decoration: none;
}
.dash-row:hover { background: rgba(24, 24, 27, .025); text-decoration: none; color: inherit; }
.dash-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--line-strong); }
.dash-dot.is-up { background: var(--accent-hot); }
.dash-dot.is-down { background: var(--live); }
.dash-dot.is-fail { background: var(--danger); }
.dash-row-name { width: 168px; flex: none; min-width: 0; }
.dash-row-title { display: block; font-size: 16px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-meta { display: block; margin-top: 3px; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-speed { width: 116px; flex: none; }
.dash-speed-v { font-size: 22px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
.dash-track { flex: 1; min-width: 90px; position: relative; height: 38px; display: flex; gap: 2px; align-items: flex-end; }
.dash-cell { display: block; flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: #efece7; }
.dash-cell.is-past { background: #e3e0da; }
.dash-cell.is-peak { background: #ecd0bf; }
.dash-cell.is-peak.is-past { background: var(--accent-hot); }
.dash-now { position: absolute; top: -4px; bottom: 0; width: 2px; background: var(--accent); border-radius: 1px; }
.dash-next { width: 170px; flex: none; text-align: right; }
.dash-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 7px; white-space: nowrap;
}
.dash-pill.is-up { color: var(--accent); background: var(--accent-wash); }
.dash-pill.is-down { color: var(--live); background: var(--live-wash); }
.dash-pill.is-fail { color: #fff; background: var(--danger); }
.dash-pill.is-hold { color: var(--ink-body); background: var(--neutral-wash); }

.dash-log { display: flex; align-items: baseline; gap: 16px; padding: 12px 6px; border-top: 1px solid var(--line); }
.dash-log-when { font-size: 14px; font-weight: 500; width: 120px; flex: none; color: var(--ink-body); }
.dash-log-what { flex: 1; min-width: 0; font-size: 15px; line-height: 1.5; }
.dash-more { border-top: 1px solid var(--line); padding-top: 13px; }
.dash-more a { font-size: 15px; font-weight: 600; }

.dash-agenda { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dash-agenda-t { font-size: 13.5px; font-weight: 600; width: 62px; flex: none; }
.dash-agenda-c { flex: 1; min-width: 0; }
.dash-arrow { font-size: 17px; font-weight: 700; flex: none; }
.dash-arrow.is-up { color: var(--accent); }
.dash-arrow.is-down { color: var(--live); }
.dash-tap { width: 100%; text-align: left; margin-bottom: 8px; }
.dash-site { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.dash-fine { margin-top: 28px; font-size: 13.5px; line-height: 1.6; max-width: 860px; }

/* The day-track rows need ~830px of real width (name, speeds, 24 cells,
   status, next-change pill). Below ~1520px viewport the 300px agenda
   column starved them into horizontal overflow that crushed the agenda
   to a sliver - stack instead, hero first. */
@media (max-width: 1520px) {
  .dash-split { grid-template-columns: minmax(0, 1fr); }
  .dash-split .cd-vrule { display: none; }
  .dash-side { position: static; }
}
@media (max-width: 1360px) {
  .dash-save { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 700px) {
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-track { display: none; }
  .dash-row-name { flex: 1; width: auto; }
  .dash-except { flex-wrap: wrap; }
}

/* ---- The circuits list. Tags moved from a page-edge rail into a
   toolbar menu (owner call, 2026-08-31); the list takes the full
   measure again. ---- */
.circ-name { font-size: 16px; font-weight: 600; }
.circ-speed { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.circ-showing { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 0 14px; }
.circ-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600;
  padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--ink); color: #fff;
}
.circ-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin: -6px 0; padding: 0; background: none; border: 0;
  border-radius: 999px; cursor: pointer; color: rgba(255, 255, 255, .85); font-size: 17px;
}
.circ-chip-x:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* The filter menu: a toolbar button opening an anchored checklist.
   Shared pattern - anything that filters a list can use it. */
.filter-menu-wrap { position: relative; flex: none; }
.filter-menu-btn { display: inline-flex; align-items: center; gap: 8px; }
.filter-menu-btn.is-active { border-color: var(--ink); }
.filter-menu-count {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 600;
}
.filter-menu-caret { font-size: 11px; color: var(--muted); }
.filter-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  min-width: 240px; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px;
  box-shadow: 0 16px 40px rgba(24, 24, 27, .14);
}
.filter-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px;
  padding: 8px 10px; border: 0; border-radius: 7px; font: inherit; font-size: 14.5px;
  cursor: pointer; background: transparent; color: var(--ink-body); text-align: left;
}
.filter-item:hover { background: var(--surface-sunk); }
.filter-item.on { color: var(--ink); font-weight: 600; }
.filter-check { width: 16px; flex: none; color: var(--accent); font-weight: 700; }
.filter-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-n { font-size: 12.5px; color: var(--muted); flex: none; }

/* ---- Quick-action presets are CARDS, by owner request (2026-08-31).
   The one exception to the ruled no-cards rule: a preset is a pressable
   object, and a grid of them needs shared edges to read as a set. Cards
   stretch to equal height and pin their action row to the bottom, so
   Activate sits on one line across the row however many circuits each
   preset carries. */
.qa-grid { gap: 20px; align-items: stretch; }
/* The stacked-panel spacing rule reaches grid siblings too and nudged
   every card after the first down 6px - the misalignment the owner
   photographed. Grid gap owns the spacing here. */
.qa-grid > .panel + .panel { margin-top: 0; }
.panel.qa-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  box-shadow: none;
}
.qa-card-head { align-items: center; min-height: 40px; }
.qa-card-foot { padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: nowrap; }
/* Truncate rather than wrap: a wrapped "Last run" line pushed that card's
   buttons off the shared row. */
.qa-last { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}

/* ---- The tide loader: the brand's step path as a quiet pulse. Page
   loading states only; buttons keep the small ring. */
.loader-tide { display: inline-flex; align-items: flex-end; gap: 4px; height: 22px; }
.loader-tide i {
  width: 5px;
  height: 8px;
  border-radius: 2px;
  background: var(--line-strong);
  animation: tide-step 1.05s ease-in-out infinite;
}
.loader-tide i:nth-child(2) { animation-delay: .15s; background: var(--accent); }
.loader-tide i:nth-child(3) { animation-delay: .3s; }
@keyframes tide-step {
  0%, 100% { height: 8px; opacity: .55; }
  40% { height: 20px; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .loader-tide i { animation: none; height: 14px; opacity: .7; }
  .loader-tide i:nth-child(2) { height: 20px; }
}

/* ---- Policy cards: the whole card is the door to the editor. Same
   card family as quick actions, plus the grid-sibling margin guard
   (.panel + .panel reaches grid children). */
.pol-grid > .panel + .panel { margin-top: 0; }
.pol-card { cursor: pointer; transition: border-color .12s ease; }
.pol-card:hover { border-color: var(--ink); }
.pol-card:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.pol-card.is-off { opacity: .65; }
.pol-lines { display: flex; flex-direction: column; gap: 6px; }
.pol-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas: "t n s" "t d d";
  column-gap: 10px;
  align-items: baseline;
  font-size: 13px;
}
.pol-line-t { grid-area: t; font-size: 12.5px; color: var(--muted); }
.pol-line-n { grid-area: n; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pol-line-s { grid-area: s; font-size: 12.5px; }
.pol-line-d { grid-area: d; font-size: 12px; color: var(--muted); }
.pol-line-more { display: block; font-size: 12.5px; color: var(--muted); }
.pol-foot-note {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12.5px; color: var(--muted);
}
.pol-open { flex: none; font-size: 13px; font-weight: 600; color: var(--accent); }

/* ---- Costs page visuals: the spend band, the billed-vs-ceiling chart,
   and the opportunities panel. All figures reuse the server's derived
   numbers; nothing here computes money on its own. */
.cost-band-wrap { margin: 4px 0 22px; }
.cost-band {
  display: flex; height: 18px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--line);
}
.cost-band-billed { background: var(--ink); }
.cost-band-saved { background: var(--live-wash); position: relative; }
.cost-band-saved::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(26, 92, 64, .18) 5px 7px);
}
.cost-band-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.cost-key { display: inline-flex; align-items: center; gap: 7px; }
.cost-key::before { content: ""; width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--line); }
.cost-key.is-billed::before { background: var(--ink); border-color: var(--ink); }
.cost-key.is-saved::before { background: var(--live-wash); border-color: var(--live); }
.cost-key.is-max::before { background: var(--surface-sunk); }

.cost-viz { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 0 30px; align-items: start; }
.cost-viz > .panel + .panel { margin-top: 0; }
@media (max-width: 980px) { .cost-viz { grid-template-columns: minmax(0, 1fr); } .cost-viz > .panel + .panel { margin-top: 6px; } }

.cchart-scroll { overflow-x: auto; }
.cchart-name { font: 600 12.5px var(--font-ui); fill: var(--ink-body); }
.cchart-val { font: 500 12px var(--font-mono); fill: var(--live); }
.cchart-max { fill: var(--surface-sunk); stroke: var(--line); }
.cchart-billed { fill: var(--ink); }

.cost-oppo {
  display: flex; align-items: baseline; gap: 10px; padding: 11px 0;
  border-top: 1px solid var(--line); color: inherit; min-height: 44px;
}
.cost-oppo:hover { text-decoration: none; }
.cost-oppo:hover .cost-oppo-go { text-decoration: underline; }
.cost-oppo-name { font-weight: 600; flex: none; }
.cost-oppo-note { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--muted); }
.cost-oppo-go { flex: none; font-size: 13px; font-weight: 600; color: var(--accent); }
.cost-oppo-best { margin: 12px 0 0; font-size: 12.5px; color: var(--live); font-weight: 600; }

/* ---- Rail fit: two independent user walks found nav groups hidden
   below the rail's scroll fold with no cue that more exists. A fade at
   the bottom edge says "there is more", and short screens tighten row
   and section spacing so most rails need no scroll at all. */
.sidebar .nav {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  padding-bottom: 10px;
}
@media (max-height: 1000px) {
  .nav-item { padding-top: 6px; padding-bottom: 6px; }
  .sidebar .nav-section { padding-top: 8px; margin-top: 5px; }
}
@media (pointer: coarse) {
  .nav-item { padding-top: 8px; padding-bottom: 8px; }
}

/* Row-level open affordance for clickable table rows. */
.row-go { color: var(--faint); font-weight: 600; }
tr:hover .row-go { color: var(--accent); }

/* Native time controls render "hh:mm AM/PM" in Edge and clip their tail
   in tight columns - a clipped 07:00 PM is indistinguishable from
   07:00. Every time input keeps room for the whole value. */
input[type="time"] { min-width: 138px; }

.dash-agenda-more { display: block; padding: 10px 0 0; font-size: 13px; font-weight: 600; }

/* Timeline: quiet-circuit note and the next-change jump. */
.tl-quiet { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--faint); }
.tl-jump-row { display: flex; justify-content: flex-end; margin: 0 0 8px; }

/* A long lead message clamps to four lines until Read all. */
.lead-msg { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lead-msg.is-open { display: block; -webkit-line-clamp: none; }

/* ---- Rate card grids: three compact editable tables plus history. */
.rate-grids { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px 30px; }
.rate-section { min-width: 0; }
.rate-grid-head, .rate-grid-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
  gap: 8px; align-items: center;
}
.rate-grid-head { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 0 6px; }
.rate-grid-row { padding: 3px 0; }
.rate-grid-row input { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-family: var(--font-mono); font-size: 13.5px; }
.rate-hist { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-height: 48px; }

/* Help index groups: each category gets its own titled grid. */
.kb-group { margin-top: 22px; }
.kb-group .kb-grid-title { margin-bottom: 10px; }

/* ---------- Sales group in the rail: a heading that opens and closes ---------- */
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.nav-group-toggle:hover { color: rgba(255, 255, 255, .85); }
.nav-group-toggle:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 2px; border-radius: 4px; }
.nav-group-caret {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .15s ease;
}
.nav-group-toggle[aria-expanded="false"] .nav-group-caret { transform: rotate(-45deg); }
.nav-group-links { display: flex; flex-direction: column; gap: 2px; }
.nav-group-links[hidden] { display: none; }

/* ---------- Tools shelf ---------- */
.tool-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.tool-card:hover { border-color: var(--accent-line); background: var(--accent-wash); }
.tool-card span { color: var(--faint); font-size: 13.5px; line-height: 1.5; }

/* ---------- Savings estimator ---------- */
/* Circuit cards on the left, a sticky totals panel on the right. Under
   960px the panel becomes a bar pinned to the bottom that opens upward. */
.est-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 24px; align-items: start; }
.est-inputs { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.est-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.est-help { margin: 0; font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.est-warn { color: var(--accent); }
.est-note { font-size: 12.5px; color: var(--accent); white-space: nowrap; }

/* A label column and a control column, stacked on a phone. */
.est-line { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 12px; align-items: start; }
.est-line > .est-label { padding-top: 9px; }
.est-ctl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.est-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.est-chip {
  font: inherit;
  font-size: 12.5px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.est-chip:hover { border-color: var(--accent); color: var(--accent); }
.est-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.est-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
/* A speed the chosen port cannot carry stays in the ladder, faded. */
.est-chip:disabled, .est-chip:disabled:hover { color: var(--faint); background: transparent; border-color: var(--line); border-style: dashed; cursor: not-allowed; }
.est-speeds .est-chip { font-family: var(--font-mono); font-size: 12px; min-width: 50px; padding: 6px 8px; text-align: center; }
.est-day { min-width: 44px; text-align: center; padding: 5px 8px; }

.est-top { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

.est-cards { display: flex; flex-direction: column; gap: 14px; }
.est-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.est-card-head { display: flex; gap: 8px; align-items: center; }
.est-card-num {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-wash); color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.est-card-head .est-name { flex: 1; min-width: 0; font-weight: 600; }
.est-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.est-hours .select { width: auto; min-width: 0; }
.est-to { color: var(--faint); font-size: 13px; }
.est-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.est-more-toggle { font: inherit; font-size: 13px; padding: 4px 0; border: 0; background: none; color: var(--accent); cursor: pointer; }
.est-more-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.est-card-sum { font-size: 13px; color: var(--live); font-variant-numeric: tabular-nums; }
.est-card-sum.is-negative { color: var(--accent); }
.est-more { display: flex; flex-direction: column; gap: 12px; }
.est-extra { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.est-extra-remove { align-self: flex-start; }
.est-count { max-width: 110px; }
.est-add { align-self: flex-start; }

.est-details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.est-details-toggle {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px;
  font: inherit; font-size: 13.5px; text-align: left; padding: 12px 16px; border: 0; background: none; color: var(--ink); cursor: pointer;
}
.est-details-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.est-link { flex: none; color: var(--accent); font-weight: 600; }
.est-details-body { display: flex; flex-direction: column; gap: 4px; padding: 0 16px 14px; }
.est-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }

/* The totals panel. The view's entrance animation keeps a transform once it
   ends, which would pin the phone bar to the view instead of the screen. */
.view-estimator { animation-fill-mode: backwards; }
.est-results { position: sticky; top: 16px; }
.est-bar { display: none; }
.est-panel { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.est-panel-head { font-size: 13px; font-weight: 600; color: var(--faint); }
.est-sum { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 10px; }
.est-sum > span:first-child { font-size: 13.5px; }
.est-sum .est-per { grid-column: 2; text-align: right; font-size: 11.5px; color: var(--faint); }
.est-figure { font-family: var(--font-mono); font-size: 24px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.est-accent { color: var(--accent); }
.est-saving { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: rgba(26, 92, 64, .08); color: var(--live); }
.est-saving-k { font-size: 12px; font-weight: 600; }
.est-saving strong { font-family: var(--font-mono); font-size: 22px; font-weight: 500; }
.est-saving span:last-child { font-size: 12.5px; }
.est-saving.is-negative { background: var(--accent-wash); color: var(--accent); }
.est-roll { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.est-roll th { text-align: right; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.est-roll td { text-align: right; padding: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.est-roll th:first-child, .est-roll td:first-child { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.est-pos { color: var(--live); }
.est-neg { color: var(--accent); }
.est-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .est-layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 72px; }
  .est-results {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60;
    display: flex; flex-direction: column;
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, .08);
  }
  .est-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
    min-height: 56px; padding: 10px 16px; border: 0; background: var(--surface); color: var(--live);
    font: inherit; text-align: left; cursor: pointer;
  }
  .est-bar strong { font-family: var(--font-mono); font-size: 17px; font-weight: 500; }
  .est-bar span { font-size: 13px; color: var(--accent); font-weight: 600; }
  .est-bar.is-negative { color: var(--accent); }
  .est-panel { display: none; border: 0; border-radius: 0; padding: 4px 16px 16px; max-height: 70vh; overflow-y: auto; }
  .est-results.open .est-panel { display: flex; }
}
@media (max-width: 520px) {
  .est-line { grid-template-columns: minmax(0, 1fr); }
  .est-line > .est-label { padding-top: 0; }
  .est-card, .est-top { padding: 12px; }
  .est-card-head .btn-sm { padding: 6px 10px; }
  .est-speeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
  .est-speeds .est-chip { min-width: 0; padding: 6px 2px; }
  .est-speeds .est-chip[data-k$=":0"] { grid-column: span 2; }
}

/* ---------- Estimator PDF: the print sheet replaces the page while printing ---------- */
.print-sheet { display: none; }
@media print {
  @page { size: letter; margin: 0.5in; }
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing .print-sheet { display: block; color: #18181b; font-size: 10.5pt; line-height: 1.4; }
  .print-sheet h1 { margin: 2px 0 2px; font-size: 20pt; }
  .print-sheet h2 { margin: 16px 0 6px; font-size: 12pt; }
  .ps-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 12px; border-bottom: 2px solid #8e3c20; }
  .ps-brand { font-weight: 700; color: #8e3c20; letter-spacing: .02em; }
  .ps-date { color: #6e6e78; font-size: 10pt; }
  .ps-parties { display: flex; gap: 28px; font-size: 10pt; }
  .ps-k { font-size: 8pt; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6e6e78; margin-bottom: 2px; }
  .ps-hero { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 12px; margin-top: 16px; }
  .ps-hero > div { padding: 10px 12px; border: 1px solid #e5e5e9; border-radius: 8px; }
  .ps-save { background: #eef5f1 !important; border-color: #cfe3d8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-big { font-size: 18pt; font-weight: 600; }
  .ps-sub { font-size: 9pt; color: #6e6e78; }
  .ps-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .ps-table th, .ps-table td { padding: 5px 6px; border-bottom: 1px solid #e5e5e9; text-align: left; vertical-align: top; }
  .ps-table th { font-size: 8pt; text-transform: uppercase; letter-spacing: .06em; color: #6e6e78; }
  .ps-table td:last-child, .ps-table th:last-child { text-align: right; }
  .ps-summary td:nth-child(3), .ps-summary td:nth-child(4), .ps-summary th:nth-child(3), .ps-summary th:nth-child(4) { text-align: right; white-space: nowrap; }
  .ps-detail td:nth-child(2), .ps-detail th:nth-child(2) { text-align: right; }
  .ps-sched { color: #3f3f46; }
  .ps-total td { font-weight: 700; border-top: 1.5px solid #18181b; }
  .ps-table tr.ps-group td { font-weight: 700; padding-top: 10px; text-align: left; }
  .ps-note { margin: 8px 0 0; font-size: 9pt; color: #3f3f46; }
  .ps-fine { margin-top: 16px; font-size: 7.5pt; color: #6e6e78; }
  .ps-table tr { break-inside: avoid; }
}

/* Costs rework */
/* Three headline figures: estimated cost, without a schedule, savings.
   The savings card is wider so it reads first by scale. */
.cost-stats.cost-stats-3 { grid-template-columns: 1fr 1fr 1.4fr; }
.cost-rule {
  margin: -6px 2px 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-body);
  max-width: 90ch;
}
.cost-rule strong { color: var(--ink); font-weight: 600; }
.cost-table tfoot td {
  padding: 15px 14px;
  border-top: 2px solid var(--line);
  font-weight: 600;
  color: var(--ink);
}
.cost-table td.cost-total { font-weight: 600; }
.cost-tier.is-without td { border-bottom: 0; color: var(--muted); font-family: var(--font-ui); }
.cost-tier.is-without td.num { font-family: var(--font-mono); }
.cchart-val.is-none { fill: var(--muted); }
@media (max-width: 900px) {
  .cost-stats.cost-stats-3 { grid-template-columns: 1fr 1fr; }
  .cost-stats.cost-stats-3 .cost-stat.is-hero { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .cost-stats.cost-stats-3 { grid-template-columns: minmax(0, 1fr); }
}

/* Setup wizard 4-step */

/* The next action stays in view on a long step: the action row sticks
   to the bottom of the window while its panel is on screen. */
.setup4-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 18px;
  padding: 12px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.setup4-actions-row { align-items: center; flex-wrap: wrap; gap: 8px; }
.setup4-actions-hint { margin: 0 0 8px; font-size: 12.5px; }

.wizard-step .step-dot.setup4-dot-info { font-family: inherit; font-style: italic; }

.setup4-needs { margin: 0 0 12px; padding-left: 20px; }
.setup4-need { margin: 0 0 10px; }
.setup4-need strong { display: block; font-size: 13.5px; }
.setup4-need span { display: block; color: var(--ink-body); font-size: 13px; }

.setup4-alt {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.setup4-subhead { margin: 16px 0 4px; font-size: 14px; }

.setup4-progress { list-style: none; margin: 12px 0 0; padding: 0; }
.setup4-progress-item { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; color: var(--muted); }
.setup4-progress-item[data-state="run"],
.setup4-progress-item[data-state="done"] { color: var(--ink); }
.setup4-progress-item[data-state="fail"] { color: var(--danger); }
.setup4-progress-mark { display: inline-flex; width: 16px; justify-content: center; flex: none; }

.setup4-problem {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--danger);
  border-radius: var(--radius-control);
  background: var(--danger-wash);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.setup4-problem-list { margin: 6px 0 0; padding-left: 18px; }
.setup4-problem-list li { margin: 3px 0; }
.setup4-tech { margin-top: 8px; font-size: 12px; }
.setup4-tech summary { cursor: pointer; }
.setup4-tech ul { margin: 4px 0 0; padding-left: 18px; }

.setup4-sample {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  background: var(--warn-wash);
  color: var(--warn);
  font-size: 12.5px;
}

.setup4-staff { margin-top: 16px; font-size: 13px; }
.setup4-staff summary { cursor: pointer; font-weight: 600; }
.setup4-staff-body { margin-top: 10px; }

.setup4-found { margin: 0 0 14px; padding-left: 18px; }
.setup4-found li { margin: 3px 0; overflow-wrap: anywhere; }
.setup4-warn { margin: 4px 0 0; font-size: 12.5px; color: var(--warn); }

.setup4-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

.setup4-per { margin-bottom: 10px; }

.setup4-hours {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 150px) minmax(0, 150px);
  gap: 0 12px;
  align-items: start;
}

.setup4-hours .input { width: 100%; min-width: 0; }

.setup4-busy-list { margin: 6px 0 12px; }
.setup4-busy-row { display: grid; gap: 4px; margin: 0 0 10px; }

.setup4-per-circuit { margin-top: 8px; }
.setup4-problems { padding-left: 28px; }

.setup4-existing .setup-card { margin-top: 8px; }
.setup4-replace { margin-top: 6px; font-size: 13px; }

.setup4-savings strong { font-family: inherit; font-size: 22px; letter-spacing: -.01em; }
.setup4-savings .savings-note { margin-top: 4px; }

/* One column on narrow screens: minmax(0, 1fr) lets the rail's step row
   scroll inside itself instead of widening the page. */
@media (max-width: 900px) {
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .wizard-rail { min-width: 0; }
}

@media (max-width: 600px) {
  .setup4-hours { grid-template-columns: 1fr 1fr; }
  .setup4-hours > .field:first-child { grid-column: 1 / -1; }
  .setup4-actions-row .grow { display: none; }
  .setup4-actions-row .btn { flex: 1 1 auto; }
  .import-item { flex-wrap: wrap; }
}

/* Wording pass */

/* Starter rail: a client with no circuits sees only Setup, Dashboard,
   Help and Account. .nav-item sets display:flex, which beats [hidden]. */
.nav-item[hidden],
.nav-section[hidden] { display: none; }

/* Lumen account test: a product the account does not use is greyed, not red. */
.capability-row.is-unused { opacity: .6; }
.capability-chip.capability-chip-unused {
  background: var(--surface-2, rgba(127, 127, 127, .14));
  color: var(--muted, #6e6e78);
}

/* Scheduling redesign
   The week is edited in a form (off-hours speed, then busy hours with
   half-hour time selects); the grid below previews it. Change speed for
   now is the one temporary-change dialog (cd-), and the rarely used
   extras sit behind More (sched-more). */

/* Speed panel: the current speed and the one button. */
.sched-speed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.sched-speed-now { margin: 0; font-size: 13.5px; color: var(--ink-body); }
.sched-temp:not([hidden]) { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sched-temp .panel-head { margin-bottom: 4px; }
.fut-title { margin: 0; font-size: 13.5px; }

/* Which schedule applies. */
.sched-shared {
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
}

/* Describe your week, folded into the week card. */
.sched-describe { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.sched-describe[hidden] { display: none; }
.sched-describe-label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }

/* The week form. */
.wk-editor { margin-top: 14px; }
.wk-form { display: flex; flex-direction: column; gap: 10px; }
.wk-form .wk-form-off { max-width: 360px; margin: 0; }
.wk-form-label { font-weight: 600; font-size: 13.5px; margin-top: 4px; }
.wk-form-empty { margin: 0; font-size: 12.5px; color: var(--muted); }
.wk-busy-list { display: flex; flex-direction: column; gap: 10px; }
.wk-busy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  scroll-margin-top: 76px;
}
.wk-busy.is-sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wk-busy.is-paused { background: var(--surface-sunk); }
.wk-busy-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.wk-busy-days { display: flex; gap: 4px; flex-wrap: wrap; }
.wk-busy-days .wk-daychip { min-width: 34px; min-height: 32px; }
.wk-busy-sets { display: flex; gap: 4px; flex-wrap: wrap; }
.wk-set {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--surface);
  color: var(--ink-body);
  cursor: pointer;
}
.wk-set:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.wk-set.on { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-deep); }
.wk-busy-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.wk-busy-field .select { width: auto; min-width: 0; }
.wk-select { min-height: 36px; }
.wk-busy-remove {
  margin-left: auto;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 8px 6px;
  cursor: pointer;
}
.wk-busy-remove:hover:not(:disabled) { text-decoration: underline; }
.wk-busy-note { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.wk-busy-warn { margin-top: 0; }
.wk-busy-paused { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 12.5px; color: var(--muted); }
.wk-form-add { margin-top: 2px; }
.wk-editor .wk-proposal { margin-top: 14px; }

/* Temporary changes on the grid. */
.wk-band.is-future {
  background: color-mix(in srgb, var(--live) 12%, var(--surface));
  box-shadow: inset 3px 0 0 var(--live);
  color: var(--live);
}
.wk-sw.future { background: color-mix(in srgb, var(--live) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--live); }

/* More. */
.sched-more { padding: 0; }
.sched-more > summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}
.sched-more > summary::-webkit-details-marker { display: none; }
.sched-more > summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  align-self: center;
  margin-right: 2px;
}
.sched-more[open] > summary::before { transform: rotate(45deg); }
.sched-more-title { font-weight: 700; font-size: 15px; }
.sched-more-sub { font-size: 12.5px; color: var(--muted); }
.sched-more-body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.sched-more-section { border-top: 1px solid var(--line); padding-top: 16px; }
.sched-more-section h3 { margin: 0 0 4px; font-size: 14px; }

/* Change speed for now. */
.cd-form .cd-group { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.cd-form .cd-group legend { font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 6px; }
.cd-choice { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 13.5px; cursor: pointer; }
.cd-choice input[type="radio"] { margin-top: 3px; flex: none; }
.cd-choice.is-off { opacity: .5; cursor: not-allowed; }
.cd-choice-body { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cd-inline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cd-inline[hidden] { display: none; }
.cd-form .cd-date { width: auto; min-width: 0; }
.cd-form .select { width: auto; min-width: 0; }
.cd-tz { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.cd-preview { margin-top: 8px; }

@media (max-width: 600px) {
  .wk-busy-remove { margin-left: 0; }
  .wk-busy-field { flex: 1 1 40%; }
  .wk-busy-field .select { flex: 1; }
  .sched-speed-head .btn { width: 100%; }
}

/* Endpoint tester (views-apitester.js) */
.apit-form { display: grid; gap: 12px; padding: 18px; }
.apit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.apit-grid .field, .apit-line .field { margin: 0; min-width: 0; }
.apit-line { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.apit-path, .apit-body, .apit-pre { font-family: var(--font-mono); font-size: 12.5px; }
.apit-note, .apit-vars { margin: 0; overflow-wrap: anywhere; }
.apit-vars { font-family: var(--font-mono); font-size: 12px; }
.apit-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.apit-actions { display: flex; justify-content: flex-end; }
.apit-out { margin-top: 16px; display: grid; gap: 8px; min-width: 0; }
.apit-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.apit-meta { color: var(--muted); }
.apit-tools { display: flex; justify-content: flex-end; }
.apit-pre { margin: 0; padding: 14px; max-height: 70vh; overflow: auto; background: var(--surface-sunk); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); white-space: pre; tab-size: 2; }
@media (max-width: 640px) {
  .apit-line { grid-template-columns: 1fr; }
  .apit-actions .btn { width: 100%; }
}

/* ---- Global schedule editor: the circuit checklist. Tags are still the
   storage underneath and sit in the Advanced disclosure below it. */
.pol-circuits {
  display: grid; gap: 2px; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-control); padding: 6px 8px;
}
.pol-circuit {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 5px 2px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.pol-circuit input[type="checkbox"] { flex: none; margin: 0; }
.pol-advanced { margin: 10px 0 0; font-size: 12.5px; }
.pol-advanced > summary { cursor: pointer; color: var(--muted); }

/* Estimator totals: the monthly cost leads, the comparison sits under it. */
.est-sum-lead .est-figure { font-size: 30px; }
.est-sum-minor .est-figure { font-size: 17px; color: var(--muted); }
