/* Cloud Architecture Mapper - application styles.
   The diagram is the product, so the chrome stays quiet: neutral surfaces,
   one accent, and colour reserved for meaning (provider, exposure, cost). */

:root {
  /* Tells the browser to draw its own furniture - scrollbars, form controls,
     the canvas behind the page - in the matching scheme. */
  color-scheme: light;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --line: #e3e7ec;
  --line-strong: #ccd4dd;
  --ink: #16202b;
  --ink-2: #46566a;
  --muted: #6b7c8f;
  --accent: #0e7c86;
  --accent-soft: #e6f4f4;
  --accent-ink: #075e66;
  --aws: #c2710d;
  --aws-soft: #fdf3e4;
  --azure: #1d6fc0;
  --azure-soft: #e9f1fb;
  --danger: #b4342c;
  --danger-soft: #fceceb;
  --warn: #9a6410;
  --warn-soft: #fdf4e3;
  --ok: #256d4f;
  --ok-soft: #e8f4ee;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(22, 32, 43, .06), 0 8px 24px rgba(22, 32, 43, .07);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark palette. Keyed on the attribute js/theme.js sets rather than on
   prefers-color-scheme directly, so that a person can choose Light or Dark
   explicitly instead of being bound to their operating system. Defining these
   twice - once per media query, once per attribute - is how a token added to
   one and forgotten in the other silently breaks one of the two schemes, so
   there is exactly one copy and the resolution happens in JS. */
:root[data-theme="dark"] {
  color-scheme: dark;
    --bg: #0f1419;
    --surface: #161c23;
    --surface-2: #1b222b;
    --line: #27313c;
    --line-strong: #38444f;
    --ink: #e6edf3;
    --ink-2: #b3c0cd;
    --muted: #8497a8;
    --accent: #37b3ab;
    --accent-soft: #14312f;
    --accent-ink: #6fd6cd;
    --aws: #e59b45;
    --aws-soft: #33260f;
    --azure: #5aa9f0;
    --azure-soft: #12263b;
    --danger: #f08b83;
    --danger-soft: #3a1d1b;
    --warn: #e0ac5c;
    --warn-soft: #35280f;
    --ok: #6cc79a;
    --ok-soft: #122c21;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 12px; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }

.app { display: flex; flex-direction: column; height: 100vh; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  height: 52px; flex: none; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 24px; height: 24px; color: var(--accent); }
.brand-name { font-weight: 650; letter-spacing: -.015em; }
.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav a {
  padding: 6px 11px; border-radius: 6px; text-decoration: none;
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.topnav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.topbar-end { display: flex; align-items: center; gap: 12px; }
.badge {
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; border: 1px solid transparent;
}
.badge-readonly { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 700;
}
.user-meta { display: grid; line-height: 1.25; }
.user-meta strong { font-size: 12px; }
.user-meta small { font-size: 11px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
  border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); padding: 7px 13px;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  font: inherit; cursor: pointer; border: 1px solid transparent; background: transparent;
  color: var(--ink-2); border-radius: 5px; padding: 3px 7px; line-height: 1.4;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
.link {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  font-size: 12px; color: var(--accent); font-weight: 550;
}
.link:hover { text-decoration: underline; }
.link.block { display: block; width: 100%; margin-top: 12px; text-align: center; }

/* ---------- page views ---------- */
.view { display: none; min-height: 0; }
.view.on { display: block; }
.workspace.on { display: grid; }
.page { overflow: auto; padding: 26px 28px 48px; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }

.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.block-head { margin-bottom: 14px; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: grid; gap: 4px;
}
.stat .stat-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.stat .stat-value { font-size: 24px; font-weight: 640; letter-spacing: -.02em; }
.stat .stat-note { font-size: 11px; color: var(--muted); }

.env-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.env-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 15px;
  background: var(--surface-2); display: grid; gap: 10px;
}
.env-card-top { display: flex; justify-content: space-between; align-items: center; }
.env-card h3 { font-size: 15px; }
.env-metrics { display: flex; gap: 18px; border-top: 1px solid var(--line); padding-top: 10px; }
.env-metrics div { display: grid; }
.env-metrics strong { font-size: 15px; font-weight: 620; }
.env-metrics small { font-size: 11px; color: var(--muted); }
.env-actions { display: flex; gap: 8px; }
.env-empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 22px; display: grid; gap: 8px; place-items: start; background: transparent;
}

.pill {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; border: 1px solid;
}
.pill-aws { background: var(--aws-soft); color: var(--aws); border-color: var(--aws); }
.pill-azure { background: var(--azure-soft); color: var(--azure); border-color: var(--azure); }
.pill-healthy { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.pill-warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.pill-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.pill-scanning, .pill-connected { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }

.cost-breakdown { display: grid; gap: 9px; }
.cost-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.cost-row .cost-label { font-size: 12px; }
.cost-row .cost-value { font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.cost-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.cost-bar i { display: block; height: 100%; background: var(--accent); }

.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.activity li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity strong { font-size: 12px; font-weight: 600; }
.activity small { font-size: 11px; color: var(--muted); grid-column: 1; }
.activity time { font-size: 11px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 10px 8px; font-weight: 600; }
.table td { padding: 10px; border-top: 1px solid var(--line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.note { font-size: 12px; color: var(--muted); }

/* ---------- architecture workspace ---------- */
.workspace { grid-template-columns: 262px minmax(0, 1fr) 0; min-height: 0; flex: 1; }
.workspace.detail-open { grid-template-columns: 262px minmax(0, 1fr) 330px; }

.sidebar {
  border-right: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; min-height: 0;
}
.sidebar-scroll { overflow-y: auto; padding: 16px 14px; flex: 1; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.field { margin-bottom: 16px; }
.field > label, .field-label { display: block; font-size: 11px; font-weight: 650; color: var(--ink-2); margin-bottom: 5px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 5px; }

select, input[type=text], input[type=email], input[type=password], input[type=search] {
  width: 100%; font: inherit; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink);
}
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.search-results {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2); max-height: 230px; overflow-y: auto;
}
.search-results button {
  display: grid; width: 100%; text-align: left; gap: 1px; padding: 7px 9px;
  background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit;
  color: var(--ink);
}
.search-results button:last-child { border-bottom: 0; }
.search-results button:hover { background: var(--accent-soft); }
.search-results strong { font-size: 12px; font-weight: 600; }
.search-results small { font-size: 11px; color: var(--muted); }

.filter-head { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 10px; }
.filter-group { border-top: 1px solid var(--line); padding: 10px 0; }
.filter-group > summary {
  cursor: pointer; font-size: 11px; font-weight: 650; color: var(--ink-2);
  display: flex; justify-content: space-between; align-items: center; list-style: none;
}
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary::after { content: "+"; color: var(--muted); }
.filter-group[open] > summary::after { content: "\2212"; }
.filter-options { display: grid; gap: 3px; margin-top: 8px; max-height: 210px; overflow-y: auto; }
.filter-option {
  display: grid; grid-template-columns: 15px 1fr auto; gap: 7px; align-items: center;
  font-size: 12px; cursor: pointer; padding: 2px 0; color: var(--ink-2);
}
.filter-option input { margin: 0; accent-color: var(--accent); }
.filter-option .filter-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- canvas ---------- */
.canvas-area { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.canvas-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 14px 18px 10px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.canvas-title h1 { font-size: 18px; }
.canvas-actions { display: flex; gap: 8px; position: relative; }
.menu {
  position: absolute; top: 34px; right: 74px; z-index: 20; min-width: 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); padding: 4px; display: grid;
}
.menu button {
  text-align: left; background: none; border: 0; font: inherit; font-size: 12px;
  padding: 7px 9px; border-radius: 4px; cursor: pointer; color: var(--ink);
}
.menu button:hover { background: var(--accent-soft); }

.toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 8px 18px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.toolbar-end { display: flex; align-items: center; gap: 14px; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.segmented button {
  font: inherit; font-size: 12px; padding: 5px 11px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--muted); border-right: 1px solid var(--line);
}
.segmented button:last-child { border-right: 0; }
.segmented button.on { background: var(--accent); color: #fff; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--accent); margin: 0; }
.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.zoom { display: flex; align-items: center; gap: 3px; }
.zoom span { font-size: 11px; color: var(--muted); min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }

.canvas { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--bg); }
.diagram { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.diagram.panning { cursor: grabbing; }
.canvas-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 6px; text-align: center; color: var(--muted); pointer-events: none;
}
.canvas-empty strong { color: var(--ink); font-size: 15px; }

.legend {
  position: absolute; left: 14px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 11px; font-size: 11px; color: var(--muted); box-shadow: var(--shadow);
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 0; border-top: 2px solid var(--line-strong); display: block; }
.legend i.inferred { border-top-style: dashed; }
.legend i.possible { border-top-style: dotted; }
.legend .swatch { width: 9px; height: 9px; border-radius: 2px; border: 1px solid; }

.canvas-foot {
  flex: none; display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  padding: 7px 18px; border-top: 1px solid var(--line); background: var(--surface);
  font-size: 12px; color: var(--muted);
}
.canvas-foot strong { color: var(--ink); font-weight: 600; }
.foot-notice { display: flex; align-items: center; gap: 2px; color: var(--warn); }
.foot-notice .link { color: var(--accent); }

/* ---------- diagram internals ---------- */
.grp-label { font: 600 10px var(--sans); fill: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.grp-sub { font: 400 10px var(--sans); fill: var(--muted); text-transform: none; letter-spacing: 0; }
.grp-toggle { cursor: pointer; }
.grp-toggle rect { fill: var(--surface); stroke: var(--line-strong); }
.grp-toggle text { font: 600 10px var(--mono); fill: var(--ink-2); }

.node { cursor: grab; }
.node.dragging { cursor: grabbing; }
.node.dragging .node-box { stroke: var(--accent); stroke-width: 2; }
.node .node-box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1; }
.node:hover .node-box { stroke: var(--accent); }
.node.selected .node-box { stroke: var(--accent); stroke-width: 2; }
.node.dimmed { opacity: .22; }
.node .node-name { font: 600 11px var(--sans); fill: var(--ink); }
.node .node-type { font: 400 10px var(--sans); fill: var(--muted); }
.node .node-meta { font: 400 9px var(--mono); fill: var(--muted); }
.node .node-cost { font: 650 10px var(--sans); fill: var(--accent-ink); }
.node .accent { stroke-width: 0; }
.node .exposure-dot { stroke: none; }

.edge { fill: none; stroke: var(--line-strong); stroke-width: 1.4; }
.edge.explicit { stroke: #7d93a8; }
.edge.inferred { stroke: #7d93a8; stroke-dasharray: 5 4; }
.edge.possible { stroke: #9aa8b6; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.edge.dimmed { opacity: .1; }
.edge.hot { stroke: var(--accent); stroke-width: 2.2; opacity: 1; }
.edge-arrow { fill: #7d93a8; }
.edge-arrow.hot { fill: var(--accent); }

/* ---------- details panel ---------- */
.details { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.workspace:not(.detail-open) .details { display: none; }
.details-empty { padding: 26px 18px; display: grid; gap: 6px; color: var(--muted); }
.details-empty strong { color: var(--ink); }
.details-head { padding: 15px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.details-head-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.details-head h2 { font-size: 15px; word-break: break-word; }
.details-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag {
  font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2); font-family: var(--mono);
}
.section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.section h3 {
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 9px; display: flex; justify-content: space-between;
}
.kv { display: grid; gap: 7px; }
.kv > div { display: grid; grid-template-columns: 108px 1fr; gap: 10px; align-items: baseline; }
.kv dt { font-size: 11px; color: var(--muted); }
.kv dd { margin: 0; font-size: 12px; word-break: break-word; font-family: var(--mono); }
.cost-basis { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.cost-headline { font-size: 20px; font-weight: 640; letter-spacing: -.02em; }
.cost-headline.unpriced { font-size: 13px; font-weight: 550; color: var(--muted); }

.rel-list { display: grid; gap: 4px; }
.rel {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 9px; cursor: pointer; font: inherit; color: var(--ink);
}
.rel:hover { border-color: var(--accent); }
.rel strong { font-size: 12px; font-weight: 600; }
.rel small { font-size: 11px; color: var(--muted); grid-column: 1 / -1; }
.rel .conf {
  font-size: 9px; font-weight: 700; letter-spacing: .05em; padding: 1px 5px;
  border-radius: 3px; align-self: start; border: 1px solid;
}
.conf-EXPLICIT { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.conf-INFERRED { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.conf-POSSIBLE { background: var(--surface-2); color: var(--muted); border-color: var(--line-strong); }

.hops { display: inline-flex; gap: 0; }
.hops button {
  font: inherit; font-size: 10px; padding: 2px 7px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted);
  border-right-width: 0;
}
.hops button:first-child { border-radius: 4px 0 0 4px; }
.hops button:last-child { border-radius: 0 4px 4px 0; border-right-width: 1px; }
.hops button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(16, 24, 33, .55); padding: 20px; backdrop-filter: blur(2px);
}
.auth-panel, .dialog {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); width: min(560px, 100%); max-height: 92vh; overflow: auto;
}
.auth-panel { width: min(380px, 100%); padding: 26px; }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; font-weight: 650; }
.auth-panel h2 { font-size: 19px; margin-bottom: 4px; }
.auth-panel form > label, .field-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 14px;
}
.auth-panel form > label input, .field-label input { margin-top: 5px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 10px; min-height: 16px; }
.auth-panel .btn-block { margin-top: 16px; }
.auth-demo { margin-top: 16px; }
.auth-demo .btn-block { margin-top: 8px; }
.auth-demo .hint { margin-top: 7px; text-align: center; }
.auth-or {
  display: block; text-align: center; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; position: relative;
}
.auth-or::before, .auth-or::after {
  content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line);
}
.auth-or::before { left: 0; }
.auth-or::after { right: 0; }

.dialog-narrow { width: min(440px, 100%); }
.dialog-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 17px; margin-top: 3px; }
.dialog-body { padding: 18px 20px; }
.dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.steps { display: grid; gap: 14px; margin: 18px 0; }
.step { display: grid; grid-template-columns: 24px 1fr; gap: 11px; }
.step b {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 11px;
}
.step strong { font-size: 13px; }
.step p { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.step input { margin-top: 8px; }
.callout { border-radius: 6px; padding: 11px 13px; display: grid; gap: 4px; font-size: 12px; line-height: 1.5; }
.callout strong { font-size: 12px; }
.callout-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }

.phases { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.phase { display: grid; grid-template-columns: 16px 1fr auto; gap: 9px; align-items: center; font-size: 12px; }
.phase .mark { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.phase.running .mark { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.phase.complete .mark { background: var(--ok); border-color: var(--ok); }
.phase.degraded .mark { background: var(--warn); border-color: var(--warn); }
.phase .detail { grid-column: 2 / -1; font-size: 11px; color: var(--muted); }
.phase.degraded .detail { color: var(--warn); }
.phase .tally { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: var(--bg); font-size: 13px; padding: 9px 16px;
  border-radius: 6px; box-shadow: var(--shadow); max-width: 80vw;
}

/* ---------- print / PDF export ---------- */
#print-surface { display: none; }

@media print {
  /* Only the diagram is printed. The app chrome would be noise on paper and
     the overlays would obscure it entirely. */
  body.printing .app,
  body.printing .overlay,
  body.printing .toast { display: none !important; }

  body.printing #print-surface { display: block; }
  body.printing #print-surface svg { width: 100%; height: auto; }

  body { background: #fff; }

  @page { margin: 12mm; size: landscape; }
}

@media (max-width: 1100px) {
  .split, .stat-row { grid-template-columns: 1fr 1fr; }
  .workspace, .workspace.detail-open { grid-template-columns: 220px minmax(0, 1fr); }
  .workspace.detail-open .details {
    position: fixed; right: 0; top: 52px; bottom: 0; width: min(330px, 90vw); z-index: 30;
    box-shadow: var(--shadow);
  }
}
@media (max-width: 720px) {
  .stat-row, .split { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .workspace, .workspace.detail-open { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Shown on the public site to someone who already has a session, which now
   happens whenever they press Back out of the workspace. */
.landing-return {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
