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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-3);
  background: var(--panel);
  border-right: 1px solid var(--rule);
  overflow-y: auto;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-2);
}

.workspace {
  display: grid;
  gap: 2px;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
}

.workspace b {
  font-size: var(--text-13);
  font-weight: 560;
  color: var(--fg-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace span {
  font-family: var(--mono);
  font-size: var(--text-11);
  color: var(--fg-muted);
}

.nav-group {
  display: grid;
  gap: 1px;
}

.nav-group + .nav-group {
  margin-top: var(--space-3);
}

.nav-label {
  padding: 0 var(--space-2) var(--space-2);
  font-family: var(--mono);
  font-size: var(--text-11);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 7px var(--space-2);
  border-radius: var(--radius);
  color: var(--fg-secondary);
  font-size: var(--text-13);
  transition: background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.nav-item .icon {
  color: var(--fg-muted);
  transition: color var(--dur-fast) var(--ease);
}

.nav-item:hover {
  background: var(--control);
  color: var(--fg-strong);
}

.nav-item:hover .icon {
  color: var(--fg-secondary);
}

.nav-item.active {
  background: var(--control);
  color: var(--fg-strong);
  font-weight: 540;
}

.nav-item.active .icon {
  color: var(--fg-strong);
}

.nav-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--state-warn);
  color: var(--bg);
  font-family: var(--mono);
  font-size: var(--text-11);
  font-weight: 600;
}

.side-foot {
  margin-top: auto;
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-4);
}

.user-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border-top: 1px solid var(--rule);
  color: var(--fg-secondary);
}

.user-row:hover {
  color: var(--fg-strong);
}

.avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--control);
  border: 1px solid var(--rule);
  color: var(--fg-secondary);
  font-size: var(--text-12);
  font-weight: 560;
  flex: none;
}

.user-row div {
  min-width: 0;
  display: grid;
}

.user-row b {
  font-size: var(--text-12);
  font-weight: 500;
  color: var(--fg-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row small {
  font-size: var(--text-11);
  color: var(--fg-muted);
}

/* ------------------------------------------------------------------ topbar */

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--shell-topbar);
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-12);
  color: var(--fg-secondary);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-faint);
  flex: none;
}

.live-dot.on {
  background: var(--state-ok);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--state-ok) 20%, transparent);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6);
}

/* ---------------------------------------------------------------- pro gate */

.pro-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.pro-gate h3 {
  font-size: var(--text-14);
}

.pro-gate p {
  margin-top: var(--space-1);
  color: var(--fg-muted);
  font-size: var(--text-12);
  max-width: 70ch;
}

/* ------------------------------------------------------------------ charts */

.chart {
  position: relative;
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart .bar {
  fill: var(--series-1);
  transition: opacity var(--dur-fast) var(--ease);
}

.chart .bar-track {
  fill: color-mix(in oklab, var(--fg-strong) 5%, transparent);
}

.chart:hover .bar {
  opacity: 0.55;
}

.chart .bar:hover,
.chart .bar-hit:hover + .bar {
  opacity: 1;
}

.chart .axis {
  stroke: var(--rule-strong);
  stroke-width: 1;
}

.chart .grid {
  stroke: var(--rule);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-family: var(--mono);
  font-size: var(--text-11);
  color: var(--fg-muted);
}

.chart-tip {
  position: absolute;
  z-index: 10;
  min-width: 130px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-overlay);
  font-size: var(--text-12);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}

.chart-tip b {
  display: block;
  font-family: var(--mono);
  font-size: var(--text-13);
  color: var(--fg-strong);
}

.chart-tip span {
  color: var(--fg-muted);
  font-size: var(--text-11);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-size: var(--text-12);
  color: var(--fg-secondary);
}

.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}

/* The stacked bar keeps a surface-coloured gap between segments so adjacent
   fills never touch, which is what makes the boundary readable without relying
   on the two hues being far apart. */
.stack-bar {
  display: flex;
  height: 12px;
  border-radius: 2px;
  overflow: hidden;
  gap: 2px;
  background: var(--control);
}

.stack-bar > i {
  display: block;
  height: 100%;
}

/* ---------------------------------------------------------------- timeline */

/* One unbroken line that scales instead of wrapping, with now always marked. */
.timeline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--rule-strong);
}

.timeline > i {
  flex: 1 1 0;
  min-width: 2px;
  background: color-mix(in oklab, var(--fg-strong) 22%, transparent);
  border-radius: 1px 1px 0 0;
  transition: background var(--dur-fast) var(--ease);
}

.timeline > i.now {
  background: var(--fg-strong);
}

.timeline > i.none {
  background: var(--rule);
  min-height: 2px;
}

/* ----------------------------------------------------------------- machines */

.machine-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.machine-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.machine-top h3 {
  font-size: var(--text-14);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-top p {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: var(--text-11);
  color: var(--fg-muted);
}

.machine-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}

.machine-stats div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.machine-stats b {
  font-family: var(--mono);
  font-size: var(--text-13);
  color: var(--fg-strong);
  overflow: hidden;
  text-overflow: ellipsis;
}

.machine-stats span {
  font-size: var(--text-11);
  color: var(--fg-muted);
}

/* ---------------------------------------------------------------- findings */

.finding-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--rule);
}

.rows > .finding-card:first-child {
  border-top: 0;
}

.finding-card h3 {
  font-size: var(--text-13);
}

.finding-card > div > p {
  margin-top: var(--space-1);
  color: var(--fg-muted);
  font-size: var(--text-12);
  line-height: 1.6;
  max-width: 82ch;
}

.finding-meta {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-3);
  font-family: var(--mono);
  font-size: var(--text-11);
  color: var(--fg-muted);
}

.recommend-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
}

.recommend-card h3 {
  font-size: var(--text-14);
}

.recommend-card p {
  color: var(--fg-muted);
  font-size: var(--text-12);
  line-height: 1.6;
}

.recommend-card > .btn {
  justify-self: start;
}

/* --------------------------------------------------------------- approvals */

.approval {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid color-mix(in oklab, var(--state-warn) 32%, var(--rule));
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--state-warn) 6%, var(--panel));
}

.approval h3 {
  font-size: var(--text-14);
  margin-top: var(--space-2);
}

.approval p {
  margin-top: var(--space-1);
  color: var(--fg-secondary);
  font-size: var(--text-12);
  max-width: 70ch;
}

.approval .basis {
  margin-top: var(--space-2);
}

/* -------------------------------------------------------------- priorities */

.priority {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-faint);
  flex: none;
}

.priority.high { background: var(--state-bad); }
.priority.medium { background: var(--state-warn); }
.priority.low { background: var(--state-info); }

/* ------------------------------------------------------------------- trace */

.trace-node {
  display: grid;
  grid-template-columns: 34px 170px minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}

.trace-node:first-child {
  border-top: 0;
}

.trace-node > .n {
  font-family: var(--mono);
  font-size: var(--text-11);
  color: var(--fg-faint);
}

.trace-node b {
  display: block;
  font-size: var(--text-12);
  font-weight: 540;
  color: var(--fg-strong);
}

.trace-node small {
  display: block;
  font-family: var(--mono);
  font-size: var(--text-11);
  color: var(--fg-muted);
}

.trace-node code {
  font-family: var(--mono);
  font-size: var(--text-11);
  line-height: 1.6;
  color: var(--fg-secondary);
  overflow: hidden;
  word-break: break-all;
}

/* ------------------------------------------------------------ detail grids */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--rule);
}

.detail-grid > div {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.detail-grid dt {
  font-size: var(--text-11);
  color: var(--fg-muted);
}

.detail-grid dd {
  margin: 0;
  font-size: var(--text-13);
  color: var(--fg-strong);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------------------- onboarding */

.activate {
  max-width: 780px;
}

.activate-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.activate-step:last-child {
  border-bottom: 0;
}

.activate-step::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: -1px;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--rule-strong) 0 3px,
    transparent 3px 7px
  );
}

.activate-step:last-child::before {
  display: none;
}

.activate-mark {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--bg);
  font-family: var(--mono);
  font-size: var(--text-12);
  color: var(--fg-secondary);
}

.activate-step.done .activate-mark {
  background: var(--state-ok);
  border-color: var(--state-ok);
  color: var(--bg);
}

.activate-step.active .activate-mark {
  border-color: var(--fg-strong);
  color: var(--fg-strong);
}

.activate-step h3 {
  font-size: var(--text-15);
}

.activate-step > div > p {
  margin-top: var(--space-2);
  color: var(--fg-muted);
  max-width: 72ch;
  line-height: 1.65;
}

.activate-step .copy-line,
.activate-step .term {
  margin-top: var(--space-4);
}

.waiting {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: var(--text-11);
  color: var(--fg-muted);
}

.waiting .pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--state-warn);
  animation: pip 1.8s var(--ease) infinite;
}

@keyframes pip {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------------------------------------------------------------- terminal */

.terminal-frame {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0c0e;
}

.terminal-frame-empty {
  background: var(--panel);
  border-color: var(--rule);
  justify-content: center;
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid #1e242a;
  color: #8a95a1;
  font-family: var(--mono);
  font-size: var(--text-11);
}

.terminal-status b {
  color: #f4f6f8;
  font-weight: 500;
}

.terminal-status .spacer {
  margin-left: auto;
}

/* A definite height, not a minimum: xterm sizes itself from its row count, so
   a growable box and a resize observer feed each other forever. The session
   page hands it whatever is left of the viewport. */
#terminal-output {
  flex: 1 1 auto;
  height: var(--terminal-height, clamp(320px, 58vh, 640px));
  min-height: 240px;
  overflow: hidden;
  padding: var(--space-3);
}

.terminal-help {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid #1e242a;
  color: #68737f;
  font-family: var(--mono);
  font-size: var(--text-11);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 50;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: var(--space-2);
    border-right: 0;
    border-top: 1px solid var(--rule);
    overflow-x: auto;
  }
  .side-head,
  .workspace,
  .side-foot,
  .nav-label {
    display: none;
  }
  /* The whole nav becomes one horizontally scrollable row, so the group
     boundaries stop forcing a wrap. */
  .sidebar nav {
    display: flex;
    gap: var(--space-1);
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar {
    display: none;
  }
  .nav-group {
    display: flex;
    gap: var(--space-1);
  }
  .nav-group + .nav-group {
    margin-top: 0;
  }
  .nav-item {
    flex-direction: column;
    gap: 3px;
    padding: 6px var(--space-3);
    font-size: var(--text-11);
    white-space: nowrap;
  }
  .nav-count {
    position: absolute;
    margin: 0;
    transform: translate(14px, -6px);
  }
  .content {
    padding: var(--space-4) var(--space-4) 84px;
  }
  .topbar {
    padding: 0 var(--space-4);
  }
  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(3) {
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }
  .approval {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  .trace-node {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .trace-node code {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .stat-strip {
    grid-template-columns: minmax(0, 1fr);
  }
  .stat {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .stat:first-child {
    border-top: 0;
  }
  .machine-stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-head {
    align-items: flex-start;
  }
}

/* -------------------------------------------------------------- bar charts */

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 168px;
  border-bottom: 1px solid var(--rule-strong);
}

.bars .col {
  flex: 1 1 0;
  min-width: 3px;
  height: var(--h, 2%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  transition: opacity var(--dur-fast) var(--ease);
}

.bars .seg {
  display: block;
  width: 100%;
  flex: none;
}

.bars .seg-1 { background: var(--series-1); }
.bars .seg-2 { background: var(--series-2); }

.bars:hover .col { opacity: 0.45; }
.bars .col:hover,
.bars .col:focus-visible { opacity: 1; }

.provider-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 76px;
  align-items: center;
  gap: var(--space-4);
}

.provider-row b {
  display: block;
  font-size: var(--text-13);
  font-weight: 520;
  color: var(--fg-strong);
}

.provider-row strong {
  text-align: right;
  font-size: var(--text-12);
  font-weight: 500;
  color: var(--fg-secondary);
}

.model-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
}

.model-card b {
  font-family: var(--mono);
  font-size: var(--text-12);
  color: var(--fg-strong);
}

@media (max-width: 640px) {
  .provider-row {
    grid-template-columns: 110px minmax(0, 1fr) 64px;
    gap: var(--space-3);
  }
}

/* ============================================================ attention app */

/* The queue is the app's front page, so its rows are full articles with their
   actions attached rather than list items that need opening first. */

.queue-list {
  display: grid;
  border-top: 1px solid var(--rule-strong);
}

.queue-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur-fast) var(--ease);
}

.queue-item:hover {
  background: var(--panel);
}

.queue-item > .priority {
  align-self: start;
  margin-top: 6px;
}

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

.queue-body h3 {
  font-size: var(--text-15);
  letter-spacing: -0.012em;
}

.queue-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-1);
  font-size: var(--text-12);
  color: var(--fg-muted);
}

.queue-meta b {
  color: var(--fg-secondary);
  font-weight: 520;
}

.queue-meta > span::before {
  content: "·";
  margin-right: var(--space-2);
  color: var(--fg-faint);
}

.queue-detail {
  margin-top: var(--space-1);
  font-size: var(--text-12);
  color: var(--fg-muted);
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.attention-section {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
}

.attention-section-head,
.attention-column > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--rule);
}

.attention-section-head h2,
.attention-column h2 {
  font-size: var(--text-16);
}

.attention-section-head p,
.attention-column header p {
  margin-top: var(--space-1);
  color: var(--fg-muted);
  font-size: var(--text-12);
}

.attention-count {
  min-width: 28px;
  padding: 3px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--fg-secondary);
  font: 600 var(--text-12) var(--mono);
  text-align: center;
}

.attention-count.urgent {
  border-color: color-mix(in srgb, var(--state-warn) 45%, var(--rule));
  color: var(--state-warn);
}

.attention-section .queue-list { border-top: 0; }
.attention-section .queue-item { padding-inline: var(--space-4); }

.attention-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.attention-column {
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}

.activity-list { display: grid; }

.activity-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: inherit;
  text-align: left;
}

.activity-row:last-child { border-bottom: 0; }
.activity-row:hover { background: var(--panel); }

.activity-state {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-faint);
}
.activity-state.info { background: var(--state-info); }
.activity-state.ok { background: var(--state-ok); }
.activity-state.bad { background: var(--state-bad); }

.activity-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.activity-main b { font-size: var(--text-13); }
.activity-main span,
.activity-evidence { color: var(--fg-muted); font-size: var(--text-11); }
.activity-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-evidence { font-family: var(--mono); white-space: nowrap; }
.activity-empty { padding: var(--space-5); color: var(--fg-muted); font-size: var(--text-13); }
.attention-footer { display: flex; justify-content: flex-end; margin-top: var(--space-3); }

/* ---------------------------------------------------------------- session */

/* A terminal that needs the page scrolled to read it is not a terminal you
   would supervise from, so the session view claims the viewport and lets the
   long column beside it scroll on its own. */
.session-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--shell-topbar) - var(--space-6) * 2);
  min-height: 520px;
}

.session-page > .session-grid {
  flex: 1;
  min-height: 0;
}

.session-page .session-side {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

.session-page .terminal-frame {
  height: 100%;
}

.session-page #terminal-output {
  --terminal-height: auto;
}

.session-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.session-title {
  min-width: 0;
  margin-right: auto;
}

.session-title h1 {
  font-size: var(--text-24);
  letter-spacing: -0.024em;
}

.session-title p {
  margin-top: 2px;
  font-size: var(--text-12);
  color: var(--fg-muted);
}

.icon.flip {
  transform: rotate(180deg);
}

.session-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid color-mix(in oklab, var(--state-warn) 38%, var(--rule));
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--state-warn) 8%, transparent);
}

.session-banner > div:first-child {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.session-banner .icon {
  margin-top: 2px;
  color: var(--state-warn);
}

.session-banner b {
  color: var(--fg-strong);
}

.session-banner p {
  margin-top: 2px;
  font-size: var(--text-12);
  color: var(--fg-muted);
}

.session-banner-quiet {
  border-color: var(--rule);
  background: var(--panel);
}

.session-banner-quiet .icon {
  color: var(--fg-muted);
}

.session-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-5);
  margin-top: var(--space-5);
  align-items: start;
}

.session-side {
  display: grid;
  gap: var(--space-4);
}

.detail-stack {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.detail-stack > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
}

.detail-stack > div:last-child {
  border-bottom: 0;
}

/* ------------------------------------------------------------------ fleet */

.machine-card.offline {
  opacity: 0.72;
}

.machine-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}

tr.dim-row td {
  color: var(--fg-muted);
}

.danger-panel {
  border-color: color-mix(in oklab, var(--state-bad) 30%, var(--rule));
}

.row.read {
  opacity: 0.55;
}

.live-sep {
  width: 1px;
  height: 12px;
  background: var(--rule-strong);
}

/* ------------------------------------------------------ responsive, new */

@media (max-width: 1180px) {
  .session-page {
    height: auto;
    min-height: 0;
  }
  .session-page .session-side {
    max-height: none;
    overflow: visible;
  }
  .session-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .session-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .attention-overview {
    grid-template-columns: minmax(0, 1fr);
  }
  .activity-row {
    grid-template-columns: 8px minmax(0, 1fr) auto;
  }
  .activity-evidence {
    grid-column: 2;
    grid-row: 2;
  }
  .queue-item {
    grid-template-columns: 8px minmax(0, 1fr);
  }
  .queue-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }
  .session-side {
    grid-template-columns: minmax(0, 1fr);
  }
  .session-head {
    gap: var(--space-3);
  }
  .session-head .row-actions {
    width: 100%;
  }
}
