/* The charger emulator, dressed as Maia: the tokens, rail, top bar, panels, controls, statuses and
   dialogs below follow apps/web/src/styles.css. Keep them in step with it; colours live only in
   the two token blocks. */

@font-face {
  font-family: "Figtree Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("/fonts/figtree-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  --rail: #0b1f4b;
  --rail-pill: #1d3672;
  --rail-hover: #14295c;
  --rail-ink: #dce5f7;
  --rail-ink-2: #8fa3cc;

  --ground: #f3f6fb;
  --panel: #ffffff;
  --line: #dce3ee;
  --line-2: #c5d0e2;
  --ink: #0f1b33;
  --ink-2: #47556f;
  --ink-3: #5f6d88;

  --blue: #2f6bff;
  --blue-ink: #1d52d8;
  --blue-wash: #e8efff;
  --blue-text: #2f6bff;
  /* Blue text on a blue wash (a ghost control's hover): 5.9:1 on --blue-wash. */
  --blue-on-wash: #1d52d8;
  --blue-hover: #1d52d8;
  --focus: #2f6bff;
  --navy-deep: #0b1f4b;

  --available: #16935a;
  --available-wash: #dff3e8;
  --available-text: #0f7046;
  --charging: #2f6bff;
  --charging-wash: #e3ebff;
  --waiting: #c27c00;
  --waiting-wash: #fcefd6;
  --waiting-text: #8a5800;
  --waiting-line: #f1d29b;
  --faulted: #d9364f;
  --faulted-wash: #fde4e8;
  /* Faulted as text: clears 4.5:1 on the panel and on the wash. */
  --faulted-ink: #b8243c;
  --faulted-text: #b0243c;
  --faulted-line: #f5b9c3;
  --offline: #7d89a0;
  --offline-wash: #e9edf3;
  --never: #b3bdcd;
  --never-wash: #eef1f6;

  --sunk: #f8fafd;
  --row-hover: #f6f9ff;
  --well: #f3f6fb;
  --hover: #f3f6fb;
  --shadow-rgb: 11 31 75;
  --scrim-strong: rgb(11 31 75 / 0.45);

  --font: "Figtree Variable", "Figtree", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --r-sm: 6px;
  --r-md: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

/* Polar night, as in Maia. */
:root[data-theme="dark"] {
  --rail: #050b1a;
  --rail-pill: #17295c;
  --rail-hover: #0e1a3a;
  --rail-ink: #dce5f7;
  --rail-ink-2: #8a9dc6;

  --ground: #08101f;
  --panel: #0f192d;
  --line: #1d2a44;
  --line-2: #2c3d5f;
  --ink: #e7edf9;
  --ink-2: #aab7d0;
  --ink-3: #8d9dba;

  --blue: #3468f5;
  --blue-ink: #a3bdff;
  --blue-wash: rgb(84 130 255 / 0.16);
  --blue-text: #86a8ff;
  --blue-on-wash: #a3bdff;
  --blue-hover: #2a5ce6;
  --focus: #86a8ff;
  --navy-deep: #12255a;

  --available: #34c47c;
  --available-wash: rgb(52 196 124 / 0.16);
  --available-text: #5fd99a;
  --charging: #6b95ff;
  --charging-wash: rgb(107 149 255 / 0.18);
  --waiting: #f0a92e;
  --waiting-wash: rgb(240 169 46 / 0.15);
  --waiting-text: #f5bd5a;
  --waiting-line: rgb(240 169 46 / 0.38);
  --faulted: #ff5c74;
  --faulted-wash: rgb(255 92 116 / 0.15);
  --faulted-ink: #ff5c74;
  --faulted-text: #ff8597;
  --faulted-line: rgb(255 92 116 / 0.38);
  --offline: #7f8ba3;
  --offline-wash: rgb(127 139 163 / 0.16);
  /* Lighter than Maia's #34405a so the "never" dot shows on the panel (3.2:1). */
  --never: #5d6a86;
  --never-wash: rgb(127 139 163 / 0.1);

  --sunk: #0c1528;
  --row-hover: #132038;
  --well: #16223a;
  --hover: #1a2846;
  --shadow-rgb: 0 0 0;
  --scrim-strong: rgb(2 6 16 / 0.7);
  color-scheme: dark;
}
:where(:root[data-theme="dark"]) .rail {
  box-shadow: inset -1px 0 0 #16223c;
}
:where(:root[data-theme="dark"]) .dialog {
  --panel: #131f38;
  --sunk: #101a30;
  --line: #24334f;
}
:where(:root[data-theme="dark"]) .panel {
  box-shadow: inset 0 1px 0 rgb(220 229 247 / 0.035);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  caret-color: var(--blue-text);
  scrollbar-color: var(--line-2) transparent;
  scrollbar-width: thin;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px / 1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--blue);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--well);
  border-radius: 4px;
  padding: 1px 5px;
}
.ico {
  display: block;
  flex: none;
}
.muted {
  color: var(--ink-3);
}
.small {
  font-size: 13px;
}
.num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: var(--mono);
  font-size: 13px;
}

/* ---------- Shell: rail, main ---------- */

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100%;
}
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 14px;
  background: var(--rail);
  color: var(--rail-ink);
}
.brand {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 12px;
  padding: 0 10px;
  color: #fff;
}
.wordmark {
  display: block;
  height: 26px;
  width: auto;
  flex: none;
  overflow: visible;
}
.wordmark-dot {
  fill: #5b8cff;
}
.brand-tag {
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  background: var(--rail-pill);
  color: #9fc0ff;
  font-size: 12px;
  font-weight: 600;
}

/* The target switch is Maia's organization switch: a code tile, the name, and a native select
   laid over the whole row so it keeps keyboard and screen-reader behaviour. */
.target-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: #fff;
  cursor: pointer;
}
.target-switch:hover {
  background: var(--rail-hover);
}
.target-switch:has(select:focus-visible) {
  outline: 2px solid #9fc0ff;
  outline-offset: -2px;
}
.target-switch select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}
.org-code {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--rail-pill);
  font: 600 13px / 1 var(--font);
  color: #9fc0ff;
  text-transform: uppercase;
}
.target-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.target-name {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
}
.target-host {
  font-size: 13px;
  color: var(--rail-ink-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.target-caret {
  color: var(--rail-ink-2);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--rail-ink);
  font-weight: 600;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.12s ease-out,
    color 0.12s ease-out;
}
.nav-link .ico {
  color: var(--rail-ink-2);
  transition: color 0.12s ease-out;
}
.nav-link:hover {
  background: rgb(255 255 255 / 0.06);
  color: #fff;
}
.nav-link:hover .ico {
  color: var(--rail-ink);
}
.nav-link:active {
  background: rgb(255 255 255 / 0.1);
}
.nav-link:focus-visible {
  outline: 2px solid #9fc0ff;
  outline-offset: -2px;
}
.rail-foot {
  margin-top: auto;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 76px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title .title-target {
  color: var(--ink-3);
  font-weight: 500;
}
.topbar .end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.link-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  min-width: 0;
}
.link-state .status {
  overflow: hidden;
  text-overflow: ellipsis;
}

.page {
  padding: 28px 32px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.page-sub {
  color: var(--ink-2);
  max-width: 72ch;
  font-size: 16px;
}
.page-head .actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

/* ---------- Primitives ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  min-width: 0;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-size: 18px;
  font-weight: 600;
}
.panel-head .hint {
  color: var(--ink-3);
  font-size: 14px;
}
.panel-head .right {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
/* A download link before it has anything to download (a lab report before the first reading). */
a.btn[aria-disabled="true"],
a.btn[aria-disabled="true"]:hover {
  border-color: var(--line);
  background: var(--ground);
  color: var(--ink-2);
  cursor: not-allowed;
}
.btn[aria-busy="true"] {
  cursor: progress;
}
.btn:hover {
  border-color: var(--ink-3);
  background: var(--hover);
}
.btn:disabled,
.btn:disabled:hover,
.btn:is(.primary, .danger, .ghost):disabled,
.btn:is(.primary, .danger, .ghost):disabled:hover {
  border-color: var(--line);
  background: var(--ground);
  color: var(--ink-2);
  cursor: not-allowed;
}
.btn:disabled .ico {
  opacity: 0.6;
}
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn.primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}
.btn.ghost {
  border-color: transparent;
  background: none;
  color: var(--blue-text);
}
.btn.ghost:hover {
  background: var(--blue-wash);
  color: var(--blue-on-wash);
}
.btn.danger {
  border-color: var(--faulted);
  color: var(--faulted-ink);
}
.btn.danger:hover {
  background: var(--faulted-wash);
}
.btn.small {
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink-2);
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

.field,
.select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink);
  min-width: 0;
  width: 100%;
}
.select {
  padding-right: 34px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238d9dba' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.field:hover,
.select:hover {
  border-color: var(--ink-3);
}
.field:focus,
.select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-wash);
}
.field::placeholder {
  color: var(--ink-3);
}
.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.field-wrap .ico {
  position: absolute;
  left: 12px;
  color: var(--ink-3);
  pointer-events: none;
}
.field-wrap .field {
  padding-left: 38px;
}
.unit-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--panel);
}
.unit-field:hover {
  border-color: var(--ink-3);
}
.unit-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-wash);
}
.unit-field .field {
  border: 0;
  box-shadow: none;
  background: none;
}
.unit-field span {
  padding: 0 12px 0 4px;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
input[type="checkbox"],
input[type="range"] {
  accent-color: var(--blue);
}

/* Status: a dot plus a word. Colour never carries meaning alone. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.status::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px var(--w);
}
.status.h-charging::before {
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    box-shadow: 0 0 0 5px var(--w);
  }
}
.h-available {
  --c: var(--available);
  --w: var(--available-wash);
}
.h-charging {
  --c: var(--charging);
  --w: var(--charging-wash);
}
.h-waiting {
  --c: var(--waiting);
  --w: var(--waiting-wash);
}
.h-faulted {
  --c: var(--faulted);
  --w: var(--faulted-wash);
}
.h-offline {
  --c: var(--offline);
  --w: var(--offline-wash);
}
.h-never {
  --c: var(--never);
  --w: var(--never-wash);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  background: var(--ground);
  color: var(--ink-2);
  white-space: nowrap;
}
.tag.blue {
  background: var(--blue-wash);
  color: var(--blue-ink);
}
.tag.warn {
  background: var(--faulted-wash);
  color: var(--faulted-text);
}

.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--waiting-line);
  background: var(--waiting-wash);
  color: var(--ink);
  white-space: pre-wrap;
}
.notice.warn {
  border-color: var(--faulted-line);
  background: var(--faulted-wash);
}

/* The draw on the load bar, the CSMS limit as the dark tick: Maia's power-tree bar. */
.load {
  position: relative;
  height: 12px;
  border-radius: 99px;
  background: var(--well);
  border: 1px solid var(--line);
}
.load.thin {
  height: 8px;
}
.load span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.9s var(--ease);
}
.load span.hot {
  background: var(--waiting);
}
.load i {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  border-radius: 2px;
  transition: left 0.9s var(--ease);
}
.load.thin i {
  top: -4px;
  bottom: -4px;
}
/* The draw held right at Maia's limit: Maia at work, so the tick says it, not the fill's colour. */
.load i.held {
  width: 4px;
  margin-left: -2px;
  box-shadow: 0 0 0 2px var(--panel);
}
.load-line {
  display: grid;
  gap: 6px;
}
.load-note {
  color: var(--ink-3);
}
.load-note:empty {
  display: none;
}
.load-note.hot {
  color: var(--waiting-text);
  font-weight: 600;
}
.load-note.over {
  color: var(--faulted-text);
  font-weight: 600;
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.grid th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--sunk);
  white-space: nowrap;
}
.grid td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.grid tbody tr:last-child td {
  border-bottom: 0;
}
.grid th:first-child,
.grid td:first-child {
  padding-left: 24px;
}
.grid th:last-child,
.grid td:last-child {
  padding-right: 24px;
}
.table-wrap {
  overflow-x: auto;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--ink-2);
  display: grid;
  justify-items: center;
  gap: 4px;
}
.empty strong {
  color: var(--ink);
  font-size: 17px;
}
.empty-icon {
  color: var(--ink-3);
  margin-bottom: 8px;
}

.toasts {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--navy-deep);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 18px 40px -12px rgb(var(--shadow-rgb) / 0.5);
  animation: rise 0.22s var(--ease);
}
/* An error toast: Maia's faulted colours, its own icon, a dismiss button; it stays (see ui.js). */
.toast.error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 14px;
  background: var(--panel);
  color: var(--faulted-text);
  border: 1px solid var(--faulted-line);
  box-shadow:
    inset 0 0 0 100vmax var(--faulted-wash),
    0 18px 40px -12px rgb(var(--shadow-rgb) / 0.5);
  pointer-events: auto;
  max-width: min(640px, calc(100vw - 32px));
}
.toast.error span {
  color: var(--ink);
  font-weight: 600;
}
.toast-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.toast-close:hover {
  background: var(--faulted-wash);
  color: var(--ink);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Workspace: fleet beside the charger ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.fleet {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 124px);
  display: flex;
  flex-direction: column;
}
.filters {
  padding: 16px 20px 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
}
.chips button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--ink-2);
  font: 600 14px / 1 var(--font);
  cursor: pointer;
}
.chips button:hover {
  border-color: var(--line-2);
  color: var(--ink);
}
.chips button i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}
.chips button span {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.chips button[aria-pressed="true"] {
  border-color: var(--c, var(--ink));
  background: var(--w, var(--ground));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--c, var(--ink));
}
.fleet-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--line);
}
.bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.fleet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
}
.fleet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
}
.fleet-row:hover {
  background: var(--row-hover);
}
.fleet-row:focus-visible {
  outline-offset: -2px;
}
.fleet-row[aria-current="true"] {
  background: var(--blue-wash);
}
.fleet-row[aria-current="true"] .id {
  color: var(--blue-ink);
}
.fleet-row .id {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-row .sub {
  grid-column: 1;
  font-size: 13px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-row .draw {
  grid-column: 2;
  font-size: 13px;
  color: var(--ink-2);
  text-align: right;
}
.fleet-row .load {
  grid-column: 1 / -1;
  margin-top: 6px;
}

/* The charger in detail: identity in the head, then the car and the charger side by side. */
.detail .panel-head h2 {
  font-size: 20px;
}
.detail-sub {
  flex-basis: 100%;
  margin-top: -6px;
  color: var(--ink-3);
  font-size: 14px;
}
.halves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.half {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.half + .half {
  border-left: 1px solid var(--line);
}
.half h3,
.sub-head h3 {
  font-size: 16px;
  font-weight: 600;
}
.readouts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
}
.readout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.readout b {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.readout b small {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
  margin-left: 3px;
}
.readout span {
  font-size: 13px;
  color: var(--ink-3);
}
/* In a charger's detail, drawing and Maia's limit lead; the rest are context. */
.readout.lead b {
  font-size: 30px;
  line-height: 1.15;
}
.readout.lead b small {
  font-size: 16px;
}
.readout.minor b {
  font-size: 18px;
}
.readout.minor b small {
  font-size: 13px;
}
.readouts:has(.lead) {
  align-items: flex-end;
}
.slider {
  display: grid;
  gap: 6px;
}
.slider-top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}
.slider input {
  width: 100%;
  margin: 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.row .field {
  width: auto;
  flex: 1 1 140px;
}
.row .select {
  width: auto;
  flex: 1 1 180px;
}
.sub-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 12px;
}
.sub-head .hint {
  color: var(--ink-3);
  font-size: 14px;
}
.sub-body {
  padding: 0 24px 22px;
  color: var(--ink-2);
  font-size: 14px;
  display: grid;
  gap: 8px;
}
.section + .section {
  border-top: 1px solid var(--line);
}
.site-table {
  margin: 0 -24px;
}
.frames-empty {
  padding: 16px;
  color: var(--ink-3);
}
.site-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-head .frames-filter {
  margin-left: auto;
  width: auto;
  min-width: 200px;
  height: 34px;
  font-size: 14px;
}
.frames {
  margin: 0 24px 24px;
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--sunk);
  font-size: 13px;
}
.frames details {
  border-bottom: 1px solid var(--line);
}
.frames details:last-child {
  border-bottom: 0;
}
.frames summary {
  display: grid;
  grid-template-columns: 72px 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  cursor: pointer;
  list-style: none;
}
.frames summary::-webkit-details-marker {
  display: none;
}
.frames summary:hover {
  background: var(--row-hover);
}
.frames time {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.frames .dir {
  color: var(--ink-3);
}
.frames .name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* --blue-text is 4.3:1 on the log's sunk ground in light; the deeper blue clears 4.5. */
.frames .out .dir {
  color: var(--blue-ink);
}
.frames .result {
  color: var(--available-text);
  font-weight: 500;
}
.frames .error {
  color: var(--faulted-text);
}
.frames pre {
  margin: 0;
  padding: 4px 12px 12px 110px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
}

/* ---------- Dialogs ---------- */

.dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 64px -16px rgb(var(--shadow-rgb) / 0.45);
}
.dialog.wide {
  width: min(720px, calc(100vw - 32px));
}
.dialog::backdrop {
  background: var(--scrim-strong);
}
.dialog[open] {
  animation: dialog-in 0.22s var(--ease);
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}
.dialog header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 14px 24px;
  border-bottom: 1px solid var(--line);
}
.dialog-heading {
  flex: 1;
  min-width: 0;
}
.dialog header h2 {
  font-size: 18px;
  font-weight: 600;
}
.dialog-subtitle {
  margin-top: 2px;
  font-size: 14px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
  overflow-y: auto;
}
.dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.form-label.sub {
  font-weight: 500;
  color: var(--ink-2);
}
.form-hint {
  font-size: 13px;
  color: var(--ink-3);
}
/* One line under a field saying what it means. */
.field-help {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-3);
}
.form-grid {
  display: grid;
  gap: 14px;
  align-items: end;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid.three {
  grid-template-columns: 2fr 1fr 1fr;
}
.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.form-grid > legend {
  margin-bottom: 8px;
  padding: 0;
}
.form-grid.wire {
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--sunk);
}
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}
.check input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.target-rows {
  display: grid;
  gap: 12px;
}
.target-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.target-row .remove-target {
  justify-self: start;
  grid-column: 2;
}
.add-target {
  align-self: flex-start;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .fleet {
    position: static;
    max-height: 520px;
  }
}
@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
  }
  .target-switch {
    flex: 1 1 200px;
  }
  .rail-nav {
    flex-direction: row;
  }
  .brand {
    flex: 1 1 auto;
  }
  /* Two rows: the wordmark with the theme switch, then the target with the actions. */
  .rail-foot {
    margin-top: 0;
    order: 1;
  }
  .target-switch,
  .rail-nav {
    order: 2;
  }
  .nav-link {
    width: auto;
    padding: 0 12px;
    gap: 8px;
    font-size: 15px;
  }
  .rail-nav .nav-link span:last-child,
  .rail-foot .nav-link span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .topbar {
    height: 64px;
    padding: 0 16px;
  }
  .topbar-title {
    font-size: 19px;
  }
  /* Only the "on <target>" suffix goes; the view's title stays (the nav is icons only here). */
  .topbar-title .title-target {
    display: none;
  }
  .page {
    padding: 20px 16px 64px;
  }
  /* The page's actions wrap under its summary instead of leaving. */
  .page-head .actions {
    margin-left: 0;
    flex-wrap: wrap;
  }
  .half + .half {
    border-left: 0;
  }
  .form-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid.two,
  .form-grid.three,
  .target-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .target-row .remove-target {
    grid-column: 1;
  }
  .frames pre {
    padding-left: 12px;
  }
}
@media (max-width: 520px) {
  /* The link state keeps its dot (the word stays for screen readers and on hover); the catalogue
     count goes. */
  .link-state > .muted {
    display: none;
  }
  .link-state .status {
    font-size: 0;
    gap: 0;
  }
  .link-state .status::before {
    width: 11px;
    height: 11px;
  }
  .readout b {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dialog[open],
  .toast,
  .status.h-charging::before {
    animation: none;
  }
  .load span,
  .load i {
    transition: none;
  }
}

/* ---------- Navigation between the two pages ---------- */

.nav-link.active {
  background: var(--rail-pill);
  box-shadow: inset 0 0 0 1px rgb(159 192 255 / 0.14);
  color: #fff;
  text-decoration: none;
}
.nav-link.active .ico {
  color: #9fc0ff;
}
a.nav-link {
  text-decoration: none;
}
.nav-gap {
  height: 14px;
}

/* ---------- The car's battery and settings ---------- */

.load.soc span {
  background: var(--available);
}
.battery-line {
  display: grid;
  gap: 6px;
}
.battery-line:empty {
  display: none;
}
.car-settings {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--sunk);
}
.car-settings summary {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.car-settings[open] summary {
  border-bottom: 1px solid var(--line);
}
.car-settings > :not(summary) {
  margin: 12px 14px;
}
.car-settings .form-grid {
  gap: 10px;
}
.car-settings .form-grid.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.span-2 {
  grid-column: span 2;
  align-self: center;
}
.form-grid.three-even {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- Power lab ---------- */

.lab-site {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 420px);
}
.lab-site .select {
  min-width: 280px;
}
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}
.lab-main,
.lab-side {
  display: grid;
  gap: 24px;
  min-width: 0;
}
.side-body {
  display: grid;
  gap: 14px;
  padding: 18px 24px 22px;
}
.pad {
  padding: 18px 24px;
}
.cap-row {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.cap-row .unit-field {
  flex: 1 1 90px;
}
.vehicle-picks {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 8px;
}
.vehicle-picks legend {
  padding: 0;
  margin-bottom: 8px;
}
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 12px;
}
.vehicle-grid .check {
  font-size: 14px;
}

/* A node per row, indented by depth; each used leg a bar against the node's limit, with the worst
   load seen as a thin mark. */
.tree-live {
  display: grid;
}
.live-node {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 2.2fr) minmax(120px, auto);
  gap: 16px;
  align-items: center;
  padding: 14px 24px 14px calc(24px + var(--depth, 0) * 22px);
  border-bottom: 1px solid var(--line);
}
.live-name {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.live-name span {
  font-size: 13px;
  color: var(--ink-3);
}
.live-legs {
  display: grid;
  gap: 8px;
}
.live-leg {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 86px;
  gap: 10px;
  align-items: center;
}
.live-leg .leg {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.live-leg .amps {
  text-align: right;
  font-size: 14px;
  white-space: nowrap;
}
.live-leg .amps small {
  color: var(--ink-3);
  font-weight: 500;
}
.load span.over {
  background: var(--faulted);
}
.load .worst {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--ink-3);
  opacity: 0.6;
}
.live-verdict {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.tag.good {
  background: var(--available-wash);
  color: var(--available-text);
}
.tag .ico {
  margin-right: 2px;
}
.soc-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.soc-cell .load {
  flex: 1;
  height: 8px;
}
.soc-cell .load i {
  top: -4px;
  bottom: -4px;
}
.row-link {
  font-weight: 600;
  color: var(--blue-text);
  text-decoration: none;
}
.row-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.grid .r {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .lab-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 860px) {
  .live-node {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-left: calc(16px + var(--depth, 0) * 14px);
    padding-right: 16px;
  }
  .live-verdict {
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
  }
  .lab-site .select {
    min-width: 0;
  }
  .form-grid.three-even {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-gap {
    display: none;
  }
}

/* The run strip, in the lab's page head: what plays, power management, what holds the load. */
.run-strip {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 12px 16px 12px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.strip-part {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.strip-part + .strip-part {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.strip-count {
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
}
.strip-count b {
  color: var(--ink);
}
.strip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  justify-content: flex-end;
}
.strip-chips:empty {
  display: none;
}

/* A side panel folded to its head, with a one-line summary of what it holds. */
details.fold > summary {
  list-style: none;
  cursor: pointer;
  border-bottom: 0;
  min-height: 60px;
}
details.fold > summary::-webkit-details-marker {
  display: none;
}
details.fold[open] > summary {
  border-bottom: 1px solid var(--line);
}
details.fold > summary:hover {
  background: var(--row-hover);
}
details.fold > summary:focus-visible {
  outline-offset: -2px;
}
.fold-caret {
  display: grid;
  margin-left: -6px;
  color: var(--ink-3);
  transform: rotate(-90deg);
  transition: transform 0.18s var(--ease);
}
details.fold[open] .fold-caret {
  transform: none;
}
.fold-sum {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The lab's chargers table: two short lines a cell, so it fits the main column. */
.grid.lab-chargers td {
  padding: 10px 10px;
  vertical-align: top;
}
.grid.lab-chargers th {
  padding: 10px 10px;
}
.grid.lab-chargers th:first-child,
.grid.lab-chargers td:first-child {
  padding-left: 20px;
}
.grid.lab-chargers th:last-child,
.grid.lab-chargers td:last-child {
  padding-right: 16px;
}
.cell-stack {
  display: grid;
  gap: 4px;
  justify-items: start;
}
.cell-stack.end {
  justify-items: end;
}
.cell-stack .row-link {
  white-space: nowrap;
}
.cell-stack .status {
  font-size: 13px;
}
.grid.lab-chargers .tag {
  white-space: normal;
  height: auto;
  min-height: 24px;
  padding-block: 2px;
}
.grid.lab-chargers .quirks {
  display: flex;
}
.grid.lab-chargers .session-actions {
  flex-wrap: wrap;
  gap: 6px;
}
.grid.lab-chargers .soc-cell {
  min-width: 110px;
  width: 100%;
}
.tone-over {
  color: var(--faulted-text);
}
.tone-hot {
  color: var(--waiting-text);
}
.tag.hot {
  background: var(--waiting-wash);
  color: var(--waiting-text);
}

/* The scenario's draw: its behaviour on a row of its own, so the longest one reads whole. */
.form-grid.draw {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid.draw > :first-child {
  grid-column: 1 / -1;
}
.grid td.num {
  white-space: nowrap;
}

/* Stress: what each phase does, as a list to scan. */
.phase-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}
.phase-list dt {
  font-weight: 600;
}
.phase-list dd {
  margin: 0;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .run-strip {
    padding: 12px 14px;
  }
  .strip-part + .strip-part {
    padding-left: 0;
    border-left: 0;
  }
  .strip-chips {
    margin-left: 0;
    justify-content: flex-start;
  }
  .phase-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .phase-list dd + dt {
    margin-top: 8px;
  }
}

/* Last, so a hidden element stays hidden whatever display its component rule gives it. */
[hidden] {
  display: none;
}

/* ---------- What a charger gets wrong ---------- */

.fleet-row .quirks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quirk {
  display: grid;
  gap: 4px;
}
.quirk .form-hint,
.quirk .row {
  margin: 0;
}
.quirk > .check + .form-hint {
  padding-left: 26px;
}
fieldset.quirk {
  gap: 8px;
}

/* ---------- Power lab: checks, power options, sessions ---------- */

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.check-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.check-item:last-child {
  border-bottom: 0;
}
.check-item .tag {
  justify-self: start;
}
.check-item p {
  margin: 3px 0 0;
}
.power-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.power-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.power-list li > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.session-actions {
  flex-wrap: nowrap;
}
.row .select.boost-select {
  flex: 0 0 auto;
  width: 112px;
  height: 32px;
  font-size: 13px;
}
table.grid tbody tr.needs-row td {
  background: var(--sunk);
}
.needs-row .unit-field {
  flex: 0 1 120px;
}
@media (max-width: 860px) {
  .check-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 12px 16px;
  }
}

/* ---------- Stress test ---------- */

.stress-stack {
  display: grid;
  gap: 24px;
}
.stress-stack .panel-head .right .btn:disabled {
  opacity: 0.55;
}
#stress-bottleneck:not(:empty) {
  display: grid;
  gap: 10px;
  padding: 0 24px 18px;
}
/* With help under the fields, rows line up by their top, and a checkbox sits beside the inputs. */
#build .form-grid {
  align-items: start;
}
#build .form-grid > .check {
  margin-top: 34px;
}
#stress-registered[hidden] {
  display: none;
}
.chart {
  display: block;
  max-width: 100%;
  height: auto;
  font-family: var(--font);
}
.chart .grid-line {
  stroke: var(--line);
  stroke-width: 1;
}
.chart .axis {
  fill: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chart .mark {
  stroke: var(--ink-3);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.chart .line-connected,
.chart .line-rtt {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .line-connected {
  stroke: var(--charging);
}
.chart .line-rtt {
  stroke: var(--waiting-text);
}
.legend {
  font-size: 13px;
  color: var(--ink-2);
}
.legend .key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend .key::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.legend .key-connected::before {
  background: var(--charging);
}
.legend .key-rtt::before {
  background: var(--waiting-text);
}

/* ---------- Hosted: who is signed in, and the login page ---------- */

.signed-in {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 18px 8px;
  min-width: 0;
}
.signed-in-label {
  font-size: 12.5px;
  color: var(--rail-ink-2);
}
.signed-in-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--rail-ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Maia's sign-in: a panel on the navy of the rail. */
.login-page {
  background: var(--rail);
}
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.login-card {
  width: min(400px, 100%);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-radius: var(--r-md);
  box-shadow: 0 24px 64px -16px rgb(0 0 0 / 0.45);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.login-brand .brand-tag {
  background: var(--blue-wash);
  color: var(--blue-on-wash);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-form[hidden] {
  display: none;
}
.login-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.login-head h1 {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
}
.login-sub {
  font-size: 14px;
  color: var(--ink-2);
}
/* Faulted text: 6.3:1 on the panel in light, 7.4:1 in dark. */
.login-error {
  min-height: 1.5em;
  margin: -6px 0 -4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--faulted-text);
}
.login-error:empty {
  min-height: 0;
  margin: 0;
}
.login-submit {
  width: 100%;
}
/* White on --blue is 4.49:1 in light: the login's buttons take the deeper blue (6.5:1). */
:root:not([data-theme="dark"]) .login .btn.primary {
  background: var(--blue-ink);
  border-color: var(--blue-ink);
}
:root:not([data-theme="dark"]) .login .btn.primary:hover {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
}
.login .btn.ghost {
  color: var(--blue-on-wash);
}
