/*
 * AM HORIZONT Cockpit 0.10.90
 * Portal visual system. Existing markup, access rules and data remain unchanged.
 * This stylesheet follows app.css. It never imports third-party resources.
 */
@font-face {
  font-family: "Portal Nunito";
  src: url("fonts/nunito-sans-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --portal-font: "Portal Nunito", "Nunito Sans", "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  --portal-radius: 21px;
  --portal-inner-radius: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --control-radius: 15px;
  --control-height: 48px;
  --control-motion: 140ms ease;
  --button-shadow: 0 2px 0 rgba(18,43,68,.12), 0 5px 12px rgba(18,43,68,.05), inset 0 1px 0 #fff;
  --button-primary-shadow: 0 3px 0 rgba(8,47,68,.24), 0 8px 18px rgba(18,43,68,.12), inset 0 1px 0 rgba(255,255,255,.45);
  --portal-padding: 20px;
  --bg: #f2f5f8;
  --canvas: #f2f5f8;
  --card: #fff;
  --surface: #fff;
  --surface-soft: #f7f8fa;
  --text: #15324b;
  --ink: #15324b;
  --muted: #506575;
  --line: #dbe4eb;
  --brand: #0c6187;
  --brand-2: #084765;
  --brand-soft: #eaf3f8;
  --accent: #0c6187;
  --accent2: #eaf2f3;
  --green: #236044;
  --green-soft: #edf6f0;
  --ok: #edf6f0;
  --oktext: #236044;
  --amber: #84570f;
  --amber-soft: #fff6e4;
  --warn: #fff6e4;
  --warntext: #84570f;
  --red: #963c49;
  --red-soft: #fbf0f2;
  --dangerbg: #fbf0f2;
  --danger: #963c49;
  --blue: #315f88;
  --blue-soft: #edf4fb;
  --shadow-sm: 0 8px 24px rgba(18,43,68,.045);
  --shadow-md: 0 14px 34px rgba(18,43,68,.07);
}

/* Override legacy body-scoped tokens as well as root defaults. */
body.app-authenticated, body.app-standalone {
  --bg: #f2f5f8;
  --text: #15324b;
  --ink: #15324b;
  --muted: #506575;
  --brand: #0c6187;
  --brand-2: #084765;
  --brand-soft: #eaf3f8;
  --accent: #0c6187;
  --accent2: #eaf3f8;
  --line: #dbe4eb;
}

/* The older interface applies important font rules to individual text nodes. */
body, button, input, select, textarea {
  font-family: var(--portal-font);
  font-optical-sizing: auto;
  font-synthesis: none;
}
body :where(h1,h2,h3,h4,h5,h6,p,span,strong,b,a,button,input,select,textarea,label,legend,summary,li,td,th,dt,dd,small,em,i,kbd) {
  font-family: var(--portal-font) !important;
}
body :where(code,pre,code *,pre *,.secret) {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace !important;
}
html, body, body.app-authenticated, body.app-standalone {
  background: var(--bg);
  color: var(--text);
}
body, body.app-authenticated, body.app-standalone {
  font-size: 16px;
  font-weight: 450;
  line-height: 1.55;
  letter-spacing: 0;
}
body h1 { font-weight: 720 !important; line-height: 1.16; letter-spacing: -.025em; }
body h2 { font-weight: 700 !important; line-height: 1.24; letter-spacing: -.02em; }
body h3, body h4 { font-weight: 650 !important; line-height: 1.28; letter-spacing: -.014em; }
body h5, body h6, body strong, body b { font-weight: 650 !important; }
body label, body legend { font-weight: 650 !important; }
body :where(p,li,td,dd) { line-height: 1.55; }
body :where(th,td,.metric-grid strong,.hours-badge strong,.testlab-summary strong) {
  font-variant-numeric: tabular-nums;
}
body.app-authenticated .shell { padding: var(--space-6) var(--space-8) 104px; }
body.app-authenticated .cockpit-home { gap: 24px; }
.cockpit-intro { gap: 24px; padding: 6px 2px 4px; }
.cockpit-intro h1 { font-size: clamp(30px,3vw,38px); }
.cockpit-intro > div > p:last-child { font-size: 16px; line-height: 1.55; }

/* Main surfaces. No new layout containers and no overrides of hidden states. */
body.app-authenticated :is(.panel,.module-head,.hero,.auth-card,.insight-card,.module-head-modern,.analytics-panel,.analytics-hero,.analytics-kpi,.today-hero,.today-praxis-strip),
body.app-standalone .auth-card,
body :is(.module-map,.home-now,.home-facts,.bh-secondary-details,.methods-launch-card,.lock-card,.command-dialog) {
  border: 1px solid var(--line);
  border-radius: var(--portal-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
body.app-authenticated :is(.panel,.module-head,.hero,.analytics-panel,.analytics-hero,.today-hero,.today-praxis-strip),
body.app-standalone .auth-card,
body .lock-card { padding: var(--portal-padding); }
body .auth-card { padding: 32px; }
body :is(.module-map-head,.module-lane,.home-now-head) { padding: 20px var(--portal-padding); }
body :is(.module-map-head,.module-lane + .module-lane,.home-now-head) {
  border-color: var(--line);
  background: #fff;
}
body .module-lane + .module-lane { background: var(--surface-soft); }
.module-map-head h2 { font-size: 24px; }
.module-map-head p, .module-lane-head p { font-size: 14px; }
.module-lane-head { gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.module-lane-head h3 { font-size: 16px; }
.module-tile-grid { gap: 16px; }
.primary-modules .module-tile-grid, .support-modules .module-tile-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
}
/* Module colors remain attached to their destination across viewport sizes. */
body .module-tile {
  min-height: 112px;
  padding: var(--space-4);
  gap: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--module) 22%, var(--line));
  border-radius: var(--portal-inner-radius);
  background: var(--module-soft);
  box-shadow: 0 2px 0 rgba(18,43,68,.06);
  transition: transform var(--control-motion), box-shadow var(--control-motion);
}
body .module-tile::before { display: none; }
body .module-tile-copy strong { font-size: 16px; line-height: 1.3; }
body .module-tile-copy small { margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--muted); }
body .module-tile-state { margin-top: var(--space-1); font-size: 13px; color: var(--module); }
body .module-tile-icon { border-radius: var(--control-radius); background: #fff; color: var(--module); }
.module-bh { --module: #0c6187; --module-soft: #eaf3f8; }
.module-amelia { --module: #96492f; --module-soft: #fcf0ea; }
.module-portal { --module: #435994; --module-soft: #edf0fb; }
.module-mail { --module: #136a80; --module-soft: #e7f5f8; }
.module-studio { --module: #6c4898; --module-soft: #f1ecf8; }
.module-wordpress { --module: #425c72; --module-soft: #eef2f5; }
.module-finanzen, .module-sevdesk { --module: #30694f; --module-soft: #edf6f0; }
.module-today, .module-methoden, .module-test { --module: #795014; --module-soft: #fff3df; }
.module-analytics { --module: #305f7c; --module-soft: #eaf4f8; }
.module-kompass, .module-security, .module-website { --module: #216350; --module-soft: #e8f5f1; }
.module-psido, .module-playnvoice { --module: #794867; --module-soft: #f6edf3; }
body .primary-modules .module-tile {
  background: linear-gradient(165deg, rgba(255,255,255,.04), rgba(0,0,0,.05)), var(--module);
  border-color: var(--module);
  color: #fff;
  box-shadow: 0 3px 0 rgba(18,43,68,.16), 0 8px 18px rgba(18,43,68,.07);
}
body .primary-modules .module-tile :is(strong,small,.module-tile-state) { color: #fff; }
body .primary-modules .module-tile-icon { color: #fff; background: rgba(255,255,255,.12); }
body .module-tile.needs-setup { border-style: dashed; }
@media (hover: hover) and (pointer: fine) {
  body .module-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
}
body .module-tile:active { transform: translateY(1px); box-shadow: none; }

body .analytics-hero h1, body .today-hero h1 { font-size: clamp(30px,3vw,38px); }
body .analytics-hero::after { display: none; }
/* Explicit chart rows keep the bars tall when narrow layouts hide values. */
body .year-bar > strong { grid-row: 1; }
body .year-bar-track { grid-row: 2; min-height: 0; }
body .year-bar > small { grid-row: 3; }
body .year-bar > .month-dot { grid-row: 4; }
body .analytics-copy > p { font-size: 15px; line-height: 1.55; }
body .analytics-panel-head p { font-size: 14px; line-height: 1.5; }

/* Inner rows preserve existing status and family identities. */
body :is(.family-card,.entry-card,.test-family-row,.test-phase-list>div,.test-entry-list>div,.test-month-families>div,.testlab-action,.app-card,.system-check-card,.cockpit-today-link) {
  border-radius: var(--portal-inner-radius);
  border-color: var(--line);
  box-shadow: none;
}
body :is(.family-card,.entry-card,.test-family-row,.test-phase-list>div,.test-entry-list>div,.test-month-families>div,.testlab-action,.app-card) { padding: 18px; }
body .home-now-row { min-height: 88px; padding: 17px 22px; border-left-width: 3px; }
body .home-now-row strong { font-size: 16px; }
body .home-now-row em { font-size: 14px; line-height: 1.45; }
body .home-now-row small { font-size: 12px; }
body .home-now-head p { font-size: 14px; }
body .home-now-head > a { min-height: 44px; font-size: 14px; }
body :is(.metric-grid>div,.status-grid article,.hours-badge,.phase-list article,.month-list article) {
  border-radius: 18px;
  border-color: var(--line);
}
body .metric-grid { gap: 14px; }
body .metric-grid > div { padding: 17px; }
body .metric-grid span { font-size: 13px; }
body .metric-grid strong { font-size: 22px; }
body :is(.alert,.calculation-preview,.recovery-box,.code-choice,.choice,.checkline) { border-radius: 16px; }
body .alert { padding: 15px 18px; line-height: 1.55; }
body .alert.error { color: var(--danger); background: var(--dangerbg); }
body .alert.success { color: var(--oktext); background: var(--ok); }
body .info-panel { background: var(--surface-soft); }

/* Shared control states, with the same contrast on touch and keyboard. */
body .btn, body.app-authenticated .btn,
body :is(.topbar-quick,.topbar-search,.testlab-nav a) {
  min-height: var(--control-height);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--control-radius);
  font-size: 15px;
  font-weight: 650 !important;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: normal;
  transition: transform var(--control-motion), box-shadow var(--control-motion), background-color var(--control-motion);
}
body .btn, body.app-authenticated .btn, body .topbar-search {
  border: 1px solid var(--line);
  background: linear-gradient(#fff, #f2f6f9);
  color: var(--text);
  box-shadow: var(--button-shadow);
}
body .btn.primary, body.app-authenticated .btn.primary,
body .app-topbar .topbar-quick {
  border: 1px solid var(--brand-2);
  background: linear-gradient(var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: var(--button-primary-shadow);
}
body .btn.danger-button, body.app-authenticated .btn.danger-button {
  border-color: #e6bec6;
  color: #8c3040;
  background: var(--red-soft);
}
@media (hover: hover) and (pointer: fine) {
  body .btn:not(:disabled):not([aria-disabled="true"]):hover,
  body.app-authenticated .btn:not(:disabled):not([aria-disabled="true"]):hover,
  body :is(.topbar-quick,.topbar-search):not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 rgba(18,43,68,.14), 0 10px 20px rgba(18,43,68,.12), inset 0 1px 0 rgba(255,255,255,.45);
  }
}
body .btn:not(:disabled):not([aria-disabled="true"]):active,
body.app-authenticated .btn:not(:disabled):not([aria-disabled="true"]):active,
body :is(.topbar-quick,.topbar-search):not(:disabled):active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 2px rgba(18,43,68,.12);
}
body :is(button,.btn):is(:disabled,[aria-disabled="true"]),
body.app-authenticated .btn:is(:disabled,[aria-disabled="true"]),
body.app-authenticated .btn:is(:disabled,[aria-disabled="true"]):is(:hover,:active) {
  opacity: 1;
  color: #596a76;
  background: #e8edf1;
  border-color: #cbd6df;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
body :is(.actions,.choice-row) { gap: 12px; }
body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body select, body textarea,
body.app-authenticated input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.app-authenticated select, body.app-authenticated textarea {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #bac9d5;
  border-radius: 15px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}
body textarea, body.app-authenticated textarea { min-height: 128px; resize: vertical; }
body input[type="checkbox"], body input[type="radio"] { accent-color: var(--brand); }
body label { gap: 8px; font-size: 14px; }
body .form-grid { gap: 18px; }
body fieldset { border: 1px solid var(--line); border-radius: 18px; }
body :is(a,button,input,select,textarea,summary):focus-visible {
  outline: 3px solid #0c6187 !important;
  outline-offset: 3px !important;
}

/* The existing navigation and its breakpoints remain functional. */
body .desktop-sidebar { background: #fff; border-color: var(--line); }
body :is(.sidebar-nav a,.sidebar-subnav a) { min-height: 46px; border-radius: 15px; font-size: 14px; }
body .sidebar-nav a[aria-current="page"], body .sidebar-subnav a[aria-current="page"] {
  border-color: #ccdce2;
  background: var(--brand-soft);
  color: var(--brand-2);
}
body .sidebar-bh-group.is-section-active { border-color: var(--line); background: #f7f9fb; border-radius: 19px; }
body .sidebar-account { border-color: var(--line); background: #f7f9fb; border-radius: 18px; }
body .app-topbar { background: rgba(255,255,255,.97); border-color: var(--line); }
body .topbar-search { border-color: var(--line); }
body .topbar-page-title strong { font-size: 16px; }
body .mobile-dock { background: rgba(255,255,255,.98); border-color: var(--line); box-shadow: 0 -4px 20px rgba(18,43,68,.045); }
body .app-version-footer { border-color: var(--line); border-radius: 18px; }
body .command-dialog { box-shadow: var(--shadow-md); }
body .methods-launch-copy strong { font-family: var(--portal-font) !important; }

/* Test mode stays unambiguous. The golden safety banner is intentional. */
body.test-context .app-main { background: var(--bg); }
body.test-context .test-sidebar { background: #fffdf8; }
body.test-context .test-topbar { background: #fff8e9; border-color: #e6d4b2; }
body.test-context .test-mode-banner {
  border: 2px solid #cc9b45;
  border-radius: 21px;
  background: #fff5df;
  box-shadow: none;
}
body.test-context .testlab-summary > div { background: #fffdf8; }
body.test-context .test-quick, body.test-context .testlab-nav a[aria-current="page"] {
  background: #7f4b00 !important;
  border-color: #7f4b00;
  color: #fff;
}
body.test-context .test-exit { border-color: #d9c296; background: #fffdf7; color: #673b00; }
body.test-context .test-mobile-dock { background: #fff8e9; border-color: #e6d4b2; }

@media (min-width: 1700px) {
  .support-modules .module-tile-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (min-width: 721px) and (max-width: 1100px) {
  .primary-modules .module-tile-grid, .support-modules .module-tile-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
@media (max-width: 720px) {
  :root { --portal-radius: 24px; --portal-padding: 16px; --portal-inner-radius: 20px; }
  body.app-authenticated .shell { padding: 18px 14px calc(100px + env(safe-area-inset-bottom)); }
  body.app-authenticated .cockpit-home { gap: 18px; }
  body .cockpit-intro { gap: 16px; }
  body .cockpit-intro h1 { font-size: 28px; }
  body .cockpit-intro > div > p:last-child { font-size: 15px; }
  body .primary-modules .module-tile-grid, body .support-modules .module-tile-grid,
  body .testlab-action-grid, body .form-grid, body .form-grid.three, body .card-grid,
  body .analytics-grid, body .analytics-kpis, body .analytics-bottom-grid {
    grid-template-columns: minmax(0,1fr);
  }
  body .module-tile-grid { gap: 12px; }
  body .module-tile { min-height: 104px; padding: var(--space-4); grid-template-columns: 42px minmax(0,1fr); }
  body .module-map-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  body .module-map-head > div { min-width: 0; gap: 12px; }
  body .module-map-head h2 { font-size: 23px; }
  body .module-map-head p { font-size: 14px; }
  body .module-map-symbol { flex: 0 0 42px; width: 42px; height: 42px; }
  body .module-map-count { align-self: flex-start; }
  body .home-now-head { gap: 12px; flex-wrap: wrap; }
  body .home-now-head > div { min-width: 0; }
  body .home-now-row { padding: 18px; gap: 10px; }
  body .home-now-row em { white-space: normal; overflow: visible; text-overflow: clip; }
  body .metric-grid { gap: 12px; }
  body .metric-grid > div { padding: 15px; min-width: 0; }
  body .metric-grid strong { font-size: 20px; overflow-wrap: anywhere; }
  body .mobile-first-capture {
    border: 1px solid #d8e4e6;
    border-radius: 21px;
    background: #edf4f4;
    box-shadow: none;
  }
  body .mobile-first-capture strong { font-size: 17px; }
  body .auth-card, body.app-standalone .auth-card { padding: 24px; }
  body .btn { max-width: 100%; overflow-wrap: anywhere; }
  body .testlab-nav a { white-space: nowrap; }
}
@media (max-width: 380px) {
  body.app-authenticated .shell { padding-left: 10px; padding-right: 10px; }
  body .metric-grid { grid-template-columns: minmax(0,1fr); }
  body .module-map-count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body :is(.module-tile,.btn,.app-card,.home-now-row,.topbar-quick,.topbar-search),
  body :is(.module-tile,.btn,.topbar-quick,.topbar-search):is(:hover,:active) { transition: none !important; transform: none !important; }
}
/* This file is for the browser interface, never the official BH print forms. */

/* 0.10.66: explicit main-card headers. Form sections and list labels stay smaller. */
@media screen {
  :root {
    --portal-head-bg: #edf3f8;
    --portal-head-ink: #243e55;
    --portal-head-muted: #53697c;
    --portal-head-line: #d5e1eb;
  }
  body.app-authenticated :is(.panel,.analytics-panel,.today-praxis-strip,.today-order-panel,.today-overview-section,.today-quick-section,.quick-group,.bh-work-center,.bh-month-cockpit-v2,.workflow-map) {
    padding: var(--portal-padding);
    border-radius: var(--portal-radius) !important;
    min-width: 0;
  }
  body.app-authenticated :is(.today-order-panel,.today-overview-section,.today-quick-section,.quick-group,.bh-work-center,.bh-month-cockpit-v2,.workflow-map) {
    box-shadow: var(--shadow-sm);
  }
  body.app-authenticated .portal-card-head,
  body.app-authenticated .testlab-summary > .portal-card-head {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin: calc(-1 * var(--portal-padding)) calc(-1 * var(--portal-padding)) 22px;
    padding: 20px var(--portal-padding);
    border: 0;
    border-bottom: 1px solid var(--portal-head-line);
    border-radius: calc(var(--portal-radius) - 1px) calc(var(--portal-radius) - 1px) 0 0;
    background: var(--portal-head-bg);
    box-shadow: none;
    color: var(--portal-head-ink);
    min-width: 0;
  }
  body.app-authenticated .portal-card-head-edge { margin: 0; }
  body.app-authenticated .portal-card-head > div:first-child {
    flex: 1 1 250px;
    min-width: 0;
  }
  body.app-authenticated .portal-card-head :is(h1,h2) {
    margin: 0;
    color: var(--portal-head-ink);
    font-size: 22px;
    font-weight: 720 !important;
    line-height: 1.3;
    letter-spacing: -.018em;
    overflow-wrap: anywhere;
  }
  body.app-authenticated .portal-card-head-page h1 { font-size: 28px; }
  body.app-authenticated .portal-card-head p:not(.section-kicker):not(.eyebrow) {
    margin: 6px 0 0;
    color: var(--portal-head-muted);
    font-size: 14px !important;
    font-weight: 450;
    line-height: 1.55;
    max-width: 80ch;
    overflow-wrap: anywhere;
  }
  body.app-authenticated .portal-card-head :is(.section-kicker,.eyebrow) {
    margin: 0 0 6px;
    color: var(--portal-head-muted);
    font-size: 12px;
    line-height: 1.45;
  }
  body.app-authenticated .portal-card-head > :is(.actions,.today-praxis-actions) {
    flex: 0 1 auto;
    align-self: center;
    justify-content: flex-start;
    margin: 0;
    min-width: 0;
    max-width: 100%;
  }
  body.app-authenticated .portal-card-head > a:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    align-self: center;
    gap: 8px;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--portal-head-ink);
    font-size: 14px;
    font-weight: 650 !important;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.app-authenticated .portal-card-head > a:not(.btn):hover {
    background: #fff;
    color: var(--portal-head-ink);
  }
  body.app-authenticated .portal-card-head :is(.module-map-symbol,.home-now-icon) {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid #d2dfe9;
    border-radius: 14px;
    background: #fff;
    color: #385c77;
  }
  body.app-authenticated :is(.module-map-head,.home-now-head) > div {
    align-items: flex-start;
    gap: 14px;
  }
  body.app-authenticated :is(.module-map-head,.home-now-head) > div > div { min-width: 0; }
  body.app-authenticated .portal-card-head > :is(.pill,.module-map-count,.icon-chip) {
    align-self: center;
    flex-shrink: 0;
    max-width: 100%;
  }

  body.app-authenticated .portal-card-head .btn {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }
  body .module-head > div:first-child { min-width: 0; }
  body .module-head h1 { overflow-wrap: anywhere; }
  body .panel :is(form,label,input[type="file"]) { min-width: 0; max-width: 100%; }
  body .panel label .small { overflow-wrap: anywhere; }

  /* Lists remain quiet and readable. Status uses the already calculated state. */
  body .home-now-row { padding: 18px var(--portal-padding); gap: 14px; }
  body .home-now-row strong { line-height: 1.45; overflow-wrap: anywhere; }
  body .home-now-row small, body .home-now-row > b { font-size: 13px; line-height: 1.4; }
  body .home-now-row em { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  body .home-now-row > b { white-space: normal; }
  body .home-now-row.security-row.action-tone-warning { --row: var(--amber); --row-soft: var(--amber-soft); }
  body .home-now-row.no-appointment { --row: #52676e; }
  body :is(.home-now-row,.home-facts>summary,.bh-secondary-details>summary):focus-visible {
    outline-offset: -4px !important;
  }
  body .home-facts > summary {
    min-height: 78px;
    padding: 16px var(--portal-padding);
    gap: 14px;
    background: #f7f9fc;
  }
  body .home-facts > summary strong { font-size: 17px; line-height: 1.4; }
  body .home-facts > summary small { font-size: 13px; line-height: 1.45; color: #53697c; }
  body .home-facts-summary { font-size: 13px; color: #53697c; }
  body .home-facts[open] > summary { background: var(--portal-head-bg); border-color: var(--portal-head-line); }
  body .home-facts-list small, body .home-facts-list em { font-size: 13px; }
  body .home-facts-list > a { padding: 17px; }
  body :is(.panel,.analytics-panel,.today-order-panel,.quick-group) { scroll-margin-top: 104px; }

  /* Gold remains the unambiguous sandbox identity. No production status is changed. */
  body.test-context .portal-card-head {
    --portal-head-bg: #fff4df;
    --portal-head-line: #e7d3ae;
    --portal-head-ink: #5e411b;
    --portal-head-muted: #715536;
    background: var(--portal-head-bg);
  }
  @media (max-width: 720px) {
    body.app-authenticated .portal-card-head,
    body.app-authenticated .testlab-summary > .portal-card-head {
      gap: 14px;
      padding: 18px var(--portal-padding);
      margin-bottom: 20px;
    }
    body.app-authenticated .portal-card-head-edge { margin-bottom: 0; }
    body.app-authenticated .portal-card-head h2 { font-size: 20px; }
    body.app-authenticated .portal-card-head-page h1 { font-size: 26px; }
    body.app-authenticated .portal-card-head > div:first-child { flex-basis: 100%; }
    body.app-authenticated .portal-card-head > :is(.actions,.today-praxis-actions) {
      width: 100%;
      flex-wrap: wrap;
      gap: 10px;
    }
    body.app-authenticated .home-now-head > a { margin-left: 58px; }
    body.app-authenticated .module-map-head > .module-map-count { margin-left: 58px; }
    body .home-now-row { grid-template-columns: 40px minmax(0,1fr); gap: 10px 12px; padding: 18px var(--portal-padding); }
    body .home-now-row > b { grid-column: 2; justify-content: flex-start; }
    body .home-facts > summary { grid-template-columns: 40px minmax(0,1fr) 18px; gap: 12px; }
    body .home-facts > summary .home-facts-symbol { width: 40px; height: 40px; }
    body .home-facts > summary .home-facts-summary { display: none; }
    body .home-facts-list { grid-template-columns: minmax(0,1fr); }
    body .home-facts-list > a + a { border-left: 0; border-top: 1px solid var(--line); }
  }
}

/* 0.10.90: orientation, narrow screens and field feedback. */
@media screen {
  body .cockpit-intro {
    padding: var(--space-5) var(--space-6);
    border: 1px solid var(--line);
    border-radius: var(--portal-radius);
    background: linear-gradient(110deg, #eaf3f8, #f7f8fa 65%, #fff);
    min-width: 0;
  }
  body .cockpit-intro > div { min-width: 0; }
  body .cockpit-intro h1 { margin-bottom: var(--space-2); }
  body .cockpit-overline { color: var(--muted); text-transform: none; letter-spacing: 0; }
  body :is(.sidebar-nav,.sidebar-subnav,.mobile-dock,.fin-tabs) a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
  }
  body .sidebar-brand, body .topbar-mobile-brand { min-height: 48px; }
  body .topbar-page-title small { color: var(--muted); }
  body :is(.panel,.module-head,.fin-root,.form-grid,.actions) { min-width: 0; }
  body :is(input,select,textarea,[tabindex]) { scroll-margin-top: 110px; scroll-margin-bottom: 130px; }
  body :is(input,select,textarea)[aria-invalid="true"] { border: 2px solid var(--danger); }
  body .portal-field-error { display: block; margin-top: 4px; color: #963c49; font-size: 14px; line-height: 1.45; font-weight: 650; }
  body .edit-draft-status[data-tone="warning"] { color: #8c3040; }
  body .command-dialog { max-height: calc(100dvh - 48px); overflow-y: auto; }
  body .unsaved-card { max-height: calc(100dvh - 48px); overflow-y: auto; }
}
@media (min-width: 541px) and (max-width: 720px) {
  body .primary-modules .module-tile-grid, body .support-modules .module-tile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  body .cockpit-intro { padding: var(--space-4); }
  body .app-topbar { gap: var(--space-2); padding-inline: var(--space-3); }
  body .topbar-tools { gap: var(--space-2); }
  body .topbar-search, body .app-topbar .topbar-quick { min-width: 48px; }
  body .module-head { gap: var(--space-4); }
  body .module-head > .actions { width: 100%; flex-wrap: wrap; }
  body .module-head > .actions .btn { flex: 1 1 140px; }
  body .form-grid.four { grid-template-columns: minmax(0,1fr); }
}
@media (forced-colors: active) {
  body .module-tile, body .btn { border: 1px solid ButtonText; }
}

/* 0.10.92: shared workspace surfaces. Home and official print forms stay separate. */
@media screen {
  body.portal-workspace {
    --work-border: 1px solid var(--line);
    --work-surface: #fff;
    --work-soft: #f7f8fa;
  }
  body.portal-workspace :is(.bh-calm-head,.module-head,.quick-hero,.review-hero,.today-hero,.analytics-hero,.fin-head) {
    padding: var(--space-6);
    margin: 0 0 var(--space-6);
    border: var(--work-border);
    border-radius: var(--portal-radius);
    background: linear-gradient(110deg,#eaf3f8,#f7f8fa 65%,#fff);
    box-shadow: none;
    min-width: 0;
  }
  body.portal-workspace :is(.bh-calm-head,.module-head,.quick-hero,.review-hero,.today-hero,.analytics-hero,.fin-head) h1 {
    font-size: clamp(28px,3vw,38px);
    line-height: 1.2;
    color: var(--text);
    margin: 4px 0 8px;
    overflow-wrap: anywhere;
  }
  body.portal-workspace :is(.eyebrow,.section-kicker,.fin-kicker) {
    text-transform: none;
    letter-spacing: 0;
  }
  body.portal-workspace :is(.module-head,.bh-calm-head,.quick-hero,.review-hero,.today-hero,.analytics-hero) p {
    color: var(--muted);
    max-width: 80ch;
  }
  body.portal-workspace :is(.panel,.bh-capacity-overview,.bh-report-strip,.bh-work-center,.bh-month-cockpit-v2,.quick-group,.quick-step,.review-calendar-section,.analytics-panel,.today-order-panel,.today-praxis-strip,.today-overview-section,.today-quick-section,.fin-panel,.workflow-map) {
    border: var(--work-border);
    border-radius: var(--portal-radius);
    padding: var(--portal-padding);
    background: var(--work-surface);
    box-shadow: var(--shadow-sm);
    min-width: 0;
  }
  body.portal-workspace :is(.bh-capacity-head,.bh-report-strip-head) {
    margin: calc(-1 * var(--portal-padding)) calc(-1 * var(--portal-padding)) var(--space-5);
    padding: var(--space-5);
    border-radius: calc(var(--portal-radius) - 1px) calc(var(--portal-radius) - 1px) 0 0;
  }
  body.portal-workspace .portal-card-head { background: #edf3f8; }
  body.portal-workspace :is(.quick-step-head,.review-calendar-section>.section-head,.fin-panel-head) {
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: var(--work-border);
  }
  body.portal-workspace :is(.metric-grid>div,.report-source-strip>div,.bh-report-kpis>a,.report-kpi-grid>*,.analytics-kpi,.today-kpis>article,.fin-metric,.system-check-card,.security-check) {
    border-radius: var(--portal-inner-radius);
    border: var(--work-border);
    box-shadow: none;
  }

  /* Action colors follow the same task on every workspace page. */
  .portal-task-capture { --task: #0c6187; --task-soft: #eaf3f8; }
  .portal-task-review { --task: #96492f; --task-soft: #fcf0ea; }
  .portal-task-billing { --task: #30694f; --task-soft: #edf6f0; }
  .portal-task-reports { --task: #6c4898; --task-soft: #f1ecf8; }
  .portal-task-payments { --task: #136a80; --task-soft: #e7f5f8; }
  .portal-task-families { --task: #435994; --task-soft: #edf0fb; }
  body.portal-workspace .portal-task-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: var(--space-4);
    margin: 0 0 var(--space-6);
  }
  body.portal-workspace .portal-task {
    display: grid;
    position: relative;
    grid-template-columns: 44px minmax(0,1fr) auto;
    align-items: center;
    gap: var(--space-3);
    min-height: 108px;
    padding: var(--space-4);
    border: 1px solid var(--task,#0c6187);
    border-radius: var(--portal-inner-radius);
    background: linear-gradient(165deg,rgba(255,255,255,.04),rgba(0,0,0,.05)),var(--task,#0c6187);
    color: #fff;
    box-shadow: 0 3px 0 rgba(18,43,68,.16),0 8px 18px rgba(18,43,68,.07);
    text-decoration: none;
    min-width: 0;
    transition: transform var(--control-motion),box-shadow var(--control-motion);
  }
  body.portal-workspace .portal-task :is(strong,small,span,i,b,em) { color: #fff; }
  body.portal-workspace .portal-task > span { min-width: 0; }
  body.portal-workspace .portal-task strong { display: block; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
  body.portal-workspace .portal-task small { display: block; margin-top: 4px; font-size: 13px; line-height: 1.45; }
  body.portal-workspace .portal-task > :is(.bh-task-icon,.command-action-icon) {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: rgba(255,255,255,.14);
  }
  body.portal-workspace .portal-task > :is(b,i) { position: static; background: transparent; margin: 0; }
  body.portal-workspace .portal-task > b { border-radius: 10px; padding: 4px 8px; background: rgba(0,0,0,.14); }
  body.portal-workspace .bh-work-center-grid { grid-template-columns: minmax(0,1fr); }
  body.portal-workspace .bh-next-appointment { min-height: 112px; background: var(--work-soft); border: var(--work-border); box-shadow: none; }
  body.portal-workspace .bh-next-appointment-copy { min-width: 0; }

  /* Rest hours are the focal number. Each underlying value has one labeled place. */
  body.portal-workspace .bh-capacity-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: var(--space-4); }
  body.portal-workspace .bh-capacity-card {
    padding: var(--space-5);
    gap: var(--space-4);
    border: var(--work-border);
    border-top: 4px solid var(--family);
    border-radius: var(--portal-inner-radius);
    background: #fff;
    box-shadow: 0 3px 12px rgba(18,43,68,.035);
    align-content: start;
  }
  body.portal-workspace .bh-capacity-card-head { align-items: start; }
  body.portal-workspace .bh-capacity-card-head strong { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.4; }
  body.portal-workspace .bh-capacity-card-head em { white-space: normal; text-align: center; max-width: 130px; }
  body.portal-workspace .bh-capacity-main {
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 0;
    gap: var(--space-3);
  }
  body.portal-workspace .bh-capacity-now > strong { font-size: 38px; line-height: 1.2; }
  body.portal-workspace .bh-capacity-threshold { max-width: 120px; gap: 4px; }
  body.portal-workspace .bh-capacity-threshold small { font-size: 13px; }
  body.portal-workspace .bh-free-share { justify-self: start; margin-top: var(--space-2); }
  body.portal-workspace .bh-quota-segments { height: 14px; border: 0; padding: 0; box-shadow: none; }
  body.portal-workspace .bh-quota-legend { gap: var(--space-3); margin-top: var(--space-2); }
  body.portal-workspace .bh-quota-legend > span {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    grid-template-columns: 8px minmax(0,1fr);
    align-items: start;
    gap: 4px 8px;
  }
  body.portal-workspace .bh-quota-legend > span > i { width: 8px; height: 8px; margin-top: 5px; }
  body.portal-workspace .bh-quota-legend small { font-size: 13px; line-height: 1.4; white-space: normal; overflow: visible; color: var(--muted); }
  body.portal-workspace .bh-quota-legend b { font-size: 15px; line-height: 1.4; white-space: normal; }
  body.portal-workspace .bh-quota-plain { border: 0; padding: 0; background: transparent; font-size: 13px; line-height: 1.5; margin: var(--space-2) 0 0; }
  body.portal-workspace .bh-capacity-foot { border-top: var(--work-border); padding-top: var(--space-3); }
  body.portal-workspace .bh-capacity-rule { border: 0; background: var(--work-soft); padding: var(--space-3); margin: var(--space-3) 0 var(--space-4); }
  body.portal-workspace .bh-capacity-forecast { font-size: 13px; grid-template-columns: minmax(0,1fr); gap: 4px; }
  body.portal-workspace .bh-capacity-forecast strong { font-size: 14px; white-space: normal; }
  body.portal-workspace .bh-capacity-statusbar > div { box-shadow: none; border-radius: 16px; }
  body.portal-workspace :is(.bh-capacity-card,.family-page-panel).is-critical { border-color: #c13f50 !important; border-top-width: 4px; }
  body.portal-workspace :is(.family-phase-state.is-critical,.status-dot.is-critical,.bh-capacity-signal,.attention-item.is-critical .attention-icon) { animation: none; }

  /* Quiet family details and forms, with an unmistakable action row. */
  body.portal-workspace .family-page-hero { border-left: 4px solid var(--family); }
  body.portal-workspace .family-page-panel { border-top: var(--work-border); }
  body.portal-workspace .family-phase-focus { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: var(--space-6); }
  body.portal-workspace .family-phase-free { border: 0; background: transparent; padding: 0; }
  body.portal-workspace .family-phase-free > strong { font-size: 42px; line-height: 1.2; }
  body.portal-workspace .family-phase-focus-progress { grid-column: 2; align-self: center; }
  body.portal-workspace .family-phase-focus-foot { grid-column: 1/-1; border-top: var(--work-border); padding-top: var(--space-4); background: transparent; }
  body.portal-workspace :is(.family-report-current,.review-card,.quick-event-card,.month-family-row,.invoice-card,.bh-family-tile,.phase-list-visual>article) {
    border-radius: var(--portal-inner-radius);
    box-shadow: none;
  }
  body.portal-workspace :is(.bh-family-phase-snapshot,.bh-family-money-grid,.bh-family-forecast-breakdown) { box-shadow: none; }
  body.portal-workspace .bh-family-phase-snapshot { background: var(--work-soft); grid-template-columns: minmax(0,1fr); }
  body.portal-workspace .bh-family-phase-primary { border: 0; background: transparent; padding: 0; }
  body.portal-workspace .bh-family-phase-primary strong { font-size: 30px; }
  body.portal-workspace :is(.quick-global-toolbar,.review-toolbar,.family-page-jump,.bh-jump-nav,.family-page-secondary-actions) { border: var(--work-border); background: #fff; border-radius: 16px; box-shadow: none; }
  body.portal-workspace :is(.family-page-jump,.bh-jump-nav) a { min-height: 44px; display: inline-flex; align-items: center; }
  body.portal-workspace .review-card { padding: var(--space-5); background: #fff; }
  body.portal-workspace :is(.review-facts,.review-missing,.review-invoice-label,.review-internal-note) { border-radius: 12px; padding: var(--space-3); }
  body.portal-workspace :is(.quick-step,.report-editor fieldset) { border-radius: var(--portal-inner-radius); }
  body.portal-workspace :is(.form-panel,.quick-capture-form,.report-editor) { max-width: 100%; }
  body.portal-workspace .form-panel { max-width: 960px; }
  body.portal-workspace :is(.action-chip,.command-pill,.icon-button) { min-height: 48px; border-radius: var(--control-radius); line-height: 1.4; }

  /* The four existing workflow links retain their destinations and active state. */
  body.portal-workspace .bh-flow-nav { grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--space-3); }
  .portal-workspace .bh-flow-step:nth-child(1) { --step: #0c6187; --step-soft: #eaf3f8; }
  .portal-workspace .bh-flow-step:nth-child(2) { --step: #96492f; --step-soft: #fcf0ea; }
  .portal-workspace .bh-flow-step:nth-child(3) { --step: #30694f; --step-soft: #edf6f0; }
  .portal-workspace .bh-flow-step:nth-child(4) { --step: #136a80; --step-soft: #e7f5f8; }
  body.portal-workspace .bh-flow-step {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr);
    align-content: start;
    align-items: start;
    gap: 8px 12px;
    padding: var(--space-4);
    min-height: 118px;
    border: 1px solid color-mix(in srgb,var(--step) 24%,var(--line));
    border-radius: var(--portal-inner-radius);
    background: var(--step-soft);
    color: var(--text);
    box-shadow: 0 2px 0 rgba(18,43,68,.07);
  }
  body.portal-workspace .bh-flow-step.active { background: var(--step); color: #fff; border-color: var(--step); box-shadow: 0 3px 0 rgba(18,43,68,.2); }
  body.portal-workspace .bh-flow-step.active :is(strong,small,.bh-flow-you,.bh-flow-badge) { color: #fff; }
  body.portal-workspace .bh-flow-number { width: 36px; height: 36px; background: #fff; color: var(--step); border-radius: 12px; grid-row: 1/4; }
  body.portal-workspace .bh-flow-step.active .bh-flow-number { background: #fff; color: var(--step); }
  body.portal-workspace .bh-flow-copy { grid-column: 2; }
  body.portal-workspace .bh-flow-copy strong { font-size: 15px; line-height: 1.35; }
  body.portal-workspace .bh-flow-copy small { font-size: 13px; line-height: 1.45; }
  body.portal-workspace :is(.bh-flow-badge,.bh-flow-you) { position: static; grid-column: 2; justify-self: start; background: transparent; padding: 0; font-size: 13px; }
  body.portal-workspace .bh-flow-you { display: block; text-decoration: underline; text-underline-offset: 4px; }
  body.portal-workspace .bh-flow-rule { background: transparent; border: 0; padding: 8px 0; }
  body.portal-workspace .month-switcher { border: var(--work-border); background: #fff; box-shadow: none; border-radius: var(--portal-radius); }
  body.portal-workspace .month-switch-arrow { border: var(--work-border); background: var(--brand-soft); color: var(--brand-2); border-radius: 16px; }
  body.portal-workspace .month-switch-current { background: transparent; }
  body.portal-workspace .month-downloads { gap: var(--space-3); }

  /* Other internal modules share typography, main cards and button hierarchy. */
  body.portal-workspace .methods-launch-card { padding: var(--space-6); border-radius: var(--portal-radius); box-shadow: var(--button-shadow); }
  body.portal-workspace .methods-launch-work { --methods-color: #0c6187; background: #0c6187; color: #fff; border-color: #084765; }
  body.portal-workspace .methods-launch-work :is(strong,small,span,p) { color: #fff; }
  body.portal-workspace .methods-launch-work .methods-launch-icon { background: rgba(255,255,255,.14); }
  body.portal-workspace .methods-launch-admin { --methods-color: #6c4898; background: #f1ecf8; border-color: #d7cde5; color: #523478; }
  body.portal-workspace .methods-launch-admin :is(strong,small,span,p) { color: #523478; }
  body.portal-workspace .year-bar-fill { transform: scaleY(1); }
  body.portal-workspace .capacity-card.tone-critical { border-color: #bd4d5a; background: #fff6f7; }
  body.portal-workspace .capacity-card.tone-critical::before, body.portal-workspace .capacity-card.tone-critical .capacity-track span { background: #8f2636; }
  body.portal-workspace .capacity-card.tone-critical .capacity-top b { color: #8f2636; }
  body.portal-workspace .analytics-kpi { background: #fff; border-top: 3px solid var(--kpi-color,var(--brand)); }
  body.portal-workspace .analytics-kpi.violet { --kpi-color: #6c4898; }
  body.portal-workspace .analytics-kpi.green { --kpi-color: #30694f; }
  body.portal-workspace .analytics-kpi.red { --kpi-color: #963c49; }
  body.portal-workspace .today-quick-grid { gap: var(--space-4); }
  body.portal-workspace .command-action.portal-task { grid-template-columns: 44px minmax(0,1fr); text-align: left; }
  body.portal-workspace .command-action.portal-task>span { background: rgba(255,255,255,.14); color: #fff; }
  body.portal-workspace .fin-root { --fin-ink: #15324b; --fin-muted: #506575; }
  body.portal-workspace .fin-root .fin-panel { padding: var(--portal-padding); }
  body.portal-workspace .fin-root .fin-tabs a { min-height: 48px; display: inline-flex; align-items: center; }
  body.portal-workspace .fin-root .fin-tabs a[aria-current] { background: #eaf3f8; color: #084765; }
  body.portal-workspace.test-context .portal-card-head { background: #fff4df; }
}
@media screen and (hover: hover) and (pointer: fine) {
  body.portal-workspace .portal-task:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(18,43,68,.14),0 12px 24px rgba(18,43,68,.1); }
}
@media screen and (max-width: 1150px) {
  body.portal-workspace .bh-flow-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.portal-workspace .portal-task-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width: 720px) {
  body.portal-workspace :is(.bh-calm-head,.module-head,.quick-hero,.review-hero,.today-hero,.analytics-hero,.fin-head) { padding: var(--space-4); margin-bottom: var(--space-4); }
  body.portal-workspace :is(.bh-calm-head,.module-head,.quick-hero,.review-hero,.today-hero,.analytics-hero,.fin-head) h1 { font-size: 28px; }
  body.portal-workspace .portal-task-grid { gap: var(--space-3); }
  body.portal-workspace .portal-task { grid-template-columns: 36px minmax(0,1fr); padding: var(--space-3); gap: 8px; min-height: 116px; align-content: start; }
  body.portal-workspace .portal-task > span:nth-child(2) { grid-column: 1/-1; }
  body.portal-workspace .portal-task > .bh-task-icon { width: 36px; height: 36px; }
  body.portal-workspace .portal-task > :is(b,i) { grid-column: 2; grid-row: 1; justify-self: end; }
  body.portal-workspace .portal-task strong { font-size: 15px; }
  body.portal-workspace .bh-flow-nav { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  body.portal-workspace .bh-flow-step { grid-template-columns: 28px minmax(0,1fr); padding: 12px; gap: 8px; }
  body.portal-workspace .bh-flow-number { width: 28px; height: 28px; border-radius: 9px; }
  body.portal-workspace .family-phase-focus { grid-template-columns: minmax(0,1fr); gap: var(--space-5); }
  body.portal-workspace .family-phase-focus-progress { grid-column: 1; }
  body.portal-workspace .bh-capacity-card { padding: var(--space-4); }
  body.portal-workspace .bh-capacity-card-head { grid-template-columns: 40px minmax(0,1fr); }
  body.portal-workspace .bh-capacity-card-head em { grid-column: 2; justify-self: start; max-width: none; }
  body.portal-workspace .bh-capacity-statusbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.portal-workspace .bh-capacity-statusbar > div { min-width: 0; padding: var(--space-3); }
  body.portal-workspace .bh-capacity-statusbar small { white-space: normal; }
  body.portal-workspace .review-card { padding: var(--space-4); }
  body.portal-workspace :is(.actions,.review-actions,.status-actions,.month-downloads) { flex-wrap: wrap; }
  body.portal-workspace :is(.review-actions,.month-downloads) .btn { min-width: 0; max-width: 100%; white-space: normal; }
}
@media screen and (max-width: 360px) {
  body.portal-workspace .portal-task-grid, body.portal-workspace .bh-flow-nav { grid-template-columns: minmax(0,1fr) !important; }
  body.portal-workspace .portal-task { min-height: 90px; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; }
  body.portal-workspace .portal-task > span:nth-child(2) { grid-column: 2; }
  body.portal-workspace .portal-task > :is(b,i) { grid-column: 3; }
  body.portal-workspace .bh-quota-legend { grid-template-columns: minmax(0,1fr); gap: 8px; }
  body.portal-workspace .bh-quota-legend > span { grid-template-columns: 8px minmax(0,1fr) auto; align-items: baseline; }
  body.portal-workspace .bh-quota-legend > span > i { grid-row: 1; }
  body.portal-workspace .bh-capacity-now > strong { font-size: 34px; }
  body.portal-workspace .bh-capacity-statusbar { grid-template-columns: minmax(0,1fr); }
}
@media screen and (prefers-reduced-motion: reduce) {
  body.portal-workspace :is(.portal-task,.bh-flow-step,.methods-launch-card),
  body.portal-workspace :is(.portal-task,.bh-flow-step,.methods-launch-card):is(:hover,:active) { transform: none !important; transition: none !important; }
}

/* Isolated acceptance setup and evidence, within the existing cockpit shell. */
.acceptance-page { min-width: 0; }
.acceptance-page code { overflow-wrap: anywhere; white-space: normal; }
.acceptance-page form { max-width: 760px; }
.acceptance-results { max-width: 100%; overflow-x: auto; }
.acceptance-results table { width: 100%; min-width: 660px; border-collapse: collapse; }
.acceptance-results th, .acceptance-results td { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.acceptance-results th:nth-child(1) { min-width: 180px; }
.acceptance-results th:nth-child(2) { min-width: 130px; }
.acceptance-results td { overflow-wrap: anywhere; }

.acceptance-status { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef2f6; color: #425466; white-space: nowrap; font-size: 13px; font-weight: 700; }
.acceptance-status[data-state="passed"] { background: #eaf7ef; color: #17603a; }
.acceptance-status[data-state="failed"] { background: #fdecec; color: #9b1c1c; }
@media (max-width: 640px) {
  .acceptance-results table, .acceptance-results tbody, .acceptance-results tr, .acceptance-results td { display: block; width: 100%; min-width: 0; }
  .acceptance-results thead { display: none; }
  .acceptance-results tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .acceptance-results td { border: 0; padding: 5px 0; }
  .acceptance-results td::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
}

/* 0.10.119: BH Leistungsnachweis, schreibgeschützte Prüfung */
.bh-readonly-preview { border-left: 4px solid #18845e; }
.bh-print-preview-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.bh-print-preview-grid > div { border: 1px solid #d9e3ee; background: #f7fafd; border-radius: 12px; padding: 12px 15px; min-width: 0; }
.bh-print-preview-grid dt { font-size: 12px; color: #52667c; margin-bottom: 5px; }
.bh-print-preview-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 680; color: #183753; }
.bh-print-preview-grid .bh-print-preview-wide { grid-column: 1/-1; background: #edf5f8; }
.bh-readonly-internal summary { cursor: pointer; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.bh-readonly-internal summary small,.bh-readonly-calendar-note { color: #647489; font-size: 13px; }
.bh-readonly-note { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 15px; }
.bh-completed-list summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bh-completed-list summary span { color: #637489; font-size: 13px; }
.bh-completed-items { margin-top: 16px; display: grid; gap: 9px; }
.bh-completed-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #dce5ee; border-radius: 13px; padding: 12px 15px; text-decoration: none; }
.bh-completed-item span { display: grid; gap: 3px; }
.bh-completed-item small { color: #61758a; }
.bh-completed-item b { color: #075780; font-weight: 700; font-size: 13px; }
@media (max-width: 650px) { .bh-print-preview-grid { grid-template-columns: 1fr; } .bh-completed-item { align-items: flex-start; } }

/* Cockpit 0.10.122: three primary views, unified search and staged BH workflow. */
.ah-primary-views{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:14px 0 18px}
.ah-primary-view{display:flex;flex-direction:column;align-items:flex-start;gap:10px;min-height:205px;border:1px solid #d3e0e9;border-radius:21px;background:#fff;padding:23px;box-shadow:0 5px 16px rgba(15,45,65,.035);text-decoration:none;color:#192f42}
.ah-primary-view:hover,.ah-primary-view:focus-visible{border-color:#4e8eac;box-shadow:0 10px 24px rgba(15,45,65,.1)}
.ah-view-number{font-size:11px;letter-spacing:.1em;font-weight:850;color:#607b8a}.ah-view-icon{display:grid;place-items:center;background:#e7f1f6;border-radius:14px;width:46px;height:46px;color:#0c6187}
.ah-view-icon .ui-icon{width:25px;height:25px}.ah-primary-view strong{font-size:20px;line-height:1.2}.ah-primary-view small{font-size:13px;line-height:1.5;color:#536979}.ah-view-go{margin-top:auto;font-weight:800;color:#0c6187;display:flex;gap:8px;align-items:center;font-size:13px}
.ah-search-home{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border:1px solid #d3e0e9;border-radius:17px;padding:12px 15px;background:#fff;margin-bottom:22px}.ah-search-home label{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:780}.ah-search-home input{flex:1;min-width:160px;max-width:none!important;border-radius:12px}.ah-search-home button{margin:0}
.ah-secondary-tools{border:1px solid #d3e0e9;border-radius:19px;background:#f8fafb;margin:18px 0}.ah-secondary-tools>summary{display:flex;align-items:center;gap:14px;cursor:pointer;padding:18px 21px;list-style:none}.ah-secondary-tools>summary::-webkit-details-marker{display:none}.ah-secondary-tools>summary>span{flex:1;display:grid;gap:4px}.ah-secondary-tools>summary strong{font-size:16px}.ah-secondary-tools>summary small{font-size:12px;color:#607381}.ah-secondary-tools[open]>summary{border-bottom:1px solid #d3e0e9}.ah-secondary-tools>.module-map{margin:15px}
.ah-search-panel,.ah-close-panel,.ah-close-routes,.ah-work-panel{padding:22px}.ah-search-form label,.ah-close-form label{display:block;font-weight:780;margin-bottom:8px}.ah-search-controls,.ah-close-form>div{display:flex;gap:10px;align-items:center}.ah-search-controls input{flex:1;min-width:0}.ah-search-count{font-size:13px;color:#576c7b;margin:17px 0}
.ah-search-group{margin-top:26px}.ah-search-group h2{font-size:18px;display:flex;align-items:center;gap:10px}.ah-search-group h2 span{color:#607381;font-size:12px;background:#eef3f7;border-radius:100px;padding:3px 9px}.ah-search-items,.ah-close-route-list,.ah-work-family-list{display:grid;gap:9px;margin-top:13px}.ah-search-items>a,.ah-close-route-list>a{display:flex;justify-content:space-between;align-items:center;gap:15px;border:1px solid #dae4eb;border-radius:13px;padding:15px;text-decoration:none;color:#17374a}.ah-search-items>a>span,.ah-close-route-list>a>span{display:grid;gap:5px}.ah-search-items a strong,.ah-close-route-list a strong{font-size:15px}.ah-search-items a small,.ah-close-route-list a small{color:#586d7c;font-size:13px;line-height:1.4}.ah-search-items>a:hover,.ah-close-route-list>a:hover{background:#f3f8fa;border-color:#8aaec2}.ah-search-empty{color:#738492;font-size:13px}
.ah-close-form{margin-bottom:23px}.ah-close-form input{max-width:230px}.ah-close-state{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #e1e9ef;padding:18px 0}.ah-close-state h2{font-size:23px;margin:4px 0 8px}.ah-close-state p{font-size:13px;color:#536c7e}.ah-state-pill{display:inline-flex;align-items:center;padding:6px 11px;border-radius:30px;background:#e5edf4;color:#1e5871;font-size:12px;font-weight:800;white-space:normal}.ah-stage-capture,.ah-stage-review{background:#fff0da;color:#885319}.ah-stage-ready{background:#e4f1f8;color:#185677}.ah-stage-billed,.ah-stage-sent{background:#e9efff;color:#304e8a}.ah-stage-paid{background:#e2f4e9;color:#1c6542}
.ah-status-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;counter-reset:stage;list-style:none;margin:20px 0 25px;padding:0}.ah-status-steps li{display:flex;gap:11px;border:1px solid #dde5ed;border-radius:14px;padding:14px;align-items:flex-start;background:#f9fafb}.ah-status-steps li>span:nth-child(2){display:grid;gap:5px;min-width:0}.ah-status-steps strong{font-size:13px}.ah-status-steps small{font-size:11px;line-height:1.35;color:#5a6b79}.ah-step-circle{flex:0 0 auto;display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:#e0e9f0;color:#45606f;font-size:12px;font-weight:800}.ah-status-steps .complete{background:#f1f8f4}.ah-status-steps .complete .ah-step-circle{background:#d7eee1;color:#226144}.ah-status-steps .current{border:2px solid #1b779b;background:#eff8fb}.ah-status-steps .current .ah-step-circle{background:#0c6187;color:#fff}.ah-close-result{display:flex;flex-wrap:wrap;gap:9px 22px;border-top:1px solid #e1e9ef;padding-top:16px}.ah-close-result p{font-size:13px}.ah-close-checks{padding:10px;list-style:none;display:grid;gap:8px}.ah-close-checks li{display:flex;align-items:center;gap:8px;font-size:13px}.ah-close-checks .pass{color:#226144}.ah-close-checks .fail{color:#aa6415}.ah-close-notices{margin:12px 0;border:1px solid #dce6ed;padding:12px 14px;border-radius:12px}.ah-close-notices summary{cursor:pointer;font-weight:780}
.ah-work-actions{display:flex;flex-wrap:wrap;gap:9px;margin:0 0 20px}.ah-work-panel{margin-bottom:18px}.ah-work-family{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid #dce6ed;border-radius:14px;background:#fff;color:#173749;text-decoration:none}.ah-work-family:hover{background:#f4f8fa;border-color:#91b5c5}.ah-work-family-dot{background:#e5f1f6;color:#0c6187;width:40px;height:40px;flex:0 0 auto;border-radius:12px;display:grid;place-items:center}.ah-work-family-copy{flex:1;display:grid;gap:5px;min-width:0}.ah-work-family-copy strong{font-size:15px}.ah-work-family-copy small{font-size:12px;color:#647888}.ah-work-family-hours{text-align:right;display:grid;gap:4px;margin-left:auto}.ah-work-family-hours strong{font-size:15px}.ah-work-family-hours small{font-size:11px;color:#687987}.ah-work-family-hours.attention{color:#a35c1c}.ah-work-secondary{border:1px solid #d7e3eb;border-radius:16px;margin:18px 0;background:#fff}.ah-work-secondary summary{padding:17px;cursor:pointer;font-weight:770}.ah-work-secondary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px}.ah-work-secondary-grid a{padding:14px;border-radius:10px;border:1px solid #e0e9ed}
@media(max-width:960px){.ah-primary-views{grid-template-columns:1fr}.ah-primary-view{min-height:unset;display:grid;grid-template-columns:42px 1fr auto;grid-template-rows:auto auto auto;gap:4px 12px}.ah-view-number{grid-column:1}.ah-view-icon{grid-column:1;grid-row:2/4}.ah-primary-view strong{grid-column:2;grid-row:2}.ah-primary-view small{grid-column:2;grid-row:3}.ah-view-go{grid-column:3;grid-row:2/4;align-self:center}}
@media(max-width:680px){.ah-primary-view{display:flex;gap:9px}.ah-primary-views{gap:10px}.ah-primary-view strong{font-size:18px}.ah-search-home label{width:100%}.ah-search-home input{min-width:0}.ah-status-steps{grid-template-columns:1fr 1fr}.ah-close-result{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.ah-work-family{flex-wrap:wrap}.ah-work-family-hours{margin-left:auto}.ah-work-secondary-grid{grid-template-columns:1fr}.ah-search-controls{flex-wrap:wrap}.ah-search-controls .btn{width:100%}.ah-mobile-main a span{font-size:11px}}
@media(max-width:410px){.ah-status-steps{grid-template-columns:1fr}.ah-work-family-hours{width:100%;text-align:left;padding-left:48px}.ah-search-home button{width:100%}}

.ah-sidebar-expand summary{cursor:pointer;display:flex;justify-content:space-between;align-items:center;gap:6px;list-style:none;user-select:none;padding:10px 0}
.ah-sidebar-expand summary::-webkit-details-marker{display:none}
.ah-sidebar-expand summary svg{width:15px;height:15px;transition:transform .15s ease}
.ah-sidebar-expand[open] summary svg{transform:rotate(180deg)}
.ah-sidebar-expand summary:focus-visible{outline:2px solid currentColor;outline-offset:3px}

/* BH invoice quota separation and audit history */
.bh-billing-explanation,.bh-billing-split{border:1px solid var(--line,#d8e1ea);background:var(--panel,#f7fafc);padding:1rem;border-radius:14px;margin:1rem 0;}
.bh-billing-explanation p,.bh-billing-split p{margin:.4rem 0;color:var(--muted,#475569);line-height:1.55;}
.bh-correction-history{display:grid;gap:.65rem;margin-top:1rem;}
.bh-correction-history>div{padding:1rem;border:1px solid var(--line,#d8e1ea);border-radius:12px;display:grid;gap:.3rem;}
@media(max-width:650px){.bh-billing-split{padding:.8rem}.bh-correction-history>div{word-break:break-word}}

.bh-correct-links{display:flex;flex-wrap:wrap;gap:.55rem;padding:.35rem 0}.bh-correct-links .mini-link{white-space:normal}.bh-correction-history{display:grid;gap:.6rem}.bh-correction-history>div{display:flex;flex-wrap:wrap;gap:.8rem;padding:.65rem;border:1px solid var(--border, #d9e3eb);border-radius:.7rem}
