@import url("/assets/sitrep-tokens.css");
@import url("/assets/sitrep-ui.css");

/*
 * Fleet composition adapted from SITREP's MIT-licensed frontend.
 * Copyright (c) 2026 Iluvatar Labs. See SITREP-LICENSE.txt.
 */

html,
body {
  height: 100%;
  overflow: hidden;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--control) transparent;
  scrollbar-width: thin;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  margin: 0;
  color: var(--ink);
  background: var(--frame);
}

.shell-frame {
  --rail-w: 252px;
  --pane-w: 0px;
  --top-h: 48px;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--pane-w);
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  height: 100dvh;
  min-width: 0;
  overflow: hidden;
}

.shell-frame.has-panel {
  --pane-w: 360px;
}

.shell-frame:has(> .shell-rail[hidden]) {
  --rail-w: 0px;
}

#rail-toggle[aria-expanded="false"] .rail-arrow {
  transform: rotate(180deg);
  transform-box: fill-box;
  transform-origin: center;
}

.shell-rail {
  display: flex;
  flex-direction: column;
  grid-row: 1 / -1;
  grid-column: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--frame);
  border-right: 1px solid var(--rule);
}

.shell-brand {
  display: flex;
  flex: none;
  height: var(--top-h);
  border-bottom: 1px solid var(--rule);
}

.shell-brand-link {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  padding: 0 var(--s4);
  color: var(--ink);
  text-decoration: none;
}

.shell-brand-text {
  display: grid;
  min-width: 0;
}

.shell-brand-name {
  font-size: var(--t-md);
  line-height: var(--lh-sm);
}

.shell-brand-kind,
.version {
  color: var(--muted);
  font-size: var(--t-xs);
  line-height: var(--lh-xs);
}

.shell-list {
  flex: none;
  padding: var(--s2);
}

.shell-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 0 var(--s3);
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: var(--r-control);
  cursor: pointer;
}

.shell-item:hover,
.shell-item[aria-current="page"] {
  color: var(--ink);
  background: var(--frame-on);
}

.shell-item[aria-current="page"] {
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--ink);
}

.shell-item-name {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.shell-tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--edge);
}

.tree-empty {
  margin: 0;
  padding: var(--s4);
  color: var(--muted);
  font-size: var(--t-xs);
}

.tree-row {
  display: flex;
  align-items: center;
}

.tree-children {
  padding-left: var(--s3);
}

.tree-toggle,
.tree-leaf {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  width: 100%;
  min-height: 32px;
  padding: 0 var(--s3);
  color: var(--ink-2);
  font-size: var(--t-xs);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.tree-root {
  color: var(--ink);
  font-weight: 600;
  list-style: none;
}

.tree-root::-webkit-details-marker {
  display: none;
}

.tree-toggle::before {
  flex: none;
  width: 6px;
  height: 6px;
  content: "";
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}

.shell-tree[open] > .tree-root::before,
.tree-toggle[aria-expanded="true"]::before {
  transform: rotate(135deg);
}

.tree-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-project-summary {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 1px;
}

.tree-project-summary .tree-label {
  display: block;
  color: var(--ink);
}

.tree-project-counts {
  overflow: hidden;
  color: var(--muted);
  font: 400 11px / 15px var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-meta-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s1) var(--s2);
  min-width: 0;
  min-height: 24px;
  padding: 2px var(--s3);
  color: var(--muted);
  font-size: var(--t-xs);
}

.tree-meta-label {
  color: var(--muted);
}

.tree-meta-value {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-action {
  flex: none;
  margin-right: var(--s1);
}

.tree-toggle:hover,
.tree-leaf:hover,
.tree-action[aria-pressed="true"],
.shell-tree [aria-current="true"] {
  color: var(--ink);
  background: var(--frame-on);
}

.tree-action[aria-pressed="true"],
.shell-tree [aria-current="true"] {
  box-shadow: inset 2px 0 0 var(--ink);
}

.shell-foot {
  display: grid;
  place-items: center;
  flex: none;
  min-height: 40px;
  margin-top: auto;
  padding: var(--s1) var(--s3);
  border-top: 1px solid var(--edge);
}

.version {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-top {
  display: flex;
  align-items: center;
  gap: var(--s2);
  grid-row: 1;
  grid-column: 2 / 4;
  min-width: 0;
  padding: 0 var(--s3);
  background: var(--frame);
  border-bottom: 1px solid var(--rule);
}

.shell-filter {
  display: flex;
  flex: 0 1 360px;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  height: 32px;
  padding: 0 var(--s2);
  color: var(--muted);
  background: var(--sheet);
  border: 1px solid var(--control);
  border-radius: var(--r-control);
}

.shell-filter:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.shell-filter input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.shell-filter input::placeholder {
  color: var(--muted);
}

.mobile-view {
  display: none;
  flex: none;
  width: 112px;
  padding-inline: var(--s2);
}

.shell-top-gap {
  flex: 1;
}

.fleet-tools,
.auto-refresh {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--s2);
}

.auto-refresh {
  height: 32px;
  padding-inline: var(--s2) var(--s1);
  color: var(--ink-2);
  font-size: var(--t-xs);
  white-space: nowrap;
  background: var(--sheet);
  border: 1px solid var(--control);
  border-radius: var(--r-control);
}

.auto-refresh select {
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.shell-sheet {
  grid-row: 2;
  grid-column: 2;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--sheet);
}

.shell-pane {
  display: flex;
  flex-direction: column;
  grid-row: 2;
  grid-column: 3;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--sheet);
  border-left: 1px solid var(--rule);
}

.session-detail {
  min-height: 0;
  overflow-y: auto;
  padding: var(--s5);
}

.session-detail-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin-bottom: var(--s5);
}

.session-detail-head > div {
  flex: 1;
  min-width: 0;
}

.session-detail h2 {
  margin: var(--s1) 0 0;
  overflow-wrap: anywhere;
  font-size: var(--t-lg);
  line-height: var(--lh-lg);
}

.detail-state {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink-2);
}

.detail-grid {
  display: grid;
  gap: var(--s2);
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--s3);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--rule);
}

.detail-row dt {
  color: var(--muted);
}

.detail-row dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-boundary {
  margin-top: var(--s5);
  padding: var(--s3);
  color: var(--muted);
  font-size: var(--t-xs);
  line-height: 1.6;
  background: var(--band);
  border-left: 2px solid var(--edge);
}

.detail-section {
  margin-top: var(--s5);
}

.detail-section h3 {
  margin: 0 0 var(--s2);
  color: var(--ink-2);
  font-size: var(--t-sm);
  font-weight: 600;
}

.detail-agent-list,
.detail-input-list {
  display: grid;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-agent,
.detail-input {
  display: grid;
  gap: var(--s1);
  padding: var(--s3);
  background: var(--band);
  border: 1px solid var(--rule);
}

.detail-agent > div {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.detail-agent strong,
.detail-input strong {
  overflow-wrap: anywhere;
}

.detail-agent-facts,
.detail-input > span {
  color: var(--muted);
  font-size: var(--t-xs);
  overflow-wrap: anywhere;
}

.control-compose {
  display: grid;
  gap: var(--s3);
}

.control-message {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: var(--s3);
  color: var(--ink);
  font: inherit;
  background: var(--band);
  border: 1px solid var(--edge);
}

.control-message:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.control-receipt,
.detail-command-receipt {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-xs);
  line-height: 1.55;
}

.signin-view {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: var(--s6);
}

.signin-card {
  width: min(660px, 100%);
  padding: var(--s6);
  background: var(--band);
  border: 1px solid var(--edge);
}

.signin-mark {
  margin-bottom: var(--s4);
}

.eyebrow {
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.signin-card h1,
.view-header h1,
.fleet-heading-row h1 {
  margin: var(--s2) 0 0;
  letter-spacing: -0.025em;
}

.signin-card h1 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.08;
}

.signin-copy {
  max-width: 560px;
  margin: var(--s4) 0 var(--s5);
  color: var(--ink-2);
  line-height: 1.65;
}

.signin-primary {
  width: auto;
}

.signin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--s2);
}

.signin-actions .ui-button {
  min-height: 32px;
}

.signin-note,
.signin-boundary {
  color: var(--muted);
  font-size: var(--t-xs);
  line-height: 1.6;
}

.signin-note {
  margin: var(--s2) 0 var(--s5);
}

.signin-boundary {
  margin: var(--s4) 0 0;
  max-width: 560px;
}

.recovery {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.recovery summary,
.enrollment summary {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) 0;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.signin-form,
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}

.signin-form {
  padding-bottom: var(--s3);
}

input,
select,
textarea {
  min-height: 32px;
  padding: 0 var(--s2);
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--control);
  border-radius: var(--r-control);
}

textarea {
  padding-top: var(--s2);
  padding-bottom: var(--s2);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.error-banner,
.notice {
  margin: 0;
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--rule);
}

.error-banner {
  color: var(--fail);
  background: color-mix(in srgb, var(--fail) 9%, var(--sheet));
}

.notice {
  color: var(--warn-text);
  background: color-mix(in srgb, var(--stuck) 8%, var(--sheet));
}

.muted {
  color: var(--muted);
}

.view-pane {
  min-height: 100%;
}

.view-pane[data-view-pane="attention"] {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.view-pane[data-view-pane="attention"] > .view-header {
  flex: none;
}

.state-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  min-height: 40px;
  padding: var(--s1) var(--s5);
  border-bottom: 1px solid var(--rule);
}

.state-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 32px;
  padding: 0 var(--s2);
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: var(--r-control);
  cursor: pointer;
}

.state-chip:hover,
.state-chip[aria-pressed="true"] {
  color: var(--queue-ink, var(--ink));
  background: var(--band);
}

.state-chip[aria-pressed="true"] {
  box-shadow: inset 0 -2px 0 var(--ink);
}

.state-chip b {
  font-family: var(--font-mono);
}

.state-chip[data-empty="true"] {
  color: var(--muted);
  cursor: default;
}

.state-chip[data-empty="true"]:hover,
.state-chip[data-empty="true"][aria-pressed="true"] {
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.state-summary {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--t-xs);
  white-space: nowrap;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--s5);
  padding-top: var(--s2);
}

.attention-grid[hidden] {
  display: none;
}

.attention-grid.wide {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--s5);
}

.attention-column {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.attention-column h2 {
  flex: none;
  width: fit-content;
  margin: 0 0 var(--s2);
  font-size: var(--t-sm);
}

.attention-column h2 span {
  color: var(--muted);
  font-family: var(--font-mono);
}

[data-queue-cue="needs"] {
  --queue-ink: var(--held);
}

:root[data-theme="light"] [data-queue-cue="needs"] {
  --queue-ink: var(--warn-text);
}

[data-queue-cue="problems"] {
  --queue-ink: var(--fail);
}

[data-queue-cue] {
  color: var(--queue-ink);
  font-weight: 700;
  animation: queue-breathe 2.4s ease-in-out infinite;
}

.attention-column h2[data-queue-cue] span {
  color: inherit;
}

@keyframes queue-breathe {
  0%, 100% {
    color: var(--queue-ink);
    background-color: transparent;
    text-shadow: none;
  }
  50% {
    color: var(--ink);
    background-color: color-mix(in srgb, var(--queue-ink) 22%, var(--sheet));
    text-shadow: 0 0 6px var(--queue-ink);
  }
}

.attention-list {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.attention-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--s2);
  min-height: 38px;
  padding: var(--s2);
  border-bottom: 1px solid var(--rule);
  border-radius: var(--r-control);
  cursor: pointer;
}

.attention-item:hover,
.attention-item:focus-visible,
.attention-item[data-selected="true"] {
  background: var(--selection);
}

.attention-item:focus-visible,
.attention-item[data-selected="true"] {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.attention-item[data-selected="true"] {
  box-shadow: inset 3px 0 0 var(--held);
}

.attention-item[data-state="failed"][data-selected="true"],
.attention-item[data-state="offline"][data-selected="true"] {
  box-shadow: inset 3px 0 0 var(--fail);
}

.attention-item > .station-mark {
  margin: 3px;
}

.attention-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-item small,
.attention-empty {
  color: var(--muted);
  font-size: var(--t-xs);
}

.attention-item small {
  display: block;
  overflow-wrap: anywhere;
}

.attention-time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
}

.fleet-region {
  padding: var(--s5);
}

.fleet-heading-row,
.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
}

.fleet-heading-row {
  margin-bottom: var(--s4);
}

.fleet-heading-row h1,
.view-header h1 {
  font-size: var(--t-lg);
  line-height: var(--lh-lg);
}

.fleet-summary {
  color: var(--muted);
  font: 400 var(--t-xs) / var(--lh-xs) var(--font-mono);
}

.session-groups {
  display: grid;
  gap: var(--s5);
}

.session-group {
  min-width: 0;
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin: 0 0 var(--s2);
  padding-bottom: var(--s2);
  color: var(--ink-2);
  font-size: var(--t-sm);
  border-bottom: 1px solid var(--rule);
}

.group-toggle {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
}

.group-toggle[aria-expanded="false"] .inline-icon {
  transform: rotate(-90deg);
}

.group-title {
  display: flex;
  flex: 1 1 360px;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.group-title h3 {
  margin: 0;
  font-size: inherit;
}

.group-title .group-path {
  color: var(--muted);
  font-size: var(--t-xs);
}

.group-filters {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
}

.group-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 30px;
  padding: 0 var(--s2);
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  cursor: pointer;
}

.group-filter:hover,
.group-filter[aria-pressed="true"] {
  color: var(--ink);
  background: var(--band);
  border-color: var(--control);
}

.group-filter[aria-pressed="true"] {
  box-shadow: inset 0 -2px 0 var(--ink);
}

.group-filter b {
  font-family: var(--font-mono);
}

.group-filter[data-empty="true"] {
  color: var(--muted);
  border-color: var(--rule);
  cursor: default;
}

.group-filter[data-empty="true"]:hover,
.group-filter[data-empty="true"][aria-pressed="true"] {
  color: var(--muted);
  background: transparent;
  border-color: var(--rule);
  box-shadow: none;
}

.group-empty {
  margin: 0;
  padding: var(--s3);
  color: var(--muted);
  font-size: var(--t-xs);
  background: color-mix(in srgb, var(--band) 55%, transparent);
  border: 1px dashed var(--edge);
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  gap: var(--s3);
}

.session-card {
  position: relative;
  display: grid;
  gap: var(--s3);
  min-width: 0;
  padding: var(--s3);
  text-align: left;
  background: var(--band);
  border: 1px solid var(--edge);
  border-radius: var(--r-sheet);
  cursor: pointer;
}

.session-toggle {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
}

.session-toggle[aria-expanded="false"] .inline-icon {
  transform: rotate(-90deg);
}

.session-card:hover,
.session-card:focus-visible,
.session-list tr:hover {
  background: var(--selection);
}

.session-card:focus-visible,
.session-card[data-selected="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.session-card[data-edge]::before {
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 4px;
  background: var(--edge-color);
  content: "";
}

.session-card[data-edge="needs-you"] {
  --edge-color: var(--held);
}

.session-card[data-edge="problem"] {
  --edge-color: var(--fail);
}

.session-card[data-edge="offline"] {
  --edge-color: var(--idle);
}

.session-card[data-edge="archived"] {
  --edge-color: var(--done);
}

.session-card[data-edge="inactive"] {
  --edge-color: var(--idle);
}

.card-title {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.card-title strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--t-md);
  line-height: var(--lh-md);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-card .provider-chip {
  flex: none;
  margin-left: auto;
}

.card-location {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  color: var(--ink-2);
  font-size: var(--t-xs);
  overflow: hidden;
}

.card-location span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-task {
  min-height: 40px;
  margin: 0;
  color: var(--ink-2);
  line-height: 1.55;
}

.card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  color: var(--muted);
  font: 400 var(--t-xs) / var(--lh-xs) var(--font-mono);
}

.provider-chip,
.state-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 22px;
  padding: 0 var(--s2);
  font-size: var(--t-xs);
  background: var(--sheet);
  border: 1px solid var(--edge);
}

.state-pill {
  color: var(--ink-2);
}

.station-mark {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--done);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.station-mark[data-state="online"],
.station-mark[data-state="working"] {
  background: var(--line);
}

.station-mark[data-state="working"] {
  animation: station-working 2.4s ease-in-out infinite;
}

.station-mark[data-state="attention"],
.station-mark[data-state="assessing"] {
  background: var(--held);
  box-shadow: 0 0 0 2px var(--sheet), 0 0 0 3px var(--held);
}

.station-mark[data-state="assessing"] {
  animation: station-assessing 3.2s ease-in-out infinite;
}

.station-mark[data-state="repairing"] {
  background: var(--fail);
  animation: station-repairing 2s ease-in-out infinite;
}

.station-mark[data-state="blocked"] {
  background: var(--fail);
  box-shadow: 0 0 0 2px var(--sheet), 0 0 0 3px var(--fail);
}

.station-mark[data-state="offline"],
.station-mark[data-state="archived"] {
  background: var(--done);
  border-color: var(--muted);
}

.station-mark[data-state="inactive"] {
  background: var(--idle);
  border-color: var(--muted);
}

@keyframes station-working {
  50% {
    opacity: 0.55;
    box-shadow: 0 0 7px color-mix(in srgb, var(--line) 75%, transparent);
  }
}

@keyframes station-assessing {
  50% {
    opacity: 0.5;
    box-shadow: 0 0 0 2px var(--sheet), 0 0 8px 4px color-mix(in srgb, var(--held) 70%, transparent);
  }
}

@keyframes station-repairing {
  50% {
    opacity: 0.42;
    box-shadow: 0 0 9px 4px color-mix(in srgb, var(--fail) 72%, transparent);
  }
}

.step-cue[data-cue="working"] {
  animation: step-breathe 3s ease-in-out infinite;
}

.step-cue[data-cue="attention"] {
  color: var(--held);
  font-weight: 600;
}

.step-cue[data-cue="assessing"] {
  color: var(--held);
  font-weight: 600;
  animation: step-attention 4s ease-in-out infinite;
}

.step-cue[data-cue="repairing"] {
  color: var(--fail);
  font-weight: 600;
  animation: step-repair 2.4s ease-in-out infinite;
}

.step-cue[data-cue="blocked"] {
  color: var(--fail);
  font-weight: 600;
}

.delivery-current {
  margin: 0;
  font-size: var(--t-md);
  line-height: var(--lh-md);
}

.decision-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--s2);
}

.decision-actions .ui-button {
  flex: none;
  min-height: 32px;
}

.decision-boundary,
.decision-status {
  font-size: var(--t-xs);
  line-height: 1.6;
}

.decision-boundary {
  color: var(--muted);
}

.decision-scope {
  overflow-wrap: anywhere;
}

@keyframes step-breathe {
  50% {
    opacity: 0.75;
  }
}

@keyframes step-attention {
  50% {
    opacity: 0.8;
    text-shadow: 0 0 8px var(--held);
  }
}

@keyframes step-repair {
  50% {
    opacity: 0.75;
    text-shadow: 0 0 8px var(--fail);
  }
}

.status-legend {
  color: var(--muted);
  font-size: var(--t-xs);
}

.status-legend summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 28px;
  cursor: pointer;
}

.status-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  margin: var(--s1) var(--s2) var(--s1) 0;
  white-space: nowrap;
}

.session-list,
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.session-list th,
.session-list td,
.table-scroll th,
.table-scroll td {
  padding: var(--s3);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.session-list th,
.table-scroll th {
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 500;
}

.session-list td {
  font-size: var(--t-sm);
}

.session-list tr {
  cursor: pointer;
}

.list-groups {
  gap: var(--s5);
}

.list-groups .session-group {
  min-width: 0;
  overflow-x: auto;
}

.list-groups .session-list {
  min-width: 720px;
}

.list-session {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.list-session .session-toggle {
  margin-left: calc(var(--s2) * -1);
}

.list-session strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-tree {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: var(--s5);
}

.graph-project {
  min-width: 0;
  padding: var(--s4);
  background: color-mix(in srgb, var(--band) 70%, transparent);
  border: 1px solid var(--edge);
}

.graph-session-list {
  display: grid;
  gap: var(--s1);
  margin: var(--s2) 0 0;
  padding-left: var(--s4);
  border-left: 1px solid var(--edge);
}

.graph-session-cluster {
  display: grid;
  gap: var(--s1);
}

.graph-session-details {
  display: grid;
  gap: var(--s1);
  margin-left: calc(32px + var(--s1));
  padding: var(--s2);
  color: var(--muted);
  font: 400 var(--t-xs) / var(--lh-xs) var(--font-mono);
  background: color-mix(in srgb, var(--sheet) 70%, transparent);
  border-left: 1px solid var(--edge);
}

.graph-session-head {
  display: flex;
  align-items: center;
  gap: var(--s1);
  min-width: 0;
}

.graph-session {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  height: 32px;
  padding: 0 var(--s2);
  color: var(--ink-2);
  text-align: left;
  background: var(--sheet);
  border: 1px solid var(--edge);
  cursor: pointer;
}

.graph-session:hover {
  color: var(--ink);
  background: var(--band);
}

.graph-agents {
  display: grid;
  gap: var(--s1);
  margin-left: var(--s4);
  padding-left: var(--s3);
  border-left: 1px solid var(--edge);
}

.graph-agent {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  min-height: 28px;
  padding: 0 var(--s2);
  color: var(--ink-2);
  text-align: left;
  background: transparent;
  border: 1px solid var(--rule);
  cursor: pointer;
}

.graph-agent[data-delegated="true"] {
  border-left-color: var(--line);
  border-left-width: 3px;
}

.graph-agent:hover {
  color: var(--ink);
  background: var(--band);
}

.graph-agent span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-more {
  color: var(--muted);
  font: 400 var(--t-xs) / var(--lh-xs) var(--font-mono);
}

.graph-session span:nth-last-child(1) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: var(--s5);
  color: var(--muted);
  border: 1px dashed var(--edge);
}

.view-header {
  padding: var(--s5);
  border-bottom: 1px solid var(--rule);
}

.table-scroll {
  margin: var(--s4) var(--s5);
  overflow-x: auto;
  border: 1px solid var(--edge);
}

#plans-view .table-scroll,
#history-view .table-scroll {
  margin-top: var(--s5);
}

.control-boundary {
  max-width: 840px;
  margin: var(--s5);
  line-height: 1.65;
}

#live-dashboard > h2 {
  margin: var(--s5) var(--s5) 0;
  font-size: var(--t-md);
}

.enrollment {
  margin: var(--s5);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.enrollment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--s2);
  padding: var(--s2) 0;
}

.enrollment textarea {
  width: 100%;
}

.enrollment-actions {
  justify-content: space-between;
  padding: var(--s2) 0 var(--s3);
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 32px;
  color: var(--ink-2);
}

.check-option input {
  min-height: 0;
  margin: 0;
}

@media (max-width: 1180px) {
  .shell-frame.has-panel {
    --pane-w: 320px;
  }

  .ui-segment-options button {
    font-size: var(--t-xs);
  }

  .ui-segment-options button {
    padding-inline: var(--s2);
  }

  .auto-refresh > span {
    display: none;
  }
}

@media (max-width: 900px) {
  .shell-frame,
  .shell-frame.has-panel {
    --rail-w: 0px;
    --pane-w: 0px;
    grid-template-columns: minmax(0, 1fr);
  }

  .shell-rail {
    position: fixed;
    z-index: 11;
    inset: var(--top-h) auto 0 0;
    width: min(252px, 100%);
  }

  .shell-top,
  .shell-sheet {
    grid-column: 1;
  }

  .shell-pane:not([hidden]) {
    position: fixed;
    inset: var(--top-h) 0 0;
    z-index: 10;
    display: block;
  }

  .shell-filter {
    flex-basis: 240px;
  }

  .mobile-view {
    display: block;
  }
}

@media (max-width: 780px) {
  .shell-frame {
    --top-h: 84px;
  }

  .shell-top {
    flex-wrap: wrap;
    align-content: center;
    gap: var(--s1);
    padding-inline: var(--s2);
  }

  .fleet-tools {
    order: 1;
    flex-basis: 100%;
    justify-content: flex-end;
  }

  .auto-refresh > span {
    display: inline;
  }

  .shell-filter {
    flex: 1;
    min-width: 0;
  }

  .mobile-view {
    width: 94px;
  }

  .shell-top-gap,
  .ui-segment-options button span {
    display: none;
  }

  .ui-segment-options button {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .signin-view {
    padding: var(--s4);
  }

  .signin-card {
    padding: var(--s5);
  }

  .state-summary {
    width: 100%;
    margin-left: 0;
  }

  .fleet-region {
    padding-inline: var(--s3);
  }

  .fleet-heading-row,
  .view-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-queue-cue],
  .station-mark[data-state="working"],
  .station-mark[data-state="assessing"],
  .station-mark[data-state="repairing"],
  .step-cue[data-cue="working"],
  .step-cue[data-cue="assessing"],
  .step-cue[data-cue="repairing"] {
    animation: none;
  }
}
