:root {
  color-scheme: light;
  --navy: #0e1a2b;
  --navy-2: #15233a;
  --navy-3: #1a7a74;
  --gold: #e0b14a;
  --gold-deep: #c4922e;
  --ice: #f4efe6;
  --ice-soft: #f7f3ec;
  --teal: #1a7a74;
  --success: #1a7a74;
  --bg: #f4efe6;
  --ink: #0e1a2b;
  --muted: #5c6570;
  --card: #fffdfa;
  --line: #e4ddd2;
  --line-strong: #d3c9ba;
  --accent-hover: #15655f;
  --tint: #f1f6f5;
  --accent: #1a7a74;
  --accent-2: #e0b14a;
  --accent-ink: #fff;
  --nav: #0e1a2b;
  --nav-ink: #f4efe6;
  --nav-muted: #b7c0c4;
  --nav-hover: #15233a;
  --nav-active: #1a3a38;
  --draft: #5d6985;
  --offered: #3d5a8c;
  --signed: #2e9a62;
  --danger: #b42318;
  --warn: #b54708;
  --shadow: 0 1px 2px rgba(14, 26, 43, 0.04), 0 6px 20px rgba(14, 26, 43, 0.05);
  --shadow-pop: 0 2px 6px rgba(14, 26, 43, 0.08), 0 16px 40px rgba(14, 26, 43, 0.14);
  --nav-w: 15.25rem;
  --agent-w: 3.35rem;
  --agent-open-w: clamp(24rem, 38vw, 40rem);
  --topbar-h: 3.5rem;
  --radius: 12px;
  --radius-control: 8px;
  --control-h: 2.35rem;
  --font: "Source Sans 3", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-brand: "Outfit", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

body.app {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--agent-w);
  min-height: 0;
}

body.app:not(.portal) {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body.agent-open,
html.agent-open-html body.app {
  --agent-w: var(--agent-open-w);
}

body:has(.sidenav):not(:has(#agent-dock)) {
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
}

body:not(:has(.sidenav)):not(:has(#agent-dock)),
body.portal,
body.chat-embed,
body.crm-embed {
  grid-template-columns: minmax(0, 1fr);
}

body.is-resizing,
body.is-resizing iframe {
  cursor: col-resize;
  user-select: none;
}
body.is-resizing iframe { pointer-events: none; }

a { color: var(--navy-3); }
a:hover { color: var(--gold-deep); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ——— Sidebar ——— */
.sidenav {
  background: var(--nav);
  color: var(--nav-ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  max-height: 100%;
  position: sticky;
  top: 0;
  overflow: auto;
  padding: 1rem 0.75rem 1.1rem;
  border-right: 1px solid #162447;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--nav-ink);
  text-decoration: none;
  letter-spacing: 0;
  font-weight: 700;
  padding: 0.35rem 0.55rem 1rem;
}

.brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0;
  background: none;
  color: inherit;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1.1;
  min-width: 0;
}
.brand-text strong {
  font-family: var(--font-brand);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand-text span {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ice);
}
.topbar .brand-text span { color: var(--muted); }
.topbar .brand-text strong { color: var(--ink); }

.nav-groups { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.nav-label {
  margin: 1rem 0.55rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nav-muted);
}
.nav-label:first-child { margin-top: 0.2rem; }

.nav-link {
  display: block;
  color: #d9dee2;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 550;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-link:hover { background: var(--nav-hover); color: #fff; }
.nav-link.is-active {
  background: var(--nav-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.85rem 0.55rem 0.2rem;
  border-top: 1px solid #1d2f5c;
  margin-top: 1rem;
}
.nav-foot .muted { color: var(--nav-muted); }
.operator-form {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  margin-top: 0.45rem;
}
.operator-form label {
  color: var(--nav-muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.operator-form input {
  background: #162447;
  color: var(--nav-ink);
  border-color: #1d2f5c;
  padding: 0.35rem 0.5rem;
}
.operator-form button {
  width: 100%;
  min-height: 2rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--nav-muted);
  border: 1px solid #2a3b55;
}
.operator-form button:hover { background: var(--nav-hover); color: #fff; border-color: #3a4d6b; }

body.role-readonly form[method="post"]:not(.cmd-chat):not(.cmd-session) { display: none !important; }
body.role-underwriter form[method="post"]:not(.cmd-uw):not(.cmd-chat):not(.cmd-session) { display: none !important; }

body.login .test-banner { display: none; }
.login-card { max-width: 28rem; margin: 2rem auto; }
.note-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.note-list li {
  padding: 0.75rem 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.note-list li:first-child { border-top: 0; padding-top: 0.2rem; }
.note-meta { color: var(--muted); font-size: 0.84rem; margin: 0 0 0.3rem; }
.note-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.nav-toggle {
  display: none;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

/* ——— Workspace ——— */
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
}

.top,
.topbar {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-height: var(--topbar-h);
  padding: 0.55rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand { color: var(--ink); padding: 0; }
.topbar-hint { margin: 0 0 0 auto; font-size: 0.8rem; white-space: nowrap; }
.test-banner {
  background: var(--navy);
  color: var(--nav-ink);
  padding: 0.4rem 1.25rem;
  font-size: 0.82rem;
  border-bottom: 1px solid #1a3a38;
}
.test-banner a { color: var(--gold); font-weight: 650; }
.test-banner strong { color: #fff; }

.jump {
  display: flex;
  gap: 0.4rem;
  flex: 1;
  max-width: 32rem;
  margin: 0;
}
.jump input {
  flex: 1;
  margin: 0;
}

main {
  --main-pad-top: 1.35rem;
  --main-pad-x: 1.5rem;
  max-width: 1240px;
  width: 100%;
  margin: 0;
  padding: var(--main-pad-top) var(--main-pad-x) 3rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; }
h1 { margin: 0 0 0.35rem; font-size: 1.6rem; font-family: var(--font-brand); letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 1.08rem; margin: 0 0 0.75rem; font-family: var(--font-brand); font-weight: 600; letter-spacing: -0.015em; }
/* h3 names a block inside a card: a quiet label, not a second headline. */
h3 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.2rem 0 0.55rem;
}
.card > h3, .card > form > h3:first-child {
  border-top: 1px solid var(--line);
  padding-top: 1.05rem;
}
.card > h2 + h3, .card > h3:first-child, .card > form:first-child > h3:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0.4rem;
}
p { margin: 0 0 0.7rem; }
.hint { font-size: 0.88rem; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--ice-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.02rem 0.3rem;
}

.lede, .hint, .muted, .crumb { color: var(--muted); }
kbd {
  font: inherit;
  font-size: 0.78em;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  background: #fff;
}
.lede { margin: 0 0 1.1rem; max-width: 46rem; }
.crumb { margin: 0 0 0.65rem; font-size: 0.85rem; }
.crumb a { color: var(--accent); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.page-head h1 { margin: 0; }
.page-head .lede { margin: 0.35rem 0 0; }
.page-head-aside { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.page-head-aside p { margin: 0; }
.page-head-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; align-items: center; margin: 0.4rem 0 0; }
.page-head-meta .mono { color: var(--muted); font-size: 0.78rem; }

/* main is the scroller and the topbar sits outside it. Sticky offsets count
   from main's content box, so the bar is pulled up by main's top padding to
   sit flush under the topbar, and widened over the side padding so nothing
   scrolls past beside it. */
.page-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  position: sticky;
  top: calc(-1 * var(--main-pad-top));
  z-index: 15;
  background: var(--bg);
  padding: 0.55rem var(--main-pad-x) 0.6rem;
  margin: 0 calc(-1 * var(--main-pad-x)) 0.85rem;
  border-bottom: 1px solid var(--line);
}
/* Jump targets land below the pinned bar, not underneath it. */
main [id] { scroll-margin-top: 3.4rem; }
.page-toc a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
}
.page-toc a:hover { border-color: var(--accent); color: var(--accent); }
.page-toc a.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

.journey {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr));
  gap: 0.4rem;
}
.journey-step {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  font-size: 0.78rem;
  min-width: 0;
}
.journey-n {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}
.journey-step.is-done { border-color: #9ee0b8; background: #e5f8ee; }
.journey-step.is-done .journey-n::after { content: " ✓"; color: var(--signed); }
.journey-step.is-rejected .journey-n::after { content: " ✕"; color: var(--danger); }
.journey-step.is-current {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(230, 181, 74, 0.28);
}
.journey-step.is-rejected { border-color: #f0b1ab; background: #fff6f5; }
.journey-step.is-blocked { opacity: 0.5; }
.guide-steps .journey-step { padding: 0; }
.guide-steps .journey-step a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}
.guide-steps .journey-step a:hover strong { color: var(--accent); }
.guide-card h2 { font-size: 1.1rem; }
.guide-question { font-size: 1.02rem; margin: 0 0 0.9rem; max-width: 46rem; }
.guide-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.2rem 1.25rem;
  margin: 0 0 0.9rem;
}
.guide-facts dd { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.guide-nav { align-items: center; margin-top: 0.9rem; }
.guide-nav form { margin: 0; }

.banner {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin: 0 0 0.65rem;
}
.banner p { margin: 0 0 0.45rem; }
.banner p:last-child { margin-bottom: 0; }
.banner-reject { background: #fff6f5; border: 1px solid #f0b1ab; border-left: 4px solid var(--danger); }
.banner-accept { background: #e5f8ee; border: 1px solid #9ee0b8; border-left: 4px solid var(--signed); }
.banner-next { background: #fbf6e9; border: 1px solid #ecdcae; border-left: 4px solid var(--gold); }
.banner .actions { margin: 0.5rem 0 0; }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: #8f1b12; }

/* Result of the last action. Pinned to the workspace, not to the scroll
   position: a redirect to #section must not hide it. */
.flash {
  position: fixed;
  left: calc(var(--nav-w) + 1.5rem);
  bottom: 1.25rem;
  z-index: 60;
  max-width: min(42rem, calc(100vw - var(--nav-w) - var(--agent-w) - 3rem));
  margin: 0;
  padding-right: 2.2rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.flash::after {
  content: "×";
  position: absolute;
  right: 0.8rem;
  top: 0.55rem;
  font-weight: 700;
  color: var(--muted);
}
body.portal .flash, body.chat-embed .flash { position: static; max-width: none; cursor: default; }
body.portal .flash::after, body.chat-embed .flash::after { content: none; }

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card ul, .card ol:not(.journey):not(.timeline):not(.note-list) { margin: 0 0 0.7rem; padding-left: 1.15rem; }
.card li { margin: 0.2rem 0; }
p.card.muted, p.card { color: var(--muted); }
p.card.error { color: var(--ink); }

/* Folded panel: an edit form or a rare action that should not take the page. */
details > summary { cursor: pointer; font-weight: 600; }
details.card {
  box-shadow: none;
  background: var(--ice-soft);
  padding: 0.7rem 0.95rem;
  margin: 0.9rem 0 0;
}
details.card > summary { font-size: 0.92rem; }
details.card[open] > summary { margin-bottom: 0.7rem; }
details.fold {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}
details.fold > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.3rem;
  font-family: var(--font-brand);
  font-size: 1rem;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before {
  content: "›";
  display: inline-block;
  width: 0.8rem;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.12s ease;
}
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary .muted { font-family: var(--font); font-size: 0.86rem; font-weight: 400; }
details.fold > summary:hover { color: var(--accent); }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
details.fold > .fold-body { padding: 1.05rem 1.3rem 0.4rem; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.15rem;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.kpi-label { font-size: 0.82rem; color: var(--muted); }
.kpi a { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 0.15rem; }
.kpi:has(a) { transition: border-color 0.12s ease; }
.kpi:has(a):hover { border-color: var(--accent); }
.kpi a:hover .kpi-label { color: var(--accent); }
.kpi.is-quiet .kpi-value { color: var(--muted); }

.table-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.7rem;
}
.table-toolbar h2 { margin: 0; }
.table-filter { max-width: 16rem; margin: 0; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.15rem 1.1rem;
  align-items: end;
}
.form-grid .span-2,
.form-grid .actions,
.form-grid > h2,
.form-grid > h3,
.form-grid > p,
.form-grid > button { grid-column: 1 / -1; }
.form-grid > h2 { margin: 0.9rem 0 0.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.form-grid > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-grid > button { justify-self: start; min-width: 12rem; }
.form-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); align-items: end; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #2b3747;
}
/* A checkbox sits beside its text, not above it. */
label > span:first-child { display: inline-flex; align-items: center; gap: 0.1rem; }
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
}
input[type="checkbox"], input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

input, select, button, textarea { font: inherit; }

input, select, textarea {
  padding: 0.45rem 0.65rem;
  min-height: var(--control-h);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 400;
  max-width: 100%;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { height: var(--control-h); }
input[type="file"] { padding: 0.3rem 0.4rem; background: var(--ice-soft); }
input::placeholder, textarea::placeholder { color: #9aa1a9; }
input:hover, select:hover, textarea:hover { border-color: #b3a996; }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(230, 181, 74, 0.28);
  outline: none;
}

textarea {
  width: 100%;
  min-height: 6rem;
}

button, a.button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  min-height: var(--control-h);
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
button:hover, a.button:hover { background: var(--accent-hover); color: var(--accent-ink); }
button:active, a.button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
p.actions { margin: 0.6rem 0 0; }

/* Inline forms lay their fields out side by side and wrap; the button lines
   up with the inputs, not with the labels above them. */
.upload {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 1rem;
  align-items: end;
  margin-top: 0.75rem;
}
.upload > h3,
.upload > p,
.upload > .actions,
.upload > .span-2,
.upload > label:has(> textarea) { grid-column: 1 / -1; }
.upload > button { justify-self: start; margin-bottom: 0.85rem; }
.upload > .actions { margin-bottom: 0.85rem; }

dl { margin: 0; }
dt { color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
dd { margin: 0 0 0.65rem; overflow-wrap: anywhere; }
/* Label left, value right: reads as a table, takes half the height. */
dl.kv {
  display: grid;
  grid-template-columns: minmax(6.5rem, max-content) minmax(0, 1fr);
  gap: 0.4rem 1rem;
  align-items: baseline;
}
dl.kv dd { margin: 0; }
dl.kv dt { padding-top: 0.1rem; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  padding: 0.14rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
  background: #eef0f3;
  color: var(--navy-2);
  vertical-align: baseline;
}
.badge-draft { background: #eef0f3; color: var(--draft); }
.badge-offered { background: #e7f1fb; color: var(--offered); }
.badge-signed, .badge-posted, .badge-allocated, .badge-settled,
.badge-pass, .badge-uploaded, .badge-approved, .badge-done,
.badge-approve, .badge-released, .badge-finished, .badge-confirmed {
  background: #e5f8ee; color: var(--signed);
}
.badge-planned, .badge-open, .badge-received, .badge-missing,
.badge-drafted, .badge-unsupported { background: #eef0f3; color: var(--draft); }
.badge-cancelled, .badge-rejected, .badge-fail, .badge-denied,
.badge-reject, .badge-void, .badge-failed {
  background: #fdecea; color: var(--danger);
}
.badge-partially_allocated, .badge-partial, .badge-waived,
.badge-approve_modified, .badge-running, .badge-amount_mismatch {
  background: #e7f1fb; color: var(--offered);
}
.badge-pending, .badge-timeout { background: #fef4e6; color: var(--warn); }
.badge-ops { background: #22344f; color: var(--ice); text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.05em; }
.badge-active, .badge-accept { background: #e5f8ee; color: var(--signed); }
.badge-ended, .badge-superseded, .badge-reversed { background: #eef0f3; color: var(--draft); }
.badge-disputed { background: #fdecea; color: var(--danger); }
.badge-submitted, .badge-executed { background: #e7f1fb; color: var(--offered); }
.badge-advance { background: #e5f8ee; color: var(--signed); }
.badge-review { background: #fef4e6; color: var(--warn); }
.badge-decline_hint { background: #fdecea; color: var(--danger); }
.badge-hard { background: #fdecea; color: var(--danger); }
.badge-soft { background: #eef0f3; color: var(--draft); }
.badge-unclear { background: #fef4e6; color: var(--warn); }
.bar {
  display: block;
  height: 0.35rem;
  background: var(--success);
  border-radius: 99px;
  margin-top: 0.2rem;
  max-width: 100%;
}
.doc-preview iframe {
  width: 100%;
  height: 22rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 0.4rem;
}
.doc-preview.is-tall iframe { height: min(46rem, 72vh); }
.task-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.card ul.task-list { padding-left: 0; }
.task-list li { margin: 0; display: flex; gap: 0.4rem; align-items: center; }
.task-list li.is-done, .task-list li.is-cancelled { color: var(--muted); }
.inline-form { display: inline-flex; gap: 0.4rem; align-items: center; margin: 0; flex-wrap: wrap; }
.inline-form input[type="text"] { min-width: 12rem; }
h2 .count {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--ice-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  vertical-align: middle;
}
.doc-list { list-style: none; margin: 0 0 0.9rem; padding: 0; }
.card ul.doc-list { padding-left: 0; }
.doc-list > li {
  padding: 0.6rem 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.doc-list > li:first-child { border-top: 0; padding-top: 0.2rem; }
.doc-row { display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; align-items: baseline; }
.doc-row .doc-name { font-weight: 600; overflow-wrap: anywhere; }
.doc-row .doc-links { margin-left: auto; display: flex; gap: 0.75rem; font-size: 0.9rem; }
.doc-preview > summary { font-size: 0.86rem; font-weight: 500; color: var(--muted); margin-top: 0.25rem; }
.doc-preview > summary:hover { color: var(--accent); }

table.slots {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.35rem 0 0.4rem;
}
table.slots th, table.slots td {
  text-align: left;
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.slots th:first-child, table.slots td:first-child { padding-left: 0.2rem; }
table.slots th:last-child, table.slots td:last-child { padding-right: 0.2rem; }
table.slots tbody tr:last-child td { border-bottom: 0; }
table.slots thead th { border-bottom-color: var(--line-strong); white-space: nowrap; }
table.slots td.num, table.slots th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.slots td.mono { white-space: nowrap; word-break: normal; overflow-wrap: normal; }
table.slots td form { margin: 0; }
table.slots td .upload { margin-top: 0; }
table.slots td .upload label, table.slots td .upload > button { margin-bottom: 0.3rem; }
table.slots button, table.slots a.button {
  min-height: 1.95rem;
  padding: 0.2rem 0.7rem;
  font-size: 0.84rem;
}
td.row-actions { white-space: nowrap; text-align: right; }
td.row-actions form { display: inline-block; margin: 0.1rem 0 0.1rem 0.25rem; }
table.slots th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
table.slots tbody tr:hover { background: var(--tint); }
table.slots a.row-name {
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
}
table.slots a.row-name:hover { color: var(--accent); text-decoration: underline; }
table.slots th a.sort-link {
  color: inherit;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  font-weight: inherit;
  white-space: nowrap;
}
table.slots th a.sort-link:hover { color: var(--navy-3); text-decoration: underline; }
table.slots th a.sort-link.is-active { color: var(--navy); }

a.button { color: var(--accent-ink); }
fieldset.slot-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #f7f8fc;
}
.card.error {
  border-color: #f0b1ab;
  background: #fff6f5;
}

.timeline { list-style: none; margin: 0; padding: 0; max-height: 28rem; overflow: auto; }
.timeline li {
  display: grid;
  grid-template-columns: 2.6rem 8.6rem minmax(0, 1fr);
  gap: 0.1rem 0.75rem;
  align-items: baseline;
  padding: 0.45rem 0;
  margin: 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.timeline li:first-child { border-top: 0; }
.timeline .mono { grid-column: 3; font-size: 0.74rem; }
.seq { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.8rem; }
@media (max-width: 860px) {
  .timeline li { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .timeline li > * { grid-column: 2; }
  .timeline li > .seq { grid-column: 1; }
}

button.secondary, .button.ghost, a.button.ghost, button.chip {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
button.secondary:hover, .button.ghost:hover, a.button.ghost:hover, button.chip:hover {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
}
button.link {
  background: none;
  border: 0;
  min-height: 0;
  padding: 0;
  color: var(--navy-3);
  font-weight: 500;
  text-decoration: underline;
}
button.link:hover { background: none; color: var(--gold-deep); }
button.chip {
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.86rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ——— Chat ——— */
body.chat-body main {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
body.chat-body .workspace { background: var(--bg); }

.chat-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 52rem;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.25rem;
}

.chat-intro { padding: 1rem 0 0.35rem; }
.chat-intro h1 { margin-bottom: 0.25rem; }
.chat-steps {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.2rem;
  color: var(--muted);
}
.chat-steps li { margin: 0.2rem 0; }

.chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  padding: 0.5rem 0 0.85rem;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
}

.bubble {
  flex: 0 0 auto;
  align-self: flex-start;
  box-sizing: border-box;
  width: fit-content;
  max-width: min(92%, 100%);
  min-width: 0;
  min-height: min-content;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(16, 24, 20, 0.04);
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.bubble p { margin: 0.35rem 0; overflow-wrap: anywhere; }
.bubble p:first-child { margin-top: 0; }
.bubble-who {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-weight: 700;
}
.bubble.me {
  align-self: flex-end;
  background: #e8eef8;
  border-color: #c5d3ea;
}
.bubble.bot { align-self: flex-start; }
.bubble.bot:has(.artifact-list) {
  width: 100%;
  max-width: 100%;
}
.artifact-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0.55rem 0 0.15rem;
  min-width: 0;
}
.artifact { margin: 0; min-width: 0; }
.artifact-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.artifact figcaption,
.artifact-frame p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}
.artifact-frame iframe {
  display: block;
  width: 100%;
  height: 18rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.artifact-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.artifact-card:hover { border-color: var(--accent); color: inherit; }
.artifact-card strong { color: var(--navy); }
.artifact-card span { color: var(--muted); font-size: 0.8rem; }

.proposal-card {
  margin: 0.55rem 0 0.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: #f3faf8;
}
.proposal-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.proposal-card h3 { margin: 0.15rem 0 0.2rem; font-size: 1.02rem; }
.proposal-payload {
  max-height: 9rem;
  overflow: auto;
  font-size: 0.78rem;
  background: #fff;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.proposal-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.55rem; }
.proposal-actions form { margin: 0; }
.bubble-propose { border-color: var(--gold); }
.bubble-done { border-color: #9ee0b8; background: #e5f8ee; }
.bubble-failed, .bubble-blocked { border-color: #f0b1ab; background: #fff6f5; }
.bubble-rejected { opacity: 0.85; }
.chat-people { margin: 0.4rem 0 0.2rem; padding-left: 1.1rem; }
.chat-people a { color: var(--accent); }

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
}
.chat-chips form { margin: 0; }
.chat-chips.is-busy { pointer-events: none; opacity: 0.55; }

.bubble-wait {
  border-color: #b7d4d1;
  background: #f3faf8;
}
.bubble-wait p { margin: 0.2rem 0; }
.wait-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  animation: wait-pulse 0.9s ease-in-out infinite;
}
#agent-wait-sec { font-variant-numeric: tabular-nums; }
.wait-hint { font-size: 0.8rem; }
@keyframes wait-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}
.chat-composer.is-busy { pointer-events: none; opacity: 0.72; }

.chat-composer {
  display: flex;
  gap: 0.55rem;
  align-items: flex-end;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  padding: 0.65rem 0 max(0.55rem, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(243, 245, 250, 0), var(--bg) 28%);
  border-top: 1px solid var(--line);
}
.composer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.45rem 0.55rem 0.4rem;
}
.chat-composer textarea {
  flex: 1;
  min-height: 3.1rem;
  margin: 0;
  resize: vertical;
  width: 100%;
  border: 0;
  box-shadow: none;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
}
.chat-composer textarea:focus { box-shadow: none; }
.file-pick {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}
.file-pick input { margin-top: 0.15rem; }
.chat-composer label { margin: 0; flex: 1; }
.chat-composer button { margin-bottom: 0.2rem; }

html:has(body.chat-embed),
body.chat-embed {
  overflow: hidden;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: var(--bg);
}
body.chat-embed header.top,
body.chat-embed .sidenav,
body.chat-embed .agent-dock,
body.crm-embed header.top,
body.crm-embed .sidenav,
body.crm-embed .agent-dock { display: none !important; }
body.crm-embed main {
  max-width: none;
  padding: 0.75rem 0.85rem 1.5rem;
}
body.crm-embed h1 { font-size: 1.15rem; }
body.chat-embed .workspace {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
body.chat-embed main {
  max-width: none;
  padding: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
body.chat-embed .chat-shell,
body.chat-embed .chat-thread,
body.chat-embed .chat-composer,
body.chat-embed .chat-chips {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
body.chat-embed .bubble {
  max-width: 100%;
  flex: 0 0 auto;
  overflow: visible;
}
body.chat-embed .chat-shell {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  max-width: none;
  padding: 0 0.75rem;
  overflow: hidden;
}
body.chat-embed .chat-intro { padding: 0.65rem 0 0.2rem; }
body.chat-embed .chat-intro h1 { font-size: 1.05rem; margin-bottom: 0.15rem; }
body.chat-embed .lede { font-size: 0.82rem; margin-bottom: 0.4rem; }
body.chat-embed .chat-advanced { display: none; }
body.chat-embed .bubble-text,
body.chat-embed pre.mono {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  overflow-x: hidden;
}

/* ——— Agent column (not a squeezed overlay) ——— */
.agent-dock {
  position: relative;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: contain;
  background: var(--ice-soft);
  border-left: 1px solid var(--line);
}
.agent-fab {
  border-radius: 0;
  box-shadow: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 100%;
  width: 100%;
  letter-spacing: 0.16em;
  font-family: var(--font-brand);
  text-transform: uppercase;
  font-size: 0.82rem;
  background: var(--nav);
  color: var(--gold);
}
body.agent-open .agent-fab,
html.agent-open-html body.app .agent-fab { display: none; }
body:not(.agent-open) .agent-panel { display: none !important; }
html.agent-open-html body.app:not(.is-closing) .agent-panel {
  display: flex !important;
}

.agent-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  background: var(--bg);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.agent-resizer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 2;
}
.agent-resizer:hover,
body.is-resizing .agent-resizer { background: rgba(230, 181, 74, 0.45); }

.agent-panel-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  background: #fff;
  flex: 0 0 auto;
}
.agent-panel-bar a { margin-left: auto; color: var(--accent); font-weight: 650; text-decoration: none; }
.agent-panel-bar button { padding: 0.25rem 0.65rem; }
.agent-bar-hint { font-size: 0.75rem; }
.agent-panel iframe {
  border: 0;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}

.chat-advanced {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.chat-advanced summary { cursor: pointer; margin-bottom: 0.5rem; }

.chat-intro-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.chat-intro-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}
.model-pick { margin: 0; }
.model-pick select {
  font-size: 0.8rem;
  padding: 0.28rem 0.45rem;
  max-width: 11.5rem;
}
.chat-new { margin: 0; }
.tool-line { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tool-chip {
  font-size: 0.72rem;
  background: var(--ice-soft);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  color: var(--ink);
  font-weight: 650;
}
.tool-result {
  align-self: stretch;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
}
.tool-result pre { max-height: 14rem; overflow: auto; overflow-x: auto; white-space: pre-wrap; }
.bubble-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.help-pop {
  display: inline-block;
  position: relative;
  margin-left: 0.3rem;
  vertical-align: middle;
  font-weight: 400;
}
.help-pop > summary {
  list-style: none;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}
.help-pop > summary::-webkit-details-marker { display: none; }
.help-pop > summary::marker { content: ""; }
.help-pop-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
}
.help-pop-panel p { margin: 0 0 0.45rem; }
.help-pop-panel p:last-child { margin-bottom: 0; }
.help-more { font-size: 0.8rem; }
.topbar .help-pop { flex: 0 0 auto; }
.agent-panel-bar .help-pop-panel { left: 0; right: auto; }
.page-head h1 .help-pop,
h2 .help-pop { font-weight: 400; }
.help-topic ol { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.help-topic li { margin: 0.25rem 0; }

.composer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}
.mic-btn {
  min-width: 2.6rem;
  padding: 0.45rem 0.55rem;
}
.mic-btn.is-listening {
  background: #b42318;
  color: #fff;
}
.mic-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

body.portal {
  overflow: auto;
  height: auto;
  max-height: none;
  min-height: 100dvh;
}
body.portal .workspace { max-width: 52rem; margin: 0 auto; height: auto; max-height: none; min-height: 100dvh; overflow: visible; }
body.portal main { max-width: none; overflow: visible; flex: none; }

@media (max-width: 1100px) {
  body.app:not(.chat-embed):not(.portal):not(.crm-embed) {
    grid-template-columns: var(--nav-w) minmax(0, 1fr);
  }
  body.agent-open:not(.chat-embed):not(.portal):not(.crm-embed) {
    grid-template-columns: var(--nav-w) minmax(0, 1fr) minmax(22rem, 42vw);
  }
}

@media (max-width: 860px) {
  body.app:not(.chat-embed):not(.portal):not(.crm-embed) {
    grid-template-columns: minmax(0, 1fr);
  }
  body.agent-open:not(.chat-embed):not(.portal):not(.crm-embed) {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidenav {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(18rem, 86vw);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.16s ease;
  }
  body.nav-open .sidenav { transform: none; box-shadow: 16px 0 40px rgba(0,0,0,0.18); }
  .nav-toggle { display: inline-flex; }
  .topbar-hint { display: none; }
  .agent-dock {
    position: fixed;
    inset: auto 0.75rem 0.75rem auto;
    height: auto;
    width: auto;
    background: transparent;
    border: 0;
    z-index: 80;
  }
  body:not(.agent-open) .agent-fab {
    display: inline-flex;
    writing-mode: horizontal-tb;
    transform: none;
    width: auto;
    height: auto;
    border-radius: 999px;
    padding: 0.7rem 1.1rem;
    box-shadow: var(--shadow);
  }
  body.agent-open .agent-dock {
    inset: 0.5rem;
    width: auto;
    height: auto;
  }
  body.agent-open .agent-panel {
    height: calc(100dvh - 1rem);
    max-height: calc(100svh - 1rem);
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .form-grid { grid-template-columns: 1fr; }
  .jump { max-width: none; }
  .flash { left: 1rem; right: 1rem; bottom: 4.5rem; max-width: none; }
  main { --main-pad-x: 1rem; }
  /* Wide tables scroll inside their card instead of stretching the page. */
  table.slots { display: block; overflow-x: auto; white-space: nowrap; }
  .page-toc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .page-toc a { white-space: nowrap; }
  .page-head-aside { align-items: flex-start; }
  dl.kv { grid-template-columns: 1fr; gap: 0 0; }
  dl.kv dd { margin-bottom: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sidenav { transition: none; }
  .wait-dot { animation: none; }
}

body.docs-shot {
  grid-template-columns: var(--nav-w) minmax(0, 1fr) !important;
}
body.docs-shot #agent-dock { display: none !important; }
body.portal .test-banner,
body.chat-embed .test-banner,
body.crm-embed .test-banner { display: none; }

.labor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}
.labor-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.labor-jumps form { margin: 0; }
.labor-reset input[name="confirm"] { max-width: 10rem; }
.labor-reset { grid-template-columns: 12rem auto; justify-content: start; }
ol.playbook {
  margin: 0;
  padding-left: 1.25rem;
}
ol.playbook li { margin: 0.35rem 0; }
@media (max-width: 900px) {
  .labor-grid { grid-template-columns: 1fr; }
}

/* Sektion-Navigation als "Blase" (nur auf Origination-/Portfolio-Unterseiten) */
.subnav-bubble {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  padding: 0.45rem;
  width: fit-content;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.subnav-bubble a {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.subnav-bubble a:hover { color: var(--accent); }
.subnav-bubble a.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
