/* Application stylesheet. Layers: tokens -> base -> layout -> components. No framework, no build step.
   Colour tokens keep WCAG 2.1 AA contrast: brand green is never used for text; primary green carries white text. */

/* ---------- Tokens ---------- */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/atkinson-hyperlegible-next-5.3.0/atkinson-hyperlegible-next-latin-ext-400-normal.bcad3501e62c.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/atkinson-hyperlegible-next-5.3.0/atkinson-hyperlegible-next-latin-400-normal.e8da57bc0c3d.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../vendor/atkinson-hyperlegible-next-5.3.0/atkinson-hyperlegible-next-latin-ext-700-normal.521d9348d7ad.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../vendor/atkinson-hyperlegible-next-5.3.0/atkinson-hyperlegible-next-latin-700-normal.617b4197a93a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-brand: #50a833;          /* logo green: graphics and accents only, 3.0:1 on white */
  --color-primary: #407d2c;        /* buttons and links, 5.0:1 with white text */
  --color-primary-hover: #346d22;
  --color-primary-soft: #e8f2e3;
  --color-text: #212326;
  --color-text-muted: #434549;
  --color-border-input: #8a8d91;   /* 3.3:1, form control borders */
  --color-border: #dddddd;         /* decorative dividers only */
  --color-danger: #b02a37;
  --color-danger-soft: #fbeaec;
  --color-warning: #7a5600;
  --color-warning-soft: #fff4d6;
  --color-env-1: #ffe08a; --color-env-2: #ffd25e;  /* PRO-06 banner stripes; text 9.5:1 on the darker stripe */
  --color-env-text: #3d2b00; --color-env-border: #b7791f;
  --color-info-soft: #e9f1fb;
  --color-focus: #212326;
  --color-bg: #f2f3f5;
  --color-script-bg: #e9f1fb; --color-script-border: #c3d5ec;
  --color-call-bg: #eef6ea; --color-call-border: #b9d8ab;
  --color-history-bg: #f7f8f9; --color-history-border: #e1e3e6;
  --color-surface: #ffffff;

  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-size-ui: 15px;
  --radius: 6px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --topbar-height: 56px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--font-size-ui); }
body {
  margin: 0; font-family: var(--font-body); line-height: 1.5; color: var(--color-text); background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--space-3); text-wrap: balance; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-primary); text-underline-offset: 2px; }
a:hover { color: var(--color-primary-hover); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.num, td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--color-text-muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-2); top: -40px; background: var(--color-surface); padding: var(--space-2); z-index: 10; }
.skip-link:focus { top: var(--space-2); }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: var(--topbar-height); padding: 0 var(--space-4); background: var(--color-surface);
  border-bottom: 3px solid var(--color-brand);
}
.topbar .brand { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text); text-decoration: none; }
.topbar .brand img { height: 34px; width: auto; }
.topbar .brand .app-name { font-weight: 700; }
.topbar nav { display: flex; gap: var(--space-4); align-items: center; }
.topbar .user { display: flex; gap: var(--space-3); align-items: center; color: var(--color-text-muted); }
/* NEF-10: main navigation right after the name; the menu under the user's name holds the rest. */
.topbar .brand { flex: 0 0 auto; }
.topbar .mainnav { flex: 1 1 auto; gap: var(--space-4); min-width: 0; }
.mainnav a, .usermenu-nav a { color: var(--color-text); text-decoration: none; padding: var(--space-1) 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.mainnav a:hover, .usermenu-nav a:hover { color: var(--color-primary); }
.mainnav a[aria-current="page"] { color: var(--color-primary); font-weight: 700; border-bottom-color: var(--color-primary); }
.usermenu-nav a[aria-current="page"] { color: var(--color-primary); font-weight: 700; }
.topbar .user { flex: 0 0 auto; white-space: nowrap; }
.acting-form { display: inline-flex; margin: 0; }
.acting-chip { cursor: pointer; font: inherit; font-size: .9em; min-height: 0; padding: 0 .55em; }
.acting-chip:hover { background: var(--color-env-1); }
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .3em; padding: var(--space-1) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-text); }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover, .usermenu[open] > summary { border-color: var(--color-border-input); background: var(--color-bg); }
.usermenu-caret { font-size: .8em; }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 20; min-width: 15rem; max-width: 90vw;
  display: flex; flex-direction: column; align-items: stretch; padding: var(--space-2) 0; background: var(--color-surface);
  border: 1px solid var(--color-border-input); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  white-space: normal;
}
.usermenu-panel > a, .usermenu-panel .usermenu-item, .usermenu-nav a {
  display: block; width: 100%; padding: var(--space-2) var(--space-4); text-align: left; color: var(--color-text);
  text-decoration: none; background: none; border: none; border-radius: 0; font: inherit; font-weight: 400; min-height: 0;
}
.usermenu-panel > a:hover, .usermenu-panel .usermenu-item:hover, .usermenu-panel .usermenu-item:focus-visible,
.usermenu-panel > a:focus-visible { background: var(--color-bg); color: var(--color-primary); }
.usermenu-panel form { margin: 0; }
.usermenu-role { margin: 0; padding: var(--space-1) var(--space-4) var(--space-2); color: var(--color-text-muted); font-size: .9rem; border-bottom: 1px solid var(--color-border); }
.usermenu-label { margin: var(--space-2) 0 0; padding: var(--space-1) var(--space-4) 0; color: var(--color-text-muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--color-border); }
.usermenu-nav { display: none; }  /* copies of the main navigation, only on narrow screens */
@media (max-width: 900px) {  /* the main navigation moves into the menu under the name */
  .topbar .mainnav { display: none; }
  .usermenu-nav { display: block; border-bottom: 1px solid var(--color-border); padding-bottom: var(--space-1); margin-bottom: var(--space-1); }
}
@media (max-width: 600px) {  /* narrow screens: the user's links wrap instead of widening the page */
  .topbar { flex-wrap: wrap; padding-top: var(--space-2); padding-bottom: var(--space-2); }
  .topbar .user { flex-wrap: wrap; gap: var(--space-1) var(--space-3); min-width: 0; overflow-wrap: anywhere; white-space: normal; }
}
/* NEF-08: the top bar stays in view while the page scrolls (internal pages above the width where it wraps; the
   processing page pins its own work bar instead). Anchors and scrolled-to elements land below it. */
/* PRO-06: outside production a striped banner opens every page and a chip follows the application name, so the
   pinned top bar keeps the mark in view after the banner scrolls away. Never shown in production. */
.env-banner {
  padding: var(--space-1) var(--space-4); text-align: center; font-weight: 700; color: var(--color-env-text);
  background: repeating-linear-gradient(-45deg, var(--color-env-1) 0 14px, var(--color-env-2) 14px 28px);
  border-bottom: 2px solid var(--color-env-border);
}
.env-chip {
  display: inline-block; margin-left: var(--space-2); padding: 1px var(--space-2); border-radius: var(--radius);
  background: var(--color-warning); color: #ffffff; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em;
}
@media (min-width: 601px) {
  .topbar-pinned { position: sticky; top: 0; z-index: 6; }
  html:has(.topbar-pinned) { scroll-padding-top: calc(var(--topbar-height) + var(--space-3)); }
}
.page { max-width: 1180px; margin: var(--space-5) auto; padding: 0 var(--space-4); }
.page-narrow { max-width: 520px; }
.footer { padding: var(--space-4); color: var(--color-text-muted); font-size: .85rem; text-align: center; min-height: var(--footer-height); }
/* Sticky panels end above the footer: at the bottom of the page their column ends there and pushes them up, which
   must not bring their top under the pinned top bar (NEF-08). */
:root { --footer-height: calc(2 * var(--space-4) + 1.3rem); }

/* F1 browsing: work list | read-only customer card. */
.browse { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4); align-items: start; }
.browse > * { min-width: 0; }
.card-column { display: flex; flex-direction: column; gap: var(--space-4); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3) var(--space-5); }
.card-head h1 { margin: 0; }
.card-head p { margin: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); }
@media (max-width: 900px) { .browse { grid-template-columns: minmax(0, 1fr); } }
/* Wide screens: the work list scrolls on its own beside the card and stays in view (SEZ-10). */
@media (min-width: 901px) {
  .list-panel { position: sticky; top: calc(var(--topbar-height) + var(--space-4)); display: flex; flex-direction: column;
    max-height: calc(100vh - var(--topbar-height) - 3 * var(--space-4) - var(--footer-height)); }
  .list-panel > * { flex: none; }
  .list-panel > .customer-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    border-top: 1px solid var(--color-border); margin-top: var(--space-2); }
}

/* F1 processing: the whole width for one customer; the action bar stays visible. */
.workbar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: var(--space-3) var(--space-5); padding: var(--space-3) var(--space-5); background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.workbar-who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); min-width: 0; }
.workbar-who h1 { margin: 0; font-size: 1.4rem; }
.workbar-who p { margin: 0; font-size: .9rem; }
.workbar-actions { display: flex; gap: var(--space-3); align-items: center; }
.chip-active { padding: 3px 10px; border-radius: 999px; background: var(--color-primary-soft); color: #2f5c20; border: 1px solid #9cc68a; font-weight: 700; font-size: .85rem; }
.process { display: flex; flex-wrap: wrap; gap: var(--space-5); padding: var(--space-5); align-items: flex-start; }
.process-info { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.section-title { margin: var(--space-1) 0 0; font-size: 1.1rem; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-1) var(--space-5); font-size: .95rem; }

/* Zones: one background per kind of content. */
.zone-script { background: var(--color-script-bg); border: 1px solid var(--color-script-border); border-radius: var(--radius); padding: var(--space-2) var(--space-4); }
.zone-script summary { color: #1f3f66; }
.zone-call {
  flex: 1 1 380px; min-width: 0; display: grid; gap: var(--space-4); align-self: flex-start;
  background: var(--color-call-bg); border: 1px solid var(--color-call-border); border-radius: var(--radius); padding: var(--space-4) var(--space-5);
}
.zone-call h2 { margin: 0; color: #2f5c20; }
.zone-history { background: var(--color-history-bg); border-color: var(--color-history-border); }
.history { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-1); font-size: .9rem; }

/* ---------- Components ---------- */
.panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-4); }
.panel + .panel { margin-top: var(--space-4); }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: var(--space-2) var(--space-4); border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #ffffff; }
.btn-primary:hover { background: var(--color-primary-hover); color: #ffffff; }
.btn-secondary { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary-soft); }
.btn-link { background: none; border: none; color: var(--color-primary); padding: 0; min-height: 0; text-decoration: underline; font-weight: 400; }
.btn-danger { background: var(--color-danger); color: #ffffff; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }

.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.field label, .field legend { font-weight: 700; }
.field .help { color: var(--color-text-muted); font-size: .9rem; }
.choice-list > .help { margin: 0 0 var(--space-2); color: var(--color-text-muted); font-size: .9rem; }
.field .error { color: var(--color-danger); font-size: .9rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 40px; padding: var(--space-2) var(--space-3); font: inherit; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border-input); border-radius: var(--radius);
}
textarea { min-height: 90px; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--color-danger); border-width: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-primary); width: 18px; height: 18px; }
fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-3); margin: 0 0 var(--space-3); }
.choice { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-1) 0; font-weight: 400; }
/* Confirmations of the F2 summary: long texts in GC's wording that wrap; every box sits at its first line and is
   never squeezed. */
.f2-summary .choice { align-items: flex-start; }
.f2-summary .choice > input { flex: none; margin-top: .3em; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 var(--space-3); }
.errorlist { color: var(--color-danger); margin: var(--space-1) 0; padding-left: var(--space-4); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: var(--space-2); border-bottom: 1px solid var(--color-border); vertical-align: top; }
.table th { font-size: .85rem; color: var(--color-text-muted); font-weight: 700; }
.table tr.is-selected td { background: var(--color-primary-soft); }

.badge {
  display: inline-block; padding: 1px var(--space-2); border-radius: 999px; font-size: .8rem; font-weight: 700;
  border: 1px solid currentColor; white-space: nowrap; line-height: 1.4;
}
.badge-ok { color: var(--color-primary); background: var(--color-primary-soft); }
.badge-warn { color: var(--color-warning); background: var(--color-warning-soft); }
.badge-danger { color: var(--color-danger); background: var(--color-danger-soft); }
.badge-neutral { color: var(--color-text-muted); background: var(--color-bg); }

.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius); border-left: 4px solid; margin-bottom: var(--space-4); }
.alert-info { background: var(--color-info-soft); border-color: #2f5f98; }
.alert-success { background: var(--color-primary-soft); border-color: var(--color-primary); }
.alert-warning { background: var(--color-warning-soft); border-color: var(--color-warning); }
.alert-error { background: var(--color-danger-soft); border-color: var(--color-danger); }
.messages { list-style: none; padding: 0; margin: 0 0 var(--space-4); }

.lock-bar { padding: var(--space-2) var(--space-3); border-radius: var(--radius); font-weight: 700; margin-bottom: var(--space-3); }
.lock-bar.mine { background: var(--color-primary-soft); color: var(--color-primary); }
.lock-bar.other { background: var(--color-warning-soft); color: var(--color-warning); }

/* Customer list (panel A) */
.search { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.filters { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.filter-group-label { font-size: .8rem; font-weight: 700; color: var(--color-text-muted); }
.filter { font-size: .85rem; padding: 2px var(--space-2); border: 1px solid var(--color-border-input); border-radius: 999px; color: var(--color-text); text-decoration: none; }
.filter[aria-current="true"] { background: var(--color-primary); border-color: var(--color-primary); color: #ffffff; }
.customer-list { list-style: none; margin: 0; padding: 0; }
.customer-list li a { display: grid; gap: 2px; padding: var(--space-2); border-bottom: 1px solid var(--color-border); color: var(--color-text); text-decoration: none; }
.customer-list li a:hover, .customer-list li a[aria-current="page"] { background: var(--color-primary-soft); }
.customer-list .line { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.customer-list .name { font-weight: 700; min-width: 0; }
/* The status badge keeps its own one-line height even when a long name wraps (flex would stretch it). */
.customer-list .line .badge { flex: none; align-self: flex-start; }
.customer-list .meta { font-size: .85rem; color: var(--color-text-muted); }

dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-4); margin: 0; }
dl.facts dt { color: var(--color-text-muted); }
dl.facts dd { margin: 0; }
details summary { cursor: pointer; font-weight: 700; padding: var(--space-1) 0; }
details > div { padding: var(--space-2) 0 var(--space-2) var(--space-4); }

.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.inline { display: inline; }
.lock-bar form { display: inline; margin-left: var(--space-2); }
.quick-dates { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.btn-small { min-height: 32px; padding: 2px var(--space-2); font-size: .85rem; font-weight: 400; }

/* Installation card with result pills */
.inst { display: grid; gap: var(--space-2); }
.inst-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); align-items: baseline; }
.inst-head h3 { margin: 0; }
.inst-head p, .inst > p { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.chip { padding: 1px var(--space-2); border-radius: 999px; background: var(--color-bg); border: 1px solid #c5c8cc; font-size: .8rem; white-space: nowrap; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; border: none; padding: 0; margin: 0; }
.pill input, .segment input, .choice-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--color-border-input); background: var(--color-surface); cursor: pointer; font-size: .9rem; }
.pill input:checked + span { background: var(--color-primary); border-color: var(--color-primary); color: #ffffff; }
.pill input:focus-visible + span, .segment input:focus-visible + span, .choice-card input:focus-visible + span { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* Call record: who, connection, contextual fields */
.choice-list, .segmented { border: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.choice-list legend, .segmented legend, .field-title { font-weight: 700; padding: 0 0 4px; }
.segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented legend { grid-column: 1 / -1; }
.segment > span, .choice-card > span {
  display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius); border: 1px solid var(--color-call-border);
  background: #f7fbf5; cursor: pointer;
}
.segment input:checked + span, .choice-card input:checked + span { border: 2px solid var(--color-primary); background: var(--color-surface); font-weight: 700; }
.segment-off span { color: var(--color-text-muted); border-style: dashed; cursor: not-allowed; }
.choice-card small { color: var(--color-text-muted); font-weight: 400; }
.inset { background: var(--color-surface); border: 1px solid var(--color-call-border); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.chip-button { padding: 1px var(--space-2); border-radius: 999px; border: 1px solid var(--color-border-input); background: var(--color-surface); font: inherit; font-size: .8rem; cursor: pointer; }
.btn-large { min-height: 48px; padding: 0 var(--space-6); font-size: 1.1rem; }
.btn-block { width: 100%; min-height: 44px; }
.contact-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.contact-stats { text-align: right; font-size: .9rem; }

/* Contextual fields appear only with the choice that needs them; without :has() support they all stay visible. */
@supports selector(:has(*)) {
  .when { display: none; }
  .zone-call:has(input[name="outcome"][value="call_later"]:checked) .when-date,
  .zone-call:has(input[name="outcome"][value="no_answer"]:checked) .when-date,
  .zone-call:has(input[name="outcome"][value="no_answer"]:checked) .when-mail,
  .zone-call:has(input[name="outcome"][value="wrong_contact"]:checked) .when-wrong,
  .zone-call:has(input[name="contact"][value="new"]:checked) .when-new-person,
  .zone-call:has(input[name="outcome"][value="call_later"]:checked) .when-after-call,
  .process:has(input[name="outcome"][value="connected"]:checked):has(.inst input[value="needs_info"]:checked) .when-after-call,
  .process:has(input[name="outcome"][value="connected"]:checked):has(.inst input[value="later"]:checked) .when-after-call,
  .process:has(input[name="outcome"][value="connected"]:checked):has(.inst input[value="needs_info"]:checked) .when-handover,
  .inst:has(input[value="needs_info"]:checked) .when-reason,
  .inst:has(input[value="not_interested"]:checked) .when-reason,
  .inst:has(input[value="other"]:checked) .when-reason,
  .inst:has(input[value="later"]:checked) .when-follow,
  .inst:has(input[value="other_person"]:checked) .when-follow,
  .inst:has(input[value="other_person"]:checked) .when-person,
  .inst:has(select.other-contact option[value="new"]:checked) .when-other-new { display: grid; }
}

/* Public F2: one column, progress list, locked values, price table */
.f2-main { max-width: 760px; margin: 0 auto; padding: var(--space-4); display: grid; gap: var(--space-4); }
.f2 .field input:not([type=checkbox]):not([type=radio]), .f2 .field select, .f2 .field textarea { width: 100%; }
.f2-progress ol { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); list-style: none; margin: 0; padding: 0; font-size: .9rem; color: var(--color-text-muted); counter-reset: step; }
.f2-progress li { counter-increment: step; }
.f2-progress li::before { content: counter(step) ". "; }
.f2-progress li.done { color: var(--color-text); }
.f2-progress li.current { color: var(--color-text); font-weight: 700; text-decoration: underline; }
.f2-actions { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.field-title { font-weight: 700; display: block; }
.locked { display: block; padding: var(--space-1) 0; font-weight: 700; }
.locked-list, .recap { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-3); }
.locked-list dt, .recap dt { color: var(--color-text-muted); }
.locked-list dd, .recap dd { margin: 0; }
.required { color: var(--color-danger); }
.mode { padding: var(--space-2) var(--space-3); border-radius: var(--radius); border: 1px solid; }
.mode-order { background: var(--color-primary-soft); border-color: #9cc68a; }
.mode-inquiry { background: #fff4d6; border-color: #e0b84c; }
.price-table td.num, .price-table th.num { text-align: right; white-space: nowrap; }
.price-table tbody th { font-size: 1rem; color: var(--color-text); }
.price-name { display: block; font-weight: 700; }
.price-desc { display: block; margin-top: 2px; font-size: .85rem; font-weight: 400; color: var(--color-text-muted); }
.price-table td.price-gross { font-weight: 700; }
@media (max-width: 600px) {  /* phones: each payment is a block, its three amounts listed under the description */
  .price-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .price-table, .price-table tbody, .price-table tr, .price-table tbody th, .price-table td { display: block; }
  .price-table tr { padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
  .price-table tbody th, .price-table td { padding: 0; border: 0; }
  .price-table tbody th { margin-bottom: var(--space-1); }
  .price-table td.num { display: flex; justify-content: space-between; gap: var(--space-3); padding: 2px 0; }
  .price-table td.num::before { content: attr(data-label); font-weight: 400; color: var(--color-text-muted); }
}
.document { max-height: 18rem; overflow: auto; padding: var(--space-2); border: 1px solid var(--color-border); background: var(--color-bg); }
.mail-preview { white-space: pre-wrap; font-family: inherit; background: var(--color-bg); padding: var(--space-3); border-radius: var(--radius); }
.f2-steps { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); margin-top: var(--space-2); font-size: .85rem; }
.f2-steps-title { font-weight: 700; }
.f2-steps ol { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin: 0; padding: 0; list-style: none; }
.f2-steps li { white-space: nowrap; }
.f2-steps li + li::before { content: "→"; margin-right: var(--space-2); color: var(--color-text-muted); }
.f2-steps .num { color: var(--color-text-muted); }
.f2-steps li.pending { color: var(--color-text-muted); }
.f2-steps-link { margin: 0; }
/* ODE-07: an e-mail that has not left - hint next to its state, highlighted rows in the overviews. */
.mail-hint { font-size: .85rem; color: var(--color-danger); }
.resend-form { display: inline-block; margin: 0 0 0 var(--space-2); vertical-align: middle; }
.resend-button { margin: 0 0 0 var(--space-2); vertical-align: middle; }
.f2-steps li.has-mail { white-space: normal; }
.f2-steps .mail-hint { display: block; }
.row-problem > td { background: var(--color-danger-soft); }
/* Empty F2 for sales (UZI-03): the link just created is highlighted; links wrap instead of widening the table. */
.row-new > td { background: var(--color-primary-soft); }
.link-cell { overflow-wrap: anywhere; min-width: 16rem; }
.empty-link-form { max-width: 32rem; }
.filter-action { font-size: .85rem; margin-left: var(--space-2); }
.mail-alert { margin: var(--space-2) 0; }
.mail-cell { font-size: .85rem; white-space: nowrap; }
.mail-problems { border-top: 4px solid var(--color-danger); }
@supports selector(:has(*)) {
  .f2 .when-ico-wrong, .f2 .when-address, .f2 .when-sw-other { display: none; }
  .f2 form:has(input[name="ico_wrong"]:checked) .when-ico-wrong,
  .f2 form:has(input[name="address_mismatch"]:checked) .when-address,
  .f2 form:has(select[name="sw_choice"] option[value="other"]:checked) .when-sw-other { display: block; }
  .f2 form:has(input[name="technical_same"]:checked) .when-technical { display: none; }
}

/* Problem report dialog over the page (HLA-03, HLA-05) and the report list (HLA-02). */
.report-dialog {
  width: min(1000px, calc(100vw - 2 * var(--space-4))); max-height: calc(100vh - 2 * var(--space-4)); overflow: auto;
  padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text);
}
.report-dialog::backdrop { background: rgba(33, 35, 38, .45); }
.report-form { padding: var(--space-4) var(--space-5); }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.report-head h2 { margin: 0 0 var(--space-3); }
.report-head-links { display: flex; gap: var(--space-4); align-items: baseline; }
.report-question { background: var(--color-info-soft); border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.report-question p { margin: 0; }
.report-question .actions { margin-top: var(--space-2); }
.report-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.report-tools .btn { background: var(--color-surface); border-color: var(--color-border-input); color: var(--color-text); }
.report-tools .btn[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-primary); color: #ffffff; }
.report-tools-gap { flex: 1 1 var(--space-4); }
.report-text-tool { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.report-text-tool input { flex: 1 1 220px; width: auto; }
.report-canvas { display: block; max-width: 100%; max-height: 55vh; width: auto; height: auto; border: 1px solid var(--color-border-input); cursor: crosshair; touch-action: none; }
.report-file-label { color: var(--color-primary); text-decoration: underline; cursor: pointer; }
.report-file-label:focus-within { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.report-file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.report-alt { font-size: .9rem; }
.report-status:empty { display: none; }
.report-status.error { color: var(--color-danger); font-weight: 700; }
.report-toast { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 20; max-width: 380px; margin: 0; }
.report-thumb { display: block; max-width: 280px; height: auto; border: 1px solid var(--color-border); }
.report-description { white-space: pre-wrap; margin: 0; }

/* Calls with one person in the contact row (HOV-19): closed it is the right-hand summary, open it takes the row. */
.contact-calls > summary { font-weight: 400; list-style: none; }
.contact-calls > summary::-webkit-details-marker { display: none; }
.contact-calls > summary strong { text-decoration: underline; text-decoration-color: var(--color-primary); text-underline-offset: 3px; }
.contact-calls > summary strong::after { content: " ▸"; color: var(--color-primary); }
.contact-calls[open] { flex-basis: 100%; }
.contact-calls[open] > summary strong::after { content: " ▾"; }
.contact-calls .history { margin-top: var(--space-2); }
.call-note { white-space: pre-wrap; }

/* Processing: unsaved call record and its guard (HOV-20). */
.workbar-actions > [data-report-open] { order: 0; }
.workbar-actions > .workbar-end { order: 1; }
.workbar-actions > .workbar-save { order: 2; }
.unsaved-bar { border-left-width: 6px; }
.unsaved-bar p { margin: 0 0 var(--space-2); }
.unsaved-bar .actions { margin-top: 0; }
.date-input { max-width: 12rem; }
.when-not-connected { display: none; margin: 0 0 var(--space-2); color: var(--color-warning); font-weight: 700; }
/* A warning that does not block saving: the look of the line above (HOV-03, HOV-13). */
.field-warning { margin: var(--space-1) 0 0; color: var(--color-warning); font-weight: 700; }
@supports selector(:has(*)) {
  /* A result per installation is recorded only for a connected call: with another outcome the choice is dimmed and
     the reason shown (the server refuses such a record, it is not dropped silently). */
  .process:has(input[name="outcome"]:checked):not(:has(input[name="outcome"][value="connected"]:checked)) .inst .pills { opacity: .5; }
  .process:has(input[name="outcome"]:checked):not(:has(input[name="outcome"][value="connected"]:checked)) .when-not-connected { display: block; }
}

/* Customer card and processing head: a clear head with the status, coloured results. */
.customer-head { border-left: 6px solid var(--color-brand); background: linear-gradient(90deg, var(--color-primary-soft), var(--color-surface) 55%); }
.customer-head h1 { font-size: 1.6rem; line-height: 1.2; }
.workbar-who h1 { font-size: 1.35rem; line-height: 1.2; margin: 0; }
.head-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.badge-info { color: #1f4f86; background: var(--color-info-soft); }
.badge-lg { font-size: .9rem; padding: 2px 10px; }
.chip-ok { color: #2f5c20; background: var(--color-primary-soft); border-color: #9cc68a; }
.chip-info { color: #1f4f86; background: var(--color-info-soft); border-color: #a9c3e3; }
.chip-warn { color: var(--color-warning); background: var(--color-warning-soft); border-color: #e3c77a; }
.sw-field { margin: var(--space-3) 0; }
.sw-field input { max-width: 16rem; }
h2 .count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: var(--space-1); border-radius: 999px; background: var(--color-bg); color: var(--color-text-muted); font-size: .8rem; text-align: center; vertical-align: middle; }
.card-grid { align-items: stretch; }
.card-grid > .panel { margin-top: 0; }  /* the general ".panel + .panel" gap pushed the second box down */
.inst-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.inst-item { display: grid; gap: var(--space-1); padding: var(--space-3); border: 1px solid var(--color-border); border-left: 4px solid var(--color-brand); border-radius: var(--radius); }
.inst-item-gc { border-left-color: #c5c8cc; background: var(--color-bg); }
.inst-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.phone { font-variant-numeric: tabular-nums; font-weight: 700; }
.card-grid .contact-stats, .card-grid .contact-calls > summary { text-align: left; }

/* Processing page layout (report 20): status row on top, one customer head, parking lots that read as places. */
.workbar { background: #1f3b2a; border-bottom: 3px solid var(--color-brand); color: #ffffff; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.workbar a { color: #ffffff; }
.workbar a:hover { color: #d9efcf; }
.back-link { display: inline-flex; align-items: center; padding: 6px 14px; border: 2px solid #ffffff; border-radius: var(--radius); font-weight: 700; text-decoration: none; }
.back-link:hover { background: rgba(255, 255, 255, .12); }
.workbar-name { font-weight: 700; font-size: 1.05rem; }
.workbar .chip-active { background: #2f5c20; color: #ffffff; border-color: #9cc68a; }
.workbar .btn-secondary { background: transparent; color: #ffffff; border-color: #ffffff; }
.workbar .btn-secondary:hover { background: rgba(255, 255, 255, .12); }
.workbar .btn-primary { background: var(--color-brand); color: #10230a; }
.workbar .btn-primary:hover { background: #64bd45; color: #10230a; }
.workbar :focus-visible { outline-color: #ffffff; }
.process-head h1 { margin: 0; }
.process-head .facts-grid { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
.section-hint { font-size: .85rem; font-weight: 400; margin-left: var(--space-2); }
.section-action { margin-left: var(--space-3); font-size: .9rem; font-weight: 400; white-space: nowrap; }
.inst { border-left: 6px solid #c5c8cc; padding-top: 0; overflow: hidden; }
.inst-badge-ok { border-left-color: var(--color-primary); }
.inst-badge-info { border-left-color: #2f6cb3; }
.inst-badge-warn { border-left-color: #c58a00; }
.inst-badge-danger { border-left-color: var(--color-danger); }
.inst-gc { background: var(--color-bg); }
.inst-band { display: flex; align-items: center; gap: var(--space-3); margin: 0 calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4); background: #f3f6fa; border-bottom: 1px solid #dfe5ec; }
.parking-sign { flex: none; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 6px; background: #1f5fae; color: #ffffff; font-weight: 800; font-size: 1.5rem; box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 1px #1f5fae; }
.inst-title { flex: 1; min-width: 0; }
.inst-title h3 { margin: 0; font-size: 1.15rem; }
.inst-title p { margin: 0; color: var(--color-text-muted); }
.inst-index { font-size: .8rem; font-weight: 400; color: var(--color-text-muted); margin-left: var(--space-1); }
.inst-who { margin: 0; }
.result-pills { padding: var(--space-3); background: #fafbfc; border: 1px solid var(--color-border); border-radius: var(--radius); }
.result-legend { float: left; width: 100%; padding: 0 0 var(--space-2); font-weight: 700; font-size: .9rem; }
/* The chosen result shows its meaning; "not discussed" is neutral, not a success colour. */
.pill input:checked + span { background: #5b6068; border-color: #5b6068; color: #ffffff; }
.pill input[value="interested"]:checked + span { background: var(--color-primary); border-color: var(--color-primary); }
.pill input[value="needs_info"]:checked + span, .pill input[value="other_person"]:checked + span { background: #2f6cb3; border-color: #2f6cb3; }
.pill input[value="later"]:checked + span { background: #8a5d00; border-color: #8a5d00; }
.pill input[value="not_interested"]:checked + span { background: var(--color-danger); border-color: var(--color-danger); }
.zone-call .zone-script { background: var(--color-surface); }

/* Planned contacts under the customer head (HOV-21). */
.planned { margin-top: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid #e0b84c; border-radius: var(--radius); background: #fffaf0; }
.planned-title { font-weight: 700; font-size: .9rem; }
.planned ul { list-style: none; margin: var(--space-1) 0 0; padding: 0; display: grid; gap: var(--space-1); }
.planned .badge { margin-right: var(--space-1); }

/* Missing person or outcome, marked where the operator works (report 22). */
.has-error { outline: 3px solid var(--color-danger); outline-offset: 6px; border-radius: var(--radius); }
.field-error { margin: 0 0 var(--space-1); color: var(--color-danger); font-weight: 700; }
.segmented .field-error { grid-column: 1 / -1; }
.call-error-summary { margin: 0; padding: var(--space-2) var(--space-3); border-left: 4px solid var(--color-danger); border-radius: var(--radius); background: var(--color-danger-soft); color: var(--color-danger); font-weight: 700; }
.call-error-summary p { margin: 0; }
.call-error-summary ul { margin: var(--space-1) 0 0; padding-left: var(--space-4); font-weight: 400; }
.call-error-summary ul:empty { display: none; }
.form-grid > .field-error { grid-column: 1 / -1; }

/* Required fields of a choice (HOV-22): a marker next to the label; a date only for the choice that needs it. */
.req { margin-left: var(--space-1); color: var(--color-danger); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
@supports selector(:has(*)) {
  .req-later, .req-call-later { display: none; }
  .inst:has(input[value="later"]:checked) .req-later,
  .zone-call:has(input[name="outcome"][value="call_later"]:checked) .req-call-later { display: inline; }
}

/* Installation data in F1 (INS-02, INS-03, INS-07): evidence values, proposals shown with their mark. */
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); }
.facts-list dt { color: var(--color-text-muted); }
.facts-list dd { margin: 0; }
.inst-form fieldset { margin: 0 0 var(--space-4); }
.inst-form .segmented > .help { grid-column: 1 / -1; margin: 0; }
@supports selector(:has(*)) {
  .inst-form .when-address, .inst-form .when-identifiers { display: none; }
  .inst-form form:has(input[name="address_mismatch"]:checked) .when-address,
  .inst-form form:has(input[name="identifiers_mismatch"]:checked) .when-identifiers { display: block; }
}
.inst-notes { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: center; margin: var(--space-1) 0; font-size: .9rem; }
.inst-notes form { display: inline; }
.inst-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: .9rem; }

/* Active search above the list (SEZ-03): what is searched and how to leave it. */
.search-state { margin: 0; font-size: .9rem; }
.search-cancel { margin-left: var(--space-2); white-space: nowrap; }
.start-form { display: grid; justify-items: end; gap: var(--space-1); }
.start-form .help { margin: 0; color: var(--color-text-muted); font-size: .9rem; }

/* Call record restored from the browser after leaving the page (NEF-04). */
.draft-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.draft-bar p { margin: 0; }

/* F2 link: e-mail added for a person right where the link is sent. */
@supports selector(:has(*)) {
  .send-form .when-other { display: none; }
  .send-form:has(select[name="recipient"] option[value="jiny"]:checked) .when-other { display: grid; }
}

/* People at an installation (HOV-24): who answers for it, how to reach them, call and edit from the card. */
.inst-people { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.inst-person {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; gap: var(--space-1) var(--space-3);
  align-items: center; padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface);
}
.inst-person-reach { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3); min-width: 0; }
.inst-person-phone { font-weight: 700; font-size: 1.05rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inst-person-mail { color: var(--color-text-muted); font-size: .9rem; overflow-wrap: anywhere; }
.inst-person-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); white-space: nowrap; font-size: .9rem; }
.inst-person-actions .btn { cursor: pointer; }
.inst-person-calling { display: none; }
.inst-person.is-calling { border: 2px solid var(--color-primary); background: var(--color-primary-soft); }
.inst-person.is-calling .inst-person-calling { display: inline-block; }
.inst-person.is-calling [data-call-pick] { display: none; }
.inst-person-none { padding: var(--space-1) 0; }
@media (max-width: 760px) { .inst-person { grid-template-columns: minmax(0, 1fr); } .inst-person-actions { justify-content: flex-start; } }

/* Only the installations of the chosen person (on screen only; hidden cards are still sent). */
.person-filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-call-border); border-radius: var(--radius); background: var(--color-call-bg);
}
.person-filter .choice { margin: 0; }
.inst.is-filtered-out { display: none; }

/* The people of the call record fold to the chosen one; the change button opens the list again. */
.person-chosen {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border: 2px solid var(--color-primary); border-radius: var(--radius); background: var(--color-surface);
}
.choice-list.is-folded > .choice-card, .choice-list.is-folded > .help, .choice-list.is-folded > .person-search { display: none; }
.person-search { width: 100%; }

/* Wide screens: the call record stays beside the installations while they scroll; anchored cards clear the bar. */
.inst { scroll-margin-top: calc(var(--workbar-height, 72px) + var(--space-3)); }
@media (min-width: 1180px) {
  .zone-call {
    position: sticky; top: calc(var(--workbar-height, 72px) + var(--space-3));
    max-height: calc(100vh - var(--workbar-height, 72px) - 2 * var(--space-3)); overflow-y: auto; overscroll-behavior: contain;
  }
}

/* Phone numbers and e-mail addresses copy with a click (NEF-07): plain text, a hint on hover and focus. */
.copy { cursor: copy; border-radius: 3px; }
.copy:hover, .copy:focus-visible { text-decoration: underline dotted; text-underline-offset: 3px; background: var(--color-primary-soft); }
.copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.copy-toast {
  position: fixed; left: 50%; bottom: var(--space-5); transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 2 * var(--space-4));
  padding: var(--space-2) var(--space-4); border-radius: var(--radius); background: #1f3b2a; color: #ffffff; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

/* ---------- Documents for testers (HLA-07, test environments only): overview, guide, test scenarios ----------
   The document bodies come from outside the application as HTML fragments built from these classes. */
/* Contents column + a text column of about 54rem, centred; header, contents and body form one grid. */
.page-docs { max-width: calc(70rem + var(--space-6) + 2 * var(--space-4)); }
.doc-crumbs { font-size: .9rem; color: var(--color-text-muted); margin-bottom: var(--space-4); }
.doc-crumbs a { font-weight: 700; }
.doc-header { display: grid; gap: var(--space-3); margin-bottom: var(--space-6); }
.doc-header > * { margin: 0; }
.doc-header h1 { font-size: 2rem; }
.doc-kicker { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-primary); }
.doc-lead { font-size: 1.1rem; color: var(--color-text-muted); }

.doc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 700px) { .doc-list { grid-template-columns: minmax(0, 1fr); } }
.doc-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); height: 100%; padding: var(--space-5);
  background: var(--color-surface); border: 1px solid var(--color-border); border-top: 4px solid var(--color-brand);
  border-radius: var(--radius); color: var(--color-text); text-decoration: none;
}
.doc-tile:hover { color: var(--color-text); border-color: var(--color-primary); box-shadow: 0 2px 10px rgb(0 0 0 / .08); }
.doc-tile-title { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); line-height: 1.25; }
.doc-tile-summary { color: var(--color-text-muted); }
.doc-tile-open { margin-top: auto; padding-top: var(--space-2); font-weight: 700; color: var(--color-primary); }

.doc-layout {
  display: grid; grid-template-columns: 16rem minmax(0, 1fr); grid-template-areas: "toc header" "toc body";
  gap: var(--space-5) var(--space-6); align-items: start;
}
.doc-layout > .doc-header { grid-area: header; margin-bottom: 0; }
.doc-layout > .doc-toc { grid-area: toc; }
.doc-layout > .doc-body { grid-area: body; }
.doc-toc {
  position: sticky; top: calc(var(--topbar-height) + var(--space-4)); overflow-y: auto;
  max-height: calc(100vh - var(--topbar-height) - 2 * var(--space-4) - var(--space-5) - var(--footer-height));
  font-size: .9rem; padding: 0 var(--space-2) var(--space-4) 0;
}
.doc-toc-title { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 var(--space-2); }
.doc-toc ol { list-style: none; margin: 0; padding: 0; }
.doc-toc > ol > li + li { margin-top: var(--space-2); }
.doc-toc a { display: flex; gap: var(--space-2); padding: 3px var(--space-2); border-radius: var(--radius); color: var(--color-text); text-decoration: none; line-height: 1.35; }
.doc-toc a:hover { background: var(--color-primary-soft); color: var(--color-text); }
.doc-toc > ol > li > a { font-weight: 700; }
.doc-toc ol ol { margin: 2px 0 0 var(--space-3); padding-left: var(--space-1); border-left: 2px solid var(--color-border); }
.doc-toc-num { flex: none; min-width: 1.5em; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 980px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "header" "toc" "body"; }
  .doc-toc { position: static; max-height: none; padding: var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
}

.doc-body { display: grid; gap: var(--space-5); min-width: 0; }
.doc-body [id] { scroll-margin-top: var(--space-2); }
.doc-body ul, .doc-body ol { margin: 0 0 var(--space-3); padding-left: 1.3rem; }
.doc-body li + li { margin-top: var(--space-1); }
.doc-body li > p { margin-bottom: var(--space-1); }
.doc-body code { font-size: .92em; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere; }
.doc-section, .doc-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-5); min-width: 0; }
.doc-section > :last-child, .doc-card > :last-child, .doc-callout > :last-child, .doc-part-intro > :last-child { margin-bottom: 0; }
.doc-section > h2 { font-size: 1.35rem; margin-bottom: var(--space-4); }
.doc-section h3 { font-size: 1.05rem; margin: var(--space-5) 0 var(--space-2); }
.doc-section-warn { background: var(--color-warning-soft); border-color: var(--color-border); border-left: 4px solid var(--color-warning); }

.doc-part { display: grid; gap: var(--space-4); min-width: 0; }
.doc-part > h2 { display: flex; align-items: center; gap: var(--space-3); font-size: 1.45rem; margin: var(--space-4) 0 0; }
.doc-part-letter {
  flex: none; display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: var(--radius);
  background: var(--color-primary); color: #fff; font-size: 1.15rem;
}
.doc-part-intro { color: var(--color-text-muted); }

.doc-card { border-top: 4px solid var(--color-brand); }
.doc-card > h3 { display: flex; align-items: flex-start; gap: var(--space-3); font-size: 1.2rem; margin-bottom: var(--space-4); }
.doc-num {
  flex: none; display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 6px; border-radius: 999px;
  background: var(--color-primary-soft); color: var(--color-primary); border: 1px solid var(--color-primary);
  font-size: .95rem; font-variant-numeric: tabular-nums; margin-top: -3px;
}
.doc-meta { display: grid; gap: var(--space-2); margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); background: var(--color-bg); border-radius: var(--radius); }
.doc-meta > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: var(--space-4); }
.doc-meta dt { font-weight: 700; color: var(--color-text-muted); }
.doc-meta dd { margin: 0; }
.doc-meta > .is-wait { margin: 0 calc(-1 * var(--space-2)); padding: var(--space-2); border-radius: var(--radius); background: var(--color-warning-soft); }
.doc-meta > .is-wait dt { color: var(--color-warning); }
@media (max-width: 600px) { .doc-meta > div { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.doc-body .doc-label { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); margin: var(--space-5) 0 var(--space-2); }
.doc-body .doc-steps, .doc-body .doc-checks { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.doc-body .doc-steps > li, .doc-body .doc-checks > li { position: relative; padding-left: 2.4rem; }
.doc-body .doc-steps > li + li, .doc-body .doc-checks > li + li { margin-top: var(--space-2); }
.doc-step-n {
  position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 999px;
  background: var(--color-surface); border: 1px solid var(--color-border-input); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.doc-checks > li::before {
  content: "✓"; position: absolute; left: .3rem; top: 0; width: 1.3rem; text-align: center; font-weight: 700; color: var(--color-primary);
}
.doc-refs { font-size: .85rem; color: var(--color-text-muted); border-top: 1px solid var(--color-border); padding-top: var(--space-3); margin: var(--space-4) 0 var(--space-1); }
.doc-report { font-size: .85rem; color: var(--color-text-muted); }
.doc-nowrap { white-space: nowrap; }
.doc-wait-mark { padding: 0 3px; border-radius: 4px; background: var(--color-warning-soft); color: var(--color-warning); font-weight: 700; }
/* Introduction of a document: groups with a small label, marked facts, notes. */
.doc-group + .doc-group { margin-top: var(--space-5); }
.doc-body .doc-group > .doc-label:first-child { margin-top: 0; }
.doc-group > :last-child { margin-bottom: 0; }
.doc-note { color: var(--color-text-muted); font-size: .9rem; }
.doc-body .doc-facts { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.doc-body .doc-facts > li { position: relative; padding-left: 1.4rem; }
.doc-facts > li::before {
  content: ""; position: absolute; left: .4rem; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--color-brand);
}
.doc-callout-warn .doc-facts > li::before { background: var(--color-warning); }
.doc-meta-wide > div { grid-template-columns: 13rem minmax(0, 1fr); }
@media (max-width: 600px) { .doc-meta-wide > div { grid-template-columns: minmax(0, 1fr); } }
.doc-ask {
  padding: 0 3px; border-radius: 4px; background: var(--color-info-soft); color: #1f4f86; font-weight: 700;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

.doc-callout { border-left: 4px solid; border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.doc-callout-warn { background: var(--color-warning-soft); border-color: var(--color-warning); }
.doc-callout-info { background: var(--color-info-soft); border-color: #2f5f98; }
.doc-callout p { margin: 0 0 var(--space-2); }

.doc-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-3) var(--space-5); margin: 0; }
.doc-kv dt { font-weight: 700; }
.doc-kv dd { margin: 0; }
@media (max-width: 600px) { .doc-kv { grid-template-columns: minmax(0, 1fr); gap: 0; } .doc-kv dd { margin-bottom: var(--space-3); } }
.doc-topics { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.doc-body .doc-topics > li { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius); }
.doc-topics strong { display: block; }
.doc-topics .doc-topic-text { color: var(--color-text-muted); }
.doc-topics .doc-topic-links { white-space: nowrap; font-size: .9rem; }
@media (max-width: 600px) { .doc-body .doc-topics > li { grid-template-columns: minmax(0, 1fr); } }

.doc-table { overflow-x: auto; margin: 0 0 var(--space-3); }
.doc-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); }
.doc-table thead th { background: var(--color-bg); font-size: .85rem; color: var(--color-text-muted); }
.doc-versions { font-size: .9rem; }
.doc-versions > summary { cursor: pointer; font-weight: 700; color: var(--color-primary); }
.doc-versions[open] > summary { margin-bottom: var(--space-2); }

/* ---------- GC campaign overview (ADM-03..05) ---------- */
.overview-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-4); }
.overview-head h1 { margin: 0 0 var(--space-1); }
.overview-head p { margin: 0; }
.kicker { margin: 0 0 var(--space-1); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--color-primary); }
.overview-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.campaign-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-2); align-items: end; }
.campaign-picker label { grid-column: 1 / -1; font-weight: 700; font-size: .85rem; }
.campaign-picker select { min-width: 260px; max-width: 420px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); margin: var(--space-4) 0; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 700; }
.stat-note { font-size: .85rem; color: var(--color-text-muted); }
.stat-ok { border-top: 4px solid var(--color-primary); }
.stat-warn { border-top: 4px solid #c99400; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: var(--space-4); margin-top: var(--space-4); align-items: start; }
.overview-grid > .panel { margin-top: 0; }
.overview-grid h2, .funnel-panel h2 { margin: 0; }
.panel-note { margin: var(--space-2) 0 var(--space-3); font-size: .9rem; color: var(--color-text-muted); }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.dist td, .funnel td { vertical-align: middle; }
.dist .dist-bar, .funnel .funnel-bar { width: 32%; }
.funnel tbody th { font-size: 1rem; font-weight: 700; color: var(--color-text); white-space: nowrap; }
.funnel tr.funnel-split th { font-weight: 400; padding-left: var(--space-5); }
.funnel tr.funnel-split th::before { content: "↳ "; color: var(--color-text-muted); }
.meter { display: block; height: 10px; min-width: 60px; background: var(--color-bg); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--color-primary); border-radius: 999px; }
.meter .w-0 { width: 0%; } .meter .w-5 { width: 5%; } .meter .w-10 { width: 10%; } .meter .w-15 { width: 15%; } .meter .w-20 { width: 20%; } .meter .w-25 { width: 25%; } .meter .w-30 { width: 30%; } .meter .w-35 { width: 35%; } .meter .w-40 { width: 40%; } .meter .w-45 { width: 45%; } .meter .w-50 { width: 50%; } .meter .w-55 { width: 55%; } .meter .w-60 { width: 60%; } .meter .w-65 { width: 65%; } .meter .w-70 { width: 70%; } .meter .w-75 { width: 75%; } .meter .w-80 { width: 80%; } .meter .w-85 { width: 85%; } .meter .w-90 { width: 90%; } .meter .w-95 { width: 95%; } .meter .w-100 { width: 100%; }
.legend { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-4); margin: var(--space-3) 0 0; font-size: .9rem; }
.legend dt { font-weight: 700; }
.legend dd { margin: 0; color: var(--color-text-muted); }
.figures { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-3); }
.figures dt { color: var(--color-text-muted); }
.figures dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.figures-title { margin: var(--space-4) 0 var(--space-2); font-size: 1rem; }
@media (max-width: 600px) {
  .legend { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .legend dd { margin-bottom: var(--space-2); }
  .campaign-picker select { min-width: 0; }
  .dist .dist-bar, .funnel .funnel-bar { display: none; }
}

@media print {
  .topbar, .footer, .doc-toc, .doc-crumbs, .skip-link { display: none !important; }
  body { background: #fff; }
  .page-docs { margin: 0; max-width: none; }
  .doc-layout { display: block; }
  .doc-body { max-width: none; }
  .doc-card, .doc-section { border-color: #999; break-inside: auto; }
  .doc-card > h3, .doc-label { break-after: avoid; }
  .doc-versions:not([open]) { display: none; }
}

/* Installations of the campaign for GC: "handled by Green Center" in bulk (PRI-03, PRI-04) */
.gc-inst-head h1 { margin: 0 0 var(--space-1); }
.gc-inst-totals { margin: var(--space-3) 0; font-variant-numeric: tabular-nums; }
.gc-inst-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: var(--space-3); align-items: end; }
.gc-inst-filters .field, .gc-inst-bulk .field { margin: 0; }
.gc-inst-filters .actions { margin: 0; align-items: center; }
.gc-inst-bulk { display: grid; gap: var(--space-3); margin: var(--space-3) 0; max-width: 60rem; }
.gc-inst-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.gc-inst-scope { color: var(--color-text-muted); font-size: .9rem; }
.gc-inst-scope { min-width: 13rem; }
.table-scroll { overflow-x: auto; }
.gc-inst-table td:first-child, .gc-inst-table th:first-child { width: 2.5rem; }
.gc-inst-table label { cursor: pointer; }
.row-gc > td { background: var(--color-info-soft); }

/* ---------- Status and questions page for GC (KOM-01..06) ---------- */
.page-status .doc-header { margin-bottom: var(--space-5); }
.status-toc { font-size: .95rem; }
.status-section { margin-bottom: var(--space-6); }
.status-section > h3 { margin-top: var(--space-5); }
.status-diagram { margin: 0 0 var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-3); }
.status-diagram-scroll { overflow-x: auto; }
.status-diagram-scroll img { display: block; width: 100%; min-width: 900px; height: auto; }
.status-diagram figcaption { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; margin-top: var(--space-3); font-size: .9rem; }
.status-diagram figcaption a { margin-left: auto; font-weight: 700; }
.status-key { display: inline-flex; align-items: center; gap: var(--space-2); }
.status-swatch { display: inline-block; width: 26px; height: 14px; border-radius: 4px; border: 1.5px solid; }
.status-swatch-done { background: #e3f1da; border-color: #407d2c; }
.status-swatch-partial { background: #fff0c4; border-color: #b7791f; }
.status-swatch-people { background: #eceff3; border-color: #66717e; border-style: dashed; }
.status-swatch-open { background: #fde4f0; border-color: #c2185b; }
.status-phases { width: 100%; border-collapse: collapse; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.status-phases th, .status-phases td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); }
.status-phases thead th { font-size: .85rem; color: var(--color-text-muted); }
.status-phases tbody th { width: 22%; }
.question-list { display: grid; gap: var(--space-2); }
.question { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.question[open] { border-color: var(--color-primary); }
.question > summary { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-weight: 400; list-style: none; }
.question > summary::-webkit-details-marker { display: none; }
.question > summary::before { content: "▸"; color: var(--color-primary); font-weight: 700; flex-shrink: 0; transition: transform .15s; }
.question[open] > summary::before { transform: rotate(90deg); }
.question-title { flex: 1; }
.question-title { font-weight: 700; }
.draft-note { margin: 0 0 var(--space-1); font-size: .85rem; color: var(--color-text-muted); }
.question-number { display: inline-block; min-width: 1.9em; margin-right: var(--space-1); padding: 0 .35em; border-radius: 999px; background: var(--color-bg); color: var(--color-text); font-size: .85rem; text-align: center; font-variant-numeric: tabular-nums; }
.question-meta { display: inline-flex; gap: var(--space-2); align-items: baseline; flex-shrink: 0; font-size: .9rem; }
.question-resolved .question-title { color: var(--color-text-muted); }
.question-decides { display: inline-block; margin-left: var(--space-2); font-weight: 400; font-size: .85rem; color: var(--color-text-muted); white-space: nowrap; }
.question-body { padding: 0 var(--space-4) var(--space-4); border-top: 1px solid var(--color-border); }
.question-details { margin-top: var(--space-3); }
.thread { list-style: none; margin: var(--space-3) 0; padding: 0; display: grid; gap: var(--space-2); }
.thread-item { background: var(--color-history-bg); border: 1px solid var(--color-history-border); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.thread-item p { margin: 0; }
.thread-head { font-size: .9rem; color: var(--color-text-muted); }
.thread-text { margin-top: var(--space-1) !important; overflow-wrap: anywhere; }
.thread-resolved, .thread-reopened { background: var(--color-primary-soft); }
.question-reply { margin-top: var(--space-3); }
.question-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.status-ask { margin-top: var(--space-4); max-width: 46rem; }

/* ROL-01: a role taken on for trying the application stays in view in the top bar */
.acting-chip { display: inline-block; padding: 0 .5em; border: 1px solid var(--color-env-border); border-radius: 999px; background: var(--color-warning-soft); color: var(--color-env-text); font-weight: 700; white-space: nowrap; }


/* ================= F1 visual system =================
   1. Four text sizes (13 / 15 / 18 / 24 px) and two weights: hierarchy comes from size, tone and spacing.
   2. Two text tones: text for values, subtle for labels and secondary lines (at least 4.5:1 on every surface used).
   3. One shape per role: status = rounded badge without a border (read only); fact = label and value as text;
      choice = box with a radio ring; action = button or link in the primary colour.
   4. A card is divided into sections by hairlines; no boxes inside boxes.
   Applied to the processing page and the customer card; the badge is shared by all internal pages. */
:root {
  --text-sm: .8667rem; --text-md: 1rem; --text-lg: 1.2rem; --text-xl: 1.6rem;
  --color-text-subtle: #5a5e64;
  --color-line: #e4e6e9;
  --color-choice-border: #b3b7bc;
}

/* Status: a rounded badge, tinted, no border. */
.badge { border: 0; padding: 2px 9px; font-size: var(--text-sm); line-height: 1.45; }
.badge-lg { font-size: var(--text-sm); padding: 3px 11px; }
.badge-ok { color: #2a5a1c; background: #dcecd4; }
.badge-warn { color: #6b4b00; background: #ffecb8; }
.badge-danger { color: #9b2430; background: #f8dadd; }
.badge-info { color: #1b4677; background: #dbe8f8; }
.badge-neutral { color: #3f4246; background: #e6e8eb; }

:is(.process, .card-column) .muted { color: var(--color-text-subtle); }
:is(.process, .card-column) h2 { font-size: var(--text-lg); }
:is(.process, .card-column) h2 .count {
  min-width: 0; padding: 0; margin-left: var(--space-1); border-radius: 0; background: none;
  font-size: var(--text-md); font-weight: 400; color: var(--color-text-subtle); vertical-align: baseline;
}
:is(.process, .card-column) .btn-small { font-size: var(--text-sm); }

/* Work bar: the lock state, then the customer's name once the head has scrolled away. */
.workbar-name { font-size: var(--text-md); }
.workbar-name.is-waiting { display: none; }
.workbar .chip-active { border: 0; padding: 3px 11px; font-size: var(--text-sm); }

/* Customer head: name, status and the last contact in one glance; facts below as label above value. */
.customer-head { background: var(--color-surface); }
.process-head, .card-head.customer-head { padding: var(--space-4) var(--space-5); }
.customer-head h1 { font-size: var(--text-xl); }
.head-chips { gap: var(--space-2) var(--space-4); }
.head-fact-label { color: var(--color-text-subtle); }
.facts-row {
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin: var(--space-4) 0 0; padding-top: var(--space-3);
  border-top: 1px solid var(--color-line);
}
.facts-row > div { min-width: 6.5rem; }
.facts-row dt { font-size: var(--text-sm); color: var(--color-text-subtle); }
.facts-row dd { margin: 0; }
.fact-note { font-size: var(--text-sm); color: var(--color-text-subtle); }
.planned { padding: var(--space-2) var(--space-3); border: 0; border-left: 4px solid #c58a00; background: var(--color-warning-soft); }
.planned-title { font-size: var(--text-sm); color: #6b4b00; }

/* Section head: title, hint, action at the end of the row. */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); }
.section-head .section-title { margin: 0; font-size: var(--text-lg); }
.section-head .section-hint { margin: 0; font-size: var(--text-sm); color: var(--color-text-subtle); }
.section-head .section-action { margin-left: auto; font-size: var(--text-md); }

/* Facts in one row: label in the subtle tone, value in the text tone. */
.inst-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-5); }
.facts-inline { display: flex; flex-wrap: wrap; gap: 2px var(--space-5); margin: 0; font-size: var(--text-sm); }
.facts-inline > div { display: flex; align-items: baseline; gap: 6px; }
.facts-inline dt { color: var(--color-text-subtle); white-space: nowrap; }
.facts-inline dd { margin: 0; }
.fact-yes { color: #2a5a1c; font-weight: 700; }
.fact-flag { font-size: var(--text-sm); }
.inst-meta .inst-actions { margin: 0; font-size: var(--text-sm); }

/* Installation card on the processing page: sections divided by hairlines. */
.process .inst { padding: 0; gap: 0; }
.process .inst > * { margin: 0; padding-left: var(--space-5); padding-right: var(--space-5); }
.process .inst > .inst-band { margin: 0; padding: var(--space-3) var(--space-5); border-radius: 5px 5px 0 0; }
.inst-title h3 { font-size: var(--text-lg); }
/* The state of the installation: the result, at the other side's installation followed by who records there. */
.inst-state { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--space-2); }
.inst-title p { color: var(--color-text); }
.inst-index { font-size: var(--text-sm); color: var(--color-text-subtle); }
.process .inst > .inst-meta { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.process .inst > .inst-notes { padding-bottom: var(--space-3); font-size: var(--text-md); }

/* People of the installation: who (name, role) | how to reach (phone, e-mail) | actions; no box per person. */
.process .inst > .inst-people { padding: 0; gap: 0; border-top: 1px solid var(--color-line); }
.process .inst-person {
  grid-template-columns: minmax(0, 19rem) minmax(0, 1fr) auto; gap: 0 var(--space-4); padding: 10px var(--space-5);
  border: 0; border-radius: 0; background: none;
}
.process .inst-person + .inst-person { border-top: 1px solid var(--color-line); }
.process .inst-person-who { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; min-width: 0; }
.process .inst-person-who strong { flex: 0 0 100%; }
.process .inst-person-who .chip, .process .inst-person-who .muted { font-size: var(--text-sm); color: var(--color-text-subtle); }
.process .inst-person-who .chip, .card-column .contact-row .chip { padding: 0; border: 0; border-radius: 0; background: none; }
.process .inst-person-who .chip + .muted::before { content: "· "; }
.process .inst-person-reach { display: grid; gap: 0; }
.process .inst-person-phone { font-size: var(--text-md); }
.process .inst-person-mail { font-size: var(--text-sm); color: var(--color-text-subtle); }
.process .inst-person-actions { font-size: var(--text-sm); }
.process .inst-person.is-calling { border: 0; background: var(--color-primary-soft); box-shadow: inset 4px 0 0 var(--color-primary); }
.process .inst-person-none { padding: 10px var(--space-5); font-size: var(--text-sm); }
@media (max-width: 760px) { .process .inst-person { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-1); } }

/* Choice: a box with a radio ring - results, connection and the person share one look (also the fees answer
   on the installation data page, INS-14). */
.process .pill span, :is(.process, .inst-form) .segment > span, .process .choice-card > span {
  position: relative; padding: 7px 12px 7px 34px; border: 1px solid var(--color-choice-border); border-radius: var(--radius);
  background: var(--color-surface); font-size: var(--text-md); color: var(--color-text);
}
.process .pill span::before, :is(.process, .inst-form) .segment > span::before, .process .choice-card > span::before {
  content: ""; position: absolute; left: 11px; top: 11px; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--color-border-input); background: var(--color-surface);
}
.process .pill input:checked + span, :is(.process, .inst-form) .segment input:checked + span, .process .choice-card input:checked + span {
  --choice: #5b6068; border: 1px solid var(--choice); box-shadow: inset 0 0 0 1px var(--choice); background: #eceef0;
  color: var(--color-text); font-weight: 400;
}
.process .pill input:checked + span::before, :is(.process, .inst-form) .segment input:checked + span::before,
.process .choice-card input:checked + span::before {
  border-color: var(--choice); background: radial-gradient(circle, var(--choice) 0 3.5px, var(--color-surface) 4px);
}
:is(.process, .inst-form) .segment input:checked + span, .process .choice-card input:checked + span,
.process .pill input[value="interested"]:checked + span { --choice: var(--color-primary); background: var(--color-primary-soft); }
:is(.process, .inst-form) .segment input:checked + span, .process .choice-card input:checked + span { background: var(--color-surface); }
.process .pill input[value="needs_info"]:checked + span, .process .pill input[value="other_person"]:checked + span { --choice: #2f6cb3; background: var(--color-info-soft); }
.process .pill input[value="later"]:checked + span { --choice: #8a5d00; background: var(--color-warning-soft); }
.process .pill input[value="not_interested"]:checked + span { --choice: var(--color-danger); background: var(--color-danger-soft); }
.process .segment-off span { color: var(--color-text-subtle); border-style: dashed; }
.process .choice-card small { font-size: var(--text-sm); color: var(--color-text-subtle); }

/* Result of the installation in this call. */
.process .inst > .result-pills {
  padding-top: var(--space-3); padding-bottom: var(--space-3); gap: var(--space-2); border: 0; border-top: 1px solid var(--color-line);
  border-radius: 0; background: none;
}
.process .result-legend { padding-bottom: var(--space-2); font-size: var(--text-md); }
.process .inst > .when-not-connected { padding-top: var(--space-3); }
.process .inst > .when { padding-bottom: var(--space-3); }
.process .inst > .when input[type="text"]:not(.date-input), .process .inst > .when select { max-width: 44rem; }
.process .chip-button {
  min-height: 28px; padding: 2px 9px; border-radius: var(--radius); border-color: var(--color-choice-border);
  font-size: var(--text-sm); color: var(--color-primary);
}
.process .chip-button:hover { background: var(--color-primary-soft); border-color: var(--color-primary); }

/* F2 of the installation: the states reached as a track running downwards, each with its time (one form on the
   processing page and on the customer card). */
:is(.process, .card-column) .f2-steps {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--space-3) var(--space-3);
  margin: var(--space-2) 0 0; font-size: var(--text-sm);
}
.process .inst > .f2-steps { margin: 0; padding-top: var(--space-3); padding-bottom: var(--space-3); border-top: 1px solid var(--color-line); }
:is(.process, .card-column) .f2-steps-title { font-size: var(--text-md); }
:is(.process, .card-column) .f2-steps ol { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: column; gap: 0; padding: 0 0 0 5px; }
:is(.process, .card-column) .f2-steps li {
  position: relative; padding: 0 0 10px 18px; white-space: normal; border-left: 2px solid var(--color-primary);
}
:is(.process, .card-column) .f2-steps li::before {
  content: ""; position: absolute; top: 4px; left: -6px; width: 10px; height: 10px; margin: 0; border-radius: 50%;
  background: var(--color-primary);
}
:is(.process, .card-column) .f2-steps li:last-child { padding-bottom: 0; border-left-color: transparent; }
:is(.process, .card-column) .f2-steps li:has(+ li.pending) { border-left-color: var(--color-choice-border); border-left-style: dashed; }
:is(.process, .card-column) .f2-steps li.pending::before { box-sizing: border-box; background: var(--color-surface); border: 2px solid var(--color-choice-border); }
:is(.process, .card-column) .f2-step-label { font-weight: 700; color: var(--color-text); }
:is(.process, .card-column) .f2-steps li.pending .f2-step-label { font-weight: 400; color: var(--color-text-subtle); }
:is(.process, .card-column) .f2-steps li .num { color: var(--color-text-subtle); }
:is(.process, .card-column) .f2-steps li .badge { margin-top: 3px; border-radius: 11px; white-space: normal; }
:is(.process, .card-column) .f2-steps-link { grid-row: 1; grid-column: 2; justify-self: end; }
.process .inst > .inst-f2-action { padding-bottom: var(--space-3); }
.process .inst > details { padding-top: var(--space-2); padding-bottom: var(--space-2); border-top: 1px solid var(--color-line); }
.process .inst > details > summary { font-weight: 400; color: var(--color-primary); }

/* Call record. */
.zone-call { gap: var(--space-5); padding: var(--space-4) var(--space-5) var(--space-5); }
.zone-call h2 { font-size: var(--text-lg); }
.zone-script summary { color: var(--color-text); }
.zone-script summary .muted { font-weight: 400; }
/* Definitions of code list values under the field that chooses one (INS-04): a name with its definition below. */
.definitions > summary { font-weight: 400; color: var(--color-primary); }
.definitions dl { margin: 0; padding: var(--space-1) 0 0 var(--space-4); font-size: var(--text-sm); }
.definitions dt { font-weight: 700; }
.definitions dd { margin: 0 0 var(--space-2); color: var(--color-text-subtle); }
/* Call script (SCR-01): groups and parts fold and the body scrolls on its own, so a long script leaves the record
   below in reach. A group is a heading, a part opens like a link; the open part carries the mark of the F2 track. */
.script-body { display: grid; gap: 2px; max-height: min(55vh, 560px); overflow-y: auto; overscroll-behavior: contain; padding: var(--space-2) var(--space-2) var(--space-2) 0; }
.script-search { width: 100%; margin-bottom: var(--space-2); }
.script-group > div { display: grid; gap: 2px; padding: 0 0 var(--space-2) var(--space-4); }
.zone-script .script-block > summary { font-weight: 400; color: var(--color-primary); }
.zone-script .script-block[open] > summary { font-weight: 700; color: var(--color-text); }
.script-block[open] { margin: var(--space-1) 0 var(--space-2); padding-left: var(--space-3); border-left: 2px solid var(--color-primary); }
.script-block > .script-text { padding: 0 0 var(--space-1); }
.script-text p, .script-text ul, .script-text ol { margin: 0 0 var(--space-2); }
.script-text ul, .script-text ol { padding-left: var(--space-5); }
.script-text .script-label { font-weight: 700; }
.script-text .script-note { color: var(--color-text-subtle); }
.process .req { font-size: var(--text-sm); font-weight: 400; letter-spacing: 0; text-transform: none; }
.process .choice-list > .help, .process .field .help { font-size: var(--text-sm); color: var(--color-text-subtle); }
.process .choice-card > span { display: block; }
.process .person-chosen { border: 1px solid var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }

/* Reference: people with their calls, history. */
.process .contact-row { padding: 10px 0; border-bottom-color: var(--color-line); }
:is(.process, .card-column) .contact-row .muted, :is(.process, .card-column) .contact-row .chip { font-size: var(--text-sm); color: var(--color-text-subtle); }
:is(.process, .card-column) .contact-stats { font-size: var(--text-sm); }
:is(.process, .card-column) .history { font-size: var(--text-sm); }
:is(.process, .card-column) .history .num { color: var(--color-text-subtle); }
.mail-hint { font-size: var(--text-sm); }
.zone-call { flex-basis: 440px; }  /* two choices side by side also when the record scrolls and shows a scrollbar */
.process .choice-card small .copy, .process .person-chosen .copy { white-space: nowrap; }
.process .field label.choice { font-weight: 400; }
.inst-facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-5); min-width: 0; }
.process .inst > .inst-f2-action {
  display: flex; align-items: center; gap: var(--space-3); padding-top: var(--space-3); padding-bottom: var(--space-3);
  border-top: 1px solid var(--color-line);
}
.process .inst > .f2-steps + .inst-f2-action { padding-top: 0; border-top: 0; }
.card-column .contact-row .chip + .muted::before { content: "· "; }

/* The reason why results are off belongs to the result section: the hairline closes the people instead. */
.process .inst > .inst-people { border-bottom: 1px solid var(--color-line); }
.process .inst > .inst-people:last-child { border-bottom: 0; }
.process .inst > .result-pills { border-top: 0; }

/* Call record: what will be recorded at each installation. */
.result-summary ul { list-style: none; margin: 0; padding: 0; display: grid; }
.result-summary li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--space-3); padding: 6px 0; }
.result-summary li + li { border-top: 1px solid var(--color-line); }
.result-summary .badge { white-space: normal; border-radius: 11px; }

/* Work list (NEF-11): the text sizes and shapes of the card. A filter is a link (an action) with its count, the chosen
   one marked like the current page of the main navigation; the customer's status and the F2 state are badges without
   a border, together under the name, so a long name keeps the whole width. */
.list-panel .panel-title h2 { font-size: var(--text-lg); }
.list-panel .panel-title .num { font-size: var(--text-sm); color: var(--color-text-subtle); }
.list-panel .search input { font-size: var(--text-md); }
.list-panel .filters { gap: 0; margin-bottom: var(--space-2); }
.filter-group { gap: 1px 14px; align-items: baseline; }
.list-panel .filter-group { padding: 5px 0; border-top: 1px solid var(--color-line); }
.list-panel .filter-group:first-child { border-top: 0; padding-top: 0; }
.list-panel .filter-group-label { font-size: var(--text-sm); font-weight: 400; color: var(--color-text-subtle); }
.filter { padding: 1px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
  font-size: var(--text-sm); color: var(--color-text); white-space: nowrap; }
.filter .num { color: var(--color-text-subtle); }
.filter:hover { border-bottom-color: var(--color-choice-border); }
.filter[aria-current="true"] { background: none; border-bottom-color: var(--color-primary); color: var(--color-text);
  font-weight: 700; }
.filter[aria-current="true"] .num { color: var(--color-text); }
.customer-list li a { gap: 3px; padding: var(--space-2); border-bottom-color: var(--color-line); }
.customer-list .line { flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-2); }  /* states go below a long name */
.customer-list .name { flex: 0 1 auto; }
.customer-list .name { font-size: var(--text-md); }
.customer-list .row-states { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px var(--space-1); margin-left: auto; }
.customer-list .chip { border: 0; padding: 2px 9px; font-size: var(--text-sm); font-weight: 700; line-height: 1.45; }
.customer-list .meta { font-size: var(--text-sm); color: var(--color-text-subtle); }
.list-panel > .actions { font-size: var(--text-sm); }

/* The start of processing on the card: sizes of the scale. */
.card-column .btn-large { font-size: var(--text-lg); }
.card-column .start-form .help { font-size: var(--text-sm); color: var(--color-text-subtle); }
.card-column .inst-item .inst-actions { font-size: var(--text-sm); }

/* History of the customer as a track (NEF-11): the line and the nodes of the F2 progress. A call is a full node, an
   F2 event or a note an empty one; the newest event is on top. */
.history-order { margin: -2px 0 var(--space-2); font-size: var(--text-sm); color: var(--color-text-subtle); }
.history-track { list-style: none; gap: 0; padding: 0 0 0 5px; }
.history-track > li { position: relative; padding: 0 0 8px 18px; border-left: 2px solid var(--color-primary); }
.history-track > li::before { content: ""; position: absolute; top: 4px; left: -6px; box-sizing: border-box; width: 10px;
  height: 10px; border-radius: 50%; background: var(--color-surface); border: 2px solid var(--color-primary); }
.history-track > li.history-call::before { background: var(--color-primary); }
.history-track > li:last-child { padding-bottom: 0; border-left-color: transparent; }
.history-track > li.history-none { padding-left: 0; border-left: 0; }
.history-track > li.history-none::before { content: none; }

/* Other internal pages of Green Center (NEF-11): overviews, lists and forms use the four text sizes of the card.
   Documents (page-docs: the tester documents and the status page) keep their reading typography. */
body:not(.f2) .page:not(.page-docs) h2 { font-size: var(--text-lg); }
body:not(.f2) .page:not(.page-docs) h2 .count { min-width: 0; padding: 0; background: none; font-size: var(--text-md);
  font-weight: 400; color: var(--color-text-subtle); }
body:not(.f2) .page:not(.page-docs) :is(.kicker, .table th, .stat-note, .panel-note, .help, .mail-cell,
  .filter-action, .gc-inst-scope, .legend, .campaign-picker label, .btn-small) { font-size: var(--text-sm); }
body:not(.f2) .page:not(.page-docs) .stat-value { font-size: var(--text-xl); }

/* A customer e-mail that did not leave for good (EM-08): a state badge and what it is about, under the head. */
.mail-failures { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); }
.mail-failures ul { list-style: none; margin: 0; padding: 0; flex: 1 1 20rem; font-size: var(--text-md); }
.mail-failures li + li { margin-top: var(--space-1); }
.mail-failures .resend-form, .mail-failures .resend-button { margin-left: var(--space-2); }
.mail-failures .mail-hint { display: block; }
