/* OpsBoard mockup — light SaaS theme, no external assets. */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --line: #e5e8ee;
  --line-strong: #d3d9e3;
  --ink: #0d1526;
  --ink-2: #3f4b60;
  --muted: #77839a;
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-soft: #eef4ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffaeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(13, 21, 38, 0.05);
  --shadow: 0 1px 2px rgba(13, 21, 38, 0.04), 0 8px 24px -16px rgba(13, 21, 38, 0.22);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

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

.topbar {
  position: sticky;
  min-width: 0;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 4px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8 70%);
  box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.65);
}

.brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand-name em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.pill-mock {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.topbar-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 2px;
}

.topbar-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
}

#fleet-status-detail {
  display: inline-block;
  max-width: 330px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ok-soft);
  border: 1px solid #c7f0dd;
  color: #065f46;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.is-warn {
  background: var(--warn-soft);
  border-color: #fde68a;
  color: #92400e;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.status-pill.is-warn .dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.clock {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.clock-zone {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* -------------------------------------------------------------------- main */

main {
  padding: 16px 20px 28px;
  max-width: 1680px;
  margin: 0 auto;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 11px 14px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

button.kpi {
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

button.kpi:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.kpi-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.kpi-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kpi-sub .warn-text {
  color: var(--warn);
  font-weight: 600;
}

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

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.shell.has-pane {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.col-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.chart-card,
.incidents-card,
.servers-block {
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.chart-card {
  padding: 13px 16px 6px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-heading h2,
.section-head h2 {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.hint {
  color: var(--accent-ink);
  font-weight: 500;
  white-space: nowrap;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-line {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.legend-area {
  width: 14px;
  height: 7px;
  border-radius: 2px;
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--bad);
}

.chart {
  position: relative;
  margin-top: 2px;
  min-width: 0;
}

.chart svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.axis-text {
  font-family: var(--mono);
  font-size: 9.5px;
  fill: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.grid-line {
  stroke: var(--line);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.series-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.series-err {
  fill: none;
  stroke: rgba(220, 38, 38, 0.82);
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.window-shade {
  fill: rgba(220, 38, 38, 0.055);
  cursor: pointer;
}

.window-edge {
  stroke: rgba(220, 38, 38, 0.5);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.window-label {
  font-size: 9.5px;
  font-weight: 650;
  fill: #b91c1c;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.deploy-line {
  stroke: #d97706;
  stroke-width: 1;
  stroke-dasharray: 2 3;
  pointer-events: none;
}

.deploy-label {
  font-family: var(--mono);
  font-size: 9px;
  fill: #b45309;
  pointer-events: none;
}

.marker-hit {
  fill: transparent;
  cursor: pointer;
}

.marker-dot {
  fill: #fff;
  stroke: var(--bad);
  stroke-width: 2;
  pointer-events: none;
}

.marker-label {
  font-size: 9.5px;
  font-weight: 650;
  fill: #b91c1c;
  pointer-events: none;
}

.chart-hit {
  fill: transparent;
  cursor: crosshair;
}

.tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  padding: 4px 7px;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -125%);
  transition: opacity 0.08s ease;
  box-shadow: 0 6px 18px -8px rgba(15, 23, 42, 0.55);
}

.tooltip.is-on {
  opacity: 1;
}

.tooltip b {
  color: #fff;
  font-weight: 600;
}

/* ----------------------------------------------------------------- servers */

.servers-block {
  display: grid;
  gap: 9px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.section-note {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 10px;
}

.server {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.server:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.server.is-warn {
  border-color: #f2d9a6;
  background: linear-gradient(180deg, #fffdf8, #ffffff 60%);
}

.server.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14), var(--shadow);
}

.server-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.server-name {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-role {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
}

.server-meta {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-spark {
  position: relative;
  height: 30px;
  margin: 1px 0 0;
}

.spark-label {
  position: absolute;
  top: -1px;
  right: 0;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: #aab3c2;
  background: rgba(255, 255, 255, 0.82);
  padding-left: 3px;
  pointer-events: none;
}

.server-spark svg {
  display: block;
  width: 100%;
  height: 30px;
}

.server-stats {
  display: flex;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.server-stats span b {
  font-weight: 650;
  color: var(--muted);
  margin-right: 2px;
}

.server-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.server-inc {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 1px 4px;
}

.server-warn-note {
  font-size: 9.5px;
  color: var(--warn);
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------- incidents */

.incidents-card {
  overflow: hidden;
}

.incidents-card .card-head {
  padding: 12px 16px 10px;
}

.incident-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.incident-row {
  display: grid;
  grid-template-columns: 78px 62px minmax(0, 1fr) 182px 50px 76px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}

.incident-list li:first-child .incident-row {
  border-top: 0;
}

.incident-row:hover {
  background: var(--surface-2);
}

.incident-row.is-warn-row {
  background: linear-gradient(90deg, rgba(255, 250, 235, 0.9), rgba(255, 255, 255, 0) 55%);
}

.incident-id {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
}

.incident-title {
  font-weight: 550;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.incident-when {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.incident-duration {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
  text-align: right;
  white-space: nowrap;
}

.sev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.sev-2 {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.sev-3 {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.sev-warn {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ok);
  white-space: nowrap;
}

.state .dot {
  width: 5px;
  height: 5px;
  box-shadow: none;
}

.state.is-warn {
  color: var(--warn);
}

.state.is-warn .dot {
  background: var(--warn);
}

/* -------------------------------------------------------------------- pane */

.pane {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 195px);
  min-height: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 50px -30px rgba(13, 21, 38, 0.4);
  overflow: hidden;
  animation: pane-in 0.18s ease-out;
}

@keyframes pane-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 45px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  flex-shrink: 0;
}

.pane-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 650;
}

.bot-mark {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 6px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #dbe7ff;
}

.pane-model {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-actions {
  display: flex;
  gap: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.pane-context {
  position: relative;
  flex-shrink: 0;
  max-height: 43vh;
  overflow-y: auto;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fcfdff;
}

.pane-context:empty {
  display: none;
}

.pane.is-chatting .pane-context {
  padding-bottom: 10px;
}

.pane.is-chatting .context-stats,
.pane.is-chatting .context-note {
  display: none;
}

.pane.is-chatting .context-title {
  font-size: 13.5px;
}

.context-kind {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.context-kind.is-incident {
  color: #b91c1c;
}

.context-kind.is-warn {
  color: var(--warn);
}

.context-title {
  margin-top: 3px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.context-when {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.context-stats {
  display: flex;
  gap: 18px;
  margin-top: 10px;
}

.context-stat b {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.context-stat span {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.context-note {
  margin-top: 10px;
  padding-left: 8px;
  border-left: 2px solid var(--line-strong);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ctx-tokens {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--muted);
}

.context-chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #eef2f7;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 550;
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.chip.is-incident::before {
  background: var(--bad);
}

.chip.is-warn::before {
  background: var(--warn);
}

.context-json {
  margin-top: 9px;
}

.context-json summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  user-select: none;
  list-style: none;
}

.context-json summary::-webkit-details-marker {
  display: none;
}

.context-json summary:hover {
  color: var(--accent-ink);
}

.context-json pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #cbd5e1;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.5;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.6);
}

/* ------------------------------------------------------------------- chat */

.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: #fcfdff;
  scroll-behavior: smooth;
}

.msg {
  max-width: 100%;
  animation: msg-in 0.14s ease-out;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg-user {
  align-self: flex-end;
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 12px 12px 4px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.22);
}

.msg-assistant {
  align-self: stretch;
}

.msg-assistant .who {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.msg-assistant .who .dot {
  width: 5px;
  height: 5px;
  box-shadow: none;
  background: var(--accent);
}

.md {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.md > *:first-child {
  margin-top: 0;
}

.md > *:last-child {
  margin-bottom: 0;
}

.md p {
  margin: 0 0 8px;
}

.md ul,
.md ol {
  margin: 0 0 8px;
  padding-left: 18px;
}

.md li {
  margin: 2px 0;
}

.md strong {
  font-weight: 650;
}

.md code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef2f7;
  border: 1px solid #e2e8f0;
  font-size: 11px;
}

.md pre {
  margin: 0 0 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #dbe4f0;
  overflow-x: auto;
  font-size: 10.5px;
  line-height: 1.5;
}

.md pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.md h4 {
  margin: 10px 0 5px;
  font-size: 12.5px;
  font-weight: 650;
}

.md a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  color: var(--muted);
  font-size: 11.5px;
}

.thinking-dots {
  display: inline-flex;
  gap: 3px;
}

.thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: blink 1.1s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes blink {
  0%,
  70%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.msg-error {
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--bad-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 11.5px;
  line-height: 1.45;
}

.msg-error b {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
}

.msg-note {
  align-self: stretch;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.usage {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: #a3adbf;
  letter-spacing: 0.01em;
}

/* -------------------------------------------------------------- suggestions */

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  flex-shrink: 0;
}

.suggestions:empty {
  display: none;
}

.suggestion {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 10.5px;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}

.suggestion:hover {
  border-color: #b9cdfb;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.suggestion:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ----------------------------------------------------------------- composer */

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 9px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.composer textarea {
  flex: 1;
  min-height: 38px;
  max-height: 112px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.4;
  resize: none;
  outline: none;
}

.composer textarea::placeholder {
  color: #9aa5b8;
}

.composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.send-btn:hover {
  background: var(--accent-ink);
}

.send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.send-btn.is-stop {
  background: #0f172a;
}

.pane-foot {
  min-height: 23px;
  padding: 0 14px 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: #9aa5b8;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------------------------- foot */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 12px 2px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}

.foot code {
  font-size: 9.5px;
}

.foot-right {
  white-space: nowrap;
}

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

@media (max-width: 1360px) {
  #fleet-status-detail {
    max-width: 230px;
  }
}

@media (max-width: 1240px) {
  .shell.has-pane {
    grid-template-columns: minmax(0, 1fr) 380px;
  }

  .incident-row {
    grid-template-columns: 74px 56px minmax(0, 1fr) 150px 44px 68px;
  }
}

@media (max-width: 1180px) {
  .shell.has-pane {
    grid-template-columns: minmax(0, 1fr);
  }

  .pane {
    position: fixed;
    top: 70px;
    right: 12px;
    bottom: 12px;
    width: min(420px, calc(100vw - 24px));
    height: auto;
    min-height: 0;
    z-index: 60;
  }
}

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

  .hide-narrow {
    display: none;
  }

  .incident-row {
    grid-template-columns: 74px 56px minmax(0, 1fr) 44px 68px;
  }

  .incident-when {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 0 14px;
    gap: 8px;
  }

  .topbar-meta {
    display: none;
  }

  .brand-name {
    font-size: 14px;
  }

  main {
    padding: 12px 14px 24px;
  }

  .server-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .server-role {
    display: none;
  }

  .legend {
    display: none;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .foot-right {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
