/* Longhouse — page shell and dark-navy / gold palette.
   Style-A frames (Warchief override, 2026-11-16): tall rounded-oval arches with thin gold
   edging and a knotwork clasp. No shield polygons and no dragon corners.
   System fonts and approved roster portraits. */

:root {
  /* Core palette (spec section 4.2). HOD-3098: the gold, text and field values are
     bravendal.com's --gold / --ivory / --ink so the Longhouse reads as the same site. */
  --lh-field: #050d1a;
  --lh-plate: #121C2E;
  --lh-rule: #25344F;
  --lh-gold: #dcae58;
  --lh-gold-hi: #f0c977;
  --lh-text: #f3ecdc;
  --lh-muted: #A3B1C6;
  --lh-ember: #F07A3A;
  --lh-blood: #FF6B6B;
  --lh-amber: #F5C451;
  --lh-frost: #8FD3FF;
  /* HOD-3152 status colours: up steel-blue, down terracotta, not-checked gold.
     Each is paired with a shape and a word, so colour is never the only cue. */
  --lh-status-up: #6ba4ff;
  --lh-status-down: #e06c47;
  --lh-status-down-text: #ff8a66;
  --lh-status-down-bg: #2a0f08;
  --lh-status-unknown: #d8b25c;
  /* HOD-3152: the failing count on a card detail line. */
  --lh-detail-bad: #ff9d80;
  /* HOD-3098: no green in the Bravendal palette. The old sea green is retired and the
     token now resolves to the frost blue so the Realm busy gauge stays blue. */
  --lh-sea: #8FD3FF;

  /* Team bands: a band fill and a brighter text accent per group. */
  --lh-team-boat: #1FA595;
  --lh-team-boat-hi: #7FE0D0;
  --lh-team-raid: #C8343C;
  --lh-team-raid-hi: #F08A8A;
  --lh-team-jarl: #7B4FB8;
  --lh-team-jarl-hi: #C9A8F5;
  --lh-team-hall: #D9A441;
  --lh-team-hall-hi: #F2C66D;
  --lh-team-forge: #5D6B7A;
  --lh-team-forge-hi: #F07A3A;
  --lh-team-sky: #3E6FD8;
  --lh-team-sky-hi: #9DB8F2;

  /* Type and spacing. */
  --lh-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --lh-body-size: clamp(15px, 0.55vw + 7px, 30px);
  --lh-radius: 10px;
  --lh-gap: clamp(8px, 0.9vw, 18px);

  /* Style-A frame geometry (override 2026-11-16): a rounded crown, straight sides and a flat
     foot. The path is the canonical 120x150 arch for fixed-size frame boxes. */
  --lh-arch-radius: 50% 50% 8px 8px / 44% 44% 8px 8px;
  --lh-arch-path: "M 60 6 C 24 6 6 30 6 58 L 6 144 L 114 144 L 114 58 C 114 30 96 6 60 6 Z";
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body.lh-body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  grid-template-areas:
    "top"
    "scene"
    "alarms"
    "main"
    "nav";
  gap: var(--lh-gap);
  padding: var(--lh-gap);
  background: var(--lh-field);
  color: var(--lh-text);
  font-family: var(--lh-font);
  font-size: var(--lh-body-size);
  line-height: 1.4;
}

/* ---------- Top bar ---------- */

/* HOD-3152: every link and button is at least 44x44 on every viewport. The phone
   block already did this; the desktop header controls were 27-31px tall. */
.lh-top .lh-text-link,
.lh-top .lh-calm-toggle,
.lh-top .lh-tv-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

.lh-top {
  grid-area: top;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--lh-gap);
  padding: var(--lh-gap);
  background: var(--lh-plate);
  border: 2px solid var(--lh-gold);
  border-radius: var(--lh-radius);
}

.lh-title {
  margin: 0;
  font-size: clamp(1.4rem, 1.2vw + 1rem, 3.2rem);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--lh-gold-hi);
}

.lh-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--lh-gap);
}

.lh-counter {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.5em;
  align-items: center;
  padding: 0.3em 0.6em;
  background: var(--lh-field);
  border: 1px solid var(--lh-rule);
  border-radius: var(--lh-radius);
}

.lh-counter .lh-glyph {
  grid-row: 1 / span 2;
  font-size: 1.8em;
  line-height: 1;
}

.lh-counter-label {
  color: var(--lh-muted);
  font-size: 0.7em;
  font-variant: small-caps;
  letter-spacing: 0.03em;
}

.lh-counter-value {
  font-size: clamp(2rem, 1.8vw + 1.2rem, 6rem);
  font-weight: 700;
  color: var(--lh-gold-hi);
  font-variant-numeric: tabular-nums;
}

.lh-counter--merged .lh-counter-value {
  color: var(--lh-amber);
}

.lh-counter--live .lh-counter-value {
  color: var(--lh-frost);
}

.lh-topmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75em;
  justify-content: flex-end;
  color: var(--lh-muted);
}

.lh-clock {
  color: var(--lh-text);
  font-variant-numeric: tabular-nums;
}

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

/* A snapshot older than 180 s: the shell adds lh-stale and the word STALE. */
.lh-snapshot.lh-stale {
  color: var(--lh-blood);
  font-weight: 700;
}

.lh-mode {
  padding: 0.15em 0.5em;
  border: 1px solid var(--lh-gold);
  border-radius: var(--lh-radius);
  color: var(--lh-gold-hi);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

.lh-text-link,
.lh-nav-link {
  color: var(--lh-frost);
  text-decoration: underline;
}

.lh-tv-button {
  padding: 0.25em 0.75em;
  background: var(--lh-gold);
  color: var(--lh-field);
  border: 2px solid var(--lh-gold-hi);
  border-radius: var(--lh-radius);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lh-tv-button:hover {
  background: var(--lh-gold-hi);
  /* HOD-3098: keep the hover label dark. The mapped .lh-top button colour is the same
     gold as this hover plate, so it would otherwise compute to 1:1. */
  color: var(--lh-field);
}

/* HOD-3098: pressed state was #edcf93 on #f2c66d (1.07:1, invisible). A dark ink label
   on the mapped gold is 9.49:1. The rule outranks :hover so hovering a pressed TV stays legible. */
.lh-top .lh-tv-button[aria-pressed="true"] {
  background: var(--lh-gold);
  color: var(--lh-field);
  border-color: var(--lh-gold);
}

/* ---------- Alarm strip ---------- */

.lh-alarms {
  grid-area: alarms;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  padding: 0.4em 0.8em;
  background: var(--lh-plate);
  border: 1px solid var(--lh-ember);
  border-left: 6px solid var(--lh-ember);
  border-radius: var(--lh-radius);
}

.lh-alarms:empty {
  display: none;
}

.lh-alarm {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  color: var(--lh-text);
}

.lh-alarm-glyph {
  color: var(--lh-ember);
  font-size: 1.2em;
}

.lh-alarm-words {
  font-variant: small-caps;
  letter-spacing: 0.02em;
}

.lh-alarm--p0 .lh-alarm-glyph {
  color: var(--lh-blood);
}

.lh-alarm--p0 .lh-alarm-words {
  color: var(--lh-blood);
}

.lh-alarm-age {
  color: var(--lh-muted);
  font-size: 0.8em;
}

/* ---------- Nav ---------- */

.lh-nav {
  grid-area: nav;
  display: flex;
  gap: 0.5em;
  padding: 0.4em 0.8em;
  background: var(--lh-plate);
  border: 1px solid var(--lh-rule);
  border-radius: var(--lh-radius);
}

.lh-nav-link {
  padding: 0.2em 0.6em;
  border-radius: var(--lh-radius);
  color: var(--lh-text);
}

.lh-nav-link[aria-current="page"] {
  background: var(--lh-gold);
  color: var(--lh-field);
  font-weight: 700;
}

/* ---------- Main grid ---------- */

.lh-main {
  grid-area: main;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    "hall river hearth"
    "hall river stuck"
    "bridge bridge fires"
    "realm realm realm";
  gap: var(--lh-gap);
  min-height: 0;
}

.lh-hall {
  grid-area: hall;
}

.lh-river {
  grid-area: river;
}

.lh-hearth {
  grid-area: hearth;
}

.lh-stuck {
  grid-area: stuck;
}

.lh-bridge {
  grid-area: bridge;
}

.lh-fires {
  grid-area: fires;
}

.lh-realm {
  grid-area: realm;
}

.lh-realm-map {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 900px);
}

/* Place frames are the style-A arches: the gold edging, navy field, tinted
   panel and knotwork clasp ride on the paths, so no plate rectangle is drawn. */

.lh-realm-name {
  fill: var(--lh-gold-hi);
  font-size: 10px;
  font-variant: small-caps;
  text-anchor: middle;
}

.lh-realm-role,
.lh-realm-jobs,
.lh-realm-busy-label {
  fill: var(--lh-muted);
  font-size: 8px;
  text-anchor: middle;
}

.lh-realm-health {
  fill: var(--lh-text);
  font-size: 9px;
  text-anchor: middle;
}

.lh-realm-place {
  cursor: pointer;
}

/* Hover or focus highlights the place's jobs and its standing members. */
.lh-realm-place.lh-realm-hot .lh-realm-health,
.lh-realm-place.lh-realm-hot .lh-realm-jobs {
  fill: var(--lh-gold-hi);
}

.lh-realm-place.lh-realm-hot .lh-avatar path {
  stroke: var(--lh-gold-hi);
}

.lh-realm-busy-track {
  fill: var(--lh-rule);
}

.lh-realm-busy-fill {
  fill: var(--lh-sea);
}

.lh-realm-link-path {
  stroke: var(--lh-rule);
  stroke-width: 2;
}

.lh-link-glyph {
  fill: var(--lh-gold-hi);
  font-size: 14px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.lh-link-traveler {
  pointer-events: none;
}

/* ---------- Realm status pills, cards and legend (HOD-3152) ---------- */

/* A pill is a shape + a word + a colour. The word carries the meaning; the shape
   and colour only make it scannable, so no reading depends on colour alone. */
.lh-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.15em 0.55em;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.lh-realm-shape {
  font-size: 0.95em;
  line-height: 1;
}

.lh-status-up {
  color: var(--lh-status-up);
}

.lh-status-down {
  color: var(--lh-status-down-text);
  background: var(--lh-status-down-bg);
  border-color: var(--lh-status-down);
}

.lh-status-not-checked {
  color: var(--lh-status-unknown);
}

/* The legend sits above the cards and repeats the map's meaning in words. */
.lh-realm-legend {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35em 0.55em;
  margin: 0 0 0.6em;
  color: var(--lh-muted);
  font-size: 0.9em;
}

body[data-focus-panel="lh-realm"] .lh-realm-legend,
body[data-lh-tv-view="realm"] .lh-realm-legend {
  display: flex;
}

/* Cards: name · job · status word, with the detail line in muted text. */
.lh-realm-cards {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 0.5em;
  margin: 0;
  padding: 0;
  list-style: none;
}

body[data-focus-panel="lh-realm"] .lh-realm-cards,
body[data-lh-tv-view="realm"] .lh-realm-cards {
  display: grid;
}

.lh-realm-card {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  min-width: 0;
  padding: 0.45em 0.75em;
  background: #0b1728;
  border: 1px solid var(--lh-rule);
  border-left: 6px solid var(--lh-status-up);
  border-radius: 8px;
}

.lh-realm-card[data-status="down"] {
  border-left-color: var(--lh-status-down);
}

.lh-realm-card[data-status="not-checked"] {
  border-left-color: var(--lh-status-unknown);
}

.lh-realm-card-name {
  color: var(--lh-gold-hi);
  font-weight: 700;
}

.lh-realm-card-job {
  color: var(--lh-muted);
  font-size: 0.9em;
}

.lh-realm-detail {
  margin: 0;
  color: var(--lh-muted);
  font-size: 0.9em;
}

.lh-realm-detail-bad {
  color: var(--lh-detail-bad);
  font-weight: 600;
}

/* The map is a detail view: an explicit toggle, closed by default, so the cards
   and legend fit one screen on the Realm tab. */
.lh-realm-map-open {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  margin: 0.6em 0 0;
  padding: 0.4em 0.9em;
  background: #0b1728;
  color: var(--lh-text);
  border: 1px solid var(--lh-rule);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

body[data-focus-panel="lh-realm"] .lh-realm-map-open,
body[data-lh-tv-view="realm"] .lh-realm-map-open {
  display: inline-flex;
}

.lh-realm-map-wrap[hidden] {
  display: none;
}

/* The map's own status line uses the same word + shape, in the status colour. */
.lh-realm-health--up {
  fill: var(--lh-status-up);
}

.lh-realm-health--down {
  fill: var(--lh-status-down-text);
}

.lh-realm-health--not-checked {
  fill: var(--lh-status-unknown);
}

/* Panel plates with a thin gold rule. */
.lh-panel {
  position: relative;
  min-height: 0;
  padding: var(--lh-gap);
  background: var(--lh-plate);
  border: 1px solid var(--lh-rule);
  border-radius: var(--lh-radius);
  box-shadow: inset 0 0 0 1px var(--lh-gold);
  overflow: hidden;
}

.lh-panel > h2 {
  margin: 0 0 0.5em;
  font-size: 1.1em;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--lh-gold-hi);
  border-bottom: 1px solid var(--lh-gold);
  padding-bottom: 0.25em;
}

.lh-empty {
  color: var(--lh-muted);
  margin: 0;
}

/* ---------- Whole-item folding (HOD-3096) ----------
   Items that cannot fit whole are hidden with the `hidden` attribute; the class
   also folds SVG groups (the Bridge's columns and banners). The last line of a
   folded panel is a gold `+ N more` link into that panel's focus view. */

.lh-folded {
  /* `!important` is required: several item classes set their own `display`
     (`.lh-hall-card` is flex, `.lh-fires-line` is flex), and an author rule beats
     the UA stylesheet's `[hidden] { display: none }`. Folding must win. */
  display: none !important;
}

.lh-more {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0;
  padding: 0.2em 0;
  color: #dcae58;
  font-weight: 600;
  font-size: 1em;
  line-height: 1.2;
  text-decoration: none;
}

.lh-more:hover,
.lh-more:focus-visible {
  color: var(--lh-gold-hi);
  text-decoration: underline;
}

/* ---------- Style-A arch frames (override 2026-11-16) ----------
   Tall rounded-oval arches with thin gold edging and a small gold knotwork clasp at the
   foot, on the navy field. Style B's shield frames and dragon corners are void. */

.lh-arch {
  position: relative;
  border-radius: var(--lh-arch-radius);
  border: 1px solid var(--lh-gold);
  background: var(--lh-field);
  overflow: hidden;
}

.lh-arch::after {
  /* The knotwork clasp at the foot of the arch. */
  content: "";
  position: absolute;
  inset-inline: 38%;
  bottom: 4px;
  height: 6px;
  border-radius: 50%;
  background: var(--lh-gold-hi);
  box-shadow: 0 0 0 2px var(--lh-field), 0 0 0 3px var(--lh-gold);
}

/* The same arch as a closed path, for fixed-size (120x150) frame boxes. */
.lh-arch-frame {
  clip-path: path("M 60 6 C 24 6 6 30 6 58 L 6 144 L 114 144 L 114 58 C 114 30 96 6 60 6 Z");
}

/* A thin gold knotwork chain around a plate. */
.lh-knot-border {
  border: 2px solid transparent;
  border-image: repeating-linear-gradient(
    45deg,
    var(--lh-gold) 0 6px,
    var(--lh-rule) 6px 12px
  ) 2;
}

/* Team-tinted panels behind each group, mixed from the team bands. */
.lh-tint-boat {
  background: var(--lh-plate);
  background: color-mix(in srgb, var(--lh-team-boat) 22%, var(--lh-field));
}

.lh-tint-raid {
  background: var(--lh-plate);
  background: color-mix(in srgb, var(--lh-team-raid) 22%, var(--lh-field));
}

.lh-tint-builders {
  background: var(--lh-plate);
  background: color-mix(in srgb, var(--lh-ember) 20%, var(--lh-field));
}

.lh-tint-guard {
  background: var(--lh-plate);
  background: color-mix(in srgb, var(--lh-team-forge) 22%, var(--lh-field));
}

/* The river's ambient water; drifts over one minute. */
.lh-river-water {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--lh-rule) 50%,
    transparent 100%
  );
  opacity: 0.18;
  animation: lh-river-drift 60s linear infinite;
}

/* Links between places on the Realm map. */
.lh-link {
  stroke: var(--lh-gold);
  stroke-width: 2;
  stroke-dasharray: 6 6;
  animation: lh-dash 1.2s linear infinite;
}

/* ---------- Drill-down and live region ---------- */

.lh-drill {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(480px, 100vw);
  padding: var(--lh-gap);
  background: var(--lh-plate);
  border-left: 2px solid var(--lh-gold);
  overflow-y: auto;
  z-index: 20;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: 3px solid var(--lh-gold);
  outline-offset: 2px;
}

/* ---------- Avatar states ----------
   The sprite root carries data-state; parts are classed by sprites.js. */

.lh-avatar[data-state="building"] .lh-arm {
  animation: lh-arm-swing 1.2s ease-in-out infinite;
  transform-origin: 50% 30%;
}

.lh-avatar[data-state="speccing"] .lh-prop {
  animation: lh-quill 2s ease-in-out infinite;
}

.lh-avatar[data-state="inspecting"] .lh-head {
  animation: lh-inspect 3s ease-in-out infinite;
}

.lh-avatar[data-state="rowing"] .lh-body {
  animation: lh-rowing 4s ease-in-out infinite;
}

.lh-avatar[data-state="rowing"] .lh-prop {
  animation: lh-rowing 4s ease-in-out infinite;
}

.lh-avatar[data-state="merging"] .lh-prop {
  animation: lh-horn 2s ease-in-out infinite;
}

.lh-avatar[data-state="waiting"] {
  animation: lh-breathe 4s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.lh-avatar[data-state="idle"] {
  opacity: 0.7;
}

.lh-avatar[data-state="failed"] .lh-glyph {
  animation: lh-smoke 3s ease-in-out infinite;
}

@keyframes lh-arm-swing {
  0%,
  100% {
    transform: rotate(-18deg);
  }
  50% {
    transform: rotate(22deg);
  }
}

@keyframes lh-quill {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(4px, -2px) rotate(-8deg);
  }
}

@keyframes lh-inspect {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

@keyframes lh-rowing {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

@keyframes lh-horn {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes lh-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes lh-smoke {
  0% {
    transform: translateY(0);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-8px);
    opacity: 0;
  }
}

@keyframes lh-river-drift {
  0% {
    transform: translateX(-6%);
  }
  100% {
    transform: translateX(6%);
  }
}

@keyframes lh-dash {
  0% {
    stroke-dashoffset: 24;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* ---------- Calm mode ----------
   The Calm toggle turns every animation and transition off. */

.lh-calm,
.lh-calm *,
.lh-calm *::before,
.lh-calm *::after {
  animation: none;
  transition: none;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none;
    transition: none;
  }
}

/* ---------- Phone: one column, nav as bottom tabs ---------- */

@media (max-width: 700px) {
  body.lh-body {
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "top"
      "scene"
      "alarms"
      "main"
      "nav";
    padding-bottom: calc(var(--lh-gap) + 3.5rem);
  }

  .lh-top {
    grid-template-columns: 1fr;
  }

  .lh-topmeta {
    justify-content: flex-start;
  }

  .lh-counters {
    grid-template-columns: 1fr;
  }

  .lh-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "river"
      "hall"
      "hearth"
      "stuck"
      "bridge"
      "fires"
      "realm";
  }

  .lh-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    border-radius: 0;
    border-top: 2px solid var(--lh-gold);
    z-index: 30;
  }

  .lh-drill {
    width: 100vw;
  }
}

/* Brass fittings and ink-blue plates from the approved hall study. */
body.lh-body {background:radial-gradient(ellipse at top,#1b2a3c,#090e19 70%);grid-template-columns:minmax(0,1fr)}
.lh-top,.lh-panel {background:linear-gradient(150deg,#18283b,#101827 65%);border:1px solid #947346;box-shadow:inset 0 0 0 3px #111a27, inset 0 0 0 4px #453e32}
.lh-title,.lh-panel > h2,.lh-hall-name {font-family:"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif}
.lh-top {grid-template-columns:auto minmax(20rem,1fr) auto auto}
.lh-counters {gap:.45rem}
.lh-counter {padding:.35em .6em}
.lh-counter-value {font-size:1.8em;line-height:1.1}
.lh-topmeta {gap:.45rem;max-width:30em}
.lh-top a,.lh-top button,.lh-hall-period-btn,.lh-hall-hired-token {font:inherit;font-size:.8em;color:#edcf93;background:#111b29;border:1px solid #79613d;border-radius:6px;padding:.35em .65em;text-decoration:none}
/* HOD-3098: top-bar links and buttons use the mapped bright gold (10.99:1 on #111b29). */
.lh-top a,.lh-top button {color:var(--lh-gold-hi)}
.lh-top a:hover,.lh-hall-card:hover {border-color:#f2c66d}
.lh-alarms {gap:.5em 1em;padding:.45em .8em}
.lh-alarm + .lh-alarm {border-inline-start:1px solid #72563b;padding-inline-start:1em}
.lh-panel {min-width:0}
.lh-main {align-content:start}
.lh-hearth-head,.lh-hearth-planks,.lh-fires-line,.lh-stuck-group-head,.lh-stuck-item {display:flex;align-items:center;flex-wrap:wrap;gap:.4em}
#lh-river,#lh-bridge {overflow:auto}
svg.lh-river {display:block;width:100%;min-width:950px;height:auto;background:#122f40}
.lh-water-lane {fill:#193a4b;fill-opacity:.48;stroke:#446274;stroke-opacity:.5}
.lh-water-lane:nth-of-type(even) {fill:#162f42}
.lh-river text,.lh-bridge text {fill:#ebe3cf;font:600 13px system-ui}
.lh-river .lh-river-stage-oldest,.lh-river .lh-river-stage-count {fill:#b6ccda;font-size:12px}
.lh-bracket-band,.lh-fleet-badge,.lh-bypass-plate,.lh-bridge-banner-plate {fill:#333344;stroke:#9a7a4a}
.lh-boat-hull {fill:#443429;stroke:#d3a45f}
.lh-sail-plain {fill:#52767c}
.lh-sail-stripe,.lh-boat-pennant,.lh-sail-flame {fill:#e8aa56}
.lh-river .lh-sealed-rune {text-anchor:middle;fill:#f6dfab;font-size:13px;pointer-events:none}
.lh-bridge-bed {fill:#182a3b;stroke:#4a5a6b}
.lh-hearth-body {display:grid;gap:.55em}
.lh-hearth-head svg {width:3.2em;height:3.2em}
.lh-hearth-head p {flex:1}
.lh-hearth-body p {margin:0}
.lh-hearth-slot,.lh-hearth-overflow,.lh-hearth-gauge,.lh-hearth-idle-alarm {padding:.55em .7em;background:#101c2a;border:1px solid #4c5153;border-radius:6px}
.lh-hearth-slots,.lh-hearth-overflow,.lh-hearth-gauge {display:grid;gap:.4em}
.lh-hearth-slot {border-inline-start:3px solid #bd8b48}
.lh-hearth-overflow-title {font-size:.75em;color:#d7b778;letter-spacing:.08em}
.lh-hearth-planks-glyphs,.lh-hearth-planks-more {display:none}
.lh-hearth-gauge progress {width:100%;height:.7em;accent-color:#dfa944}
.lh-hearth-meta {color:var(--lh-muted);font-size:.85em}
.lh-fires-table {display:block;overflow:auto}
.lh-fires-pinned {display:flex;flex-wrap:wrap;align-items:center;gap:.2em .6em;padding:.35em .45em;border-inline-start:2px solid var(--lh-ember)}
.lh-fires-pinned-title {font-size:.8em;font-weight:700;color:#efb98b}
.lh-fires-pinned-item {overflow-wrap:anywhere}
.lh-stuck-items {padding-left:1em}
.lh-stuck-item {border-bottom:1px solid var(--lh-rule);padding:.4em 0}
.lh-stuck-group h3 {font-size:1em}
@media(min-width:1201px) {
  .lh-main {grid-template-columns:minmax(16rem,1fr) minmax(0,2.65fr) minmax(15rem,.95fr)}
}
@media(max-width:1200px) {
  .lh-top {grid-template-columns:auto minmax(0,1fr)}
  .lh-topmeta {justify-content:flex-start}
}
@media(max-width:700px) {
  .lh-top {grid-template-columns:minmax(0,1fr) auto}
  .lh-title,.lh-counters {grid-column:1/-1}
  .lh-counters {grid-template-columns:repeat(3,minmax(0,1fr))}
  .lh-counter {grid-template-columns:1fr;align-content:start}
  .lh-counter .lh-glyph {display:none}
  .lh-topmeta {font-size:.9em}
  .lh-panel {max-width:100%}
}

.lh-top .lh-nav {position:static;grid-column:1/-1;grid-area:auto / 1 / auto / -1;justify-content:flex-start;flex-wrap:wrap;background:none;border:0;padding:0}
.lh-top .lh-nav-link[aria-current=page] {color:#1b2029;background:#d7b77e}
/* HOD-3152: the compact chip strip repeats the same name · job · status words in
   one-line form, and doubles as the phone layout of the cards. */
.lh-realm-chips {display:flex;flex-wrap:wrap;align-content:flex-start;gap:.45em;margin-top:.4em;background:none;border:0;padding:0;color:#e8d3aa;font:inherit}
.lh-realm-chips .lh-realm-chip {display:inline-flex;align-items:center;flex-wrap:wrap;gap:.3em;min-height:44px;max-width:100%;border:1px solid #82704f;border-radius:1em;padding:.35em .7em;background:#1c3040;color:#e8d3aa}
.lh-realm-chips .lh-status-pill {align-self:center;background:transparent;border:1px solid currentColor;padding:.05em .45em}
.lh-realm-chips .lh-status-down {background:var(--lh-status-down-bg);border-color:var(--lh-status-down)}
.lh-realm-map {display:none}
body[data-focus-panel=lh-realm] .lh-realm-map,body[data-lh-tv-view=realm] .lh-realm-map {display:block}
@media(min-width:701px) {
 body.lh-body,body.lh-body:has(> #lh-owner-priorities:not([hidden])) {
   height:100vh;min-height:0;overflow:hidden;gap:6px;padding:8px;
   grid-template-areas:"top" "priorities" "scene" "alarms" "main";
   grid-template-rows:auto auto auto auto minmax(0,1fr)
 }
 #lh-owner-priorities,.lh-alarms {max-height:9vh;overflow:auto}
 .lh-top {gap:.4em .75em;padding:.5em .8em}
 .lh-main {grid-template-columns:minmax(0,1.05fr) minmax(0,2.7fr) minmax(0,1fr);grid-template-rows:minmax(0,1.35fr) minmax(0,.9fr) minmax(0,1fr);grid-template-areas:"hall river hearth" "hall river stuck" "realm bridge fires";align-content:stretch;gap:7px}
 .lh-panel {overflow:auto;padding:.65em}
 /* A closed <details> hides its body in the UA sheet, but the author `display` on
    .lh-stuck-chips beats that: without this, a collapsed row's chips render outside
    the row box, overlap the next row, and cross the panel's inner edge. Desktop only;
    the phone layout is unchanged. */
 .lh-stuck-row:not([open]) .lh-stuck-chips {display:none}
 /* The River is not folded (step 1 covers the six item panels); it keeps its thin bar. */
 #lh-river {scrollbar-width:thin}
 svg.lh-river {min-width:730px}
 body[data-focus-panel]:not([data-focus-panel=""]) .lh-main, body[data-lh-tv-view=realm] .lh-main {display:block}
 body[data-focus-panel]:not([data-focus-panel=""]) .lh-panel {display:none}
 body[data-focus-panel=lh-realm] #lh-realm, body[data-focus-panel=lh-bridge] #lh-bridge, body[data-focus-panel=lh-fires] #lh-fires, body[data-focus-panel=lh-hall] #lh-hall,body[data-lh-tv-view=realm] #lh-realm {display:block;height:100%}
 body[data-lh-tv-view=bridge_fires] .lh-main {grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr);grid-template-areas:"bridge fires"}
}
@media(max-width:700px) {
 .lh-panel {max-height:75vh;overflow:auto}
}

/* River scroll hint: hidden on wide viewports (HOD-3099). */
.lh-river-swipe-cue {
  display: none;
}

@media (max-width: 700px) {
  .lh-river-swipe-cue {
    display: block;
    margin: 0 0 0.35em;
    font-size: max(12px, 1em);
    color: var(--lh-muted);
  }

  #lh-river {
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
    scroll-snap-type: x proximity;
  }

  svg.lh-river .lh-river-column {
    scroll-snap-align: start;
  }

  .lh-top {
    overflow-x: hidden;
  }

  .lh-topmeta {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .lh-counter-label {
    font-size: max(12px, 0.7em);
  }

  .lh-text-link,
  .lh-calm-toggle,
  .lh-tv-button {
    font-size: max(12px, 1em);
  }

  .lh-hearth-overflow-title {
    font-size: max(12px, 0.75em);
  }

  .lh-hall-group-title {
    font-size: max(12px, 0.78em);
  }

  .lh-group-count,
  .lh-group-five {
    font-size: max(12px, 1em);
  }

  svg .lh-plate-title {
    font-size: max(12px, 1em);
  }

  .lh-top a,
  .lh-top button,
  .lh-nav-link,
  .lh-hall-card {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

.lh-stuck-group-head {
  margin:.55em 0 .2em;
  color:var(--lh-muted);
  font-size:.78em;
  font-weight:600;
}
.lh-stuck-plate {width:8.5rem;height:2rem;flex:none}
.lh-stuck-summary {
  padding:.35em .2em;
  color:#e9d4a6;
  cursor:pointer;
  border-bottom:1px solid var(--lh-rule);
  line-height:1.4;
}
.lh-stuck-summary:hover,.lh-stuck-summary:focus-visible {color:var(--lh-gold-hi)}
.lh-stuck-chips {display:flex;flex-wrap:wrap;gap:.35em;padding:.4em 0}
.lh-stuck-chip {
  display:inline-flex;
  align-items:center;
  gap:.35em;
  padding:.12em .45em;
  border:1px solid #485568;
  border-radius:.4em;
  background:#101c2a;
  color:#d5e1ec;
  font-size:.8em;
}
.lh-stuck-chip a {color:#abd6e7}
.lh-top > a {justify-self:end}
@media(min-width:701px) {
  .lh-top .lh-nav {grid-column:1 / -2;grid-row:2}
  .lh-top > a {grid-column:-2 / -1;grid-row:2}
}

/* ---------- HOD-3146 Monitor shell ---------- */

:root {
  --lh-ink: #04080f;
  --lh-navy: #0c2240;
  --lh-ivory: #f3ecd8;
  --lh-monitor-border: #2a4266;
  --lh-steel: #6ba4ff;
  --lh-pending: #d8b25c;
  --lh-terracotta: #e06c47;
  --lh-terracotta-deep: #a8471c;
  --lh-band-bg: #1f0d09;
  --lh-band-border: #e06c47;
  --lh-band-ivory: #ece3d6;
  --lh-band-peach: #ffb59e;
  --lh-band-pill: #ff8a66;
  --lh-monitor-gap: clamp(12px, 1.25vw, 24px);
  --lh-monitor-pad: clamp(14px, 1.35vw, 28px);
}

.lh-top-leading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: clamp(8px, 1vw, 20px);
  min-width: 0;
}

.lh-title {
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
}

.lh-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35em 0.85em;
  text-decoration: none;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom-width: 3px;
}

.lh-nav-link:focus-visible,
.lh-text-link:focus-visible,
.lh-tv-button:focus-visible {
  outline: 3px solid var(--lh-gold);
  outline-offset: 2px;
}

.lh-nav-link[aria-current="page"] {
  background: var(--lh-navy);
  color: var(--lh-ivory);
  border-color: var(--lh-monitor-border);
  border-bottom-color: var(--lh-pending);
  font-weight: 700;
  text-decoration: none;
}

.lh-monitor {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lh-monitor-placeholder {
  margin: 0;
}

.lh-monitor-layout {
  display: flex;
  flex-direction: column;
  gap: var(--lh-monitor-gap);
  min-height: 0;
  flex: 1;
  height: 100%;
}

.lh-red-band {
  font-family: Inter, system-ui, sans-serif;
  background: var(--lh-band-bg);
  border: 2px solid var(--lh-band-border);
  border-radius: 10px;
  padding: clamp(12px, 1.1vw, 22px);
  color: var(--lh-band-ivory);
  min-width: 0;
}

.lh-red-band--clear {
  background: var(--lh-navy);
  border-color: var(--lh-monitor-border);
  padding: clamp(10px, 0.9vw, 16px) var(--lh-monitor-pad);
}

.lh-red-band-clear {
  margin: 0;
  color: var(--lh-steel);
  font-size: max(12px, 0.95em);
}

.lh-red-band-head {
  margin-bottom: clamp(10px, 1vw, 18px);
  min-width: 0;
}

.lh-red-band-kicker {
  margin: 0;
  font-size: max(12px, 0.72em);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lh-band-peach);
}

.lh-red-band-title {
  margin: 0.15em 0 0.1em;
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
  font-size: clamp(1.15rem, 0.55vw + 1rem, 1.75rem);
  font-weight: 600;
  color: var(--lh-band-ivory);
}

.lh-red-band-count {
  margin: 0;
  color: var(--lh-band-peach);
  font-size: max(12px, 0.92em);
}

.lh-red-band-cells {
  display: grid;
  gap: clamp(12px, 1vw, 20px);
  grid-template-columns: 1fr;
}

.lh-red-band-cell-title {
  margin: 0 0 0.35em;
  font-size: max(12px, 0.78em);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lh-band-peach);
}

.lh-red-band-line {
  margin: 0.35em 0;
  font-size: max(12px, 0.92em);
  line-height: 1.35;
  color: var(--lh-band-ivory);
  overflow-wrap: anywhere;
}

.lh-red-band-muted {
  margin: 0.25em 0 0;
  font-size: max(12px, 0.85em);
  color: var(--lh-muted);
}

.lh-red-band-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin: 0.15em 0 0.45em;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  font-size: max(12px, 0.82em);
  font-weight: 600;
  border: 1px solid transparent;
}

.lh-red-band-pill--down {
  background: color-mix(in srgb, var(--lh-terracotta) 22%, var(--lh-band-bg));
  border-color: var(--lh-terracotta);
  color: var(--lh-band-pill);
}

.lh-red-band-pill--pending {
  background: color-mix(in srgb, var(--lh-pending) 18%, var(--lh-band-bg));
  border-color: var(--lh-pending);
  color: var(--lh-pending);
}

.lh-red-band-pill--up {
  background: color-mix(in srgb, var(--lh-steel) 18%, var(--lh-band-bg));
  border-color: var(--lh-steel);
  color: var(--lh-steel);
}

.lh-red-band-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45em;
  margin: 0.35em 0 0;
  font-size: max(12px, 0.92em);
}

.lh-red-band-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  margin-top: 0.35em;
  padding: 0.35em 0.75em;
  color: var(--lh-steel);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-size: max(12px, 0.92em);
}

.lh-monitor-grid {
  display: flex;
  flex-direction: column;
  gap: var(--lh-monitor-gap);
  min-height: 0;
  flex: 1;
}

.lh-monitor-card {
  background: var(--lh-navy);
  border: 1px solid var(--lh-monitor-border);
  border-radius: 10px;
  padding: var(--lh-monitor-pad);
  min-width: 0;
}

.lh-monitor-card-title {
  margin: 0 0 0.45em;
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
  font-size: clamp(1rem, 0.4vw + 0.85rem, 1.35rem);
  color: var(--lh-ivory);
  border-bottom: 1px solid var(--lh-monitor-border);
  padding-bottom: 0.25em;
}

.lh-monitor-list {
  margin: 0.35em 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35em;
}

.lh-monitor-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.55em;
  font-size: max(12px, 0.95em);
}

.lh-monitor-glyph {
  color: var(--lh-pending);
}

.lh-monitor-words {
  color: var(--lh-ivory);
  flex: 1 1 12rem;
}

.lh-monitor-age {
  color: var(--lh-muted);
  font-size: 0.85em;
}

.lh-monitor-empty {
  margin: 0.2em 0 0;
  color: var(--lh-muted);
  font-size: max(12px, 0.95em);
}

.lh-monitor-kicker,
.lh-monitor-stat,
.lh-monitor-meta {
  margin: 0.15em 0;
  color: var(--lh-muted);
  font-size: max(12px, 0.95em);
}

.lh-monitor-big {
  margin: 0.1em 0;
  font-size: clamp(1.75rem, 1.2vw + 1.2rem, 2.75rem);
  font-weight: 700;
  color: var(--lh-steel);
  font-variant-numeric: tabular-nums;
}

/* HOD-3149: deploy jam + live this week hero cards */
.lh-monitor-card-kicker {
  margin: 0 0 0.35em;
  font-size: max(12px, 0.72em);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lh-muted);
  font-weight: 600;
}

.lh-monitor-card-heading {
  margin: 0 0 0.15em;
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
  font-size: clamp(1rem, 0.35vw + 0.9rem, 1.25rem);
  font-weight: 600;
  color: var(--lh-ivory);
}

.lh-monitor-hero-num {
  margin: 0.05em 0 0.25em;
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
  font-size: clamp(56px, 4.6vw, 104px);
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lh-monitor-hero-num--gold {
  color: var(--lh-pending);
}

.lh-monitor-hero-num--ivory {
  color: var(--lh-ivory);
}

.lh-monitor-row {
  margin: 0.2em 0 0.55em;
  color: var(--lh-muted);
  font-size: max(12px, 0.95em);
}

.lh-monitor-next-box {
  margin-top: 0.35em;
  padding: 0.65em 0.75em;
  border: 1px solid color-mix(in srgb, var(--lh-pending) 45%, var(--lh-navy));
  border-radius: 8px;
  background: color-mix(in srgb, var(--lh-ink) 55%, var(--lh-navy));
}

.lh-monitor-next-label {
  margin: 0 0 0.35em;
  font-size: max(12px, 0.85em);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lh-muted);
}

.lh-monitor-next-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45em 0.65em;
}

.lh-monitor-order-label {
  font-size: max(15px, 1.05em);
  font-weight: 700;
  color: var(--lh-ivory);
}

.lh-monitor-order-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.15em 0.65em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: max(12px, 0.9em);
  font-weight: 600;
  line-height: 1.2;
}

.lh-monitor-order-pill--pending {
  color: var(--lh-pending);
  border-color: var(--lh-pending);
}

.lh-monitor-order-pill--up {
  color: var(--lh-steel);
  border-color: var(--lh-steel);
}

.lh-monitor-order-pill--down {
  color: var(--lh-terracotta);
  border-color: var(--lh-terracotta);
}

.lh-monitor-next-note {
  margin: 0.45em 0 0;
  font-size: max(12px, 0.9em);
  color: var(--lh-muted);
}

.lh-monitor-card--deploy,
.lh-monitor-card--live {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  overflow: hidden;
}

.lh-monitor-middle {
  display: grid;
  gap: var(--lh-monitor-gap);
}

.lh-monitor-tone--ok {
  color: var(--lh-steel);
}

.lh-monitor-tone--pending {
  color: var(--lh-pending);
}

.lh-monitor-tone--down {
  color: var(--lh-terracotta);
}

.lh-monitor-line--red .lh-monitor-words,
.lh-monitor-line--down {
  color: var(--lh-terracotta);
}

/* ---------- HOD-3150 Monitor Bjorn card ---------- */

.lh-monitor-bjorn-kicker {
  margin: 0 0 0.35em;
  font-size: max(12px, 0.72em);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lh-pending);
}

.lh-monitor-bjorn-grid {
  display: grid;
  grid-template-columns: minmax(100px, 52%) minmax(0, 1fr);
  gap: clamp(10px, 1.1vw, 20px);
  align-items: start;
  min-width: 0;
}

.lh-monitor-portrait-box {
  width: 100%;
  max-width: 292px;
  aspect-ratio: 3 / 4;
  border: 2px solid var(--lh-pending);
  border-radius: 6px;
  overflow: hidden;
  background: var(--lh-navy);
  min-width: min(100%, 210px);
}

.lh-monitor-portrait-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lh-monitor-portrait-image {
  pointer-events: none;
}

.lh-monitor-portrait-box--also {
  width: clamp(40px, 3.5vw, 56px);
  max-width: 56px;
  min-width: 40px;
  flex: 0 0 auto;
}

.lh-monitor-bjorn-facts {
  display: grid;
  gap: 0.25em;
  min-width: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: max(12px, 0.95em);
  line-height: 1.35;
}

.lh-monitor-bjorn-name {
  margin: 0;
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
  font-size: clamp(1.05rem, 0.35vw + 0.95rem, 1.45rem);
  font-weight: 600;
  color: var(--lh-ivory);
}

.lh-monitor-bjorn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.15em 0.65em;
  border-radius: 999px;
  font-size: max(12px, 0.82em);
  font-weight: 600;
  border: 1px solid transparent;
  width: fit-content;
}

.lh-monitor-bjorn-pill--building {
  color: var(--lh-steel);
  border-color: var(--lh-steel);
  background: color-mix(in srgb, var(--lh-steel) 15%, var(--lh-navy));
}

.lh-monitor-bjorn-pill--building::before {
  content: "● ";
}

.lh-monitor-bjorn-pill--idle {
  color: color-mix(in srgb, var(--lh-ivory) 55%, var(--lh-navy));
  border-style: dashed;
  border-color: color-mix(in srgb, var(--lh-ivory) 45%, var(--lh-navy));
  background: transparent;
}

.lh-monitor-bjorn-pill--failed {
  color: var(--lh-terracotta);
  border-color: var(--lh-terracotta);
  background: color-mix(in srgb, var(--lh-terracotta) 18%, var(--lh-navy));
}

.lh-monitor-bjorn-pill--failed::before {
  content: "■ ";
}

.lh-monitor-bjorn-verdict {
  margin: 0.1em 0;
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
  font-size: clamp(1.35rem, 0.55vw + 1.1rem, 2rem);
  font-weight: 700;
  line-height: 1.15;
}

.lh-monitor-bjorn-verdict--ok {
  color: var(--lh-steel);
}

.lh-monitor-bjorn-verdict--pending {
  color: var(--lh-pending);
}

.lh-monitor-bjorn-verdict--down {
  color: var(--lh-terracotta);
}

.lh-monitor-bjorn-queue,
.lh-monitor-bjorn-slot,
.lh-monitor-bjorn-idle {
  margin: 0;
  color: var(--lh-muted);
  overflow-wrap: anywhere;
}

.lh-monitor-bjorn-queue strong {
  color: var(--lh-ivory);
  font-weight: 700;
}

.lh-monitor-issue-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.2em 0.15em;
  color: var(--lh-steel);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.lh-monitor-also-building {
  margin-top: clamp(10px, 1vw, 16px);
  padding-top: clamp(8px, 0.8vw, 14px);
  border-top: 1px solid var(--lh-monitor-border);
  min-width: 0;
}

.lh-monitor-also-title {
  margin: 0 0 0.35em;
  font-size: max(12px, 0.78em);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lh-muted);
}

.lh-monitor-also-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 0.9vw, 14px);
  min-width: 0;
}

.lh-monitor-also-item {
  display: flex;
  align-items: center;
  gap: 0.45em;
  min-width: 0;
  flex: 1 1 8rem;
  max-width: 100%;
}

.lh-monitor-also-meta {
  min-width: 0;
}

.lh-monitor-also-name {
  margin: 0;
  font-size: max(12px, 0.9em);
  font-weight: 600;
  color: var(--lh-ivory);
}

.lh-monitor-also-job {
  margin: 0;
  font-size: max(12px, 0.85em);
  color: var(--lh-muted);
  overflow-wrap: anywhere;
}

.lh-monitor-also-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35em 0.65em;
  border-radius: 6px;
  border: 1px dashed var(--lh-monitor-border);
  color: var(--lh-pending);
  font-weight: 700;
}

@media (min-width: 1440px) {
  .lh-monitor-portrait-box:not(.lh-monitor-portrait-box--also) {
    min-width: 210px;
    width: min(100%, 219px);
  }
}

@media (min-width: 1920px) {
  .lh-monitor-portrait-box:not(.lh-monitor-portrait-box--also) {
    min-width: 280px;
    width: min(100%, 292px);
  }

  .lh-monitor-bjorn-facts {
    font-size: max(15px, 0.95em);
  }
}

@media (max-width: 375px) {
  .lh-monitor-portrait-box:not(.lh-monitor-portrait-box--also) {
    min-width: 100px;
    width: min(52%, 120px);
  }
}

@media (max-width: 320px) {
  .lh-monitor-portrait-box:not(.lh-monitor-portrait-box--also) {
    min-width: 100px;
  }
}

body.lh-body[data-focus-panel="monitor"] #lh-alarms,
body.lh-body:not([data-focus-panel]) #lh-alarms {
  display: none !important;
}

@media (min-width: 701px) {
  body.lh-body {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    grid-template-areas: "top" "scene" "alarms" "main";
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: clamp(6px, 0.7vw, 10px);
    padding: clamp(6px, 0.7vw, 10px);
    background: var(--lh-ink);
  }

  .lh-top {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  .lh-top .lh-nav {
    position: static;
    flex-wrap: wrap;
    border: 0;
    background: none;
    padding: 0;
  }

  .lh-main {
    display: block;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .lh-monitor {
    height: 100%;
    overflow: hidden;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  /* The legacy focus rule hides every `.lh-panel`; Monitor is a tab too (HOD-3146). */
  body[data-focus-panel="monitor"] #monitor {
    display: flex;
    height: 100%;
  }

  .lh-monitor > h2 {
    display: none;
  }

  .lh-red-band-cells {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lh-monitor-grid {
    display: grid;
    height: 100%;
    flex: 1;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: 1.25fr 1fr 1.15fr;
    grid-template-areas: "waits middle bjorn";
  }

  .lh-monitor-card--waits {
    grid-area: waits;
    overflow: auto;
  }

  .lh-monitor-middle {
    grid-area: middle;
    grid-template-rows: 1fr 1fr;
    min-height: 0;
  }

  .lh-monitor-card--bjorn {
    grid-area: bjorn;
    overflow: auto;
  }

  body[data-focus-panel]:not([data-focus-panel="monitor"]) .lh-main .lh-panel[hidden] {
    display: none !important;
  }

  body[data-focus-panel]:not([data-focus-panel="monitor"]) .lh-panel:not([hidden]) {
    display: block;
    height: 100%;
    overflow: auto;
  }
}

@media (max-width: 700px) {
  .lh-top-leading {
    flex-direction: column;
    align-items: stretch;
  }

  .lh-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    border: 0;
    background: none;
    padding: 0;
    border-radius: 0;
  }

  .lh-nav-link {
    width: 100%;
  }

  .lh-red-band-cells {
    grid-template-columns: 1fr;
  }

  .lh-monitor-card--waits {
    order: 1;
  }

  .lh-monitor-middle {
    order: 3;
    display: contents;
  }

  .lh-monitor-card--deploy {
    order: 3;
  }

  .lh-monitor-card--live {
    order: 4;
  }

  .lh-monitor-card--bjorn {
    order: 5;
  }
}

@media (min-width: 1920px) {
  body.lh-body {
    font-size: max(15px, var(--lh-body-size));
  }
}

/* ---------- HOD-3151 Hall portrait cards (public view) ---------- */

.lh-hall-layout {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: clamp(8px, 0.75vw, 14px);
  min-width: 0;
}

.lh-hall-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 0 1 auto;
}

.lh-hall-group-title {
  margin: 0;
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
  font-size: clamp(0.85rem, 0.5vw + 0.7rem, 1.05rem);
  font-weight: 600;
  color: #d8b25c;
  letter-spacing: 0.04em;
}

.lh-hall-members {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 0.55vw, 12px);
  min-width: 0;
}

.lh-hall-card {
  position: relative;
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 3 / 4;
  width: clamp(140px, min(10.5vw, calc((100vh - 330px) / 4)), 230px);
  min-height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid #d8b25c;
  border-radius: 8px;
  background: #04080f;
  color: #f3ecd8;
  font: inherit;
  cursor: pointer;
  text-align: left;
  overflow-wrap: anywhere;
}

.lh-hall-card:hover,
.lh-hall-card:focus-visible {
  border-color: #f0c977;
}

.lh-hall-portrait {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lh-hall-portrait-image {
  pointer-events: none;
}

.lh-hall-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.45em 0.5em 0.5em;
  background: rgba(4, 8, 15, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.12em;
  min-width: 0;
  pointer-events: none;
}

.lh-hall-caption::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 16px;
  background: linear-gradient(to top, rgba(4, 8, 15, 0.9), transparent);
  pointer-events: none;
}

.lh-hall-name {
  font-family: "Iowan Old Style", "Fraunces", Palatino, Georgia, serif;
  font-weight: 600;
  font-size: clamp(16px, 0.95vw, 21px);
  line-height: 1.15;
  color: #f3ecd8;
}

.lh-hall-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  font-family: Inter, system-ui, sans-serif;
  font-size: max(12px, 0.78rem);
  font-weight: 600;
  line-height: 1.2;
}

.lh-hall-pill--active {
  color: #6ba4ff;
}

.lh-hall-pill--wait {
  color: #d8b25c;
}

.lh-hall-pill--idle {
  color: color-mix(in srgb, #f3ecd8 72%, #04080f);
  border: 1px dashed color-mix(in srgb, #f3ecd8 45%, #04080f);
  border-radius: 999px;
  padding: 0 0.35em;
}

.lh-hall-pill--down {
  color: #e06c47;
}

.lh-hall-item {
  font-family: Inter, system-ui, sans-serif;
  font-size: max(12px, 0.78rem);
  color: color-mix(in srgb, #f3ecd8 88%, #6ba4ff);
  overflow-wrap: anywhere;
  line-height: 1.25;
}

@media (max-width: 700px) {
  .lh-hall-card {
    width: calc(50vw - 22px);
  }

  .lh-hall-name,
  .lh-hall-pill,
  .lh-hall-item {
    font-size: max(12px, 1em);
  }
}

/* ---------- HOD-3147 "Waits on you" card ---------- */

.lh-waits-kicker {
  margin: 0 0 0.2em;
  font-size: max(12px, 0.72em);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--lh-pending);
}

.lh-waits-summary {
  margin: 0.15em 0 0.5em;
  font-size: max(12px, 0.92em);
  color: var(--lh-ivory);
}

.lh-waits-summary strong {
  color: var(--lh-pending);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lh-waits-empty {
  /* Ivory-dim, not the bluish muted grey: this line is a quiet all-clear. */
  color: #c9c1ae;
}

.lh-waits-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 0;
}

.lh-waits-row {
  display: flex;
  align-items: center;
  gap: 0.55em;
  min-height: 44px;
  padding: 0.2em 0;
  border-bottom: 1px solid #56789f;
  color: var(--lh-ivory);
  text-decoration: none;
}

.lh-waits-item:last-child .lh-waits-row {
  border-bottom: 0;
}

.lh-waits-id {
  flex: none;
  color: var(--lh-pending);
  font-weight: 600;
  white-space: nowrap;
}

.lh-waits-sep {
  flex: none;
  color: var(--lh-muted);
}

.lh-waits-words {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  /* At most two lines; the text wraps, it is never ellipsis-cut mid-word. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.lh-waits-age {
  flex: none;
  margin-left: auto;
  color: var(--lh-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lh-waits-row--old .lh-waits-age {
  color: #ff9d80;
  font-weight: 600;
}

.lh-waits-row:hover .lh-waits-id,
.lh-waits-row:focus-visible .lh-waits-id {
  color: var(--lh-gold-hi);
  text-decoration: underline;
}

.lh-waits-row:focus-visible {
  outline: 3px solid var(--lh-gold);
  outline-offset: 2px;
}

.lh-waits-more {
  color: var(--lh-pending);
}

@media (min-width: 701px) {
  /* The list owns the card's remaining height, so its bottom edge is the fold line. */
  .lh-monitor-card--waits {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .lh-waits-list {
    flex: 1 1 auto;
    overflow: hidden;
  }

  .lh-waits-more {
    flex: none;
  }

  /* HOD-3147: the Stuck Pile now lives under the Watch-fires tab. */
  body.lh-body[data-focus-panel="lh-fires"] .lh-main {
    display: flex;
    flex-direction: column;
    gap: var(--lh-monitor-gap);
    height: 100%;
    overflow: auto;
  }

  body[data-focus-panel="lh-fires"] #lh-fires,
  body[data-focus-panel="lh-fires"] #lh-stuck {
    display: block;
    height: auto;
    overflow: auto;
  }

  body[data-focus-panel="lh-fires"] #lh-fires {
    order: 1;
  }

  body[data-focus-panel="lh-fires"] #lh-stuck {
    order: 2;
  }
}

/* ---------- HOD-4097 motion (Saga mock / MOTION_SPEC) ---------- */

#lh-scene {
  grid-area: scene;
  min-height: clamp(72px, 12vh, 140px);
  max-height: 140px;
}

.lh-scene-strip {
  max-height: 140px;
  height: clamp(72px, 12vh, 140px);
  min-height: 72px;
  border: 1px solid var(--lh-rule);
  border-radius: var(--lh-radius);
  background: linear-gradient(180deg, #101827 0%, #0a1018 100%);
  overflow: hidden;
}

.lh-scene-strip-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  height: 100%;
  padding: 0.35rem 0.6rem;
}

.lh-scene-longhouse,
.lh-scene-forge,
.lh-scene-hearth,
.lh-scene-ship {
  flex: 1 1 12%;
  height: 78%;
  border-radius: 6px 6px 2px 2px;
  background: #1e2a3c;
  border: 1px solid #6b5535;
  position: relative;
}

.lh-scene-torch,
.lh-scene-banner {
  width: 0.55rem;
  height: 68%;
  border-radius: 4px;
  background: #493a28;
}

.lh-scene-smoke,
.lh-scene-window {
  width: 0.8rem;
  height: 44%;
  border-radius: 3px;
  background: #27445a;
  opacity: 0.75;
}

.lh-scene-raven {
  width: 1.1rem;
  height: 0.7rem;
  border-radius: 50% 50% 40% 40%;
  background: #243044;
}

.lh-scene-hearth::after {
  content: "";
  position: absolute;
  inset: auto 30% 8% 30%;
  height: 22%;
  border-radius: 50% 50% 20% 20%;
  background: radial-gradient(circle at 50% 80%, var(--lh-ember) 0%, transparent 70%);
}

html[data-motion="full"] .lh-scene-torch {
  animation: lh-motion-torch 2.4s ease-in-out infinite;
}
html[data-motion="full"] .lh-scene-banner {
  animation: lh-motion-banner 3.2s ease-in-out infinite;
}
html[data-motion="full"] .lh-scene-smoke {
  animation: lh-motion-smoke 4s ease-in-out infinite;
}
html[data-motion="full"] .lh-scene-window {
  animation: lh-motion-window 2.8s steps(2, end) infinite;
}
html[data-motion="full"] .lh-scene-hearth::after {
  animation: lh-motion-flame 1.2s ease-in-out infinite;
}
html[data-motion="full"] .lh-scene-raven {
  animation: lh-motion-raven 14s linear infinite;
}
html[data-motion="full"] .lh-scene-ship {
  animation: lh-motion-ship-bob 3s ease-in-out infinite;
}

html[data-motion="calm"] .lh-scene-torch,
html[data-motion="calm"] .lh-scene-banner,
html[data-motion="calm"] .lh-scene-smoke,
html[data-motion="calm"] .lh-scene-hearth::after,
html[data-motion="calm"] .lh-scene-raven,
html[data-motion="calm"] .lh-scene-ship {
  animation-duration: calc(var(--lh-motion-scale, 1) * 1.5);
}

html[data-motion="lite"] .lh-scene-raven,
html[data-motion="lite"] .lh-scene-banner {
  animation: none;
}

.lh-motion-char .lh-hall-portrait {
  transform-origin: 50% 90%;
}

html[data-motion="full"] .lh-motion--breathe .lh-hall-portrait,
html[data-motion="calm"] .lh-motion--breathe .lh-hall-portrait {
  animation: lh-motion-breathe 4.5s ease-in-out infinite;
}
html[data-motion="full"] .lh-motion--building .lh-hall-portrait {
  animation: lh-motion-hammer 1.3s ease-in-out infinite;
}
html[data-motion="full"] .lh-motion--idle .lh-hall-portrait {
  animation: lh-motion-sleepy 5s ease-in-out infinite;
}
html[data-motion="full"] .lh-motion--waiting .lh-hall-portrait {
  animation: lh-motion-glance 10s ease-in-out infinite;
}
html[data-motion="full"] .lh-motion--sindri .lh-hall-portrait {
  animation: lh-motion-twinkle 2.2s ease-in-out infinite;
}
html[data-motion="full"] .lh-motion--ragnar .lh-hall-portrait {
  filter: drop-shadow(0 0 6px rgba(240, 122, 58, 0.45));
  animation: lh-motion-breathe 4s ease-in-out infinite;
}

.lh-motion-celebrate-hop {
  animation: lh-motion-hop 0.45s ease-out 1;
}
.lh-motion-celebrate-ring {
  animation: lh-motion-ring 1.1s ease-out 1;
}
.lh-motion-celebrate-burst {
  animation: lh-motion-burst 1.2s ease-out 1;
}

.lh-motion-toast-layer {
  position: fixed;
  inset-inline: 0;
  top: 0.5rem;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 40;
}

.lh-motion-toast {
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: #1a2739;
  border: 1px solid var(--lh-gold);
  color: var(--lh-gold-hi);
  font-size: 0.85em;
  opacity: 0;
  transform: translateY(-6px);
}

.lh-motion-celebrate-toast {
  animation: lh-motion-toast-in 1.2s ease-out 1 forwards;
}

.lh-motion-well {
  position: relative;
  overflow: hidden;
}

html[data-motion="full"] .lh-motion-well--brunn.lh-motion-well--up,
html[data-motion="calm"] .lh-motion-well--brunn.lh-motion-well--up {
  animation: lh-motion-ripple 3.2s ease-in-out infinite;
}

html[data-motion="full"] .lh-motion-well--brunn.lh-motion-well--up::before,
html[data-motion="calm"] .lh-motion-well--brunn.lh-motion-well--up::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(111, 164, 255, 0.22) 50%,
    transparent 62%
  );
  animation: lh-motion-well-shimmer 4.2s ease-in-out infinite;
}

html[data-motion="full"] .lh-motion-well--brunn.lh-motion-well--up::after,
html[data-motion="calm"] .lh-motion-well--brunn.lh-motion-well--up::after {
  content: "";
  position: absolute;
  right: 0.45rem;
  bottom: 0.35rem;
  width: 0.5rem;
  height: 0.62rem;
  border: 1px solid #6b5535;
  border-radius: 2px;
  background: #1e2a3c;
  animation: lh-motion-well-bucket 2.8s ease-in-out infinite;
}

.lh-motion-well--down {
  border-inline-start: 3px solid var(--lh-status-down);
}

.lh-motion-well--down::before,
.lh-motion-well--down::after,
.lh-motion-well--unknown::before,
.lh-motion-well--unknown::after {
  animation: none !important;
  content: none;
}

.lh-motion-well--unknown {
  border-inline-start: 3px solid var(--lh-status-unknown);
}

.lh-deploy-voyage {
  position: relative;
  height: 0.65rem;
  margin-top: 0.4rem;
  border-radius: 4px;
  background: #14202f;
  overflow: hidden;
}

.lh-deploy-voyage-ship,
.lh-deploy-voyage-station,
.lh-deploy-voyage-wake,
.lh-deploy-voyage-bar {
  position: absolute;
  display: block;
}

.lh-deploy-voyage-ship {
  inset-block: 0.12rem auto;
  inset-inline-start: 0.15rem;
  width: 0.75rem;
  height: 0.38rem;
  border-radius: 2px 6px 2px 2px;
  background: #4a6178;
}

.lh-deploy-voyage-bar {
  inset-block: 0.2rem;
  inset-inline: 1.1rem 1.35rem;
  height: 0.25rem;
  border-radius: 3px;
  background: #0f1824;
}

.lh-deploy-voyage-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2c4a62, var(--lh-gold));
}

.lh-deploy-voyage-station {
  inset-block: 0.08rem auto;
  inset-inline-end: 0.2rem;
  width: 0.45rem;
  height: 0.48rem;
  border: 1px solid var(--lh-gold);
  border-radius: 2px;
  background: #1c3040;
}

.lh-deploy-voyage-wake {
  inset-block: 0.35rem auto;
  inset-inline-start: 0.9rem;
  width: 1.2rem;
  height: 0.12rem;
  border-radius: 999px;
  background: rgba(111, 164, 255, 0.35);
  opacity: 0;
}

.lh-monitor-card--deploy.lh-motion-deploy-voyage .lh-deploy-voyage-ship {
  animation: lh-deploy-ship 2.6s ease-in-out 1;
}
.lh-monitor-card--deploy.lh-motion-deploy-voyage .lh-deploy-voyage-fill {
  animation: lh-deploy-fill 2.6s ease-in-out 1 forwards;
}
.lh-monitor-card--deploy.lh-motion-deploy-voyage .lh-deploy-voyage-station {
  animation: lh-deploy-station 2.6s ease-in-out 1;
}
.lh-monitor-card--deploy.lh-motion-deploy-voyage .lh-deploy-voyage-wake {
  animation: lh-deploy-wake 2.6s ease-in-out 1;
}

.lh-portrait-rig .lh-portrait-layer {
  transform-origin: 50% 90%;
}

html[data-motion="full"] .lh-portrait-rig .lh-portrait-layer--1,
html[data-motion="calm"] .lh-portrait-rig .lh-portrait-layer--1 {
  animation: lh-rig-drift-1 4.1s ease-in-out infinite;
}
html[data-motion="full"] .lh-portrait-rig .lh-portrait-layer--2,
html[data-motion="calm"] .lh-portrait-rig .lh-portrait-layer--2 {
  animation: lh-rig-drift-2 5.3s ease-in-out infinite;
}
html[data-motion="full"] .lh-portrait-rig .lh-portrait-layer--3,
html[data-motion="calm"] .lh-portrait-rig .lh-portrait-layer--3 {
  animation: lh-rig-drift-3 6.7s ease-in-out infinite;
}
html[data-motion="full"] .lh-portrait-rig .lh-portrait-layer--4,
html[data-motion="calm"] .lh-portrait-rig .lh-portrait-layer--4 {
  animation: lh-rig-drift-4 8.2s ease-in-out infinite;
}
html[data-motion="full"] .lh-portrait-rig .lh-portrait-layer--5,
html[data-motion="calm"] .lh-portrait-rig .lh-portrait-layer--5 {
  animation: lh-rig-drift-5 9.9s ease-in-out infinite;
}

html[data-motion="full"] .lh-motion-queue-fleet {
  animation: lh-motion-fleet-bob 2.6s ease-in-out infinite;
}
.lh-motion-queue-advance {
  animation: lh-motion-queue-step 1.2s ease-out 1;
}
.lh-motion-red-pulse {
  animation: lh-motion-red-pulse 0.9s ease-out 1;
}
.lh-motion-deploy-voyage {
  animation: lh-motion-deploy-slide 2.6s ease-in-out 1;
}

html.lh-motion-paused *,
html.lh-motion-paused *::before,
html.lh-motion-paused *::after {
  animation-play-state: paused !important;
}

html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after,
html.lh-motion-off *,
html.lh-motion-off *::before,
html.lh-motion-off *::after {
  animation: none !important;
  transition: none !important;
}

@keyframes lh-motion-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
@keyframes lh-motion-hammer {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(-4deg) scale(1.01); }
  60% { transform: rotate(3deg); }
}
@keyframes lh-motion-sleepy {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(2px); opacity: 0.92; }
}
@keyframes lh-motion-glance {
  0%, 40%, 60%, 100% { transform: translateX(0); }
  45% { transform: translateX(-3px); }
  55% { transform: translateX(3px); }
}
@keyframes lh-motion-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}
@keyframes lh-motion-hop {
  0% { transform: translateY(0); }
  35% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}
@keyframes lh-motion-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.12); opacity: 0; }
}
@keyframes lh-motion-burst {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}
@keyframes lh-motion-toast-in {
  0% { opacity: 0; transform: translateY(-6px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes lh-motion-torch {
  0%, 100% { transform: scaleY(1); opacity: 0.9; }
  50% { transform: scaleY(1.08); opacity: 1; }
}
@keyframes lh-motion-banner {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
@keyframes lh-motion-smoke {
  0% { transform: translateY(0); opacity: 0.5; }
  100% { transform: translateY(-6px); opacity: 0.2; }
}
@keyframes lh-motion-window {
  0%, 49% { opacity: 0.55; }
  50%, 100% { opacity: 0.95; }
}
@keyframes lh-motion-flame {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}
@keyframes lh-motion-raven {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}
@keyframes lh-motion-ship-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes lh-motion-ripple {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(111, 164, 255, 0); }
  50% { box-shadow: inset 0 -6px 12px -4px rgba(111, 164, 255, 0.35); }
}
@keyframes lh-motion-fleet-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes lh-motion-queue-step {
  0% { transform: translateX(0); }
  40% { transform: translateX(-6px); }
  100% { transform: translateX(0); }
}
@keyframes lh-motion-red-pulse {
  0% { box-shadow: inset 0 0 0 0 rgba(255, 107, 107, 0); }
  40% { box-shadow: inset 0 0 0 3px rgba(255, 107, 107, 0.65); }
  100% { box-shadow: inset 0 0 0 0 rgba(255, 107, 107, 0); }
}
@keyframes lh-motion-deploy-slide {
  0% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(8px); opacity: 0.95; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes lh-motion-well-shimmer {
  0%, 100% { transform: translateX(-30%); opacity: 0.35; }
  50% { transform: translateX(30%); opacity: 0.85; }
}
@keyframes lh-motion-well-bucket {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-4px); }
  55% { transform: translateY(-2px); }
}
@keyframes lh-deploy-ship {
  0% { transform: translateX(0); }
  55% { transform: translateX(calc(100% + 3.5rem)); }
  100% { transform: translateX(calc(100% + 3.5rem)); }
}
@keyframes lh-deploy-fill {
  0% { width: 8%; }
  55% { width: 92%; }
  100% { width: 92%; }
}
@keyframes lh-deploy-station {
  0%, 48% { transform: scale(1); opacity: 0.5; }
  58% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes lh-deploy-wake {
  0%, 40% { opacity: 0; transform: scaleX(0.2); }
  55% { opacity: 0.85; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(0.6); }
}
@keyframes lh-rig-drift-1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}
@keyframes lh-rig-drift-2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.75px); }
}
@keyframes lh-rig-drift-3 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.25px); }
}
@keyframes lh-rig-drift-4 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.5px); }
}
@keyframes lh-rig-drift-5 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}


/* ── Scene strip: the factory as a harbour (Warchief 2026-11-29 19:59 ET, "Make it usefull and beatiful and
   intuitive"). Six live stations, left to right, joined by arrows that flow while work is moving. ── */
.lh-scene-strip {
  height: auto;
  min-height: 72px;
  background:
    radial-gradient(120% 140% at 50% 120%, rgba(240, 122, 58, 0.10), transparent 60%),
    linear-gradient(180deg, #0f1a2c 0%, #08101c 100%);
}
.lh-scene-strip-inner {
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  padding: 0.4rem 0.5rem;
}
.lh-sc-station {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 600ms ease, border-color 600ms ease;
}
.lh-sc-art { flex: 0 0 auto; width: clamp(52px, 4.6vw, 88px); }
.lh-sc-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.lh-sc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.lh-sc-value {
  font-size: clamp(20px, 1.7vw, 34px);
  font-weight: 700;
  color: var(--lh-gold-hi);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.lh-sc-title {
  font-size: 0.78em;
  font-weight: 600;
  color: var(--lh-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.lh-sc-sub {
  font-size: 0.72em;
  color: var(--lh-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lh-sc-flow {
  flex: 0 0 clamp(14px, 1.6vw, 30px);
  align-self: center;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--lh-gold) 0 6px, transparent 6px 11px);
  opacity: 0.45;
  position: relative;
}
.lh-sc-flow::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--lh-gold);
  border-right-width: 0;
}

/* art palette */
.lh-sc-art svg path, .lh-sc-art svg rect, .lh-sc-art svg circle { fill: #2a3a55; stroke: none; }
.lh-sc-art .lh-sc-water { fill: #12304a; }
.lh-sc-art .lh-sc-ship path:first-child { fill: #8a5a2b; }
.lh-sc-art .lh-sc-mast, .lh-sc-art .lh-sc-line { fill: none; stroke: #c9b48a; stroke-width: 1.4; stroke-linecap: round; }
.lh-sc-art .lh-sc-sail { fill: #e9dcc0; }
.lh-sc-art .lh-sc-sail--furled { fill: #b9a98a; }
.lh-sc-art .lh-sc-stone { fill: #3b4b63; }
.lh-sc-art .lh-sc-roof { fill: #6b3a2a; }
.lh-sc-art .lh-sc-mouth { fill: #120c0a; }
.lh-sc-art .lh-sc-flame { fill: #f07a3a; opacity: 0; }
.lh-sc-art .lh-sc-flame-core { fill: #ffd27a; opacity: 0; }
.lh-sc-art .lh-sc-sparks circle { fill: #ffcf6b; opacity: 0; }
.lh-sc-art .lh-sc-anvil { fill: #4f5d72; }
.lh-sc-art .lh-sc-lens { fill: rgba(143, 211, 255, 0.25); stroke: var(--lh-frost); stroke-width: 1.4; }
.lh-sc-art .lh-sc-hill { fill: #22324a; }
.lh-sc-art .lh-sc-glow { fill: rgba(245, 196, 81, 0.0); }
.lh-sc-art .lh-sc-window { fill: #f5c451; opacity: 0.35; }
.lh-sc-art .lh-sc-raven path { fill: #0b0f16; }

/* tones: what each number means at a glance */
.lh-sc-station[data-tone="idle"] .lh-sc-value { color: var(--lh-muted); }
.lh-sc-station[data-tone="unknown"] .lh-sc-value { color: var(--lh-status-unknown); }
.lh-sc-station[data-tone="good"] .lh-sc-value { color: #8fe3a8; }
.lh-sc-station[data-tone="warn"] { background: rgba(245, 196, 81, 0.08); border-color: rgba(245, 196, 81, 0.35); }
.lh-sc-station[data-tone="warn"] .lh-sc-value { color: var(--lh-amber); }
.lh-sc-station[data-tone="bad"] { background: rgba(255, 107, 107, 0.10); border-color: rgba(255, 107, 107, 0.5); }
.lh-sc-station[data-tone="bad"] .lh-sc-value { color: var(--lh-blood); }
.lh-sc-station--forge[data-tone="hot"] { background: rgba(240, 122, 58, 0.08); border-color: rgba(240, 122, 58, 0.3); }
.lh-sc-station--forge[data-tone="hot"] .lh-sc-value { color: var(--lh-ember); }
.lh-sc-station--forge[data-tone="hot"] .lh-sc-flame { opacity: calc(0.55 + var(--lh-sc-level, 0.5) * 0.45); }
.lh-sc-station--forge[data-tone="hot"] .lh-sc-flame-core { opacity: 0.9; }
.lh-sc-station--forge[data-tone="hot"] .lh-sc-sparks circle { opacity: 0.9; }
.lh-sc-station--beacon[data-tone="good"] .lh-sc-flame { opacity: 1; }
.lh-sc-station--beacon[data-tone="good"] .lh-sc-glow { fill: rgba(245, 196, 81, 0.22); }
.lh-sc-station--watch[data-tone="good"] .lh-sc-window { opacity: 0.9; }
.lh-sc-station--watch[data-tone="bad"] .lh-sc-window { fill: var(--lh-blood); opacity: 1; }
.lh-sc-station--watch[data-tone="warn"] .lh-sc-window { fill: var(--lh-amber); opacity: 1; }
.lh-sc-station--harbour[data-tone="warn"] .lh-sc-sail--furled { fill: var(--lh-amber); }
.lh-sc-station--dock[data-tone="idle"] .lh-sc-ship--2 { opacity: 0; }
.lh-sc-station--inspect[data-tone="idle"] .lh-sc-lens { opacity: 0.35; }

/* motion: only while the page allows it */
html[data-motion="full"] .lh-scene-strip[data-flow="on"] .lh-sc-flow,
html[data-motion="calm"] .lh-scene-strip[data-flow="on"] .lh-sc-flow {
  opacity: 0.9;
  animation: lh-sc-flow 1.6s linear infinite;
}
html[data-motion="full"] .lh-sc-station--forge[data-tone="hot"] .lh-sc-flame,
html[data-motion="calm"] .lh-sc-station--forge[data-tone="hot"] .lh-sc-flame {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: lh-sc-flicker 1.3s ease-in-out infinite;
}
html[data-motion="full"] .lh-sc-station--forge[data-tone="hot"] .lh-sc-sparks circle {
  animation: lh-sc-spark 2.2s ease-out infinite;
}
html[data-motion="full"] .lh-sc-station--forge[data-tone="hot"] .lh-sc-sparks circle:nth-child(2) { animation-delay: 0.7s; }
html[data-motion="full"] .lh-sc-station--forge[data-tone="hot"] .lh-sc-sparks circle:nth-child(3) { animation-delay: 1.4s; }
html[data-motion="full"] .lh-sc-bob, html[data-motion="calm"] .lh-sc-bob { animation: lh-sc-bob 4.3s ease-in-out infinite; }
html[data-motion="full"] .lh-sc-bob2, html[data-motion="calm"] .lh-sc-bob2 { animation: lh-sc-bob 5.9s ease-in-out infinite; }
html[data-motion="full"] .lh-sc-station--beacon[data-tone="good"] .lh-sc-glow { animation: lh-sc-glow 3.1s ease-in-out infinite; }
html[data-motion="full"] .lh-sc-station[data-tone="bad"] { animation: lh-sc-alert 2.4s ease-in-out infinite; }
html[data-motion="full"] .lh-sc-raven { animation: lh-sc-raven 9s ease-in-out infinite; }

@keyframes lh-sc-flow { from { background-position: 0 0; } to { background-position: 22px 0; } }
@keyframes lh-sc-flicker { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(0.94, 1.08); } 60% { transform: scale(1.05, 0.95); } }
@keyframes lh-sc-spark { 0% { transform: translateY(0); opacity: 0.9; } 100% { transform: translateY(-8px); opacity: 0; } }
@keyframes lh-sc-bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-1.2px) rotate(-1.2deg); } }
@keyframes lh-sc-glow { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes lh-sc-alert { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); } 50% { box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.25); } }
@keyframes lh-sc-raven { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-6px, -2px); } }
html[data-motion="off"] .lh-scene-strip *, html[data-motion="off"] .lh-scene-strip *::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .lh-scene-strip *, .lh-scene-strip *::after { animation: none !important; }
}

/* phone: keep the numbers, drop the art and the subtitles */
@media (max-width: 700px) {
  .lh-sc-art, .lh-sc-sub { display: none; }
  .lh-sc-station { padding: 0.2rem 0.3rem; justify-content: center; }
  .lh-sc-text { align-items: center; }
  .lh-sc-title { font-size: 0.6em; letter-spacing: 0.04em; }
  .lh-scene-strip { max-height: none; height: auto; }
  .lh-scene-strip-inner { flex-wrap: wrap; row-gap: 0.3rem; }
  .lh-sc-station { flex: 1 1 30%; }
  .lh-sc-title { white-space: normal; text-align: center; }
  .lh-sc-flow { display: none; }
}
