/* ==========================================================================
   Governate design system
   --------------------------------------------------------------------------
   One typeface (JetBrains Mono, served from this app; nothing is loaded from
   outside), one ink colour, hairline borders, and controls that look like
   keys: a hard edge and a hard shadow. Light and dark themes share every
   rule below; only the tokens differ. The components are listed at
   /#components.

   Tokens
     --bg       page                 --panel   surfaces
     --ink      text and hard edges  --muted   secondary text
     --line     hairlines            --soft    quiet fills (secondary buttons, callouts)
     --accent   Governate green: the one primary action per screen
     --good / --warn / --bad, each with a -bg tint, for state only
   ========================================================================== */

@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("/fonts/JetBrainsMono-Medium.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url("/fonts/JetBrainsMono-Bold.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  /* Light: paper and ink. Dark: the near-black of the Governate mark. */
  --bg: light-dark(#f6f7f5, #08090a);
  --panel: light-dark(#ffffff, #101214);
  --ink: light-dark(#0c0f12, #eceee8);
  --muted: light-dark(#5a6168, #9aa19a);
  --line: light-dark(#cfd4d2, #2a2f33);
  --soft: light-dark(#e3e7e4, #1a1e21);
  /* Governate green, from the logo. Text on it is always the dark ink. */
  --accent: #a7ff3f;
  --accent-ink: #08090a;
  --code: light-dark(#2f6b00, #b9ff6b);
  --good: light-dark(#1f6b12, #8ee36a);
  --good-bg: light-dark(#e4f6dc, #14260f);
  --warn: light-dark(#8a5300, #f2c26b);
  --warn-bg: light-dark(#fdeed2, #2e230c);
  --bad: light-dark(#a8261c, #ff9f95);
  --bad-bg: light-dark(#fbd9d5, #34140f);
  --edge: var(--ink);
  --radius: 4px;
  font: 14px/1.6 "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-feature-settings: "zero", "calt" 0;
  -webkit-font-smoothing: antialiased;
}
/* The theme switch in the top bar overrides the device's setting. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
h1 { font-size: 1.85rem; line-height: 1.2; margin: 0 0 28px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 1rem; margin: 0 0 6px; font-weight: 700; }
p { margin: 0 0 12px; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
code { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---- top bar and tabs ---- */

.top { background: var(--panel); border-bottom: 1px solid var(--edge); position: sticky; top: 0; z-index: 5; }
.top-row { display: flex; align-items: center; gap: 14px; padding: 12px 28px 6px; }
.brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 9px; }
/* The mark: the G, from logo.svg. */
.brand::before { content: ""; width: 1.5em; height: 1.42em; background: url(logo.svg) center / contain no-repeat; }
.context { color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line); }
.account { margin-left: auto; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; border: 1px solid var(--line); padding: 0 6px; border-radius: 2px; color: var(--ink); }

.tabs { display: flex; gap: 6px; padding: 2px 16px 1px; margin-bottom: -1px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a {
  padding: 8px 14px 9px;
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  white-space: nowrap;

  &:hover { background: var(--soft); }
  /* The current tab is a box that opens onto the page below it. */
  &[aria-current="page"] { border-color: var(--edge); background: var(--bg); margin-bottom: -1px; padding-bottom: 10px; }
}

.content { padding: 48px 28px 120px; max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { margin: 0; }
.crumb { margin: 0 0 6px; color: var(--muted); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* A titled section: title on the left, panel on the right. */
.row { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; margin-top: 48px; align-items: start; }
.row-title { padding-top: 18px; }
.row-title h2 { font-size: 1.1rem; }
.row-title p { font-size: 12.5px; margin: 6px 0 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 20px; }

/* A note that must not be missed: quiet fill, hard edge. */
.callout { background: var(--soft); border: 1.5px solid var(--edge); padding: 14px 18px; margin: 0; }
.callout strong { display: block; margin-bottom: 4px; }

/* An identifier or other literal value. */
.chip { color: var(--code); background: var(--soft); padding: 1px 6px; border-radius: 2px; }
@media (max-width: 820px) { .row { grid-template-columns: 1fr; gap: 10px; } }

/* A bordered group with its title set into the border. */
.box { border: 1.5px solid var(--edge); border-radius: 0; padding: 16px 20px 20px; margin: 0; display: grid; gap: 14px; background: var(--panel); min-width: 0; }
/* The title sits on the border: page colour above the line, panel below. */
.box > legend { font-weight: 700; padding: 0 10px; margin-left: -6px; font-size: 1.02rem; background: linear-gradient(to bottom, var(--behind, var(--bg)) 50%, var(--panel) 50%); }
.panel { --behind: var(--panel); }
.panel .box { border-width: 1px; border-color: var(--line); }
.panel .box > legend { font-size: 1rem; }
.content > .box { margin-bottom: 28px; }

/* The stippled drop shadow under a box. */
.dither { position: relative; }
.dither::before { content: ""; position: absolute; inset: 9px -9px -9px 9px; background-image: radial-gradient(var(--edge) 0.75px, transparent 0.85px); background-size: 3px 3px; opacity: 0.75; }
.dither > * { position: relative; }
.dither .box { border: 1.5px solid var(--edge); }

/* ---- tiles, pills, tables ---- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.stat-label { color: var(--muted); }
.stat-value { font-size: 1.7rem; font-weight: 700; margin: 8px 0 6px; overflow-wrap: anywhere; letter-spacing: -0.02em; }
.stat-note { color: var(--muted); font-size: 12.5px; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 2px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; white-space: nowrap; border: 1px solid currentColor; background: var(--bg); vertical-align: middle; }
.pill[data-tone="good"] { color: var(--good); background: var(--good-bg); }
.pill[data-tone="warn"] { color: var(--warn); background: var(--warn-bg); }
.pill[data-tone="bad"] { color: var(--bad); background: var(--bad-bg); }
h1 .pill { font-size: 12.5px; }

.copyable { display: inline-flex; align-items: center; gap: 12px; }
.copyable code { font-size: 1.05rem; color: var(--code); background: var(--soft); padding: 3px 10px; border-radius: 2px; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap { border: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 700; white-space: nowrap; border-bottom-color: var(--edge); }
th + th { box-shadow: inset 1px 0 0 var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg); }
.panel th:first-child, .panel td:first-child { padding-left: 0; }
.actions { text-align: right; white-space: nowrap; }
.actions > * + * { margin-left: 8px; }
td.detail { color: var(--muted); max-width: 360px; overflow-wrap: anywhere; }
.empty { color: var(--muted); margin: 0; }

/* ---- forms and buttons ---- */

.form { display: grid; gap: 18px; max-width: 760px; min-width: 0; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-weight: 700; }
.field-hint { color: var(--muted); font-size: 12.5px; display: block; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check > span { display: grid; gap: 1px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 28px; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-error { color: var(--bad); margin: 0; }
.form-error:empty { display: none; }
.saved { color: var(--good); }

input:not([type="checkbox"], [type="radio"]), select, textarea {
  font: inherit;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--edge); outline: none; box-shadow: 1.5px 2px 0 var(--edge); }
textarea { resize: vertical; }
::placeholder { color: var(--muted); opacity: 0.8; }

/* Buttons look like keys: a hard edge and a hard shadow that shortens when
   pressed. One .primary per screen; .danger for what cannot be undone. */
button, a.button, summary.button {
  display: inline-block;
  font: inherit;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 8px 15px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 1.5px 2px 0 var(--edge);
  white-space: nowrap;
  transition: transform 40ms, box-shadow 40ms;

  &:hover { filter: brightness(0.96); }
  &:active { transform: translate(1px, 2px); box-shadow: 0 0 0 var(--edge); }
  &:disabled { opacity: 0.5; cursor: default; transform: none; }
  &.primary { background: var(--accent); color: var(--accent-ink); }
  &.quiet { background: var(--panel); }
  &.danger { background: var(--bad-bg); color: var(--ink); }
  &.small { padding: 3px 10px; font-size: 12.5px; box-shadow: 1px 1.5px 0 var(--edge); }
  &.wide { display: block; text-align: center; }
}
:focus-visible { outline: 2px solid var(--edge); outline-offset: 2px; }

/* ---- sign in ---- */

.sign-in { max-width: 420px; margin: 12vh auto 0; padding: 0 24px; display: grid; gap: 28px; }
.sign-in .brand { font-size: 1.3rem; }
.sign-in .box { padding: 20px 22px 24px; gap: 18px; }
.sign-in-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.providers { display: grid; gap: 12px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--edge); }

/* ---- protecting files ---- */

.protect { display: grid; gap: 14px; margin-bottom: 28px; }
.dropzone {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
  padding: 36px 20px;
  background: var(--panel);
  border: 1.5px dashed var(--edge);
  cursor: pointer;

  &:hover { background: var(--soft); }
  /* While files are held over it. */
  &.over { background: var(--accent); border-style: solid; box-shadow: 3px 4px 0 var(--edge); }
  &.over .muted { color: var(--accent-ink); }
}
.uploads { list-style: none; margin: 0; padding: 0; display: grid; }
.uploads:empty { display: none; }
.uploads li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---- document viewer ---- */

.viewer { display: flex; flex-direction: column; height: 100vh; }
.viewer-bar { display: flex; align-items: center; gap: 16px; padding: 9px 16px; background: var(--panel); border-bottom: 1px solid var(--edge); }
.viewer-bar a { text-decoration: none; white-space: nowrap; }
.viewer-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-note { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.viewer-message { margin: 0; padding: 8px 16px; background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--line); white-space: pre-line; }
.viewer-stage { flex: 1; min-height: 0; display: grid; position: relative; }
.viewer-frame { width: 100%; height: 100%; border: 0; background: var(--bg); }
.viewer-error { color: var(--bad); padding: 40px 24px; margin: 0; }

/* Covers the document while the window is not the one in front. */
.viewer-cover { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--muted); text-align: center; padding: 24px; }
.viewer-cover[hidden] { display: none; }

/* Printing the page prints a notice in place of the document. */
@media print {
  .viewer.no-print .viewer-stage { display: none; }
  .viewer.no-print::after { content: "Printing this document is not allowed."; display: block; padding: 40px; }
}

/* ---- small pieces ---- */

select.inline { width: auto; padding: 4px 28px 4px 8px; }
.spaced { margin-top: 28px; }
td .tag { margin-left: 8px; }
input[type="radio"] { accent-color: var(--accent); }

/* A choice between a few options, each explained: one bordered row per
   option, the chosen one marked by its edge. */
.choices { display: grid; gap: 10px; }
.choice { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.choice:hover { background: var(--soft); }
.choice:has(input:checked) { border-color: var(--edge); box-shadow: 1.5px 2px 0 var(--edge); }
.choice:has(input:focus-visible) { outline: 2px solid var(--edge); outline-offset: 2px; }
.choice > span { gap: 4px; }
.choice strong { font-weight: 700; }
.choice .field-hint { line-height: 1.55; }
.choice .tag { margin-left: 8px; }
.choice.soon { cursor: default; opacity: 0.6; padding-left: 46px; }
.choice.soon:hover { background: none; }
.choice.soon .pill { margin-left: 8px; }

/* ---- download menu ---- */

.icon-only { padding-left: 8px; padding-right: 8px; }
.button svg, summary svg { vertical-align: -2px; }
details.menu { display: inline-block; position: relative; text-align: left; }
details.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .caret { font-size: 0.75em; }
.menu-items { position: fixed; z-index: 20; min-width: 190px; background: var(--panel); border: 1.5px solid var(--edge); box-shadow: 3px 3px 0 var(--edge); padding: 4px; }
.menu-items a { display: flex; justify-content: space-between; gap: 20px; padding: 7px 10px; color: var(--ink); text-decoration: none; }
.menu-items a:hover, .menu-items a:focus-visible { background: var(--accent); color: var(--accent-ink); outline: none; }
.menu-items a:hover code, .menu-items a:focus-visible code { color: inherit; }
.menu-items code { color: var(--code); font-weight: 700; }
.menu-items span { color: inherit; opacity: 0.75; }

/* ---- documentation ---- */

.content.wide { max-width: 1400px; padding-top: 32px; }
.docs { display: grid; grid-template-columns: 230px minmax(0, 760px) 200px; gap: 56px; align-items: start; }
.docs-side, .docs-toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.docs-side input { width: 100%; margin-bottom: 20px; }
.docs-group { margin-bottom: 22px; }
.docs-group-title { margin: 0 0 6px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.docs-nav a, .docs-toc a { display: block; padding: 4px 10px; margin-left: -10px; color: var(--ink); text-decoration: none; border-left: 2px solid transparent; }
.docs-nav a:hover, .docs-toc a:hover { background: var(--soft); }
.docs-nav a[aria-current="page"] { border-left-color: var(--edge); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.docs-toc a { color: var(--muted); font-size: 0.88rem; }
.docs-toc a.h3 { padding-left: 24px; }
.docs-version { margin-top: 8px; }
.docs-crumb { margin: 0 0 4px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--code); }
.docs-body h1 { margin-top: 0; }
.docs-body h2 { margin: 44px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 1.25rem; }
.docs-body h3 { margin: 28px 0 8px; font-size: 1.05rem; }
.docs-body h2, .docs-body h3 { scroll-margin-top: 16px; }
.docs-body .anchor { color: inherit; text-decoration: none; }
.docs-body .anchor:hover::after { content: " #"; color: var(--muted); }
.docs-body p, .docs-body li { line-height: 1.7; }
.docs-body ul { padding-left: 20px; }
.docs-body li { margin: 4px 0; }
.docs-body li::marker { color: var(--muted); }
.docs-body .table-wrap, .docs-body .code, .docs-body .callout { margin: 16px 0; }
.docs-body td { vertical-align: top; }
.docs-body td:first-child { white-space: nowrap; }
code.c { color: var(--code); background: var(--soft); padding: 1px 5px; border-radius: 3px; font-size: 0.92em; overflow-wrap: anywhere; }
.code { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; line-height: 1.6; }
.code .copy { position: absolute; top: 8px; right: 8px; opacity: 0; }
.code:hover .copy, .code .copy:focus-visible { opacity: 1; }
.docs-next { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); }
.docs-next a { display: grid; gap: 2px; color: var(--ink); text-decoration: none; font-weight: 700; }
.docs-next a:hover { text-decoration: underline; }
.docs-next .next { text-align: right; }
@media (max-width: 1100px) { .docs { grid-template-columns: 210px minmax(0, 1fr); gap: 36px; } .docs-toc { display: none; } }
@media (max-width: 720px) { .docs { grid-template-columns: 1fr; } .docs-side { position: static; max-height: none; } }

/* ---- opening a .gvf ---- */

.dropzone.slim { padding: 18px 20px; }
.dropzone.busy { opacity: 0.6; pointer-events: none; }
.protect + .table-wrap { margin-top: 24px; }

/* ---- text viewer and editor ---- */

:root {
  --tok-key: light-dark(#0b5cad, #7cc4ff);
  --tok-str: var(--code);
  --tok-num: light-dark(#a04a00, #ffb86b);
  --tok-kw: light-dark(#8a2be2, #c9a5ff);
  --tok-com: var(--muted);
}
.viewer-controls { display: inline-flex; align-items: center; gap: 10px; margin-left: 8px; min-width: 0; }
.viewer-status { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-status.bad { color: var(--bad); }
.code-view { overflow: auto; background: var(--panel); outline: none; min-height: 0; }
.code-view.no-copy .code-text { user-select: none; -webkit-user-select: none; }
.code-inner { display: flex; min-width: max-content; min-height: 100%; }
.code-gutter, .code-text, .code-input { margin: 0; padding: 16px 0; font: inherit; font-size: 13.5px; line-height: 1.6; tab-size: 4; white-space: pre; }
.code-gutter { position: sticky; left: 0; z-index: 2; flex: none; min-width: 3.5em; padding-left: 14px; padding-right: 12px; text-align: right; color: var(--muted); background: var(--bg); border-right: 1px solid var(--line); user-select: none; -webkit-user-select: none; }
.code-layers { position: relative; flex: 1; min-width: max-content; }
.code-text { padding-left: 16px; padding-right: 48px; color: var(--ink); min-height: 100%; }
textarea.code-input { position: absolute; inset: 0; width: 100%; height: 100%; padding-left: 16px; padding-right: 48px; border: 0; border-radius: 0; box-shadow: none; outline: none; resize: none; overflow: hidden; background: transparent; color: transparent; caret-color: var(--ink); }
textarea.code-input:focus { box-shadow: none; }
textarea.code-input::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-kw { color: var(--tok-kw); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-head { color: var(--ink); font-weight: 700; }
/* The reader's name across the text. It lets clicks and scrolling through. */
.text-watermark { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 90px 40px; padding: 60px 20px; }
.text-watermark span { flex: none; width: 260px; text-align: center; transform: rotate(-28deg); color: var(--ink); opacity: 0.16; font-size: 15px; white-space: nowrap; user-select: none; -webkit-user-select: none; }
.viewer-cover { z-index: 5; }
@media print {
  .code-view { overflow: visible; }
  .code-gutter { position: static; }
}

/* ---- Markdown, rendered ---- */

.code-view[hidden], .md-view[hidden] { display: none; }
.md-view { overflow: auto; background: var(--panel); outline: none; min-height: 0; }
.md-view.no-copy { user-select: none; -webkit-user-select: none; }
.md { max-width: 820px; margin: 0 auto; padding: 40px 32px 120px; line-height: 1.7; }
.md > :first-child { margin-top: 0; }
.md h1 { font-size: 1.7rem; margin: 40px 0 16px; }
.md h2 { font-size: 1.3rem; margin: 36px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 1.1rem; margin: 28px 0 8px; }
.md h4, .md h5, .md h6 { font-size: 1rem; margin: 24px 0 6px; }
.md p { margin: 12px 0; }
.md ul, .md ol { padding-left: 26px; margin: 12px 0; }
.md li { margin: 4px 0; }
.md li > ul, .md li > ol { margin: 4px 0; }
.md li::marker { color: var(--muted); }
.md li.task { list-style: none; margin-left: -22px; display: flex; gap: 8px; align-items: baseline; }
.md li.task input { width: 14px; height: 14px; flex: none; accent-color: var(--accent); }
.md blockquote { margin: 16px 0; padding: 4px 18px; border-left: 3px solid var(--edge); background: var(--soft); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.md a { color: var(--tok-key); }
.md del { color: var(--muted); }
.md-code { margin: 16px 0; padding: 14px 16px; overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; line-height: 1.6; }
.md-image { color: var(--muted); font-style: italic; }
.md .table-wrap { margin: 16px 0; }
.md .align-right { text-align: right; }
.md .align-center { text-align: center; }

/* ---- the protect box, opened from the top bar ---- */

.protect { position: relative; }
.panel-close { justify-self: end; }
.job-note { color: var(--bad); font-size: 12.5px; white-space: normal; }
.top-row > button.primary { margin-left: 6px; }

/* ---- setup and infrastructure ---- */

.subtabs { display: flex; gap: 4px; margin: -8px 0 32px; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--ink); }
.subtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--edge); font-weight: 700; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.group { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; display: grid; gap: 14px; min-width: 0; }
.group > legend { padding: 0 8px; font-weight: 700; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice-body { display: grid; gap: 12px; margin-top: 12px; cursor: default; }
.choice-body[hidden] { display: none; }
.kv-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.kv-rows:empty { display: none; }
.kv { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.saved.bad, .bad-text { color: var(--bad); }
.sign-in.setup { max-width: 1120px; margin-top: 5vh; }
.wizard { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; }
.wizard-rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wizard-rail button { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; }
.wizard-rail button:hover { background: var(--soft); }
.wizard-rail button:disabled { cursor: default; }
.wizard-rail button:disabled:hover { background: none; }
.wizard-rail button:disabled:not(.done):not([aria-current]) { opacity: 0.55; }
.wizard-rail button:focus-visible { outline: 2px solid var(--edge); outline-offset: 2px; }
.wizard-rail button[aria-current="step"] { border-color: var(--edge); box-shadow: 1.5px 2px 0 var(--edge); background: var(--panel); }
.wizard-rail button > span:last-child { display: grid; gap: 2px; min-width: 0; }
.wizard-rail .field-hint { overflow-wrap: anywhere; }
.wizard-rail .done .step-n { background: var(--accent); color: var(--accent-ink); }
.wizard-pane { display: grid; gap: 16px; min-width: 0; border-left: 1px solid var(--line); padding-left: 36px; }
.wizard-pane h1 { margin: 0; font-size: 1.35rem; }
.wizard-count { margin: 0; }
.with-button { display: flex; gap: 10px; align-items: center; }
.with-button input { flex: 1; min-width: 0; }
.wizard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.wizard-head > div { display: grid; gap: 6px; }
.wizard-head .wizard-sub { margin: 0; }
.guide-link { white-space: nowrap; font-size: 0.9rem; }
.setup-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.setup-top .brand { font-size: 1.3rem; }
.guide { max-width: 1120px; margin: 5vh auto 0; padding: 0 24px 120px; display: grid; gap: 36px; }
.guide-cols { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 48px; align-items: start; }
.guide-nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.guide .docs-body h2 { scroll-margin-top: 20px; }
@media (max-width: 860px) { .guide-cols { grid-template-columns: 1fr; } .guide-nav { position: static; } }
.wizard-sub { margin: -12px 0 0; color: var(--muted); }
.wizard-pane .form { max-width: none; }
.wizard-pane .form-actions { flex-wrap: wrap; }
.pair.wide-first { grid-template-columns: 3fr 1fr; }
.wizard-pane .pair { align-items: start; }
.callout.plain { display: grid; gap: 8px; }
.callout.plain ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.more > summary { cursor: pointer; font-weight: 700; }
.more[open] > summary { margin-bottom: 12px; }
@media (max-width: 860px) { .wizard { grid-template-columns: 1fr; gap: 20px; } .wizard-pane { border-left: 0; padding-left: 0; } .wizard-rail { grid-auto-flow: column; overflow-x: auto; } .wizard-rail .field-hint { display: none; } }
.setup-step { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 14px; }
.setup-step > summary, .step-head { display: flex; gap: 12px; align-items: flex-start; cursor: default; list-style: none; }
.setup-step > summary { cursor: pointer; }
.setup-step > summary::-webkit-details-marker { display: none; }
.setup-step[open] > summary { margin-bottom: 14px; }
.step-n { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: 1.5px solid var(--edge); border-radius: 50%; font-size: 12px; font-weight: 700; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.restarting { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); text-align: center; }
@media (max-width: 640px) { .pair, .kv { grid-template-columns: 1fr; } }
.choice-body input:not([type="radio"], [type="checkbox"]), .choice-body textarea { width: 100%; height: auto; margin-top: 0; }
.setup-step:not([open]):not(.open) { gap: 0; }

/* ---- compliance ---- */

.check-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 8px; }
.check-area h2 { margin: 32px 0 12px; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.check-line { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; display: grid; gap: 8px; }
.check-line.not_met { border-left-color: var(--bad); }
.check-line.partly, .check-line.manual, .check-line.product { border-left-color: var(--warn); }
.check-line.met { border-left-color: var(--good); }
.check-line p { margin: 0; line-height: 1.6; }
.check-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.check-controls { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; }
.check-controls .tag { margin-right: 4px; }

/* ---- agents ---- */

.section-title { margin: 36px 0 12px; font-size: 1.1rem; }
.new-token { margin: 20px 0; border-color: var(--edge); box-shadow: 3px 3px 0 var(--edge); }
.code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.posture-list { display: block; }
.callout + .stats { margin-top: 20px; }
