/* Visual reference: https://www.be.ch/de/start.html (18 October 2026).
   Keep canton identity separate from workflow/status colors. */
:root, :root[data-theme="light"] {
  --bg: #fff; --surface: #fff; --surface-2: #faf1e3; --surface-3: #f2e0c3;
  --ink: #000; --ink-2: #333; --muted: #4e4e4e;
  --border: #dedede; --border-strong: #707070;
  --brand: #dc0018; --brand-soft: #faf1e3; --focus: #dc0018;
  --primary: #dc0018; --primary-ink: #fff;
  --font: "Roboto", Arial, sans-serif;
  --radius: 6px; --radius-sm: 4px;
  --shadow-sm: 0 2px 5px rgb(0 0 0 / 5%); --shadow: 0 4px 16px rgb(0 0 0 / 7%);
  --footer-bg: #fcf8f3;
  color-scheme: light;
}
body { font-size: 16px; font-weight: 300; line-height: 1.625; }
b, strong, h1, h2, h3, h4 { font-weight: 500; }
h1, h2, h3, h4 { letter-spacing: 0; }
.topbar, .topbar.staff { background: #fff; color: #000; border-bottom: 1px solid #dedede; backdrop-filter: none; }
.topbar-in { padding: 20px 24px; gap: 24px; flex-wrap: wrap; }
.canton-logo { display: block; height: 56px; width: auto; flex: none; }
.brand { gap: 24px; }
.brand-text { border-left: 1px solid #dedede; padding-left: 24px; gap: 5px; }
.brand-text b { font-size: 16px; font-weight: 500; }
.brand-text small, .topbar.staff .brand-text small { color: #4e4e4e; }
.tabs, .topbar.staff .tabs { background: transparent; border-radius: 0; padding: 0; gap: 16px; }
.tabs a, .topbar.staff .tabs a { color: #000; border-radius: 0; border-bottom: 3px solid transparent; padding: 10px 0; font-weight: 400; }
.tabs a.on, .topbar.staff .tabs a.on { color: #dc0018; background: transparent; border-color: #dc0018; box-shadow: none; }
.tabs a:hover, .topbar.staff .tabs a:hover { color: #dc0018; }
.topbar.staff .lang, .topbar.staff .staff-link, .whoami { background: #fff; border-color: #dedede; color: #000; border-radius: 2px; }
.topbar.staff .staff-link:hover, .whoami button:hover { background: #faf1e3; color: #dc0018; }
.whoami b, .whoami button { color: #000; }
.whoami small { color: #4e4e4e; }
.whoami .av.officer { background: #dc0018; }
.staff-tag { border-radius: 0; font-weight: 500; }
.btn, .btn-primary, .lang, .icon-btn, .tech-btn { border-radius: 2px; font-weight: 500; }
.btn-primary:hover:not(:disabled) { background: #b80014; opacity: 1; }
.panel.active { border-color: #707070; box-shadow: none; }
.hero-band, .explain, .preview .pv-top, .b-hero { background: #faf1e3; color: #000; border-radius: 0; }
.preview, .b-card, .agenda, .cta-box, .case-card { border-radius: 0; }
.preview .pv-top small, .b-hero .kick, .b-hero h1 span { color: #dc0018; }
.preview .pv-top p, .b-hero p { color: #333; }
.b-hero .stat-chips span { background: #fff; color: #333; }
.b-hero .stat-chips b { color: #000; }
.cta-box { background: #faf1e3; color: #000; }
.src-line a, .b-sources a, sup.ref a { color: #dc0018; text-decoration: underline; }
.foot { max-width: none; margin: 0; padding: 12px max(24px, calc((100% - 1232px) / 2));
  background: var(--footer-bg); border: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 24px; color: var(--ink); font-size: 12px; }
.footer-main { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 12px; }
.footer-main .canton-logo { height: 42px; }
.footer-main p:not(.footer-title) { display: none; }
.footer-main p { margin: 0; }
.footer-main .footer-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { text-underline-offset: 4px; }
.footer-links a:hover { color: #dc0018; }
.foot small { font-size: 11px; grid-column: 1 / -1; }
.foot .foot-disclaimer { grid-column: 1 / -1; margin: 0; padding: 8px 0 4px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--ink); }
@media (max-width: 860px) {
  .topbar-in { gap: 16px; }
  .brand-text small { display: block; }
  .tabs, .topbar.staff .tabs { gap: 16px; }
}
@media (max-width: 600px) {
  .topbar-in { padding: 16px; gap: 12px; }
  .brand { gap: 12px; flex: 1; }
  .canton-logo { height: 46px; }
  .brand-text { display: flex; padding-left: 12px; }
  .brand-text b { font-size: 13px; }
  .brand-text small { font-size: 11px; }
  .topbar-right { flex-wrap: wrap; margin-left: 0; }
  .tabs a, .topbar.staff .tabs a { font-size: 13px; }
  .footer-main { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
  .footer-main .canton-logo { height: 42px; }
  .foot { padding: 12px 16px; grid-template-columns: 1fr; gap: 8px; }
}
@media print {
  .b-hero { background: #faf1e3; color: #000; }
}

/* Contrast and theme surfaces. The official logo sits on a white tile in dark mode. */
:root[data-theme="dark"] {
  --bg: #131517; --surface: #1e2124; --surface-2: #302a24; --surface-3: #453b30;
  --ink: #f4f1eb; --ink-2: #d6d0c7; --muted: #b6afa5;
  --border: #424548; --border-strong: #777b80;
  --brand: #ff6170; --brand-soft: #3c2428; --focus: #ff8290;
  --primary: #dc0018; --primary-ink: #fff; --footer-bg: #191b1d;
  --shadow-sm: 0 2px 6px rgb(0 0 0 / 18%); --shadow: 0 4px 18px rgb(0 0 0 / 24%);
  color-scheme: dark;
}
html { min-height: 100%; }
body { font-weight: 400; position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar, .foot { flex: none; }
.view { flex: 1 0 auto; width: 100%; min-height: 0; }
.foot { margin-top: auto; position: relative; }
/* Fine branching paths: one-pixel strokes at 12%, on the page background. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #82715b;
  mask-image: url('./roots.svg');
  mask-size: 280px 280px;
  mask-repeat: repeat;
  opacity: .12;
}
:root[data-theme="dark"] body::before {
  background-color: #b8a58a;
}
.topbar, .topbar.staff { background: var(--surface); color: var(--ink); border-bottom-color: var(--border); }
.brand-text { border-color: var(--border); }
.brand-text small, .topbar.staff .brand-text small, .whoami small { color: var(--muted); }
.tabs a, .topbar.staff .tabs a, .whoami b, .whoami button { color: var(--ink); }
.tabs a.on, .topbar.staff .tabs a.on { color: var(--brand); border-color: var(--brand); }
.topbar.staff .lang, .topbar.staff .staff-link, .whoami { background: var(--surface); color: var(--ink); border-color: var(--border); }
.topbar.staff .icon-btn { background: var(--surface); border-color: var(--border); }
.topbar.staff .icon-btn svg { stroke: var(--ink); }
.topbar.staff .staff-link:hover, .whoami button:hover { background: var(--surface-2); color: var(--brand); }
.hero-band, .explain, .preview .pv-top, .b-hero, .cta-box { background: var(--surface-2); color: var(--ink); }
.preview .pv-top p, .b-hero p { color: var(--ink-2); }
.preview .pv-top small, .b-hero .kick, .b-hero h1 span, .src-line a, .b-sources a, sup.ref a { color: var(--brand); }
.b-hero .stat-chips span { background: var(--surface); color: var(--ink-2); }
.b-hero .stat-chips b { color: var(--ink); }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }
.col-h { border-bottom: 0; padding-bottom: 12px; }
.kpi { background: var(--surface); box-shadow: var(--shadow-sm); }
.case-card { border: 1px solid var(--border); border-left: 3px solid var(--brand); box-shadow: var(--shadow-sm); border-radius: 4px; }
.case-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.tabs a.kb-nav, .topbar.staff .tabs a.kb-nav { display: inline-flex; gap: 6px; background: transparent; color: var(--ink); border-radius: 0; border-bottom-color: var(--brand); font-weight: 500; }
.tabs a.kb-nav strong { font-weight: 500; }
.kb-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 20px; align-items: start; }
.kb-tree details { margin-top: 16px; }
.kb-tree summary { cursor: pointer; font-weight: 500; overflow-wrap: anywhere; }
.kb-tree .link-btn { display: flex; margin-left: 12px; }
.kb-form { display: grid; gap: 18px; }
.kb-form fieldset { min-width: 0; margin: 0; border: 1px solid var(--border); padding: 14px; }
#kbLinks { display: grid; gap: 10px; }
#kbDetail { overflow-wrap: anywhere; }
.kb-check { display: flex; align-items: flex-start; gap: 8px; }
.kb-check input { margin-top: 6px; flex: none; }
.kb-notes { white-space: pre-wrap; }
.candidate-field { border: 1px solid var(--border); padding: 16px; min-width: 0; }
.candidate-field.needs-review { border-color: #d92d20; }
.field-indicator { display: inline-block; width: 9px; height: 9px; margin-right: 6px; background: var(--ok); }
.needs-review .field-indicator { background: #d92d20; }
.discovery-candidate { margin-top: 20px; }
input[type=password], input[type=url] { width: 100%; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 4px; padding: 9px 12px; color: var(--ink); }
@media (max-width: 760px) { .kb-layout { grid-template-columns: minmax(0, 1fr); } }
.page-h { padding-bottom: 0; border-bottom: 0; }
/* Stable header rows: identity/actions above, navigation below. No flex wrapping. */
.topbar-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 24px 0;
}
.topbar-in > .brand { grid-column: 1; grid-row: 1; min-width: 0; }
.topbar-in > .staff-tag { display: none; }
.topbar-in > .topbar-right { grid-column: 2; grid-row: 1; display: flex; flex-wrap: nowrap; margin-left: 0; gap: 8px; }
.topbar-in > .tabs {
  grid-column: 1 / -1; grid-row: 2; order: initial; width: 100%; min-width: 0;
  display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: stretch;
  gap: 24px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.topbar-in .tabs a { flex: 0 0 auto; min-height: 44px; padding: 10px 0; }
.topbar-right .lang, .topbar-right .icon-btn, .topbar-right .staff-link, .whoami { min-height: 44px; }
.topbar-right .icon-btn { width: 44px; }
.topbar-right .staff-link { display: inline-flex; align-items: center; justify-content: center; }
.whoami { min-width: 0; }
.whoami .txt { max-width: 140px; min-width: 0; }
.whoami .txt b, .whoami .txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami button { min-height: 36px; }
.topbar.brief .topbar-in { padding-bottom: 14px; }
.brand-text { min-width: 0; }
.kb-layout > *, .footer-main > * { min-width: 0; }
input, select, textarea { max-width: 100%; }
@media (max-width: 1100px) {
  .topbar-in { gap: 10px 16px; padding-inline: 20px; }
  .topbar-in .canton-logo { height: 50px; }
  .brand { gap: 16px; }
  .brand-text { padding-left: 16px; }
  .brand-text small { display: block; }
  .whoami .txt { display: none; }
  .footer-links { min-width: 0; }
  .foot { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 700px) {
  .topbar-in { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 16px 0; }
  .topbar-in > .brand { grid-column: 1; grid-row: 1; }
  .topbar-in > .topbar-right {
    grid-column: 1; grid-row: 2; display: grid; width: 100%;
    grid-template-columns: 54px 44px 44px minmax(0, 1fr) minmax(0, 1fr); gap: 6px;
  }
  .topbar-in > .tabs { grid-column: 1; grid-row: 3; gap: 20px; }
  .topbar-in > .topbar-right:not(:has(.whoami)) { grid-template-columns: 54px 44px 44px minmax(0, 1fr); }
  .topbar-in .canton-logo { height: 44px; }
  .brand { gap: 12px; }
  .brand-text { display: flex; padding-left: 12px; }
  .brand-text b { font-size: 14px; }
  .brand-text small { font-size: 12px; }
  .topbar-right .lang { width: 54px; font-size: 16px; padding-inline: 4px; }
  .topbar-right .whoami { padding: 0; justify-content: center; }
  .whoami .av { display: none; }
  .topbar-right .whoami button, .topbar-right .staff-link { white-space: normal; font-size: 12px; line-height: 1.25; text-align: center; padding: 6px; }
  .topbar-right .whoami button { width: 100%; min-height: 44px; }
  .topbar-right .staff-link span { display: inline; white-space: normal; }
  .topbar-in .tabs a { font-size: 14px; }
  .topbar.brief .topbar-right { display: flex; width: auto; grid-row: 1; grid-column: 2; }
  .topbar.brief .topbar-in { grid-template-columns: minmax(0, 1fr) auto; }
  /* Avoid automatic input zoom on iOS and keep file inputs within narrow panels. */
  input[type=text], input[type=email], input[type=search], input[type=password], input[type=url], input:not([type]), select.input, textarea { font-size: 16px; }
  input[type=file] { width: 100%; min-width: 0; font-size: 13px; }
  .kb-tree, #kbDetail { padding: 16px; }
}
@supports (padding: env(safe-area-inset-bottom)) {
  .foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
:root[data-theme="dark"] .canton-logo { background: #fff; padding: 4px 6px; border-radius: 2px; box-sizing: content-box; }
.help-btn { font-weight: 500; font-size: 20px; }
.pitch-grid { grid-template-columns: minmax(0, 1.5fr) minmax(240px, .8fr); align-items: start; }
.pitch-grid > .preview { order: 0; }
.pitch-grid > .explain { order: 1; }
.pitch-commercial { padding: 0 18px; }
.pitch-commercial section { padding: 12px 0; border-bottom: 1px solid var(--border); }
.pitch-commercial h4, .pitch-commercial p { margin: 6px 0; }
.pitch-commercial h4 a { color: var(--brand); }
.pitch-branding { margin: 14px 0; font-size: 13px; }
.pitch-branding summary { cursor: pointer; margin-bottom: 12px; }
.recipient-logo { max-width: 180px; max-height: 80px; object-fit: contain; display: block; margin-bottom: 12px; }
.pv-client-logo { max-width: 110px; max-height: 45px; object-fit: contain; margin: 0 auto; }
@media (max-width: 900px) { .pitch-grid { grid-template-columns: minmax(0, 1fr); } }
.analytics-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.analytics-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.analytics-charts .panel + .panel { margin: 0; }
.analytics-charts h2 { font-size: 18px; }
.analytics-bar { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(40px, 2fr) 30px; align-items: center; gap: 12px; width: 100%; margin: 10px 0; padding: 6px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); text-align: left; font-size: 13px; }
button.analytics-bar { cursor: pointer; }
.analytics-bar > span { min-width: 0; overflow-wrap: anywhere; }
.analytics-bar[aria-pressed="true"] { background: var(--surface-2); outline: 1px solid var(--brand); }
.analytics-track { height: 10px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.analytics-track i { display: block; height: 100%; background: var(--brand); }
.analytics-table { overflow-x: auto; margin-top: 18px; }
.analytics-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.analytics-table th, .analytics-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.analytics-table th p { font-weight: 400; max-width: 55ch; }
.analytics-lead { padding: 20px 0; border-bottom: 1px solid var(--border); }
.analytics-lead:last-child { border: 0; }
.analytics-lead .kb-form { margin-top: 16px; }
.platform-guide { width: min(600px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid var(--border); border-top: 4px solid var(--brand); border-radius: 8px; padding: 24px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.platform-guide::backdrop { background: rgb(0 0 0 / 55%); }
.platform-guide h2 { font-size: 20px; }
.platform-guide h3 { font-size: 24px; }
.platform-guide #guideText { line-height: 1.75; }
.guide-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
@media (max-width: 700px) {
  .analytics-charts { grid-template-columns: minmax(0, 1fr); }
  .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-table th, .analytics-table td { min-width: 100px; padding: 8px; }
  .platform-guide { padding: 18px; }
}
@media print {
  body::before { display: none; }
  :root[data-theme="dark"] .canton-logo { background: transparent; padding: 0; }
  :root[data-theme] { --bg: #fff; --surface: #fff; --surface-2: #faf1e3; --ink: #000; --ink-2: #333; --muted: #4e4e4e; --brand: #dc0018; --border: #dedede; color-scheme: light; }
}

/* Recipient-first commercial pitch: evidence is a secondary reading path. */
.recipient-pitch { max-width: 1100px; margin-inline: auto; }
.recipient-story { background: var(--surface-2); color: var(--ink); border-top: 5px solid var(--brand); padding: clamp(24px,5vw,64px); margin-top: 24px; }
.recipient-kicker { color: var(--brand); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 20px; }
.recipient-story h1 { color: var(--ink); font-size: clamp(32px,4.2vw,54px); line-height: 1.12; max-width: 20ch; margin: 0 0 24px; letter-spacing: -.025em; }
.recipient-lead { color: var(--ink); font-size: clamp(21px,2.3vw,27px); line-height: 1.4; font-weight: 500; margin: 0 0 18px; max-width: 42ch; }
.recipient-body,.recipient-invitation { color: var(--ink-2); font-size: 18px; line-height: 1.65; max-width: 65ch; margin: 0 0 18px; }
.recipient-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 30px; }
.recipient-actions .btn-primary,.recipient-actions .btn { min-height: 48px; padding: 12px 20px; }
.recipient-actions svg,.recipient-source-links svg { width: 18px; height: 18px; }
.recipient-evidence { background: var(--surface); color: var(--ink); border: 1px solid var(--border); padding: 20px 24px; margin-top: 24px; }
.recipient-evidence summary { cursor: pointer; font-weight: 500; padding-block: 8px; }
.recipient-source-links { display: flex; flex-wrap: wrap; gap: 14px 24px; padding: 8px 0; list-style: none; }
.recipient-source-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); }
.recipient-dossier { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 12px; }
.recipient-evidence-item { padding-block: 20px; border-bottom: 1px solid var(--border); }
.recipient-evidence-item blockquote { margin: 12px 0; border-left: 3px solid var(--brand); padding: 8px 16px; color: var(--ink-2); }
.recipient-evidence-item li,.recipient-all-sources li { margin-block: 8px; overflow-wrap: anywhere; }
@media(max-width:600px){ .recipient-actions { align-items: stretch; flex-direction: column; } .recipient-actions a,.recipient-actions button { justify-content: center; } .recipient-body,.recipient-invitation { font-size: 17px; } }
