/* Coavello app UI – Default Corporate Design Aubergine & Steingrau (single token source) */
:root {
  color-scheme: light;
  --bg-main: #f8f6f5;
  --bg-top: #f3eff2;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.72);
  --ink: #302b35;
  --ink-brand: #302b35;
  --muted: #6d6472;
  --line: #ddd6dd;
  --accent: #59435f;
  --accent-hover: #493751;
  --accent-pressed: #392a3e;
  --accent-soft: #f1edf2;
  --focus: #8a6a8d;
  --lavender: #e8dfe9;
  --rose-stone: #c6a7a0;
  --ok: #267a57;
  --ok-soft: #eaf4ee;
  --bad: #a93549;
  --bad-soft: #fbeaec;
  --warn: #91600f;
  --warn-soft: #fbf1db;
  --draft: #36667c;
  --draft-soft: #eaf3f7;
  --shadow: 0 8px 25px rgba(48, 43, 53, 0.06), 0 2px 6px rgba(48, 43, 53, 0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --shell-max: 1240px;
  --shell-standard: 1120px;
  --shell-form: 1120px;
  --shell-dossier: 1200px;
  --shell-workspace: 1360px;
  --shell-admin: 1040px;
  --form-max: 28rem;
  --form-card-max: 40rem; /* ~640px – Design-System V1 Formularpanel */
  --header-h: 3.5rem;
  --control-h: 2.5rem;
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-main));
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Phase 2I – skip link + visible keyboard focus (WCAG 2.4.1 / 2.4.7) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#main-content:focus {
  outline: none;
}

#main-content:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

.shell {
  width: min(var(--shell-max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
  min-width: 0;
}

.shell--standard {
  width: min(var(--shell-standard), calc(100% - 2rem));
}

.shell--form {
  width: min(var(--shell-form), calc(100% - 2rem));
}

.shell--dossier {
  width: min(var(--shell-dossier), calc(100% - 2rem));
}

.shell--workspace {
  width: min(var(--shell-workspace), calc(100% - 2rem));
}

.shell--admin {
  width: min(var(--shell-admin), calc(100% - 2rem));
}

/* Dossier/Workspace carry their own hero titles – avoid duplicate page H1. */
.shell--dossier > main > .page-header,
.shell--workspace > main > .page-header {
  display: none;
}

/* ??? Top bar / navigation (Design-System V1 pilot) ??? */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 1.1rem;
  row-gap: 0;
  margin: 0 0 1.5rem;
  padding: 0 1.1rem;
  min-height: var(--header-h);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  margin: 0;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
  height: var(--header-h);
  grid-column: 1;
}

.brand:hover {
  opacity: 0.92;
}

.brand:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.brand-logo {
  display: block;
  height: 1.65rem;
  width: auto;
  max-width: min(11.5rem, 42vw);
  object-fit: contain;
  object-position: left center;
}

.auth-shell .brand-logo {
  height: 1.85rem;
  max-width: min(13rem, 55vw);
}

.app-nav {
  display: flex;
  flex-wrap: nowrap;
  flex: 1;
  gap: 0.25rem 0.35rem;
  align-items: center;
  min-width: 0;
  height: var(--header-h);
  grid-column: 2 / -1;
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  height: var(--header-h);
}

.app-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0 0.75rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  white-space: nowrap;
}

.app-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.app-nav a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.nav-menu {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--header-h);
  margin: 0;
}

.nav-menu--account {
  margin-left: auto;
}

.nav-menu-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.nav-menu-trigger::-webkit-details-marker {
  display: none;
}

.nav-menu-trigger::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.75;
}

.nav-menu[open] > .nav-menu-trigger::after {
  transform: rotate(225deg) translateY(-1px);
}

.nav-menu-trigger:hover,
.nav-menu[open] > .nav-menu-trigger,
.nav-menu-trigger.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-menu-panel {
  position: absolute;
  top: calc(100% - 0.35rem);
  left: 0;
  z-index: 50;
  min-width: 14rem;
  margin: 0;
  padding: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.nav-menu--account .nav-menu-panel {
  left: auto;
  right: 0;
}

.nav-menu-panel a,
.nav-menu-panel .nav-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.4rem;
  height: auto;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}

.nav-menu-panel a:hover,
.nav-menu-panel .nav-menu-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-menu-panel a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-menu-divider {
  height: 1px;
  margin: 0.35rem 0.4rem;
  background: var(--line);
  border: 0;
}

.nav-logout {
  margin: 0;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.nav-logout .nav-menu-item {
  width: 100%;
}

.app-nav-platform {
  justify-content: flex-end;
}

.app-nav-platform .nav-logout {
  margin-left: 0.35rem;
  width: auto;
}

.app-nav-platform .nav-user,
.app-nav-platform .nav-area-label {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.nav-user,
.nav-area-label {
  display: none;
}

/* Phase 2C – mobile nav toggle (hidden on desktop) */
.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  grid-column: 3;
  justify-self: end;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

.nav-menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-menu-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.nav-group-label {
  display: none;
  margin: 0.35rem 0 0.15rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Constrained form card (pilot: Neuer Klient / Bearbeiten) */
.panel--form {
  max-width: var(--form-card-max);
}

.panel--form .form {
  max-width: none;
}

.page-header {
  margin: 0 0 1.15rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink-brand);
}

.page-lede {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ??? Panels / cards ??? */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.2rem;
  min-width: 0;
}

.panel + .panel {
  margin-top: 1rem;
}

.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 800;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.panel-header h2 {
  margin: 0;
}

.meta {
  display: grid;
  gap: 0;
  margin: 0;
}

.meta > div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.meta > div:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.meta > div:first-of-type {
  padding-top: 0;
}

dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.is-ok {
  color: var(--ok);
}

.is-bad {
  color: var(--bad);
}

.error {
  color: var(--bad);
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-weight: 500;
}

.list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

/* ??? Stats ??? */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}

.stat-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  min-width: 0;
}

a.stat-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.stat-card-link:hover {
  border-color: #c5d4f0;
  background: #eef4ff;
  color: inherit;
}

a.stat-card-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.stat-card .stat-label {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.stat-card .stat-value {
  display: block;
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

.stat-card .stat-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-card.is-attention {
  border-color: #e8c4b8;
  background: #fdf6f3;
}

.stat-card.is-attention .stat-value {
  color: #8a4b3a;
}

.muted-note {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ??? Dashboard day overview (Phase 2Q) ??? */
.dash-home {
  padding-top: 0.85rem;
}

.dash-lede {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Local usability / self-serve demo only (tenant-usability-demo) */
.demo-intro {
  margin: 0 0 1.1rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid color-mix(in srgb, var(--brand, var(--accent)) 28%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand, var(--accent)) 6%, #fff);
}

.demo-intro-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand, var(--accent));
}

.demo-intro-lede {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.45;
}

.demo-intro-paths {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.7rem;
}

@media (min-width: 720px) {
  .demo-intro-paths {
    grid-template-columns: 1fr 1fr;
  }
}

.demo-intro-card {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.demo-intro-card:hover,
.demo-intro-card:focus-visible {
  border-color: var(--brand, var(--accent));
  outline: none;
}

.demo-intro-card-title {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.demo-intro-card-text {
  display: block;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--muted);
}

.demo-intro-hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Smartphone: next session first, demo intro compacted below */
@media (max-width: 480px) {
  .dash-home {
    display: flex;
    flex-direction: column;
  }

  .dash-home > .demo-intro {
    order: 8;
    margin: 0.85rem 0 0;
    padding: 0.65rem 0.75rem 0.7rem;
  }

  .dash-home > .dash-lede {
    order: 1;
  }

  .dash-home > .dash-chip-row {
    order: 2;
  }

  .dash-home > .dash-work-split {
    order: 3;
  }

  .dash-home > .dash-section-secondary {
    order: 4;
  }

  .demo-intro-lede {
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
  }

  .demo-intro-card {
    padding: 0.55rem 0.65rem;
  }

  .demo-intro-card-text,
  .demo-intro-hint {
    display: none;
  }

  .demo-intro-paths {
    gap: 0.4rem;
    margin-bottom: 0;
  }
}

.dash-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}

.dash-chip strong {
  color: var(--ink);
}

.dash-chip.is-attention {
  border-color: #e8c4b8;
  background: #fdf6f3;
  color: #8a4b3a;
}

.dash-chip.is-warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #9a6700;
}

.dash-work-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 0.85rem;
  margin: 0 0 0.85rem;
  align-items: start;
}

.dash-followup {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.dash-section {
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin: 0 0 0.75rem;
}

.dash-section-primary {
  margin-bottom: 0;
}

.dash-section-secondary {
  background: #fbfdff;
}

.dash-section-attention {
  border-color: #e8c4b8;
  background: #fffcfb;
}

.dash-section-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.dash-section-hint {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.dash-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.dash-card {
  margin: 0;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.dash-card.is-next {
  border-color: #c5d4f0;
  background: var(--accent-soft);
}

.dash-card.is-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.dash-card.is-attention {
  border-color: #e8c4b8;
  background: #fdf6f3;
}

.dash-card-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.dash-card.is-warn .dash-card-kicker {
  color: #9a6700;
}

.dash-card.is-attention .dash-card-kicker {
  color: #8a4b3a;
}

.dash-card-title {
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.dash-card-meta {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

.dash-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.dash-card-actions .btn {
  min-height: 40px;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.dash-actions .btn {
  min-height: 40px;
}

.dash-more {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
}

.dash-more a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.dash-more a:hover {
  text-decoration: underline;
}

/* Legacy list helpers still used in a few views */
.dash-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0 0 1.25rem;
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.dash-list-item {
  margin: 0;
  min-width: 0;
}

.dash-list-link {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  min-height: 2.75rem;
}

.dash-list-link:hover {
  background: var(--accent-soft);
  border-color: #c5d4f0;
  color: inherit;
}

.dash-list-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.dash-list-primary {
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.dash-list-secondary {
  font-size: 0.9rem;
  color: var(--ink);
  word-break: break-word;
}

.dash-list-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.dash-list-action {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.15rem;
}

.dash-list-overdue .dash-card-meta {
  color: #8a4b3a;
}

.empty-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.empty-hint-positive {
  color: #3d5a4a;
}

/* ??? Forms ??? */
.form {
  display: grid;
  gap: 1rem;
  margin-top: 0.25rem;
  max-width: var(--form-max);
}

.form-wide {
  max-width: none;
}

.form.inline,
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  max-width: none;
}

.form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.label-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.required-mark {
  color: var(--bad);
  font-weight: 700;
}

.field-hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.82rem;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.form input:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 109, 255, 0.18);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.25rem;
}

/* ??? Buttons ??? */
button,
.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.btn:hover,
a.btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary,
a.btn-secondary,
button.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover,
a.btn-secondary:hover,
button.btn-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--line);
}

.btn:active,
a.btn:active,
button:active:not(.btn-secondary):not(.btn-danger) {
  background: var(--accent-pressed);
  color: #fff;
}

.btn-danger,
a.btn-danger,
button.btn-danger {
  background: #fff;
  color: var(--warn);
  border-color: #f0d7b0;
}

.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

.btn-success,
a.btn-success,
button.btn-success {
  background: var(--ok);
  color: #fff;
  border-color: var(--ok);
}

.btn-success:hover,
a.btn-success:hover,
button.btn-success:hover {
  background: #15803d;
  color: #fff;
}

.btn-sm,
a.btn-sm,
button.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.link-action {
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--accent);
}

.link-action:hover {
  text-decoration: underline;
}

/* ??? Toolbar / filters / table ??? */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  flex: 1 1 16rem;
  max-width: 28rem;
}

.search-form input[type="search"] {
  flex: 1 1 10rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  background: #fff;
}

.search-form input[type="search"]:focus,
.search-form input[type="search"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 109, 255, 0.18);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-row a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
}

.filter-row a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.filter-row a.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 28rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.data-table tbody tr:hover {
  background: rgba(232, 240, 255, 0.45);
}

.data-table .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.data-table td:first-child a {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

.data-table td:first-child a:hover {
  color: var(--accent);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-draft {
  background: var(--draft-soft);
  color: var(--draft);
}

.badge-muted {
  background: #eef1f6;
  color: var(--muted);
}

.badge-planned {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-overdue {
  background: #f3e8e4;
  color: #8a4b3a;
  font-weight: 700;
}

.due-overdue {
  color: #8a4b3a;
  font-weight: 700;
}

.actions-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
}

.actions-stack .inline-form {
  display: inline;
  margin: 0;
}

.actions-stack .inline-form .btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
}

.form select,
.form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
}

.form textarea {
  min-height: 6.5rem;
  resize: vertical;
  line-height: 1.45;
}

.pre-wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.progress-block {
  margin: 0.85rem 0 1.1rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.progress-meta strong {
  color: var(--ink);
}

.progress-track {
  height: 0.55rem;
  background: #e8eef8;
  border-radius: 999px;
  overflow: hidden;
}

.progress-track-sm {
  height: 0.4rem;
  width: 4.5rem;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.progress-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.form select:focus,
.form select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 109, 255, 0.18);
}

.flash {
  background: var(--accent-soft);
  border: 1px solid #d4e2ff;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--ink);
}

.error-list {
  margin: 0 0 1rem;
  padding: 0.75rem 0.75rem 0.75rem 1.35rem;
  background: var(--bad-soft);
  border: 1px solid #fecaca;
  border-radius: 12px;
}

.error-list .error {
  font-weight: 600;
}

/* ??? Notes save reliability ??? */
.notes-save-status {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.notes-save-status[data-state="dirty"],
.notes-save-status[data-state="draft"] {
  border-color: #c5d4f0;
  background: var(--accent-soft);
  color: var(--ink);
}

.notes-save-status[data-state="saving"] {
  border-color: #c5d4f0;
  background: var(--accent-soft);
  color: var(--accent);
}

.notes-save-status[data-state="saved"] {
  border-color: #bbf7d0;
  background: var(--ok-soft);
  color: #166534;
}

.notes-save-status[data-state="failed"],
.notes-save-status[data-state="conflict"],
.notes-save-status[data-state="offline"] {
  border-color: #fecaca;
  background: var(--bad-soft);
  color: #991b1b;
}

.notes-draft-banner {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #c5d4f0;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

/* ??? Dossier ??? */
/* Phase 2N – section nav + compact preparation */
.dossier-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0;
  padding: 0.55rem 0 0.75rem;
}

.dossier-section-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.2rem 0.1rem;
  border-bottom: 2px solid transparent;
}

.dossier-section-nav a:hover {
  color: var(--accent);
}

.dossier-section-nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.dossier-prep {
  max-width: 100%;
}

.dossier-client-name {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-brand);
  line-height: var(--cv-leading-tight, 1.25);
}

.dossier-frame {
  padding-top: 1rem;
}

.dossier-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  margin: 0 0 0.65rem;
}

.dossier-chrome-status {
  margin: 0.2rem 0 0;
}

.dossier-chrome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.dossier-body > .panel {
  margin-top: 0;
  box-shadow: none;
  border: 0;
  padding: 0;
  background: transparent;
}

.dossier-section-panel {
  margin-top: 0;
}

.dossier-section-panel + .dossier-section-panel {
  margin-top: 1rem;
}

.dossier-section-nav-wrap {
  margin: 0 0 1rem;
  border-bottom: 1px solid var(--line);
}

.dossier-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding: 0.35rem 0 0.75rem;
}

@media (max-width: 480px) {
  .dossier-section-nav-wrap {
    position: relative;
  }

  /* Edge fades signal horizontal scroll without hiding tabs */
  .dossier-section-nav-wrap::before,
  .dossier-section-nav-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0.35rem;
    width: 1.35rem;
    z-index: 1;
    pointer-events: none;
  }

  .dossier-section-nav-wrap::before {
    left: 0;
    background: linear-gradient(90deg, var(--panel), transparent);
  }

  .dossier-section-nav-wrap::after {
    right: 0;
    background: linear-gradient(270deg, var(--panel), transparent);
  }

  .dossier-section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.45rem;
    padding: 0.35rem 1rem 0.65rem;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent) 55%, var(--line)) transparent;
  }

  .dossier-section-nav::-webkit-scrollbar {
    height: 5px;
  }

  .dossier-section-nav::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--accent) 55%, var(--line));
    border-radius: 999px;
  }

  .dossier-section-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.35rem 0.15rem;
  }

  .dossier-chrome-actions {
    width: 100%;
    justify-content: stretch;
  }

  .dossier-chrome-actions .btn,
  .dossier-chrome-actions .dossier-primary-cta {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .session-history-hint {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
  }

  .session-history-table tr {
    margin: 0 0 0.4rem;
    padding: 0.45rem 0.55rem;
  }

  .session-history-table td {
    padding: 0.12rem 0;
    grid-template-columns: 4.75rem 1fr;
    font-size: 0.9rem;
  }

  .session-history-table td::before {
    font-size: 0.7rem;
  }

  .session-history-table td.actions {
    margin-top: 0.15rem;
  }

  .session-history-table .btn-compact {
    min-height: 2.25rem;
    padding: 0.35rem 0.65rem;
  }
}

.dossier-prep-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.dossier-prep-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dossier-primary-cta {
  font-size: 1.05rem;
  padding: 0.7rem 1.15rem;
}

.dossier-next-line {
  margin: 0 0 1.15rem;
  font-size: 1.02rem;
}

.dossier-next-label {
  color: var(--muted);
  font-weight: 600;
  margin-right: 0.35rem;
}

.dossier-next-stale .note {
  display: block;
  margin-top: 0.35rem;
}

.dossier-prep-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dossier-prep-block {
  padding: 0.85rem 0 0;
  border-top: 1px solid var(--line);
}

.dossier-prep-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.dossier-prep-block h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.dossier-prep-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dossier-prep-split .dossier-prep-block {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.dossier-prep-list {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

.dossier-prep-list li {
  margin: 0.25rem 0;
}

.dossier-prep-list li.is-overdue,
.dossier-prep-list li.is-overdue a {
  color: var(--bad);
}

.dossier-prep-today {
  background: var(--accent-soft);
  border: 1px solid #c5d4f0;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem !important;
  border-top: 1px solid #c5d4f0 !important;
}

.dossier-prep-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dossier-prep-meta {
  margin: 0.5rem 0;
}

@media (max-width: 720px) {
  .dossier-prep-split {
    grid-template-columns: 1fr;
  }

  .dossier-prep-actions {
    width: 100%;
  }

  .dossier-primary-cta {
    width: 100%;
    text-align: center;
  }

  .dossier-section-nav {
    gap: 0.5rem;
  }
}

.dossier-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.dossier-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.dossier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dossier-more-actions {
  position: relative;
}

.dossier-more-actions > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.dossier-more-actions > summary::-webkit-details-marker {
  display: none;
}

.dossier-more-actions[open] > summary {
  color: var(--accent);
  border-color: #c5d4f0;
  background: var(--accent-soft);
}

.dossier-more-actions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.dossier-stammdaten {
  margin: 0.35rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.dossier-stammdaten > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dossier-stammdaten > summary::-webkit-details-marker {
  display: none;
}

.dossier-stammdaten > summary h2 {
  margin: 0;
  font-size: 1.05rem;
}

.dossier-stammdaten > summary::after {
  content: "anzeigen";
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.dossier-stammdaten[open] > summary::after {
  content: "ausblenden";
}

.dossier-status-overdue {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8a4b3a;
}

.overview-details {
  margin: 0.85rem 0 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
}

.overview-details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
}

.overview-details > summary::-webkit-details-marker {
  display: none;
}

.overview-details > summary h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink, var(--ink-brand));
}

.overview-details > summary::after {
  content: "+";
  font-weight: 700;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.overview-details[open] > summary::after {
  content: "–";
}

.overview-details-body {
  padding: 0.35rem 0 0.5rem;
}

.overview-block-compact {
  margin-top: 0.75rem;
}

#client-details,
#progress-overview,
#sessions,
#goals,
#tasks,
#progress {
  scroll-margin-top: 1.25rem;
}

.overview-panel .overview-block {
  margin: 1.1rem 0 1.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.overview-panel .overview-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.overview-panel h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  color: var(--ink, var(--ink-brand));
}

.overview-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.55rem;
}

.overview-stat {
  padding: 0.55rem 0.65rem;
  background: #f7f9fc;
  border-radius: var(--radius-sm, 6px);
}

.overview-stat.is-overdue .overview-stat-value {
  color: #8a1f1f;
  font-weight: 600;
}

.overview-stat-label {
  display: block;
  font-size: 0.78rem;
  color: #5a6570;
  margin-bottom: 0.2rem;
}

.overview-stat-value {
  font-size: 0.98rem;
  font-weight: 600;
}

.overview-list {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.15rem;
}

.overview-list li {
  margin: 0.28rem 0;
}

.overview-list li.is-overdue > a {
  color: #8a1f1f;
}

.overview-sub {
  margin: 0.65rem 0 0.2rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.overview-progress-item {
  margin: 0.75rem 0 1rem;
}

.overview-progress-change {
  margin: 0 0 0.35rem;
}

.overview-module-list {
  list-style: none;
  margin: 0.35rem 0;
  padding: 0;
}

.overview-module-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}

.overview-done {
  margin: 0.75rem 0;
}

.overview-meta {
  margin-top: 0.5rem;
}

@media (max-width: 640px) {
  .overview-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.dossier-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.empty-state {
  padding: 0.85rem 0 0.35rem;
}

.concept-hint {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.8rem;
  background: #f4f7fb;
  border-left: 3px solid var(--accent, var(--accent));
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
  color: var(--ink, var(--ink-brand));
  line-height: 1.45;
}

.help-quickstart .help-defs,
.help-quickstart .help-steps {
  margin: 0.5rem 0 1.1rem;
  padding-left: 1.25rem;
}

.help-quickstart .help-steps li,
.help-quickstart .help-defs li {
  margin: 0.45rem 0;
  line-height: 1.45;
}

.help-quickstart h2 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1.08rem;
}

.empty-state .toolbar {
  margin-top: 0.75rem;
}

.list-count {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}

.client-list-name {
  display: inline-block;
  font-weight: 600;
}

.client-list-updated {
  display: block;
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.btn-compact {
  padding: 0.35rem 0.7rem;
  font-size: 0.88rem;
}

.session-row-planned td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.session-row-completed td:first-child {
  box-shadow: inset 3px 0 0 #3d8b6e;
}

.session-row-cancelled td:first-child {
  box-shadow: inset 3px 0 0 #9aa4b2;
}

.dossier-status-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

a.dossier-status-item:hover {
  border-color: #c5d4f0;
  background: var(--accent-soft);
  color: inherit;
}

a.dossier-status-item:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.dossier-status-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dossier-status-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.dossier-status-item.is-overdue .dossier-status-value {
  color: #8a4b3a;
}

.dossier-status-session {
  cursor: default;
}

.dossier-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.15rem;
  align-items: center;
  margin: 0 0 1.15rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dossier-jump a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}

.dossier-jump a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.dossier-jump a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  color: var(--accent);
}

.section-future {
  margin-top: 1rem;
  opacity: 0.95;
}

.section-future .list {
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ??? Guest / login ??? */
.auth-shell .panel {
  max-width: 26rem;
}

/* Phase 2M – wide authenticated platform shell (slim nav; shared design tokens) */
.shell-wide {
  max-width: var(--shell-max);
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(0.75rem, 2vw, 1.5rem);
}

.shell-wide .page-header h1,
.shell--admin .page-header h1 {
  color: var(--ink-brand);
}

.shell-wide .panel h2,
.shell--admin .panel h2 {
  color: var(--ink-brand);
}

.shell--admin .form {
  max-width: var(--form-max);
}

.shell--admin .panel--form,
.shell--admin .form-wide {
  max-width: min(40rem, 100%);
}

/* Avoid full-width empty admin form cards; tables/previews stay wide */
.shell--admin .panel:has(> form.form),
.shell--admin .panel:has(> .form),
.shell--admin #owner-transfer,
.shell--admin #practice-profile,
.shell--admin #coach-appearance {
  max-width: min(42rem, 100%);
}

.shell--admin .branding-preview-panel,
.shell--admin .panel:has(table.data-table),
.shell--admin .panel:has(.data-table) {
  max-width: none;
}

.shell-wide .content-wide,
.content-wide {
  width: 100%;
  max-width: none;
}

.shell-wide .panel,
.panel-wide {
  max-width: none;
  width: 100%;
}

.form-wide {
  max-width: 36rem;
}

.area-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0;
}

.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.area-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.area-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.section-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.25rem 0.15rem;
  border-bottom: 2px solid transparent;
}

.section-nav a:hover {
  color: var(--accent);
}

.section-nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}

.metric-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.metric-value {
  margin: 0.35rem 0 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: end;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.filter-bar input,
.filter-bar select {
  min-width: 10rem;
}

.app-nav-platform {
  gap: 0.65rem;
  align-items: center;
}

.nav-area-label {
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.25rem;
}

.nav-user {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap .data-table {
  width: 100%;
  min-width: 640px;
}

.badge-seed {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Phase 2M – keine doppelte Bereichsauswahl: Desktop Chips, Mobil Header-Link */
@media (min-width: 721px) {
  .app-nav-platform .nav-areas-link {
    display: none;
  }
}

@media (max-width: 720px) {
  .area-switcher {
    display: none;
  }

  .responsive-table .data-table,
  .responsive-table .data-table thead,
  .responsive-table .data-table tbody,
  .responsive-table .data-table th,
  .responsive-table .data-table td,
  .responsive-table .data-table tr {
    display: block;
  }

  .responsive-table .data-table {
    min-width: 0;
  }

  .responsive-table .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .responsive-table .data-table tr {
    margin: 0 0 0.85rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
  }

  .responsive-table .data-table td {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border: 0;
  }

  .responsive-table .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
  }

  .section-nav {
    gap: 0.5rem;
  }

  .nav-user {
    max-width: 9rem;
  }
}

/* ??? Branding / export (P5) ??? */
.branding-logo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.75rem;
}

.export-options {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
}

.export-options legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

.export-scope-panel {
  margin: 0.35rem 0 0.75rem 1.6rem;
}

.export-session-list {
  max-height: 14rem;
  overflow: auto;
  padding-right: 0.35rem;
}

.export-panel .flash.error {
  color: #8a1f1f;
}

.checkbox-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.45rem 0;
  font-weight: 400;
}

.checkbox-row input {
  margin-top: 0.2rem;
}

@media (max-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* ??? Method modules (P4) ??? */
.module-card {
  margin-bottom: 0.85rem;
}

.shell--admin .module-card .panel-header h2,
.shell--admin .template-card .panel-header h2 {
  font-size: 1rem;
  color: var(--ink-brand);
}

.shell--admin .page-lede {
  margin-top: 0;
}

.module-meta {
  margin: 0.5rem 0 1rem;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.workspace-method-panel {
  margin-top: 1rem;
}

.workspace-method-offer {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
  margin-top: 0.85rem;
}

.value-axes-table input[type="number"] {
  width: 4.5rem;
  max-width: 100%;
}

.value-axis-label {
  font-weight: 600;
}

.value-gap {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.value-deactivate-form {
  margin-top: 0.75rem;
}

/* ??? Progress / Entwicklung (Core V2) ??? */
.progress-chart {
  margin: 0 0 1rem;
}

.progress-chart figcaption {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.progress-chart-axis {
  font-size: 9px;
  fill: #6b7785;
}

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.progress-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.progress-legend-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  display: inline-block;
}

.progress-chart-multi {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 720px) {
  .progress-chart svg {
    height: auto;
    min-height: 160px;
  }
}

.progress-area-block {
  margin-bottom: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.progress-area-block > summary.progress-area-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  cursor: pointer;
  list-style: none;
}

.progress-area-block > summary.progress-area-head::-webkit-details-marker {
  display: none;
}

.progress-area-summary-title {
  font-weight: 600;
}

.progress-area-detail {
  padding: 0.5rem 0 0.25rem;
}

.progress-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}

.template-order-actions {
  white-space: nowrap;
}

.template-help-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  font-size: 0.875rem;
}

.template-kind-badge {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--primary, var(--accent));
  font-weight: 600;
}

.template-kind-extras {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.45rem;
  max-width: 100%;
}

.template-kind-extras textarea {
  min-height: 4.5rem;
  font-size: 0.875rem;
}

.scale-field {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}

.scale-field legend {
  padding: 0;
}

.scale-unset,
.form .scale-unset {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted, #5a6a7a);
  margin: 0.15rem 0 0.35rem;
}

.scale-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
}

.scale-option {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line, #d5dde8);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  min-width: 2.25rem;
  font-size: 0.9rem;
  touch-action: manipulation;
}

.scale-option:has(input:checked) {
  border-color: var(--primary, var(--accent));
  background: color-mix(in srgb, var(--primary, var(--accent)) 12%, white);
  font-weight: 600;
}

.scale-option input {
  margin: 0;
}

.scale-value-readout {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

.group-field {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
  max-width: 100%;
}

.group-field legend {
  padding: 0;
}

.group-entries {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.5rem 0;
}

.group-entry {
  border: 1px solid var(--line, #d5dde8);
  border-radius: 8px;
  padding: 0.75rem;
  background: #fafbfd;
  max-width: 100%;
}

.group-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.group-subfield {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 0.45rem;
  min-width: 0;
}

.group-subfield input,
.group-subfield textarea,
.workspace-field select {
  max-width: 100%;
  box-sizing: border-box;
}

.group-undo-toast {
  position: sticky;
  bottom: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--ink-brand);
  color: #fff;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  z-index: 5;
}

.group-undo-toast[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .scale-option {
    min-width: 2rem;
    padding: 0.4rem 0.4rem;
  }

  .group-entry-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-adapt-panel .form-inline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
}

@media (max-width: 640px) {
  .scale-option {
    min-width: 1.75rem;
    padding: 0.35rem 0.3rem;
    font-size: 0.85rem;
  }

  .scale-ends {
    flex-direction: column;
    gap: 0.2rem;
  }

  .data-table {
    min-width: 22rem;
  }

  .data-table td,
  .data-table th {
    vertical-align: top;
  }
}

@media (max-width: 390px) {
  .scale-options {
    gap: 0.25rem;
  }

  .scale-option {
    min-width: 1.55rem;
    padding: 0.3rem 0.22rem;
    font-size: 0.8rem;
  }

  .group-entry {
    padding: 0.6rem;
  }
}

.field-help {
  display: block;
  margin: 0.2rem 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted, #5a6a7a);
  line-height: 1.35;
}

.session-adapt-panel {
  margin-top: 0.75rem;
}

.session-adapt-panel summary {
  cursor: pointer;
  font-weight: 600;
}

.template-card .form-actions,
.module-card .form-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 10rem;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.progress-area-head h3 {
  margin: 0;
  font-size: 1rem;
}

.progress-area-form {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.workspace-progress-panel {
  margin: 0 0 0.75rem;
  border-left: 3px solid var(--primary, var(--accent));
  padding-left: 0.85rem;
}

.progress-score-row input[type="number"] {
  max-width: 6rem;
}

/* ??? Session workspace (P2) ??? */
.workspace {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Fallback when contentLayout not set on older render paths */
.shell:has(.workspace):not(.shell--workspace) {
  width: min(var(--shell-workspace), calc(100% - 2rem));
}

.shell:has(.workspace) .page-header {
  display: none;
}

/* Use the workspace main column; keep notes readable (~52rem max). */
.workspace-notes-form.form-wide {
  max-width: min(52rem, 100%);
  width: 100%;
}

.workspace-editor .workspace-field input,
.workspace-editor .workspace-field textarea,
.workspace-editor .workspace-field select {
  max-width: 100%;
  width: 100%;
}

.workspace-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  align-items: flex-start;
}

.workspace-header-compact {
  padding: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}

.workspace-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.workspace-client {
  margin: 0 0 0.2rem;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink-brand);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.workspace-session-window {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.workspace-header-statusline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0;
  align-items: center;
  font-size: 0.92rem;
}

.workspace-status-pair {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.workspace-meta {
  margin: 0;
}

.workspace-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
}

.workspace-header-save {
  display: inline;
  min-width: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.workspace-header-save .notes-save-status-label {
  font-weight: 600;
}

.workspace-more-actions {
  position: relative;
  display: inline-block;
}

.workspace-more-actions > summary {
  list-style: none;
  cursor: pointer;
}

.workspace-more-actions > summary::-webkit-details-marker {
  display: none;
}

.workspace-more-actions-menu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: min(18rem, 90vw);
  max-width: 22rem;
  padding: 0.75rem;
  background: var(--panel, #fff);
  border: 1px solid var(--border, #d7e0ef);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.workspace-more-actions-menu .btn,
.workspace-more-actions-menu .inline-form,
.workspace-more-actions-menu .inline-form .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

.workspace-more-actions-menu .protocol-pdf-export {
  width: 100%;
}

.workspace-more-actions-menu .protocol-pdf-export > summary {
  width: 100%;
  justify-content: center;
}

.workspace-more-actions-menu .protocol-pdf-export-menu {
  position: static;
  box-shadow: none;
  border: none;
  padding: 0.35rem 0 0;
  min-width: 0;
  width: 100%;
  max-width: none;
}

.workspace-protocol-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.65rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--panel, #fff);
}

.workspace-protocol-toolbar .notes-save-status {
  margin: 0;
  padding: 0.35rem 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
}

.workspace-protocol-toolbar #notes-save-btn {
  flex: 0 0 auto;
}

.workspace-editor-header {
  margin-bottom: 0.35rem;
}

.workspace-editor-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.workspace-legacy-compact {
  margin: 0 0 0.55rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: #f8fafc;
}

.workspace-legacy-compact > summary {
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}

.workspace-legacy-compact > summary::-webkit-details-marker {
  display: none;
}

.workspace-legacy-compact[open] > summary {
  border-bottom: 1px solid var(--line);
}

.workspace-legacy-compact > p {
  margin: 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.88rem;
}

.workspace-more-actions:not([open]) > .workspace-more-actions-menu {
  display: none !important;
}

.protocol-pdf-export:not([open]) > .protocol-pdf-export-menu {
  display: none !important;
}

.workspace-notes-actions-footer {
  position: static;
  margin-top: 0.5rem;
}

.workspace-context-mobile {
  display: none;
  margin-top: 0.75rem;
}

.workspace-context-mobile > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.55rem 0.25rem;
  min-height: 44px;
}

.workspace-context-name {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.workspace-context-contact,
.workspace-context-date {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.workspace-context-row {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.workspace-context-link {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.workspace-context-empty {
  padding: 0.65rem 0.85rem;
}

.workspace-task-overdue {
  color: var(--danger, #9b2c2c);
  font-weight: 600;
  font-size: 0.85rem;
}

.workspace-section-nav {
  margin: 0 0 0.85rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg, #fff);
  padding: 0.35rem 0 0.45rem;
  border-bottom: 1px solid var(--line);
}

.workspace-section-tabs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.workspace-section-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 0.4rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink, var(--ink-brand));
  background: var(--panel, #fff);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.15;
}

.workspace-section-tab:hover {
  border-color: var(--accent, var(--accent));
}

.workspace-section-tab.is-active,
.workspace-section-tab[aria-current="page"] {
  background: var(--accent, var(--accent));
  border-color: var(--accent, var(--accent));
  color: #fff;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 20rem);
  gap: 1.1rem;
  align-items: start;
}

.workspace-layout-solo {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-tasks-panel .workspace-action-stack .btn {
  min-height: 44px;
}

.workspace-main,
.workspace-sidebar,
.workspace-context-column {
  min-width: 0;
}

.workspace-notes-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.workspace-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.workspace-editor .workspace-notes-main {
  min-height: 14rem;
  max-height: 70vh;
  resize: vertical;
  field-sizing: content;
}

.workspace-future-warn {
  margin: 0.35rem 0 0;
  color: var(--danger, #9b2c2c);
  max-width: 16rem;
  line-height: 1.35;
}

/* Closeout: keep future warning readable (not squeezed beside the button). */
.workspace-closeout .workspace-complete-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
}

.workspace-closeout .workspace-future-warn {
  max-width: none;
  width: 100%;
}

.notes-save-status[data-state="dirty"] .notes-save-status-label,
.workspace-header-save[data-state="dirty"] .notes-save-status-label {
  font-weight: 600;
}

.workspace-side-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}

.workspace-side-block h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.workspace-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.workspace-link-list a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
}

.workspace-link-list a:hover {
  text-decoration: underline;
}

.workspace-action-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.workspace-action-stack .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.protocol-pdf-export {
  position: relative;
  display: inline-block;
}
.protocol-pdf-export > summary {
  list-style: none;
  cursor: pointer;
}
.protocol-pdf-export > summary::-webkit-details-marker {
  display: none;
}
.protocol-pdf-export-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: min(20rem, 90vw);
  max-width: 22rem;
  padding: 0.75rem;
  background: var(--panel, #fff);
  border: 1px solid var(--border, #d7e0ef);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.protocol-pdf-export-menu .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
}
.workspace-action-stack .protocol-pdf-export {
  width: 100%;
}
.workspace-action-stack .protocol-pdf-export > summary {
  width: 100%;
  justify-content: center;
  text-align: center;
}
.workspace-action-stack .protocol-pdf-export-menu {
  right: auto;
  left: 0;
  width: 100%;
  max-width: none;
}

.compact-meta > div {
  grid-template-columns: 5.5rem 1fr;
}

.workspace-notes-actions {
  /* Never sticky: bottom sticky overlayed the topic/notes fields (Phase 2O). */
  position: static;
  padding-top: 0.75rem;
  padding-bottom: 0.25rem;
}

.workspace-notes-save-hint {
  margin: 0.25rem 0 0;
}

.workspace-complete-hint {
  margin: 0.35rem 0 0;
  flex: 1 1 100%;
  max-width: 22rem;
  text-align: left;
}

@media (min-width: 961px) {
  .workspace-protocol-toolbar {
    position: sticky;
    top: 0.35rem;
    z-index: 6;
  }

  .workspace-context-mobile {
    display: none !important;
  }
}

@media (max-width: 960px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .workspace-header-actions {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
  }

  .workspace-editor .workspace-notes-main {
    min-height: 12rem;
    max-height: 50vh;
  }

  .workspace-header-actions > .btn,
  .workspace-header-actions > .workspace-more-actions,
  .workspace-header-actions > .workspace-more-actions > summary {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    white-space: normal;
  }

  .workspace-more-actions-menu {
    left: 0;
    right: auto;
    min-width: 0;
    width: min(20rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
  }

  .workspace-complete-hint {
    max-width: 100%;
  }

  .notes-save-status,
  .workspace-header-save {
    max-width: 100%;
  }

  .notes-save-status-label {
    white-space: normal;
  }

  .workspace-sidebar {
    display: none !important;
  }

  .workspace-context-mobile {
    display: block;
  }

  .workspace-layout {
    display: flex;
    flex-direction: column;
  }

  .workspace-main {
    order: 1;
  }

  .workspace-context-column {
    order: 2;
  }

  .workspace-protocol-toolbar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.45rem;
    padding: 0.3rem 0.4rem;
    gap: 0.35rem;
  }

  .workspace-protocol-toolbar .notes-save-status {
    padding: 0.25rem 0.4rem;
    font-size: 0.82rem;
    border-radius: 6px;
  }

  .workspace-protocol-toolbar #notes-save-btn {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 0.45rem 0.65rem;
  }

  /* One primary save status (toolbar) – drop header mirror on small screens. */
  .workspace-status-pair-save {
    display: none;
  }

  .workspace-header {
    gap: 0.35rem;
  }

  .workspace-header-compact {
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.4rem;
  }

  .workspace-client {
    font-size: 1.05rem;
  }

  .workspace-session-window {
    font-size: 0.86rem;
    margin-bottom: 0.15rem;
  }

  .workspace-header-statusline {
    gap: 0.15rem 0.5rem;
    font-size: 0.82rem;
  }

  .workspace-section-nav {
    margin: 0 0 0.35rem;
    padding: 0.15rem 0 0.25rem;
  }

  .workspace-section-tab {
    min-height: 36px;
    padding: 0.3rem 0.25rem;
    font-size: 0.78rem;
  }

  .workspace-editor.panel {
    padding: 0.55rem 0.65rem;
  }

  .workspace-editor-header {
    margin-bottom: 0.1rem;
  }

  .workspace-editor-title {
    font-size: 0.95rem;
  }

  /* Collapsed legacy hint still costs height – hide on phone. */
  .workspace-legacy-compact {
    display: none;
  }

  /* Status already says „Entwurf gespeichert“ – skip duplicate banner height on phones. */
  .notes-draft-banner {
    display: none;
  }

  @media (max-width: 400px) {
    .workspace-editor-header {
      display: none;
    }

    .workspace-protocol-toolbar .notes-save-status {
      border: none;
      background: transparent;
      padding: 0.15rem 0;
    }
  }

  .workspace-notes-save-hint {
    font-size: 0.8rem;
  }

  .workspace-context-column {
    width: 100%;
    max-width: 100%;
  }

  .workspace-context-mobile {
    width: 100%;
  }
}

@media (min-width: 961px) {
  .workspace-section-nav {
    position: static;
    border-bottom: none;
    padding-bottom: 0;
  }

  .workspace-section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .workspace-section-tab {
    flex: 0 1 auto;
    min-width: 6.5rem;
    padding: 0.55rem 0.75rem;
  }
}

/* Phase 2P – Gesprächsabschluss */
.workspace-closeout h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.workspace-closeout .closeout-lede {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.closeout-state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.closeout-state-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: #fbfdff;
}

.closeout-state-card .closeout-k {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.closeout-state-card .closeout-v {
  font-size: 0.95rem;
  font-weight: 650;
}

.closeout-state-card.is-ok {
  background: var(--ok-soft, #ecfdf3);
  border-color: #bbf7d0;
}

.closeout-state-card.is-ok .closeout-v {
  color: var(--ok, #166534);
}

.closeout-state-card.is-warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.closeout-state-card.is-warn .closeout-v {
  color: #9a6700;
}

.closeout-state-card.is-bad {
  background: var(--bad-soft, #fef2f2);
  border-color: #fecaca;
}

.closeout-state-card.is-bad .closeout-v {
  color: #991b1b;
}

.closeout-exit-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
}

.closeout-exit-copy {
  flex: 1 1 12rem;
  min-width: 0;
}

.closeout-exit-copy strong {
  display: block;
  font-size: 0.95rem;
}

.closeout-exit-copy span {
  display: block;
  font-size: 0.84rem;
  color: var(--ink);
  margin-top: 0.1rem;
}

.closeout-exit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.closeout-section {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.closeout-section h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
}

.closeout-opt {
  margin: 0 0 0.45rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.closeout-agree-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.closeout-agree-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  background: #fbfdff;
}

.closeout-agree-item p {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.92rem;
}

.closeout-back {
  margin: 1rem 0 0;
}

.closeout-back a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.closeout-back a:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  /* Keep protocol + session status side-by-side to save vertical space. */
  .closeout-state-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
  }

  .workspace-closeout h2 {
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
  }

  .workspace-closeout .closeout-lede {
    display: none;
  }

  .closeout-exit-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.6rem;
  }

  /* Avoid tall empty flex growth from desktop flex-basis on exit copy. */
  .closeout-exit-copy {
    flex: 0 0 auto;
    width: 100%;
  }

  .closeout-exit-copy span {
    display: none;
  }

  .closeout-exit-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  .closeout-exit-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Primary save may be alone in the first cell spanning full width when present. */
  .closeout-exit-actions .btn:first-child:nth-last-child(3) {
    grid-column: 1 / -1;
  }

  .closeout-agree-item {
    flex-direction: column;
    align-items: stretch;
  }

  .closeout-agree-item .btn {
    width: 100%;
  }

  /* Closeout has no protocol toolbar – keep header save status visible. */
  .workspace[data-ws-section="abschluss"] .workspace-status-pair-save {
    display: inline-flex;
  }

  .workspace[data-ws-section="abschluss"] .workspace-more-actions {
    display: none;
  }

  .workspace[data-ws-section="abschluss"] .workspace-session-window {
    display: none;
  }
}

/* ??? Responsive ??? */
@media (max-width: 1100px) {
  .stat-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .shell,
  .shell--standard,
  .shell--form,
  .shell--dossier,
  .shell--workspace,
  .shell--admin {
    width: calc(100% - 1.25rem);
    padding-top: 0.85rem;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    padding: 0 0.85rem;
    column-gap: 0.65rem;
    align-items: center;
    min-height: 3.25rem;
  }

  .brand {
    height: 3.25rem;
  }

  /* Open menu: brand + toggle stay on the first row; avoid vertical centering beside links */
  .topbar.is-nav-open {
    align-items: flex-start;
  }

  .nav-menu-toggle {
    display: inline-flex;
  }

  /* Collapsed by default: brand + menu button only – content visible sooner */
  .app-nav {
    display: none;
    grid-column: 1 / -1;
    flex: 1 1 100%;
    flex-basis: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    height: auto;
    gap: 0.3rem;
    margin: 0;
    padding: 0.35rem 0 0.5rem;
    border-top: 1px solid var(--line);
  }

  .topbar.is-nav-open .app-nav,
  .app-nav.is-open {
    display: flex;
  }

  .nav-primary {
    display: contents;
  }

  /* Flatten desktop menus into a labeled drawer list */
  .nav-menu {
    display: contents;
    height: auto;
  }

  .nav-menu-trigger {
    display: none;
  }

  .nav-menu-panel {
    display: contents;
    position: static;
    border: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
  }

  .nav-menu-divider {
    display: none;
  }

  .nav-group-label {
    display: block;
  }

  .app-nav a,
  .app-nav .nav-menu-item {
    font-size: 0.95rem;
    padding: 0.7rem 0.75rem;
    text-align: left;
    min-height: 44px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
  }

  .app-nav a:focus-visible,
  .app-nav .nav-menu-item:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }

  .nav-logout {
    margin-left: 0;
    width: 100%;
  }

  .nav-logout .nav-menu-item,
  .nav-logout button {
    width: 100%;
    min-height: 44px;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }

  .search-form input[type="search"],
  .search-form .btn {
    width: 100%;
    min-height: 2.5rem;
  }

  .stat-grid,
  .stat-grid-4 {
    grid-template-columns: 1fr;
  }

  .dash-columns {
    grid-template-columns: 1fr;
  }

  .dash-work-split {
    grid-template-columns: 1fr;
  }

  .dash-card-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .dash-actions .btn {
    min-height: 44px;
  }

  .workspace-future-warn {
    max-width: none;
    width: 100%;
  }

  .meta > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .data-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .data-table td {
    border: 0;
    padding: 0.2rem 0;
  }

  .data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted, #5a6a7a);
    margin-bottom: 0.1rem;
  }

  .data-table .actions {
    justify-content: flex-start;
    margin-top: 0.45rem;
  }

  .role-edit-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
  }

  .role-edit-form select,
  .role-edit-form .btn {
    max-width: 100%;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    max-width: none;
  }

  .dossier-status {
    grid-template-columns: 1fr 1fr;
  }

  .clients-overview .btn-compact {
    width: 100%;
    text-align: center;
  }

  .dossier-jump {
    gap: 0.25rem;
  }

  .dossier-jump a {
    flex: 1 1 auto;
    text-align: center;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .form {
    max-width: none;
  }

  .form-actions .btn,
  .form-actions button,
  .form-actions a.btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 420px) {
  .page-header h1 {
    font-size: 1.25rem;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }
}

/* ===== Value Coaching V1 (mobile first) ===== */
.value-coaching-panel,
.value-profile-panel {
  container-type: inline-size;
}

.value-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.value-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #d9e2ec;
}

.value-tab {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border-radius: 8px 8px 0 0;
  text-decoration: none;
  color: var(--ink-brand);
  font-size: 0.9rem;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.value-tab.is-active {
  background: #eef3ff;
  color: var(--accent);
  font-weight: 600;
}

.value-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.value-card {
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.value-card-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  min-height: 48px;
}

.value-card-summary::-webkit-details-marker {
  display: none;
}

.value-card-title {
  font-weight: 600;
  color: var(--ink-brand);
}

.value-card-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #445;
}

.value-card-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #eef2f6;
}

.value-score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.value-score-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.value-score-select {
  min-height: 48px;
  font-size: 1.05rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #c5ced8;
  touch-action: manipulation;
}

.value-bars-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.value-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.value-bar-label {
  font-weight: 600;
  color: var(--ink-brand);
}

.value-bar-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.value-bar-metric {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.value-bar-metric-label {
  font-size: 0.75rem;
  color: #667;
  width: 2rem;
  flex: 0 0 auto;
}

.value-bar-track {
  flex: 1;
  height: 10px;
  background: #eef2f6;
  border-radius: 999px;
  overflow: hidden;
}

.value-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.value-bar-current {
  background: var(--accent);
}

.value-bar-target {
  background: var(--ink-brand);
}

.value-score-num {
  font-variant-numeric: tabular-nums;
  min-width: 1.25rem;
  text-align: right;
  font-size: 0.85rem;
}

.value-score-empty {
  color: #889;
}

.value-chart-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.legend-ist::before,
.legend-ziel::before {
  content: "";
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.legend-ist::before {
  background: var(--accent);
}

.legend-ziel::before {
  background: var(--ink-brand);
}

.value-history-text {
  font-size: 0.85rem;
  color: #445;
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.value-radar-desktop-only {
  display: none;
}

.value-add-form {
  margin-bottom: 1rem;
}

.value-deactivate-form {
  margin-top: 1rem;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, #fff 30%);
  padding: 0.75rem 0 0.25rem;
  z-index: 2;
}

.value-mapping-list,
.value-reflection-list,
.value-reorder-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.value-mapping-item,
.value-reorder-list li {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
}

.value-reorder-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .value-bar-row {
    display: grid;
    grid-template-columns: minmax(7rem, 11rem) 1fr;
    align-items: center;
  }

  .value-radar-desktop-only {
    display: block;
    max-width: 280px;
    margin-top: 1rem;
  }

  .value-score-row {
    max-width: 28rem;
  }
}

@media (min-width: 1440px) {
  .value-coaching-panel .value-tabs {
    gap: 0.5rem;
  }
}

@media (max-width: 389px) {
  .value-tab {
    padding: 0.5rem 0.55rem;
    font-size: 0.85rem;
  }

  .value-score-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Value Coaching V1.1 mobile refinements ===== */
.value-card-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 8rem;
}

.value-card-prio {
  font-size: 0.8rem;
  color: #667;
}

.value-card-edit-hint {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
}

.value-card[open] .value-card-edit-hint {
  visibility: hidden;
}

.value-card-actions .btn,
.value-reorder-list .btn,
.value-tabs .value-tab {
  min-height: 44px;
}

.value-mapping-item {
  margin: 0 0 0.85rem;
}

.value-mapping-form fieldset.value-mapping-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 0.85rem;
}

.value-mapping-form legend {
  font-weight: 600;
  color: var(--ink-brand);
  padding: 0 0.25rem;
}

.value-subheading {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--ink-brand);
}

.value-reflection-block {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eef2f6;
}

.value-reflection-block:last-child {
  border-bottom: 0;
}

.value-reflection-edit {
  margin-bottom: 0.75rem;
}

.value-profile-charts {
  margin-top: 1.25rem;
}

.value-tab-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.value-coaching-panel,
.value-profile-panel {
  overflow-x: clip;
}

@media (min-width: 768px) {
  .value-card-summary {
    flex-wrap: nowrap;
  }

  .value-profile-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (min-width: 1440px) {
  .value-profile-panel .value-card-list {
    max-width: 52rem;
  }

  .value-coaching-panel .value-tab-panel {
    max-width: 56rem;
  }
}

/* ===== Systemic Coaching V1 (mobile first) ===== */
.systemic-coaching-panel {
  container-type: inline-size;
  overflow-x: clip;
  margin-top: 1.25rem;
}

.systemic-coaching-panel .sc-disclaimer {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
}

.systemic-coaching-panel .sc-subheading {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
  color: var(--ink-brand);
}

.systemic-coaching-panel .sc-form .field {
  margin-bottom: 0.75rem;
}

.systemic-coaching-panel .sc-create-form {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eef2f6;
}

.systemic-coaching-panel .sc-history {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.systemic-coaching-panel .sc-history-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.systemic-coaching-panel .sticky-form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 35%);
}

.systemic-coaching-panel .value-tab-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 390px) {
  .systemic-coaching-panel .value-tabs {
    gap: 0.15rem;
  }

  .systemic-coaching-panel .value-tab {
    padding: 0.5rem 0.55rem;
    font-size: 0.85rem;
  }
}

@media (min-width: 768px) {
  .systemic-coaching-panel .value-tab-panel {
    max-width: 42rem;
  }
}

@media (min-width: 1440px) {
  .systemic-coaching-panel .value-tab-panel {
    max-width: 56rem;
  }
}

/* ===== Solution-Focused Coaching V1 ===== */
.solution-focused-panel {
  container-type: inline-size;
  overflow-x: clip;
  margin-top: 1.25rem;
}

.solution-focused-panel .sf-miracle {
  margin: 1rem 0;
  padding: 0.75rem;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
}

.solution-focused-panel .sf-miracle legend {
  font-weight: 600;
  color: var(--ink-brand);
  padding: 0 0.25rem;
}

.solution-focused-panel .value-tab-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 390px) {
  .solution-focused-panel .value-tabs {
    gap: 0.15rem;
  }

  .solution-focused-panel .value-tab {
    padding: 0.5rem 0.55rem;
    font-size: 0.85rem;
  }
}

@media (min-width: 768px) {
  .solution-focused-panel .value-tab-panel {
    max-width: 42rem;
  }
}

@media (min-width: 1440px) {
  .solution-focused-panel .value-tab-panel {
    max-width: 56rem;
  }
}

/* ===== Business Coaching V1 ===== */
.business-coaching-panel {
  container-type: inline-size;
  overflow-x: clip;
  margin-top: 1.25rem;
}

.business-coaching-panel .value-tab-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.business-coaching-panel .bc-form .field input,
.business-coaching-panel .bc-form .field textarea,
.business-coaching-panel .bc-form .field select,
.business-coaching-panel .value-card-body .field input,
.business-coaching-panel .value-card-body .field textarea,
.business-coaching-panel .value-card-body .field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Phase 2B – method discovery / mobile inner nav */
.method-section-intro {
  margin-bottom: 0.75rem;
}

.method-purpose {
  margin: 0.35rem 0 0.75rem;
}

.method-purpose-lead {
  margin-bottom: 0.25rem;
}

.method-purpose-save {
  margin-top: 0;
}

.field-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.92rem;
}

.method-picker {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--panel-soft, #f8fafc);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.method-picker-label {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.method-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.method-picker-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
}

.method-picker-link.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 600;
}

.method-picker-link.is-offer {
  border-style: dashed;
}

.method-picker-select {
  display: none;
  margin: 0;
}

.method-open-card,
.workspace-method-offer {
  margin-bottom: 0.75rem;
}

.method-inner-nav-select {
  display: none;
  margin: 0.75rem 0 1rem;
}

@media (max-width: 720px) {
  .method-picker-wide {
    display: none;
  }

  .method-picker-select {
    display: block;
  }

  .method-picker-select select {
    min-height: 44px;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .value-coaching-panel .vc-tabs-wide,
  .systemic-coaching-panel .sc-tabs-wide,
  .solution-focused-panel .sf-tabs-wide {
    display: none;
  }

  .value-coaching-panel .vc-nav-select,
  .systemic-coaching-panel .sc-nav-select,
  .solution-focused-panel .sf-nav-select {
    display: block;
  }

  .method-inner-nav-select select {
    min-height: 44px;
    width: 100%;
  }
}

.business-coaching-panel .bc-nav-select {
  display: none;
  margin: 0.75rem 0 1rem;
}

.business-coaching-panel .bc-option-block {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
}

.business-coaching-panel .bc-influence-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.35rem;
}

.business-coaching-panel .bc-influence-list li[data-influence="high"] {
  border-left: 3px solid var(--accent);
  padding-left: 0.5rem;
}

.business-coaching-panel .bc-influence-list li[data-influence="medium"] {
  border-left: 3px solid #7aa2ff;
  padding-left: 0.5rem;
}

.business-coaching-panel .bc-influence-list li[data-influence="low"] {
  border-left: 3px solid #c5d4f5;
  padding-left: 0.5rem;
}

@media (max-width: 420px) {
  .business-coaching-panel .bc-tabs-wide {
    display: none;
  }

  .business-coaching-panel .bc-nav-select {
    display: block;
  }
}

@media (min-width: 768px) {
  .business-coaching-panel .value-tab-panel {
    max-width: 42rem;
  }
}

@media (min-width: 1440px) {
  .business-coaching-panel .value-tab-panel {
    max-width: 56rem;
  }
}

/* ===== Leadership Coaching V1 ===== */
.leadership-coaching-panel {
  container-type: inline-size;
  overflow-x: clip;
  margin-top: 1.25rem;
}

.leadership-coaching-panel .value-tab-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.leadership-coaching-panel .lc-form .field input,
.leadership-coaching-panel .lc-form .field textarea,
.leadership-coaching-panel .lc-form .field select,
.leadership-coaching-panel .value-card-body .field input,
.leadership-coaching-panel .value-card-body .field textarea,
.leadership-coaching-panel .value-card-body .field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.leadership-coaching-panel .lc-nav-select {
  display: none;
  margin: 0.75rem 0 1rem;
}

@media (max-width: 420px) {
  .leadership-coaching-panel .lc-tabs-wide {
    display: none;
  }

  .leadership-coaching-panel .lc-nav-select {
    display: block;
  }
}

@media (min-width: 768px) {
  .leadership-coaching-panel .value-tab-panel {
    max-width: 42rem;
  }
}

@media (min-width: 1440px) {
  .leadership-coaching-panel .value-tab-panel {
    max-width: 56rem;
  }
}

/* ===== NLP-Coaching V1 ===== */
.nlp-coaching-panel {
  container-type: inline-size;
  overflow-x: clip;
  margin-top: 1.25rem;
}

.nlp-coaching-panel .value-tab-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.nlp-coaching-panel .nlp-form .field input,
.nlp-coaching-panel .nlp-form .field textarea,
.nlp-coaching-panel .nlp-form .field select,
.nlp-coaching-panel .value-card-body .field input,
.nlp-coaching-panel .value-card-body .field textarea,
.nlp-coaching-panel .value-card-body .field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.nlp-coaching-panel .nlp-nav-select {
  display: none;
  margin: 0.75rem 0 1rem;
}

@media (max-width: 420px) {
  .nlp-coaching-panel .nlp-tabs-wide {
    display: none;
  }

  .nlp-coaching-panel .nlp-nav-select {
    display: block;
  }
}

@media (min-width: 768px) {
  .nlp-coaching-panel .value-tab-panel {
    max-width: 42rem;
  }
}

@media (min-width: 1440px) {
  .nlp-coaching-panel .value-tab-panel {
    max-width: 56rem;
  }
}

/* Template Editor V2 Phase 2 ? new protocol field kinds */
.protocol-heading {
  margin: 1.25rem 0 0.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #d5dcea;
  font-size: 1.1rem;
  color: var(--ink-brand);
}

.protocol-help {
  margin: 0.25rem 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: #f4f7ff;
  color: var(--ink-brand);
  font-size: 0.95rem;
}

.checkbox-field .checkbox-label,
.multiselect-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: normal;
  line-height: 1.4;
}

/* `.form label` is display:grid — keep checkbox + text as one labelled control. */
.form .checkbox-field .checkbox-label,
.form .multiselect-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: normal;
  line-height: 1.4;
}

.form .checkbox-field .checkbox-label input[type="checkbox"],
.form .multiselect-option input[type="checkbox"],
.checkbox-field .checkbox-label input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0.2em 0 0;
  padding: 0;
}

.multiselect-field {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
  max-width: 100%;
}

.multiselect-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
/* Practice branding V2 ? preview + color fields (Coavello wordmark unchanged) */
.form-section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--ink);
}
.color-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.color-field input[type="color"] {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.color-field input[type="text"],
.color-field input:not([type="color"]) {
  flex: 1 1 auto;
  min-width: 0;
}
.form-actions-inline {
  margin: 0.25rem 0 0.75rem;
}
.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
@media (max-width: 720px) {
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}
.color-row-simple input[type="color"] {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.15rem;
  cursor: pointer;
}
.advanced-colors {
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.advanced-colors > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.advanced-colors > summary::-webkit-details-marker {
  display: none;
}
.advanced-colors[open] {
  padding-bottom: 0.85rem;
}
.branding-logo-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.branding-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.branding-preview-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}
.practice-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}
.practice-card-logo {
  display: block;
  max-width: 120px;
  max-height: 48px;
  margin-bottom: 0.5rem;
}
.practice-card-name {
  margin: 0;
  font-weight: 650;
  font-size: 1.1rem;
  word-break: break-word;
}
.practice-card-coach,
.practice-card-contact {
  margin: 0.25rem 0 0;
  word-break: break-word;
}
.practice-swatches {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.practice-swatches .swatch {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.pdf-letterhead-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: #fff;
}
.pdf-letterhead-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.pdf-letterhead-logo-fallback {
  width: 48px;
  height: 28px;
  border-radius: 4px;
  flex: 0 0 auto;
}
.pdf-letterhead-org {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  word-break: break-word;
}
.pdf-letterhead-sub,
.pdf-letterhead-addr {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  word-break: break-word;
}
.pdf-letterhead-rule {
  height: 3px;
  margin: 0.65rem 0 0.55rem;
  border-radius: 2px;
}
.pdf-letterhead-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

/* C1 backlog: draft fields + required field errors + session context */
.draft-field-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--accent-soft);
}
.draft-kind-extras { margin-top: 0.5rem; }
.workspace-field.is-invalid-field,
.is-invalid-field {
  outline: 2px solid var(--bad);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.field-error {
  color: var(--bad);
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: var(--bad);
}
.session-context-preview {
  margin-bottom: 1rem;
  max-width: 100%;
  overflow-x: hidden;
}
.session-context-preview .overview-list {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.1rem;
}
.session-context-preview .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.session-context-preview .toolbar .btn {
  max-width: 100%;
}
.session-context-preview dd,
.session-context-preview .overview-list li {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.badge-warn {
  background: var(--warn);
  color: #fff;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.8rem;
}

/* Session continuity (C5.1) */
.continuity-panel {
  max-width: 44rem;
}
.continuity-panel h1 {
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  color: var(--ink-brand);
}
.continuity-source-form,
.continuity-apply-form {
  margin: 1rem 0;
}
.continuity-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.75rem 0 1.25rem;
}
.continuity-field-card {
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.continuity-field-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-weight: 600;
  color: var(--ink-brand);
  min-height: 44px;
}
.continuity-field-toggle input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  flex: 0 0 auto;
}
.continuity-conflict {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  background: #f7f9fc;
}
.continuity-conflict legend {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-brand);
  padding: 0 0.25rem;
}
.continuity-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.25rem 0;
  font-weight: 400;
}
.continuity-choice input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  flex: 0 0 auto;
}
.continuity-compare {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.continuity-preview {
  margin: 0.5rem 0 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.continuity-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
}
.continuity-actions .btn,
.continuity-open-btn {
  min-height: 44px;
}
.value-panel-header .continuity-open-btn,
.panel-header .continuity-open-btn {
  margin-left: auto;
}
@media (max-width: 420px) {
  .continuity-panel h1 {
    font-size: 1.2rem;
  }
  .continuity-actions .btn,
  .continuity-actions a.btn {
    width: 100%;
    text-align: center;
  }
}
