/* Shared styling for the three Danal Pulse guides. Served statically by the console. */
:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --soft: #f8fafc;
  --brand: #0f766e;
  --brand-soft: #ccfbf1;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --stop: #b91c1c;
  --stop-soft: #fee2e2;
  --ok: #047857;
  --ok-soft: #d1fae5;
}

/* No dark variant. The console has no dark mode (see .claude/rules/web-console.md), and guides
   that flipped with the OS setting would not match the product they document. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.75 -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  word-break: keep-all;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px 96px; }

header.hero {
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  padding: 56px 20px 40px;
  margin-bottom: 40px;
}
header.hero .wrap { padding-bottom: 0; }
.eyebrow { color: var(--brand); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.25; margin: 0 0 12px; letter-spacing: -.02em; }
.lede { color: var(--muted); font-size: 17px; margin: 0; max-width: 62ch; }

h2 {
  font-size: 24px; margin: 56px 0 16px; padding-top: 16px;
  border-top: 1px solid var(--line); letter-spacing: -.01em;
}
h3 { font-size: 18px; margin: 32px 0 10px; }
p, li { max-width: 74ch; }
a { color: var(--brand); }

code {
  font: 13px/1.6 "Cascadia Code", Consolas, monospace;
  background: var(--soft); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px;
}
pre {
  background: var(--soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; overflow-x: auto; font: 13px/1.7 "Cascadia Code", Consolas, monospace;
}
pre code { background: none; border: 0; padding: 0; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 18px 0; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

.note {
  border-left: 3px solid var(--brand); background: var(--brand-soft);
  padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 20px 0;
}
.note.warn { border-color: var(--warn); background: var(--warn-soft); }
.note.stop { border-color: var(--stop); background: var(--stop-soft); }
.note p { margin: 0; }
.note p + p { margin-top: 8px; }
.note strong { display: block; margin-bottom: 4px; }

.pill {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px;
  border-radius: 999px; white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.stop { background: var(--stop-soft); color: var(--stop); }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 20px 0; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--soft); }
.card h4 { margin: 0 0 6px; font-size: 15px; }
.card p { margin: 0; font-size: 14px; color: var(--muted); }

ol.steps { counter-reset: s; list-style: none; padding: 0; }
ol.steps > li {
  counter-increment: s; position: relative; padding: 0 0 4px 44px; margin-bottom: 24px;
}
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: var(--bg);
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
ol.steps > li > strong { display: block; font-size: 17px; margin-bottom: 4px; }

nav.toc { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; background: var(--soft); margin: 0 0 8px; }
nav.toc p { margin: 0 0 8px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
nav.toc ol { margin: 0; padding-left: 20px; }
nav.toc li { margin: 3px 0; }

footer { border-top: 1px solid var(--line); margin-top: 64px; padding-top: 20px; color: var(--muted); font-size: 13px; }
.guidelinks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.guidelinks a {
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
  text-decoration: none; font-size: 13px; background: var(--bg);
}

/* Diagrams ------------------------------------------------------------------
   Every figure is inline SVG. No external image is fetched: the guides are
   served as static files behind the console and must render on a host with no
   outbound network, and an <img> that 404s teaches nothing. */
figure.fig { margin: 24px 0; }
figure.fig svg { display: block; width: 100%; height: auto; }
figure.fig figcaption {
  margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center;
}
.fig-frame {
  border: 1px solid var(--line); border-radius: 12px; background: var(--soft); padding: 18px;
}
svg text { font-family: -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }

/* API specification blocks --------------------------------------------------
   Each endpoint repeats the same four blocks in the same order. The label makes
   a missing block obvious at a glance while writing. */
.endpoint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 0 10px 10px 0; background: var(--soft);
  padding: 12px 16px; margin: 18px 0 8px;
}
.endpoint .method {
  font: 700 12px/1 "Cascadia Code", Consolas, monospace; letter-spacing: .04em;
  background: var(--brand); color: var(--bg); padding: 5px 9px; border-radius: 5px;
}
.endpoint .path { font: 14px/1.5 "Cascadia Code", Consolas, monospace; word-break: break-all; }
.blocklabel {
  margin: 22px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}

/* Print ---------------------------------------------------------------------
   These guides get printed and handed around in review meetings, so the printed
   form is a supported output, not an afterthought. Two things break by default:
   horizontally scrolling tables lose their right-hand columns, and link targets
   disappear entirely on paper. Both are fixed below. */
.printbar { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.printbtn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.printbtn:hover { background: var(--soft); }
.printbtn svg { width: 15px; height: 15px; }

@media print {
  @page { margin: 16mm 14mm; }

  body { font-size: 10.5pt; line-height: 1.6; }
  .wrap { max-width: none; padding: 0; }
  header.hero { background: none; padding: 0 0 16px; margin-bottom: 20px; }

  /* Navigation chrome carries no meaning on paper. */
  .printbar, nav.toc, .guidelinks { display: none !important; }

  /* Scroll containers must expand or the right-hand columns are simply lost. */
  .tablewrap, figure.fig svg, pre { overflow: visible !important; }
  table { min-width: 0 !important; font-size: 9pt; }
  pre { font-size: 8.5pt; white-space: pre-wrap; word-break: break-word; }

  /* Keep a heading with what it introduces, and never split a table row,
     a diagram or a callout across pages. */
  h2 { page-break-before: auto; page-break-after: avoid; margin-top: 24px; }
  h3 { page-break-after: avoid; }
  tr, .note, .card, figure.fig, .endpoint, pre { page-break-inside: avoid; }
  .endpoint { page-break-after: avoid; }
  ol.steps > li { page-break-inside: avoid; }

  /* A URL is unreachable on paper unless it is written out. Internal anchors
     are excluded — "(#auth)" next to every cross-reference is pure noise. */
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #555; }

  /* Backgrounds are dropped by default, which would flatten every diagram and
     status pill into white-on-white. */
  .diagram, figure.fig, .note, .pill, .endpoint .method, th, .card, ol.steps > li::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  footer { margin-top: 32px; }
}
