/* Status app-lag — bare Botnest semantiske tokens. Chrome er livlig (railen),
   innholdet rolig. */

html, body { height: 100%; }
.st-body { margin: 0; display: flex; min-height: 100dvh; background: var(--bn-bg); color: var(--bn-text); }

/* Rail + hovedflate */
.st-rail { flex: none; height: 100dvh; position: sticky; top: 0; }
.st-brand {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 14px;
  font: var(--bn-weight-heavy) 18px/1 var(--bn-font-ui); text-decoration: none;
  color: var(--bn-chrome-text);
}
.st-brand:hover { text-decoration: none; }
.st-rail-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.st-theme-group { width: 100%; }
.st-theme-group .bn-btn { flex: 1; }
.st-version { font-size: var(--bn-text-tiny); color: var(--bn-chrome-text-dim); padding: 4px 12px 0; }

.st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-topbar { position: sticky; top: 0; z-index: 30; }
.st-title { margin: 0; font: var(--bn-weight-bold) var(--bn-text-h3)/1.2 var(--bn-font-ui);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-topbar-right { margin-left: auto; color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-menu-btn { display: none; }
.st-content { flex: 1; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 1400px; width: 100%; box-sizing: border-box; }

.st-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; flex: none; }
.st-ic--lg { width: 40px; height: 40px; }

/* Rutenett */
.st-grid { display: grid; gap: 16px; }
.st-grid--kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.st-grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.st-hint { color: var(--bn-text-3); font-size: var(--bn-text-small); margin-top: 6px; }

/* Sjekklister med tilstand: grønn = ok, gul = mangler, rød = feil. Bare der det er sant. */
.st-checklist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-checklist li { display: flex; align-items: center; gap: 10px; }
.st-checklist li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--bn-track); }
.st-checklist li.is-ok::before { background: var(--bn-success-fill); box-shadow: 0 0 6px rgba(76,203,151,0.45); }
.st-checklist li.is-warn::before { background: var(--bn-warning-fill, #E0AC47); }
.st-checklist li.is-bad::before { background: var(--bn-danger-fill); }
.st-phases { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Innlogging: .bn-auth er hele siden (to kolonner), brand-kolonnen har himmelscenen. */
.st-body--auth { margin: 0; background: var(--bn-bg); color: var(--bn-text); }
.st-brand--auth { padding: 0; font-size: 20px; }
.st-auth-title { margin: 0 0 4px; font: var(--bn-weight-bold) var(--bn-text-h3)/1.2 var(--bn-font-ui); }
.st-auth-hint { color: var(--bn-text-3); font-size: var(--bn-text-small); margin: 0; }
.st-auth-alt { margin-top: 16px; }
.st-totp-setup { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.st-qr svg { width: 196px; height: 196px; background: #fff; border-radius: var(--bn-radius-sm); padding: 6px; box-sizing: content-box; }
.st-secret { font-size: 13px; letter-spacing: 0.06em; word-break: break-all; text-align: center; padding: 8px 10px; background: var(--bn-surface-2); border-radius: var(--bn-radius-xs); }
.bn-auth-body { flex-direction: column; gap: 0; }

/* Under 840px: railen blir en skuff */
@media (max-width: 840px) {
  .st-rail { position: fixed; height: 100%; }
  .st-rail:not(.is-open) { transform: translateX(-102%); }
  .st-rail.bn-drawer { position: fixed; }
  .st-menu-btn { display: inline-flex; }
  .st-content { padding: 14px; }
}

/* ---- Fase 1: tabeller, kort, logger, grafer ---- */
.st-h2 { margin: 0; font: var(--bn-weight-bold) var(--bn-text-h4)/1.3 var(--bn-font-ui); }
.st-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.st-card--danger { border-color: var(--bn-danger-border); }
.st-kpi { text-decoration: none; color: inherit; display: block; }
.st-kpi:hover { text-decoration: none; }
.st-kpi-of { font: var(--bn-weight-medium) 15px/1 var(--bn-font-ui); color: var(--bn-text-3); margin-left: 3px; }
.st-kpi-sm { font-size: 20px; }
.st-text-danger { color: var(--bn-danger-text); }
.st-mt { margin-top: 12px; }
.st-grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.st-grid--services { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.st-svc { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.st-svc:hover { text-decoration: none; }
.st-svc--infra { opacity: 0.8; }
.st-svc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-svc-name { font-weight: var(--bn-weight-bold); }
.st-svc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--bn-text-small); }
.st-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.st-alerts li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.st-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 6px 0 0; }
.st-kv dt { color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-kv dd { margin: 0; overflow-wrap: anywhere; }
.st-row--dim td { color: var(--bn-text-2); }
.st-trunc { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-details { margin-top: 10px; }
.st-details summary { cursor: pointer; color: var(--bn-link); font-size: var(--bn-text-small); }
.st-pre { font: 12px/1.45 var(--bn-font-mono, ui-monospace, Menlo, Consolas, monospace); background: var(--bn-surface-2);
  border-radius: var(--bn-radius-xs); padding: 10px 12px; overflow: auto; max-height: 360px; margin: 8px 0 0; white-space: pre-wrap; }
.st-spark { display: block; width: 100%; height: auto; max-width: 420px; }
.st-spark .bn-ch-line { stroke-width: 2; }
.bn-chart svg { width: 100%; }

/* Logger */
.st-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.st-filters .bn-field { min-width: 150px; }
.st-filter-q { flex: 1 1 320px; }
.bn-select { appearance: auto; }
.st-log { font: 12.5px/1.5 var(--bn-font-mono, ui-monospace, Menlo, Consolas, monospace); display: flex; flex-direction: column; gap: 1px; }
.st-log-line { display: grid; grid-template-columns: 82px 96px 1fr; gap: 10px; padding: 2px 6px; border-radius: 3px; border-left: 3px solid transparent; }
.st-log .st-log-line:not(:has(.st-log-src)) { grid-template-columns: 82px 1fr; }
.st-log-ts { color: var(--bn-text-3); white-space: nowrap; }
.st-log-src { color: var(--bn-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-log-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.st-log--error { border-left-color: var(--bn-danger-fill); background: var(--bn-danger-subtle); }
.st-log--warn { border-left-color: var(--bn-warning-fill); }
.st-log--noise { color: var(--bn-text-3); }

/* ---- Fase 2: AI ---- */
.st-inline-check { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.st-narrow { max-width: 130px; }
.st-form { display: flex; flex-direction: column; gap: 12px; }
.st-token { display: block; font-size: 14px; user-select: all; margin: 6px 0; }

/* ---- Fase 4: Tilgang ---- */
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-inline-form { display: flex; gap: 6px; align-items: center; }
.bn-input--sm { height: var(--bn-control-h-sm, 28px); font-size: 12.5px; min-width: 260px; }

/* ---- App-identitet på AI-sidene ---- */
.st-app-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 18px; }
.st-app-name { font: var(--bn-weight-heavy) 34px/1.1 var(--bn-font-ui); letter-spacing: -0.01em; margin: 2px 0 8px; }
.st-app-hero-kpis { display: flex; flex-wrap: wrap; gap: 28px; }
.bn-chip--accent a, a .bn-chip--accent { text-decoration: none; }

/* ---- Language ---- */
.st-lang { margin-left: 10px; }
.st-lang .bn-select { min-width: 120px; }
.st-lang--auth { margin-top: 18px; }
.bn-input--sm { height: var(--bn-control-h-sm, 28px); font-size: 12.5px; padding: 0 8px; }
.st-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-i18n td { vertical-align: top; }
.st-i18n-src { font-size: 13px; }
.st-i18n-val { width: 100%; min-width: 260px; }
.st-i18n--missing .st-i18n-src { color: var(--bn-danger-text); }

/* ---- Phase B: proposals and approvals ----
   Built for a phone first: this is the screen Karl answers on, often one-handed,
   so the tap targets are full width and stack, and nothing needs a sideways
   scroll to decide with. */
.st-card--warning { border-color: var(--bn-warning-border); }
.st-proposal { border-top: 1px solid var(--bn-border); padding: 14px 0 4px; }
.st-proposal:first-of-type { border-top: 0; }
.st-proposal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-proposal-title { font-weight: var(--bn-weight-bold); }
.st-proposal-summary { margin: 8px 0 0; overflow-wrap: anywhere; }
.st-proposal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.st-proposal-actions form { margin: 0; }
.st-btn-wide { min-width: 120px; justify-content: center; }
.st-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

@media (max-width: 560px) {
  /* One decision per thumb: full-width buttons, no hunting for a small target. */
  .st-proposal-actions { flex-direction: column; align-items: stretch; }
  .st-proposal-actions form,
  .st-proposal-actions .bn-btn { width: 100%; }
  .st-btn-wide { width: 100%; }
  .st-trunc { max-width: 100%; white-space: normal; }
}

@media (max-width: 560px) {
  /* A proposal title is a whole sentence. In the top bar it has to lose its tail
     rather than wrap to three lines and push its own beginning off the screen. */
  .st-title { font-size: var(--bn-text-h4); }
  .st-lang { margin-left: 8px; }
  .st-lang .bn-select { min-width: 92px; }
  .st-topbar-right { font-size: 11px; }
}

/* ---- Phase D: colonies, tiles, bots ----
   The colours are the same names the Nest will use for a bot's skin, so Status
   and the planet cannot disagree about what "moss" means. */
.st-colony { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.st-colony:hover { text-decoration: none; }
.st-colony-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-colony-name { font-weight: var(--bn-weight-bold); font-size: var(--bn-text-h4); }
.st-theme--terra { border-left: 3px solid #4a7c59; }
.st-theme--luna  { border-left: 3px solid #8a8f98; }
.st-theme--mars  { border-left: 3px solid #a4553a; }

.st-bot { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.st-bot:hover { text-decoration: none; }
.st-bot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-bot-mark { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  background: var(--st-bot-colour, #8a8f98); border: 2px solid var(--bn-surface-2); }
.st-bot-mark--lg { width: 26px; height: 26px; }
.st-bot-mark--drone  { border-radius: 4px; }
.st-bot-mark--rover  { border-radius: 4px 4px 9px 9px; }
.st-bot-mark--bird   { border-radius: 50% 50% 50% 8px; }
.st-bot--dawn  { --st-bot-colour: #e8a0a8; }
.st-bot--moss  { --st-bot-colour: #6f9367; }
.st-bot--rust  { --st-bot-colour: #b4643f; }
.st-bot--slate { --st-bot-colour: #6d7885; }
.st-bot--plum  { --st-bot-colour: #8a6b9e; }
.st-bot--sand  { --st-bot-colour: #d0b183; }
.st-bot--ice   { --st-bot-colour: #7fb3c8; }

/* A path is for pasting into a terminal, so make that one click. */
.st-copy { cursor: pointer; border-bottom: 1px dashed var(--bn-border); }
.st-copy:hover { color: var(--bn-link); }
.st-copy.is-copied::after { content: " ¹3"; color: var(--bn-success-text); }

/* The way out to the planet. Set apart from the pages below it, because it
   leaves Status rather than moving around inside it. */
.st-to-nest { margin-bottom: 6px; }
.st-to-nest::after {
  content: "97";              /* a small north-east arrow: this goes elsewhere */
  margin-left: auto;
  opacity: 0.5;
  font-size: 12px;
}
