@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans/OpenSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans/OpenSans-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/open-sans/OpenSans-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --kbb-primary: #087f75;
  --kbb-primary-light: #44b8ad;
  --kbb-primary-dark: #0b766d;
  --kbb-secondary: #23262b;
  --kbb-secondary-dark: #171a1f;
  --kbb-accent: #d3b64f;
  --kbb-success: #1f8a4c;
  --kbb-warning: #c07b09;
  --kbb-danger: #b42318;
  --kbb-info: #1570ef;
  --font-primary: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-md: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.5rem;
  --space-sm: 0.5rem;
  --space-md: 0.625rem;
  --space-lg: 0.875rem;
  --space-xl: 1.125rem;
  --radius-sm: 1px;
  --radius-md: 2px;
  --radius-lg: 4px;
  --background: #191d22;
  --background-alt: #20252b;
  --surface: rgba(29, 34, 40, 0.9);
  --surface-strong: rgba(32, 37, 44, 0.97);
  --surface-soft: rgba(35, 40, 47, 0.98);
  --surface-tint: rgba(31, 36, 43, 0.98);
  --border: rgba(238, 242, 246, 0.1);
  --text-primary: #eef2f6;
  --text-secondary: #c7d0da;
  --text-muted: #99a5b3;
  --sidebar-surface: linear-gradient(180deg, #171a1f 0%, #101215 100%);
  --glass-highlight: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.24);
}

:root[data-theme="light"] {
  color-scheme: light;
  --kbb-primary: #087f75;
  --kbb-primary-light: #0d9488;
  --kbb-primary-dark: #075f58;
  --kbb-secondary: #e7eaee;
  --kbb-secondary-dark: #d7dce2;
  --kbb-accent: #8b6f00;
  --kbb-success: #176b3d;
  --kbb-warning: #925600;
  --kbb-danger: #a32017;
  --kbb-info: #175cd3;
  --background: #f3f5f7;
  --background-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-soft: rgba(247, 249, 251, 0.98);
  --surface-tint: rgba(240, 244, 247, 0.98);
  --border: rgba(30, 41, 59, 0.15);
  --text-primary: #17212b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --sidebar-surface: linear-gradient(180deg, #ffffff 0%, #edf1f4 100%);
  --glass-highlight: rgba(13, 148, 136, 0.08);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

main,
section,
article,
.panel,
.card,
.metric-card,
.list-head,
.stack-list,
.table-wrap,
.process-hero,
.record-hero,
.page-intro {
  min-width: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--background-alt) 96%, #fff) 0%, var(--background) 26%, var(--background) 100%);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 15px;
}

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

form,
input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
}

select {
  overflow: hidden;
  text-overflow: ellipsis;
}

a {
  color: color-mix(in srgb, var(--kbb-primary-light) 86%, #fff);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--kbb-accent) 72%, #fff);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 0.5rem 0.75rem;
  color: #fff;
  background: var(--kbb-primary-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 0.9rem 0.72rem 1rem;
  color: #fff;
  background: var(--sidebar-surface);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.portal-nav-tree {
  display: grid;
  align-content: start;
  gap: 0.34rem;
}

.brand {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.85rem;
  padding: 0.15rem 0.15rem 0.35rem;
}

.brand.large {
  margin-bottom: 1.25rem;
  justify-items: start;
}

.brand-logo {
  width: min(212px, 100%);
  height: auto;
  display: block;
}

.brand-home {
  color: inherit;
  display: grid;
  gap: 0.28rem;
  padding: 0.2rem;
  text-decoration: none;
}

.brand-home:hover,
.brand-home:focus-visible {
  color: inherit;
}

.brand-home:focus-visible {
  border-radius: 8px;
  outline: 3px solid var(--kbb-accent);
  outline-offset: 2px;
}

.brand-copy {
  display: block;
}

.brand-logo.color { display: none; }
.brand-logo.white { display: block; }

:root[data-theme="light"] .brand-logo.color { display: block; }
:root[data-theme="light"] .brand-logo.white { display: none; }

.brand strong {
  display: block;
  font-size: 0.96rem;
  line-height: 1.15;
}

.auth-card .brand h1 {
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
}

.brand span {
  display: block;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 0.08rem;
  text-transform: uppercase;
}

.brand-mark { display: none; }

.nav-group {
  margin: 0.72rem 0 0.15rem;
  padding: 0.72rem 0.55rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand + .nav-group {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.nav-section {
  margin: 0;
  padding: 0.22rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 18%, transparent);
}

.nav-section.active,
.nav-section[data-active="true"] {
  border-color: color-mix(in srgb, var(--kbb-primary-light) 35%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface-soft));
}

.nav-section-title,
.nav-section-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.1rem 0.45rem;
  align-items: center;
  min-height: 40px;
  padding: 0.42rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  cursor: pointer;
  list-style: none;
}

.nav-section-summary::-webkit-details-marker {
  display: none;
}

.nav-section-title::-webkit-details-marker {
  display: none;
}

.nav-section-title::after {
  content: ">";
  color: rgba(255, 255, 255, 0.54);
  font-size: 1.05rem;
  grid-column: 2;
  grid-row: 1 / span 2;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.nav-section[open] .nav-section-title::after {
  transform: rotate(90deg);
}

.nav-section-direct {
  text-decoration: none;
}

.nav-section-direct::after {
  content: "→";
  transform: none;
}

.nav-section-summary:hover,
.nav-section-summary.active {
  color: #fff;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 42%, transparent), color-mix(in srgb, var(--kbb-primary) 10%, transparent));
  border-color: color-mix(in srgb, var(--kbb-primary-light) 24%, transparent);
  text-decoration: none;
}

.nav-section-title span,
.nav-section-summary span {
  grid-column: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-section-title small,
.nav-section-summary small {
  grid-column: 1;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.67rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  white-space: normal;
}

.nav-section-links {
  display: grid;
  gap: 0.2rem;
  padding: 0.12rem 0 0.04rem;
}

.nav-link {
  display: flex;
  align-items: flex-start;
  position: relative;
  min-height: 42px;
  padding: 0.62rem 0.68rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
}

.nav-link[aria-current="page"] {
  border-left-color: var(--kbb-accent);
  box-shadow: inset 3px 0 0 var(--kbb-accent);
}

.nav-link[aria-current="page"]::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0.35rem 0 0 auto;
  border-radius: 999px;
  background: var(--kbb-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kbb-accent) 18%, transparent);
  flex: 0 0 auto;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  text-decoration: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 42%, transparent), color-mix(in srgb, var(--kbb-primary) 10%, transparent));
  border-color: color-mix(in srgb, var(--kbb-primary-light) 24%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.main {
  min-width: 0;
  padding: clamp(0.75rem, 1.6vw, 1.25rem);
  overflow: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) auto;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.topbar-area,
.topbar-page-title,
.topbar-user {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-area {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.topbar-page-title {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.2;
}

.topbar-user {
  max-width: 12rem;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: flex-end;
}

.topbar-actions form {
  margin: 0;
}

.portal-breadcrumb {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.portal-breadcrumb a,
.portal-breadcrumb strong {
  color: var(--text-secondary);
  font-weight: 800;
}

.portal-breadcrumb a:hover {
  color: var(--text-primary);
}

.portal-breadcrumb strong {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  margin: -0.35rem 0 0.85rem;
  padding: 0.25rem 0.35rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.workspace-switcher > span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.workspace-switcher > div {
  display: flex;
  gap: 0.25rem;
}

.workspace-switcher a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 32px;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 750;
  text-decoration: none;
}

.workspace-switcher a:hover {
  border-color: var(--border);
  color: var(--text-primary);
  background: var(--surface-soft);
}

.workspace-switcher a.active {
  border-color: color-mix(in srgb, var(--kbb-primary-light) 42%, var(--border));
  color: var(--text-primary);
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface));
}

.workspace-switcher a.active::before {
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.38rem;
  border-radius: 999px;
  background: var(--kbb-primary-light);
  content: "";
}

.page-outline {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.page-outline > summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 800;
}

.page-outline-links {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.45rem;
  overflow-x: auto;
}

.page-outline-links a {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  padding: 0.22rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.page-outline-links a[aria-current="location"] {
  border-color: var(--kbb-primary-light);
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--kbb-primary-light);
}

.portal-context {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: var(--space-md);
  align-items: center;
  margin: 0 0 var(--space-lg);
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 92%, var(--kbb-primary) 8%), var(--surface));
  box-shadow: var(--shadow-sm);
}

.portal-context > div {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}

.portal-context strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 1.02rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-context small {
  color: var(--text-secondary);
}

.context-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.context-links a,
.context-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  font-size: var(--font-sm);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.context-more summary::-webkit-details-marker {
  display: none;
}

.context-links a:hover,
.context-more summary:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--kbb-primary-light) 36%, var(--border));
  text-decoration: none;
}

.context-more {
  position: relative;
}

.context-more > div {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  display: grid;
  gap: 0.3rem;
  min-width: 210px;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.context-more > div a {
  justify-content: flex-start;
}

.participant-context {
  margin-top: -0.15rem;
}

.participant-portal .process-hero,
.participant-portal .portal-context {
  width: 100%;
}

.participant-portal .portal-context h1 {
  margin: 0.12rem 0 0;
  font-size: var(--font-xl);
  line-height: 1.2;
}

.participant-portal .card strong,
.participant-portal .profile-head > div,
.participant-portal .profile-head :is(h2, p) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.participant-portal .section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem;
}

.participant-portal .process-hero {
  margin-top: 0;
}

.global-search {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
  width: 100%;
  max-width: 620px;
  justify-self: center;
}

.global-search input {
  min-height: 36px;
}

.theme-toggle {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
  line-height: 1;
}

.theme-icon.sun { display: none; }

:root[data-theme="light"] .theme-icon.moon { display: none; }
:root[data-theme="light"] .theme-icon.sun { display: inline-flex; }

:root[data-theme="light"] .sidebar {
  color: var(--text-primary);
  border-right-color: var(--border);
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .brand span,
:root[data-theme="light"] .nav-group {
  color: var(--text-muted);
}

:root[data-theme="light"] .nav-group {
  border-top-color: var(--border);
}

:root[data-theme="light"] .brand + .nav-group {
  border-top: 0;
}

:root[data-theme="light"] .nav-link {
  color: var(--text-secondary);
}

:root[data-theme="light"] .nav-section {
  border-color: var(--border);
  background: color-mix(in srgb, var(--kbb-primary) 4%, #fff);
}

:root[data-theme="light"] .nav-section.active,
:root[data-theme="light"] .nav-section[data-active="true"] {
  border-color: color-mix(in srgb, var(--kbb-primary) 28%, var(--border));
  background: color-mix(in srgb, var(--kbb-primary) 8%, #fff);
}

:root[data-theme="light"] .nav-section-title,
:root[data-theme="light"] .nav-section-summary {
  color: var(--text-secondary);
}

:root[data-theme="light"] .nav-section-title::after {
  color: var(--text-muted);
}

:root[data-theme="light"] .nav-section-title small,
:root[data-theme="light"] .nav-section-summary small {
  color: var(--text-muted);
}

:root[data-theme="light"] .nav-section-summary:hover,
:root[data-theme="light"] .nav-section-summary.active,
:root[data-theme="light"] .nav-link:hover,
:root[data-theme="light"] .nav-link.active {
  color: var(--text-primary);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--kbb-primary) 9%, #fff), color-mix(in srgb, var(--kbb-primary) 5%, #fff));
  border-color: color-mix(in srgb, var(--kbb-primary) 28%, var(--border));
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-primary);
  line-height: 1.22;
}

h1 {
  font-size: 1.35rem;
  font-weight: 800;
}

h2 {
  margin-bottom: 0.85rem;
  font-size: 1.08rem;
  font-weight: 800;
}

.topbar span,
.muted {
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--background-alt) 96%, #fff) 0%, var(--background) 36%, #14171b 100%);
}

.auth-card {
  width: min(560px, 100%);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-strong) 99%, transparent);
  box-shadow: var(--shadow-md);
}

.auth-card.wide { width: min(680px, 100%); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.auth-help { margin: var(--space-sm) 0 0; }

.badge-login-card { display: grid; gap: var(--space-lg); }

.badge-login-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-lg);
}

.badge-login-heading h2 { margin: 0.25rem 0 0.4rem; }
.badge-login-heading p { margin: 0; color: var(--text-secondary); }

.badge-camera-panel,
.badge-password-panel {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.badge-camera-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  background: #080b0d;
}

.badge-camera-frame video { width: 100%; height: 100%; object-fit: cover; }

.badge-camera-target {
  position: absolute;
  inset: 16%;
  border: 3px solid var(--kbb-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 999px rgb(0 0 0 / 32%);
}

.badge-login-status {
  padding: 0.7rem 0.8rem;
  border-left: 3px solid var(--kbb-info);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.badge-login-status[data-state="success"] { border-left-color: var(--kbb-success); }
.badge-login-status[data-state="error"] { border-left-color: var(--kbb-danger); }
.badge-login-status[data-state="working"] { border-left-color: var(--kbb-accent); }

.badge-identified-person { display: grid; gap: 0.15rem; }
.badge-identified-person span { color: var(--text-muted); font-size: var(--font-sm); }
.badge-identified-person strong { font-size: var(--font-lg); }

@media (max-width: 640px) {
  .badge-login-heading { display: grid; }
  .badge-login-heading .status-chip { justify-self: start; }
}

.auth-card .brand {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.qr {
  width: 220px;
  height: 220px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.grid.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 30%, var(--border));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--kbb-primary) 13%, var(--surface-strong)), color-mix(in srgb, var(--surface-strong) 98%, transparent));
  box-shadow: var(--shadow-sm);
}

.dashboard-hero h2 {
  margin: 0.15rem 0 0.25rem;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}

.dashboard-hero p,
.metric-card p {
  margin: 0;
  color: var(--text-secondary);
}

.eyebrow {
  color: var(--kbb-accent);
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: var(--space-lg);
  align-items: start;
}

.dashboard-priority {
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}

.dashboard-priority .metric-card {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  min-height: 168px;
}

.dashboard-priority .metric-card a {
  align-self: end;
  font-size: var(--font-sm);
  font-weight: 800;
}

.dashboard-mini-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.grid.cards.compact .card strong {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.portal-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: var(--space-lg);
  align-items: stretch;
  margin-bottom: var(--space-lg);
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 36%, var(--border));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--kbb-primary) 16%, var(--surface-strong)), color-mix(in srgb, var(--surface-strong) 98%, transparent));
  box-shadow: var(--shadow-sm);
}

.portal-home-hero h2 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.45rem, 2vw, 2.05rem);
}

.portal-home-hero p {
  max-width: 74ch;
  margin: 0;
  color: var(--text-secondary);
}

.hero-decision {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--kbb-accent) 38%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--kbb-accent) 10%, var(--surface));
}

.hero-decision span {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-decision strong {
  font-size: 2.2rem;
  line-height: 1;
}

.hero-decision small {
  color: var(--text-secondary);
  font-size: var(--font-xs);
  line-height: 1.35;
}

.hero-decision a {
  font-size: var(--font-sm);
  font-weight: 800;
}

.today-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.today-strip a,
.today-strip > .marketing-status-kpi {
  display: grid;
  gap: 0.18rem;
  min-height: 104px;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--kbb-success);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-strong) 98%, transparent);
  box-shadow: var(--shadow-sm);
}

.today-strip > .marketing-status-kpi {
  align-content: start;
}

.today-strip > .marketing-status-kpi.needs-work {
  border-left-color: var(--kbb-warning);
  background: color-mix(in srgb, var(--kbb-warning) 8%, var(--surface-strong));
}

.today-strip > .marketing-status-kpi .status-pill {
  justify-self: start;
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.today-strip a:hover,
.workspace-card:hover,
.quality-list a:hover,
.system-links a:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--kbb-primary) 48%, var(--border));
}

.today-strip a.needs-work {
  border-left-color: var(--kbb-warning);
  background: color-mix(in srgb, var(--kbb-warning) 8%, var(--surface-strong));
}

.today-strip span,
.workspace-kicker {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.today-strip strong {
  font-size: 1.9rem;
  line-height: 1;
}

.today-strip small {
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.dashboard-room-availability {
  margin-bottom: var(--space-lg);
}

.room-availability-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.room-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.room-summary-card.free { border-left-color: var(--kbb-success); }
.room-summary-card.occupied { border-left-color: var(--kbb-warning); }
.room-summary-card.unavailable { border-left-color: var(--text-muted); }
.room-summary-card span { color: var(--text-secondary); font-weight: 750; }
.room-summary-card strong { font-size: 1.45rem; }

.room-availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-sm);
}

.room-availability-card {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--text-muted);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.room-availability-card.free { border-top-color: var(--kbb-success); }
.room-availability-card.occupied { border-top-color: var(--kbb-warning); }
.room-availability-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); }
.room-availability-card-head > div { display: grid; gap: 0.12rem; min-width: 0; }
.room-availability-card-head > div > span { color: var(--text-muted); font-size: var(--font-xs); font-weight: 800; letter-spacing: 0.06em; }
.room-availability-card p { margin: 0; color: var(--text-secondary); }
.room-availability-card p strong { color: var(--text-primary); }
.room-availability-card > small { color: var(--text-muted); }

.room-current-occupancy {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.room-current-occupancy > div {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
}

.room-current-occupancy dt {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.room-current-occupancy dd {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  margin: 0;
  color: var(--text-secondary);
}

.room-current-occupancy dd strong { color: var(--text-primary); }
.room-current-occupancy dd span { color: var(--text-muted); font-size: var(--font-sm); }

.room-live-status {
  flex: 0 0 auto;
  padding: 0.22rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--font-xs);
  font-weight: 850;
}

.room-live-status.free { color: var(--kbb-success); background: color-mix(in srgb, var(--kbb-success) 10%, var(--surface-strong)); }
.room-live-status.occupied { color: var(--text-primary); background: color-mix(in srgb, var(--kbb-warning) 22%, var(--surface-strong)); }
.room-live-status.unavailable { color: var(--text-secondary); background: var(--surface-soft); }

.workspace-card {
  display: grid;
  gap: 0.35rem;
  min-height: 148px;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--kbb-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-strong) 99%, transparent);
  box-shadow: var(--shadow-sm);
}

.workspace-card.warn {
  border-top-color: var(--kbb-warning);
}

.workspace-card.bad {
  border-top-color: var(--kbb-danger);
}

.workspace-card strong {
  font-size: 1.08rem;
}

.workspace-card p {
  margin: 0;
  color: var(--text-secondary);
}

.workspace-card em {
  align-self: end;
  color: color-mix(in srgb, var(--kbb-primary-light) 88%, #fff);
  font-style: normal;
  font-size: var(--font-sm);
  font-weight: 800;
}

.workspace-card:focus-visible,
.today-strip a:focus-visible,
.quality-list a:focus-visible,
.system-links a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--kbb-accent) 72%, #fff);
  outline-offset: 2px;
}

.dashboard-layout.refined {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.dashboard-room-widget { margin-bottom: var(--space-lg); }
.dashboard-room-content {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: stretch;
}
.dashboard-room-overview { display: grid; grid-template-rows: auto 1fr; gap: var(--space-md); min-width: 0; }
.dashboard-room-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.dashboard-room-counts span,
.dashboard-room-next-list span {
  display: grid;
  gap: 0.12rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--text-muted);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}
.dashboard-room-counts span.free { border-top-color: var(--kbb-success); background: color-mix(in srgb, var(--kbb-success) 6%, var(--surface-strong)); }
.dashboard-room-counts span.occupied { border-top-color: var(--kbb-danger); background: color-mix(in srgb, var(--kbb-danger) 5%, var(--surface-strong)); }
.dashboard-room-counts span.attention { border-top-color: var(--kbb-warning); background: color-mix(in srgb, var(--kbb-warning) 7%, var(--surface-strong)); }
.dashboard-room-counts strong { font-size: 1.55rem; line-height: 1; }
.dashboard-room-counts small,
.dashboard-room-next small { color: var(--text-muted); }
.dashboard-room-next { display: grid; align-content: start; gap: 0.5rem; }
.dashboard-room-next > strong { font-size: var(--font-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.dashboard-room-next-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.dashboard-room-next-list span { border-top: 1px solid var(--border); border-left: 4px solid var(--kbb-primary); }
.dashboard-room-next-list span.empty { grid-column: 1 / -1; min-height: 74px; align-content: center; border-left-color: var(--text-muted); }
.dashboard-room-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  min-width: 0;
  padding: 0.75rem 1rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #f8faf9 0%, #eef4f2 100%);
  color: var(--text-primary);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.dashboard-room-preview:hover,
.dashboard-room-preview:focus-visible { border-color: var(--kbb-primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.dashboard-room-preview-label { justify-self: start; color: var(--text-muted); font-size: var(--font-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.dashboard-room-preview-action { justify-self: end; color: var(--kbb-primary); font-size: var(--font-sm); font-weight: 800; }

.room-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.room-summary article {
  display: grid;
  gap: 0.2rem;
  min-height: 92px;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--text-muted);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}
.room-summary article.free { border-top-color: var(--kbb-success); }
.room-summary article.occupied { border-top-color: var(--kbb-danger); }
.room-summary article.attention { border-top-color: var(--kbb-warning); }
.room-summary article span { color: var(--text-muted); font-size: var(--font-sm); font-weight: 700; }
.room-summary article strong { font-size: 1.65rem; }
.room-summary .room-time { font-size: 1rem; }

.room-plan-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.room-plan-controls .segmented,
.room-plan-controls .button-row { align-self: end; }
.segmented { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.segmented button.active,
.room-view-switch button.active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--kbb-primary) 24%, transparent); }
.room-view-switch { display: flex; align-items: center; gap: 0.5rem; margin-bottom: var(--space-md); }
.room-view-switch .muted { margin-left: auto; }
.room-view-switch .error { color: var(--kbb-danger); font-weight: 800; }

.room-plan-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: var(--space-lg);
  align-items: start;
}
.room-plan-canvas { overflow: auto; background: #f5f6f6; }
.room-plan-canvas.is-stale { border-color: var(--kbb-danger); }
.room-plan-svg { display: block; width: 100%; min-width: 560px; height: auto; }
.room-plan-svg:not(.compact) { max-width: 880px; margin-inline: auto; }
.room-plan-svg.compact { width: auto; min-width: 0; height: 255px; max-width: 100%; }
.room-plan-svg .floor-shell,
.room-plan-svg .floor-wall { fill: #fff; stroke: #5d6464; stroke-width: 7; stroke-linecap: square; stroke-linejoin: miter; }
.room-plan-svg .floor-wall { fill: none; }
.room-plan-svg .context-label { fill: #3b4141; font: 600 14px system-ui, sans-serif; }
.room-shape { cursor: pointer; outline: none; }
.room-shape rect { fill: #dfe4e3; stroke: #64706e; stroke-width: 4; transition: filter 120ms ease, stroke-width 120ms ease; }
.room-shape text { pointer-events: none; fill: #17201f; font: 800 14px system-ui, sans-serif; }
.room-shape .room-code { fill: #3c514d; font-size: 11px; letter-spacing: 0.08em; }
.room-shape .room-name { font-size: 14px; }
.room-shape .room-state-label { font-size: 13px; }
.room-shape .room-state-detail { font-size: 11px; font-weight: 600; }
.room-shape.status-free rect { fill: #ccebd8; stroke: #167846; }
.room-shape.status-soon rect { fill: #ffe4a8; stroke: #a66500; }
.room-shape.status-occupied rect { fill: #f5c6c9; stroke: #a32632; }
.room-shape.status-conflict rect { fill: #edc8fa; stroke: #7a1b92; stroke-width: 7; stroke-dasharray: 14 6; }
.room-shape.status-blocked rect { fill: #d6d9dc; stroke: #4c5358; stroke-dasharray: 8 6; }
.room-shape.status-no-data rect,
.room-shape.status-error rect { fill: #eceff0; stroke: #626c70; stroke-dasharray: 3 7; }
.room-shape:hover rect,
.room-shape:focus-visible rect,
.room-shape[aria-pressed="true"] rect { filter: brightness(0.94); stroke-width: 8; }
.room-shape.filtered-out { opacity: 0.13; pointer-events: none; }

.room-legend { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: var(--space-md); color: #17201f; }
.room-legend span,
.room-status-pill { padding: 0.28rem 0.48rem; border: 1px solid #6d7775; border-radius: 999px; background: #fff; color: #17201f; font-size: var(--font-xs); font-weight: 800; }
.room-legend .free, .room-status-pill.status-free { border-color: #167846; }
.room-legend .soon, .room-status-pill.status-soon { border-color: #a66500; }
.room-legend .occupied, .room-status-pill.status-occupied { border-color: #a32632; }
.room-legend .conflict, .room-status-pill.status-conflict { border: 2px dashed #7a1b92; }
.room-legend .blocked, .room-status-pill.status-blocked { border-style: dashed; }

.room-list { display: grid; gap: 0.55rem; }
.room-list[hidden],
.room-plan-canvas[hidden] { display: none !important; }
.room-list-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--space-md);
  width: 100%;
  min-height: 72px;
  padding: 0.7rem;
  text-align: left;
  color: var(--text-primary);
  border-left: 6px solid var(--text-muted);
  background: var(--surface-strong);
}
.room-list-card span { display: grid; gap: 0.15rem; }
.room-list-card small { color: var(--text-muted); }
.room-list-card.status-free { border-left-color: var(--kbb-success); }
.room-list-card.status-soon { border-left-color: var(--kbb-warning); }
.room-list-card.status-occupied { border-left-color: var(--kbb-danger); }
.room-list-card.status-conflict { border: 3px dashed #a44bc0; }
.room-detail { position: sticky; top: var(--space-md); min-height: 360px; }
.room-detail:focus { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.room-detail-head { display: grid; gap: 0.35rem; }
.room-detail-head .room-status-pill { justify-self: start; }
.room-detail-head h2 { margin: 0; }
.room-detail-head p { margin: 0 0 0.25rem; }
.room-detail dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.room-detail dl div { padding: 0.55rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.room-detail dt { color: var(--text-muted); font-size: var(--font-xs); font-weight: 800; }
.room-detail dd { margin: 0.15rem 0 0; }
.room-bookings { display: grid; gap: 0.4rem; padding: 0; list-style: none; }
.room-bookings li { display: grid; gap: 0.1rem; padding: 0.5rem; border-left: 4px solid var(--kbb-primary); background: var(--surface); }
.room-bookings span { color: var(--text-muted); }
.room-conflict-explanation { display: grid; gap: 0.2rem; margin: 0.75rem 0; padding: 0.7rem; border: 2px dashed #a44bc0; border-radius: var(--radius-md); }

.room-mapping-list { display: grid; gap: var(--space-md); }
.room-mapping-row { display: grid; grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1fr) auto minmax(180px, 0.7fr) auto; gap: var(--space-md); align-items: end; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md); }
.room-mapping-row > div { display: grid; gap: 0.2rem; }
.room-mapping-row span { color: var(--text-muted); font-size: var(--font-sm); }
.room-mapping-row.has-error { border: 3px dashed var(--kbb-danger); }
.conflict-confirmation { padding: 0.65rem; border: 2px dashed var(--kbb-warning); border-radius: var(--radius-md); background: color-mix(in srgb, var(--kbb-warning) 7%, var(--surface)); }

@media (max-width: 960px) {
  .dashboard-room-content { grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr); }
  .dashboard-room-counts,
  .dashboard-room-next-list { grid-template-columns: 1fr; }
  .dashboard-room-next-list span.empty { grid-column: auto; }
  .room-summary { grid-template-columns: repeat(2, 1fr); }
  .room-plan-controls { grid-template-columns: repeat(2, 1fr); }
  .room-plan-workspace { grid-template-columns: 1fr; }
  .room-detail { position: static; }
  .room-mapping-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .dashboard-room-content,
  .dashboard-room-counts,
  .dashboard-room-next-list,
  .room-summary,
  .room-plan-controls,
  .room-detail dl,
  .room-mapping-row { grid-template-columns: 1fr; }
  .dashboard-room-preview { order: -1; }
  .room-plan-svg.compact { height: 280px; }
  .room-list-card { grid-template-columns: 1fr; }
  .room-view-switch { flex-wrap: wrap; }
  .room-view-switch .muted { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .room-shape rect { transition: none; }
}

.priority-panel {
  min-width: 0;
}

.priority-list {
  display: grid;
  gap: 0.45rem;
}

.priority-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-md);
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.priority-row:last-child {
  border-bottom: 0;
}

.priority-row strong {
  display: block;
  margin-top: 0.25rem;
}

.priority-row p {
  margin: 0.12rem 0 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.status.warn {
  border-color: color-mix(in srgb, var(--kbb-warning) 56%, var(--border));
  color: color-mix(in srgb, var(--kbb-warning) 82%, #fff);
}

.status.bad {
  border-color: color-mix(in srgb, var(--kbb-danger) 56%, var(--border));
  color: color-mix(in srgb, var(--kbb-danger) 82%, #fff);
}

.quality-list,
.system-links {
  display: grid;
  gap: 0.45rem;
}

.quality-list a,
.system-links a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.quality-list span {
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: 800;
}

.quality-list .quality-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.quality-list .quality-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.system-links a {
  grid-template-columns: 1fr;
  font-weight: 800;
}

.process-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-lg);
  align-items: center;
  margin-bottom: var(--space-lg);
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 34%, var(--border));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--kbb-primary) 12%, var(--surface-strong)), color-mix(in srgb, var(--surface-strong) 98%, transparent));
  box-shadow: var(--shadow-sm);
}

.process-hero h2 {
  margin: 0.1rem 0 0.3rem;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.process-hero p {
  margin: 0;
  color: var(--text-secondary);
}

.process-stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.process-stage-grid article {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  min-height: 126px;
  padding: 0.72rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--kbb-primary);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 99%, transparent);
  box-shadow: var(--shadow-sm);
}

.process-stage-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 30px;
  height: 30px;
  padding: 0 0.35rem;
  color: #fff;
  background: var(--kbb-primary);
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.process-stage-grid p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.readiness-ring {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  min-height: 36px;
  padding: 0.22rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--text-muted) 38%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  font-size: var(--font-sm);
  font-weight: 800;
}

.readiness-ring.ok {
  border-color: color-mix(in srgb, var(--kbb-success) 54%, var(--border));
  background: color-mix(in srgb, var(--kbb-success) 10%, var(--surface));
}

.readiness-ring.warn {
  border-color: color-mix(in srgb, var(--kbb-warning) 58%, var(--border));
  background: color-mix(in srgb, var(--kbb-warning) 10%, var(--surface));
}

.readiness-ring.bad {
  border-color: color-mix(in srgb, var(--kbb-danger) 58%, var(--border));
  background: color-mix(in srgb, var(--kbb-danger) 10%, var(--surface));
}

.process-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

.process-checklist.compact {
  grid-template-columns: 1fr;
  margin-top: var(--space-sm);
}

.process-checklist article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.58rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--kbb-warning);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
}

.process-checklist article.done {
  border-left-color: var(--kbb-success);
}

.process-checklist article.open {
  border-left-color: var(--kbb-warning);
}

.process-checklist article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 0.32rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-strong) 98%, transparent);
  font-size: var(--font-xs);
  font-weight: 800;
}

.process-checklist p {
  margin: 0.12rem 0 0;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
  align-items: start;
}

.qm-workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.qm-priority-work {
  margin-bottom: var(--space-lg);
}

.qm-work-queue {
  display: grid;
  gap: 0.45rem;
}

.qm-work-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  min-height: 58px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--surface);
}

.qm-work-item:hover {
  border-color: color-mix(in srgb, var(--kbb-primary) 42%, var(--border));
}

.qm-work-item > span:nth-child(2) {
  display: grid;
  gap: 0.15rem;
}

.qm-work-item small {
  color: var(--text-muted);
}

.qm-work-rank {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--kbb-primary) 14%, var(--surface));
  font-weight: 800;
}

.workspace-panel {
  display: grid;
  gap: var(--space-sm);
  align-content: start;
}

.workspace-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.workspace-panel p {
  margin: 0;
}

.record-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: var(--space-lg);
  align-items: stretch;
  margin-bottom: var(--space-md);
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 32%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
  box-shadow: var(--shadow-sm);
}

.record-identity {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-width: 0;
}

.record-identity > div {
  min-width: 0;
}

.record-avatar-img,
.record-avatar-initials {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.record-avatar-img {
  display: block;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--kbb-primary) 38%, var(--border));
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
}

.record-avatar-button {
  display: inline-flex;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.record-avatar-initials {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--kbb-primary), var(--kbb-primary-dark));
  font-size: 1.55rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.record-hero h2 {
  margin: 0.1rem 0 0.35rem;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.record-hero p {
  margin: 0;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.record-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.record-meta-line span {
  padding: 0.22rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.record-next {
  display: grid;
  gap: 0.35rem;
  align-content: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--kbb-accent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.record-next span,
.record-summary-grid span,
.content-command-grid span {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.record-next a {
  font-weight: 800;
}

.record-section-nav {
  position: sticky;
  top: calc(58px + var(--space-sm));
  z-index: 12;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
  box-shadow: var(--shadow-sm);
}

.participant-record-tabs {
  border-radius: var(--radius-md);
  gap: 0;
  padding: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

.participant-record-tabs a {
  border-right: 1px solid var(--border);
  border-radius: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-record-tabs a:first-child {
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.participant-record-tabs a:last-child {
  border-right: 0;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.record-section-nav a {
  min-height: 36px;
}

.participant-record-tabs a:hover,
.participant-record-tabs a:focus-visible {
  background: color-mix(in srgb, var(--kbb-primary) 13%, var(--surface));
}

.participant-record-tabs a {
  scroll-snap-align: start;
}

.record-section-nav a {
  min-height: 34px;
  padding: 0.45rem 0.62rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 800;
  white-space: nowrap;
}

.participant-record-tabs a {
  padding-right: 0.48rem;
  padding-left: 0.48rem;
  font-size: var(--font-sm);
}

.record-section-nav a:hover,
.record-section-nav a:focus-visible {
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface));
}

.participant-today {
  margin-bottom: var(--space-md);
}

.participant-today-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.participant-today-grid article {
  display: grid;
  gap: 0.2rem;
  min-height: 74px;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.participant-today-grid span {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.participant-today-grid strong {
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.compact-table table th,
.compact-table table td {
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

.document-workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: var(--space-md);
  align-items: start;
}

.staff-public-profile-grid {
  align-items: stretch;
}

.staff-profile-image-editor {
  display: grid;
  grid-template-columns: minmax(112px, 150px) 1fr;
  gap: 1rem;
  align-items: start;
}

.staff-profile-preview {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1.15rem;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  box-shadow: 0 16px 34px rgba(18, 40, 46, 0.13);
}

.consent-check {
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

@media (max-width: 640px) {
  .staff-profile-image-editor {
    grid-template-columns: 1fr;
  }

  .staff-profile-preview {
    max-width: 180px;
  }
}

.document-workflow-block,
.document-template-list {
  display: grid;
  gap: var(--space-sm);
  min-width: 0;
}

.document-workflow-block h3,
.document-template-list h3 {
  margin: 0;
}

.document-editor-shell {
  display: grid;
  gap: var(--space-md);
}

.document-editor-meta {
  margin-bottom: 0;
}

.document-editor-workspace {
  display: grid;
  gap: var(--space-sm);
}

.document-editor-toolbar {
  position: sticky;
  top: calc(58px + var(--space-sm));
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: var(--shadow-sm);
}

.document-editor-toolbar button {
  min-width: 34px;
  min-height: 34px;
  padding: 0.35rem 0.5rem;
}

.document-editor-status {
  margin-left: auto;
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: 800;
}

.document-editor-page {
  min-height: 68vh;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #17212b;
  box-shadow: var(--shadow-md);
  line-height: 1.55;
  outline: none;
}

.document-editor-page:focus {
  border-color: var(--kbb-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kbb-primary) 18%, transparent), var(--shadow-md);
}

.onlyoffice-editor-shell {
  min-height: 78vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #eef3f6;
  overflow: hidden;
}

.onlyoffice-editor-frame {
  width: 100%;
  height: 78vh;
  min-height: 680px;
}

.onlyoffice-editor-shell iframe {
  width: 100% !important;
  height: 78vh !important;
  min-height: 680px;
  border: 0;
  display: block;
}

.document-editor-page h1,
.document-editor-page h2,
.document-editor-page h3 {
  color: #17212b;
}

.record-summary-grid,
.content-command-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.record-summary-grid article,
.content-command-grid a {
  display: grid;
  gap: 0.28rem;
  min-height: 86px;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-sm);
}

.record-summary-grid strong,
.content-command-grid strong {
  color: var(--text-primary);
  font-size: 1rem;
}

.participant-workbench {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.participant-workbench a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.18rem 0.55rem;
  min-height: 104px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-sm);
}

.participant-workbench a:hover,
.participant-workbench a:focus-visible {
  border-color: color-mix(in srgb, var(--kbb-primary) 45%, var(--border));
  text-decoration: none;
  background: color-mix(in srgb, var(--kbb-primary) 9%, var(--surface));
}

.participant-workbench span {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  color: #fff;
  background: var(--kbb-primary);
  font-size: var(--font-xs);
  font-weight: 900;
}

.participant-workbench strong,
.participant-workbench small {
  min-width: 0;
}

.participant-workbench small {
  grid-column: 2;
  color: var(--text-muted);
  line-height: 1.35;
}

.participant-profile-card {
  align-items: center;
}

.disclosure-panel {
  padding: 0;
  overflow: clip;
}

.disclosure-panel > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

#unterlagen .disclosure-panel > summary,
#unterlagen .btn {
  min-height: 44px;
}

#unterlagen .lifecycle-step-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.disclosure-panel > summary::-webkit-details-marker {
  display: none;
}

.disclosure-panel > summary::after {
  content: ">";
  color: var(--text-muted);
  font-weight: 900;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.disclosure-panel[open] > summary::after {
  transform: rotate(90deg);
}

.disclosure-panel > summary span {
  font-size: 1.02rem;
  font-weight: 900;
}

.disclosure-panel > summary small {
  grid-column: 1;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 700;
}

.disclosure-panel > form,
.disclosure-panel > .grid,
.disclosure-panel > .notice,
.disclosure-panel > .list-head,
.disclosure-panel > .document-process-steps,
.disclosure-panel > .document-workflow-grid,
.disclosure-panel > .staff-conversation-layout,
.disclosure-panel > .portal-action-grid,
.disclosure-panel > .staff-archive-grid,
.disclosure-panel > .lifecycle-step-list,
.disclosure-panel > .lifecycle-start-grid,
.disclosure-panel > .lifecycle-history,
.disclosure-panel > p,
.disclosure-panel > .inline-form,
.disclosure-panel > .stack,
.disclosure-panel > .table-wrap,
.disclosure-panel > .participant-secondary-links,
.disclosure-panel > .participant-m365-grid,
.disclosure-panel > .chips,
.disclosure-panel > .btn,
.disclosure-panel > h3 {
  margin: 0 1rem 1rem;
}

.participant-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  align-items: center;
}

.participant-action-list a,
.participant-secondary-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.28rem 0.58rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  font-size: var(--font-sm);
  font-weight: 800;
  text-decoration: none;
}

.participant-action-list a:hover,
.participant-action-list a:focus-visible,
.participant-secondary-links a:hover,
.participant-secondary-links a:focus-visible {
  border-color: color-mix(in srgb, var(--kbb-primary) 45%, var(--border));
  background: color-mix(in srgb, var(--kbb-primary) 8%, var(--surface));
}

.participant-secondary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.participant-action-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.25rem;
}

.participant-action-toolbar .btn,
.participant-action-toolbar button {
  min-width: 180px;
}

.participant-m365-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: var(--space-md);
  align-items: start;
}

.participant-m365-grid .form-grid,
.participant-m365-grid .table-wrap {
  margin: 0;
}

.entra-field-table td:last-child {
  width: 6.5rem;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.16rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: var(--font-xs);
  font-weight: 900;
}

.sync-badge.ok {
  border-color: color-mix(in srgb, var(--kbb-success) 40%, var(--border));
  background: color-mix(in srgb, var(--kbb-success) 10%, var(--surface));
  color: var(--text-primary);
}

.sync-badge.muted {
  border-style: dashed;
}

.nested-disclosure {
  padding: 0.65rem 0.75rem;
}

.nested-disclosure > summary {
  cursor: pointer;
  font-weight: 900;
}

.danger-zone {
  border-color: color-mix(in srgb, var(--kbb-danger) 42%, var(--border));
}

.content-command-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-command-grid a {
  color: var(--text-primary);
  text-decoration: none;
}

.content-command-grid small {
  color: var(--text-muted);
}

.content-command-grid a:hover,
.content-command-grid a:focus-visible {
  border-color: color-mix(in srgb, var(--kbb-primary) 45%, var(--border));
  background: color-mix(in srgb, var(--kbb-primary) 9%, var(--surface));
  text-decoration: none;
}

.it-rollout-flow {
  margin-bottom: var(--space-lg);
}

.it-rollout-flow a {
  min-height: 118px;
  align-content: start;
}

.it-rollout-flow span {
  background: color-mix(in srgb, var(--kbb-primary) 92%, #111827);
}

.wizard-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  margin-top: var(--space-sm);
  padding: 0.7rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 34%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--kbb-primary) 7%, var(--surface));
}

.wizard-step span {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 30px;
  padding: 0 0.35rem;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--kbb-primary);
  font-weight: 800;
}

.wizard-step strong {
  display: block;
}

.wizard-step p {
  margin: 0.12rem 0 0;
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.it-deploy-form {
  align-items: start;
}

.it-rollout-table td:last-child {
  min-width: 190px;
}

.it-rollout-table .status-pill.bad {
  white-space: nowrap;
}

.workflow-steps {
  display: grid;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-steps li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  min-height: 74px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 96%, transparent);
}

.workflow-steps.compact li {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 54px;
}

.workflow-steps.compact li span {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.workflow-steps li.bereit {
  border-color: color-mix(in srgb, var(--kbb-success) 34%, var(--border));
}

.workflow-index {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--kbb-primary) 20%, var(--surface-soft));
  color: var(--text-primary);
  font-weight: 800;
}

.workflow-steps p {
  margin: 0.2rem 0 0.15rem;
  color: var(--text-secondary);
}

.card,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-strong) 99%, transparent);
  box-shadow: var(--shadow-sm);
}

.card:hover,
.panel.interactive:hover {
  border-color: color-mix(in srgb, var(--kbb-primary) 34%, var(--border));
}

.panel > :last-child,
.metric-card > :last-child {
  margin-bottom: 0;
}

.card {
  padding: 0.75rem 0.85rem;
}

.card span {
  display: block;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-primary);
  font-size: 1.7rem;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0.18rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 36%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  font-size: var(--font-xs);
  font-weight: 800;
  text-transform: none;
}

.panel {
  margin-bottom: var(--space-lg);
  padding: clamp(0.78rem, 1.2vw, 1rem);
}

.panel h2,
.panel h3,
.panel h4 {
  margin-top: 0;
}

.panel p {
  max-width: 78ch;
}

.panel > p:first-child,
.panel > .muted:first-child {
  margin-top: 0;
}

.panel-head,
.section-heading {
  gap: var(--space-md);
}

.panel-head p,
.section-heading .muted,
.list-head .muted {
  max-width: 78ch;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.78rem 0.9rem;
  align-items: start;
}

.form-grid label,
.panel > form label,
.filter-bar label {
  display: grid;
  gap: 0.32rem;
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 800;
  line-height: 1.25;
}

.form-grid label:focus-within,
.panel > form label:focus-within,
.filter-bar label:focus-within {
  color: var(--text-primary);
}

.form-grid label input,
.form-grid label select,
.form-grid label textarea,
.panel > form label input,
.panel > form label select,
.panel > form label textarea,
.filter-bar label input,
.filter-bar label select {
  margin-top: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.form-grid > button[type="submit"],
.form-grid > .btn,
.form-grid > a.btn,
.panel > form > button[type="submit"] {
  align-self: end;
  justify-self: start;
}

.stack {
  display: grid;
  gap: var(--space-md);
}

label {
  display: grid;
  gap: 0.28rem;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 700;
}

.check,
.inline-check,
.form-grid label.check,
.form-grid label.inline-check {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem;
  justify-self: start;
  align-self: center;
  min-height: 0;
  padding: 0.15rem 0;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.check input,
.inline-check input,
.form-grid label.check input,
.form-grid label.inline-check input {
  justify-self: start;
}

.span-2 { grid-column: span 2; }

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
}

.inline-actions.start {
  justify-content: flex-start;
}

.compact-actions {
  margin-top: 0.65rem;
  gap: 0.45rem;
}

.process-diagram-grid {
  display: grid;
  gap: var(--space-lg);
}

.process-card {
  scroll-margin-top: 1rem;
}

.process-map-card {
  display: block;
  scroll-margin-top: 1rem;
}

.process-map-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-lg);
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.process-map-summary::-webkit-details-marker {
  display: none;
}

.process-map-summary::after {
  content: "+";
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  color: var(--kbb-primary);
  font-size: 1.4rem;
  font-weight: 800;
}

.process-map-card[open] .process-map-summary::after {
  content: "−";
}

.process-map-summary h2,
.process-map-summary p {
  margin: 0.1rem 0;
}

.process-map-summary-count {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  padding-right: 1.8rem;
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: 800;
}

.process-map-card-body {
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  margin-top: var(--space-md);
}

.process-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.65rem;
  margin: 0.7rem 0;
}

.process-meta-grid > div {
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.process-meta-grid span {
  display: block;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.process-meta-grid strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-primary);
  font-size: var(--font-sm);
}

.process-mermaid,
.markdown-mermaid {
  margin-top: 0.85rem;
  padding: 0.8rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--background-alt) 88%, var(--surface-soft));
}

.process-mermaid svg,
.markdown-mermaid svg {
  max-width: 100%;
  height: auto;
}

.markdown-preview {
  display: grid;
  gap: 0.75rem;
  max-width: min(100%, 980px);
  line-height: 1.55;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin: 0.35rem 0 0.1rem;
}

.markdown-preview pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
}

.document-inline-preview {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.document-pdf-preview {
  width: 100%;
  min-height: 72vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.actions,
.button-row,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.button-row {
  justify-content: flex-start;
}

.process-hero .button-row,
.record-hero .button-row,
.page-intro .button-row {
  justify-content: flex-end;
}

.button-row form,
.inline-actions form,
.actions form,
.task-actions form,
.inline-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.panel-head.compact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.panel-head.compact h3,
.panel-head.compact p {
  margin: 0;
}

.panel-head.compact p {
  margin-top: 0.15rem;
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.panel-head.compact .inline-actions {
  justify-content: flex-start;
}

.finance-bars {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.finance-bars div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  align-items: center;
  gap: var(--space-sm);
}

.finance-bars span {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 800;
}

.finance-bars strong {
  display: block;
  min-width: 0.35rem;
  height: 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--kbb-primary);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.traffic-status {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 96%, transparent);
}

.traffic-light {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--text-muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-muted) 14%, transparent);
}

.traffic-status strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--font-sm);
}

.traffic-status span:not(.traffic-light) {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-size: var(--font-sm);
  overflow-wrap: anywhere;
}

.traffic-status.ok {
  border-color: color-mix(in srgb, var(--kbb-success) 42%, var(--border));
}

.traffic-status.ok .traffic-light {
  background: var(--kbb-success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--kbb-success) 18%, transparent);
}

.traffic-status.warn {
  border-color: color-mix(in srgb, var(--kbb-warning) 48%, var(--border));
}

.traffic-status.warn .traffic-light {
  background: var(--kbb-warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--kbb-warning) 18%, transparent);
}

.traffic-status.bad {
  border-color: color-mix(in srgb, var(--kbb-danger) 48%, var(--border));
}

.traffic-status.bad .traffic-light {
  background: var(--kbb-danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--kbb-danger) 18%, transparent);
}

.integration-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: 0 0 var(--space-md);
}

.admin-filter {
  margin: var(--space-sm) 0;
}

.table-primary-link {
  color: var(--text-primary);
  text-decoration: none;
}

.table-primary-link:hover,
.table-primary-link:focus-visible {
  color: var(--kbb-primary-light);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

legend {
  padding: 0 0.35rem;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 800;
}

.feature-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.setting-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0.55rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 30%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--kbb-primary) 9%, var(--surface-soft));
}

.setting-status strong {
  color: var(--text-primary);
  font-size: var(--font-sm);
}

.setting-status span {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: var(--font-sm);
}

.setting-status.success {
  border-color: color-mix(in srgb, var(--kbb-success) 42%, var(--border));
  background: color-mix(in srgb, var(--kbb-success) 12%, var(--surface-soft));
}

.setting-status.error {
  border-color: color-mix(in srgb, var(--kbb-danger) 42%, var(--border));
  background: color-mix(in srgb, var(--kbb-danger) 12%, var(--surface-soft));
}

.setting-status.error span,
.setting-status.success span {
  white-space: normal;
  text-align: right;
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 0.7rem;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-soft) 96%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.ai-suggestions {
  display: grid;
  gap: var(--space-md);
}

.ai-suggestion {
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 96%, transparent);
}

.ai-suggestion header {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.6rem;
}

.ai-suggestion strong {
  color: var(--text-primary);
}

.ai-suggestion span {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
}

.ai-suggestion pre {
  margin: 0;
  white-space: pre-wrap;
}

.control-review {
  margin-top: 0.7rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-tint) 94%, transparent);
}

.control-review strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: var(--font-sm);
}

.control-review pre {
  border: 0;
  padding: 0;
  background: transparent;
}

.control-review.niedrig {
  border-color: color-mix(in srgb, var(--kbb-success) 40%, var(--border));
}

.control-review.mittel,
.control-review.pruefen {
  border-color: color-mix(in srgb, var(--kbb-warning) 44%, var(--border));
}

.control-review.hoch,
.control-review.kritisch {
  border-color: color-mix(in srgb, var(--kbb-danger) 48%, var(--border));
}

.planning-calendar {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) repeat(7, minmax(150px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.planning-head,
.planning-measure,
.planning-cell {
  min-width: 0;
  min-height: 112px;
  padding: 0.55rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.planning-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 42px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface-tint));
  font-size: var(--font-sm);
  font-weight: 800;
}

.planning-head.measure-col {
  left: 0;
  z-index: 3;
}

.planning-measure {
  position: sticky;
  left: 0;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  background: var(--surface-strong);
}

.planning-measure strong {
  color: var(--text-primary);
  line-height: 1.25;
}

.planning-cell {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  background: color-mix(in srgb, var(--surface-soft) 96%, transparent);
}

.empty-session-link {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px dashed color-mix(in srgb, var(--kbb-primary) 38%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 800;
}

.empty-session-link:hover {
  color: var(--text-primary);
  text-decoration: none;
  background: color-mix(in srgb, var(--kbb-primary) 10%, transparent);
}

.session-pill {
  display: grid;
  justify-items: start;
  width: 100%;
  min-height: 0;
  padding: 0.45rem;
  border-color: color-mix(in srgb, var(--kbb-primary) 32%, var(--border));
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface-soft));
  text-align: left;
}

.session-pill.bad {
  border-color: color-mix(in srgb, var(--kbb-danger) 44%, var(--border));
}

.session-pill.warn {
  border-color: color-mix(in srgb, var(--kbb-warning) 44%, var(--border));
}

.session-pill.overbooked {
  position: relative;
  border-color: color-mix(in srgb, var(--kbb-warning) 72%, var(--border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--kbb-warning) 22%, transparent), transparent 58%),
    color-mix(in srgb, var(--kbb-primary) 10%, var(--surface-soft));
  box-shadow: inset 3px 0 0 var(--kbb-warning);
}

.session-pill.overbooked:hover,
.session-pill.overbooked:focus-visible {
  border-color: color-mix(in srgb, var(--kbb-warning) 92%, #fff);
  box-shadow:
    inset 3px 0 0 var(--kbb-warning),
    0 0 0 3px color-mix(in srgb, var(--kbb-warning) 18%, transparent);
}

.session-pill.overbooked::after {
  content: attr(data-overbooking);
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: calc(100% + 0.35rem);
  z-index: 4;
  display: block;
  padding: 0.36rem 0.44rem;
  border: 1px solid color-mix(in srgb, var(--kbb-warning) 55%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-strong) 98%, #000);
  box-shadow: var(--shadow-md);
  font-size: var(--font-xs);
  font-weight: 800;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.session-pill.overbooked:hover::after,
.session-pill.overbooked:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.overbooking-note {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.12rem 0.34rem;
  border: 1px solid color-mix(in srgb, var(--kbb-warning) 58%, var(--border));
  border-radius: var(--radius-sm);
  color: color-mix(in srgb, var(--kbb-warning) 74%, #fff);
  background: color-mix(in srgb, var(--kbb-warning) 12%, transparent);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
}

.overbooking-note.inline {
  margin-top: 0.22rem;
}

.session-pill strong,
.session-pill span,
.session-pill em {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.session-pill strong {
  font-size: var(--font-xs);
}

.session-pill span {
  color: var(--text-primary);
  font-size: var(--font-sm);
}

.session-pill em {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-style: normal;
}

.ue-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.ue-timeline.list {
  margin-top: 0;
}

.ue-slot {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.12rem 0.34rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 28%, var(--border));
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--kbb-primary) 8%, transparent);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.ue-slot.break,
.ue-slot.lunch {
  border-style: dashed;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 8%, transparent);
}

.ue-slot.lunch {
  border-color: color-mix(in srgb, var(--kbb-accent) 38%, var(--border));
}

.ue-list-row td {
  padding-top: 0;
  background: color-mix(in srgb, var(--surface-soft) 94%, transparent);
}

.edit-modal[hidden] {
  display: none;
}

.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.edit-modal-backdrop {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.68);
  box-shadow: none;
}

.edit-modal-backdrop:hover,
.edit-modal-backdrop:focus,
.edit-modal-backdrop:active {
  background: rgba(0, 0, 0, 0.68);
  border: 0;
  box-shadow: none;
}

.edit-modal-card {
  position: relative;
  width: min(920px, 96vw);
  max-height: 88vh;
  overflow: auto;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.ai-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.66);
}

.ai-progress-overlay.active {
  display: grid;
}

.ai-progress-card {
  width: min(620px, 100%);
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 36%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.ai-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 0.75rem;
}

.ai-progress-head strong {
  color: var(--text-primary);
  font-size: 1rem;
}

.ai-progress-head span {
  color: var(--kbb-primary-light);
  font-weight: 800;
}

.ai-progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
}

.ai-progress-track div {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--kbb-primary), var(--kbb-accent));
  transition: width 0.4s ease;
}

.ai-progress-steps {
  display: grid;
  gap: 0.4rem;
  margin: 0.85rem 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.ai-progress-steps li.done {
  color: var(--text-primary);
  font-weight: 800;
}

.ai-progress-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 0.48rem 0.55rem;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-soft) 96%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  min-width: 1rem;
  max-width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: 0.1rem 0 0;
  padding: 0;
  accent-color: var(--kbb-primary);
  background: initial;
  border-radius: initial;
  flex: 0 0 auto;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--kbb-primary) 52%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kbb-primary) 18%, transparent);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: none;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.46rem 0.78rem;
  color: #fff;
  background: var(--kbb-primary);
  border: 1px solid var(--kbb-primary-dark);
  border-radius: var(--radius-sm);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  text-wrap: balance;
  cursor: pointer;
}

button:hover,
.btn:hover {
  background: var(--kbb-primary-dark);
  text-decoration: none;
}

button.ghost,
.btn.ghost {
  color: var(--text-secondary);
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--kbb-primary) 30%, var(--border));
}

button.ghost:hover,
.btn.ghost:hover {
  color: var(--text-primary);
}

td .btn,
td button {
  margin: 0.12rem 0.12rem 0.12rem 0;
}

td .btn.small,
td button.small {
  min-width: 92px;
}

td form,
td .inline-form {
  display: inline-flex;
  margin: 0;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 var(--space-md);
}

.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--surface);
  font-weight: 700;
}

.subnav a.active,
.subnav a:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--kbb-primary) 45%, var(--border));
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface));
  text-decoration: none;
}

.qm-azav-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: var(--space-md);
  align-items: start;
}

.assistant-panel {
  padding: var(--space-md);
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 35%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--kbb-primary) 8%, var(--surface));
}

.assistant-panel p,
.assistant-panel ul {
  color: var(--text-secondary);
}

.process-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.process-card p {
  margin: 0;
}

.plain-list {
  display: grid;
  gap: 0.65rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.plain-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.page-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.page-intro h2 {
  margin: 0.1rem 0 0.2rem;
  font-size: 1.55rem;
}

.page-intro p {
  margin: 0;
}

.eyebrow {
  color: var(--kbb-accent);
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dms-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 0.75fr) minmax(180px, 0.75fr) auto;
  gap: var(--space-md);
  align-items: end;
}

.dms-search {
  min-width: 0;
}

.dms-orientation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.dms-orientation div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.1rem var(--space-sm);
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.dms-orientation div > span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  color: var(--surface);
  background: var(--kbb-primary);
  font-weight: 800;
}

.dms-orientation small,
.dms-group-description {
  color: var(--text-muted);
  font-weight: 500;
}

.dms-inbox-notice {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  align-items: center;
  border-left: 4px solid var(--kbb-warning);
}

.dms-inbox-notice strong,
.dms-inbox-notice p {
  display: block;
  margin: 0.25rem 0 0;
}

.dms-explorer {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: start;
}

.dms-tree {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.dms-folder-group {
  border-top: 1px solid var(--border);
  padding: 0.4rem 0;
}

.dms-folder-group:first-of-type {
  border-top: 0;
}

.dms-folder-group summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-primary);
}

.dms-folder-group summary > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.dms-folder-group summary:hover {
  background: color-mix(in srgb, var(--kbb-primary) 8%, transparent);
}

.dms-folder-group[open] .folder-icon:first-child {
  transform: rotate(90deg);
}

.dms-folder-group small,
.dms-folder small {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
}

.dms-folder-list {
  display: grid;
  gap: 0.24rem;
  margin: 0.25rem 0 0.25rem 0.8rem;
}

.dms-folder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  justify-content: stretch;
  width: 100%;
  min-height: 42px;
  padding: 0.45rem 0.58rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  text-align: left;
}

.dms-folder-all {
  margin: 0.35rem 0 0.5rem;
}

.dms-folder span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dms-folder:hover,
.dms-folder.active {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--kbb-primary) 42%, var(--border));
}

.dms-file-panel {
  min-width: 0;
}

.dms-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.dms-path strong {
  color: var(--text-primary);
}

.dms-file-list {
  display: grid;
  gap: 0.5rem;
}

.dms-file {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, auto) minmax(175px, auto);
  gap: var(--space-sm);
  align-items: center;
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.dms-file:hover {
  border-color: color-mix(in srgb, var(--kbb-primary) 32%, var(--border));
  background: color-mix(in srgb, var(--kbb-primary) 5%, var(--surface));
}

.dms-file[hidden] {
  display: none;
}

.dms-file-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
}

.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 38px;
  color: #fff;
  background: color-mix(in srgb, var(--kbb-primary) 82%, #000);
  border-radius: var(--radius-sm);
  font-size: 0.62rem;
  font-weight: 800;
}

.dms-file h4 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  font-size: 0.98rem;
  white-space: nowrap;
}

.dms-file p {
  margin: 0.12rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-size: var(--font-sm);
  white-space: nowrap;
}

.dms-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 700;
}

.dms-file-actions {
  justify-content: flex-end;
}

.dms-empty-state {
  margin-bottom: var(--space-sm);
  padding: 0.8rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.dms-empty-state strong {
  display: block;
  color: var(--text-primary);
}

.qm-evidence-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

.qm-evidence-card {
  min-width: 0;
}

.audit-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-list li {
  display: grid;
  gap: 0.12rem;
  padding: 0.58rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.audit-list li span {
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.small-text {
  font-size: var(--font-sm);
}

button.ghost:hover,
.btn.ghost:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface-soft));
  border-color: color-mix(in srgb, var(--kbb-primary) 48%, var(--border));
}

button.danger,
.btn.danger {
  background: var(--kbb-danger);
  border-color: color-mix(in srgb, var(--kbb-danger) 84%, #000);
  color: #fff;
}

button.danger:hover,
.btn.danger:hover {
  background: color-mix(in srgb, var(--kbb-danger) 84%, #000);
}

button.ghost.danger,
.btn.ghost.danger,
.ghost.danger {
  color: #fff;
  background: var(--kbb-danger);
  border-color: color-mix(in srgb, var(--kbb-danger) 84%, #000);
}

button.ghost.danger:hover,
.btn.ghost.danger:hover,
.ghost.danger:hover {
  color: #fff;
  background: color-mix(in srgb, var(--kbb-danger) 84%, #000);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.button-row form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.measure-actions {
  display: grid;
  gap: 0.45rem;
  min-width: 220px;
}

.measure-actions form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
}

.measure-actions .check {
  grid-column: 1 / -1;
  align-self: center;
}

.ue-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.16rem 0.42rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-xs);
  font-weight: 800;
}

.ue-badge.ok {
  border-color: color-mix(in srgb, var(--kbb-success) 42%, var(--border));
  color: color-mix(in srgb, var(--kbb-success) 70%, #fff);
}

.ue-badge.warn {
  border-color: color-mix(in srgb, var(--kbb-warning) 48%, var(--border));
  color: color-mix(in srgb, var(--kbb-warning) 74%, #fff);
}

.ue-badge.bad {
  border-color: color-mix(in srgb, var(--kbb-danger) 48%, var(--border));
  color: color-mix(in srgb, var(--kbb-danger) 66%, #fff);
}

.ue-badge.neutral {
  border-color: color-mix(in srgb, var(--text-muted) 32%, var(--border));
  color: var(--text-secondary);
}

.btn.small,
button.small {
  min-height: 32px;
  padding: 0.28rem 0.56rem;
  font-size: 0.8rem;
}

td .btn.small,
td button.small,
.inline-actions .btn.small,
.inline-actions button.small {
  min-height: 32px;
  min-width: 92px;
}

.attendance-edit-form {
  display: grid;
  grid-template-columns: minmax(8.5rem, 1.1fr) 4.25rem 5rem minmax(8rem, 1fr) minmax(8rem, 1fr) auto auto;
  gap: 0.5rem;
  align-items: end;
  min-width: min(100%, 740px);
}

.attendance-edit-form label {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.attendance-edit-form input,
.attendance-edit-form select {
  min-height: 32px;
  padding: 0.28rem 0.45rem;
  min-width: 0;
}

.check.compact {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .attendance-edit-form {
    grid-template-columns: 1fr 1fr;
  }

  .attendance-edit-form button {
    grid-column: 1 / -1;
  }
}

table {
  width: 100%;
  margin-top: var(--space-md);
  border: 1px solid var(--border);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface-strong);
  table-layout: auto;
}

.panel:has(table) {
  overflow-x: auto;
}

.table-wrap,
.panel:has(> table) {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: color-mix(in srgb, var(--kbb-primary) 55%, var(--border)) transparent;
}

.panel > table {
  min-width: max-content;
}

.panel > .education-offers-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.education-offers-table th:nth-child(1) { width: 37%; }
.education-offers-table th:nth-child(2) { width: 24%; }
.education-offers-table th:nth-child(3) { width: 19%; }
.education-offers-table th:nth-child(4) { width: 11%; }
.education-offers-table th:nth-child(5) { width: 9%; }

.education-offers-table td {
  overflow-wrap: anywhere;
  vertical-align: top;
}

.education-offers-table .btn.small {
  white-space: normal;
}

.staff-priority-table {
  min-width: 61rem;
}

.staff-priority-table .status-pill {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

th,
td {
  padding: 0.58rem 0.62rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  line-height: 1.35;
}

td strong,
td span,
td small {
  overflow-wrap: anywhere;
}

.chips,
.status,
.status-pill,
.ue-badge {
  max-width: 100%;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--kbb-primary) 10%, var(--surface-tint));
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--kbb-primary) 7%, var(--surface-soft));
}

td:last-child .inline-actions,
td:last-child .button-row,
td:last-child .actions {
  justify-content: flex-start;
}

tbody tr.overbooked-row {
  background: color-mix(in srgb, var(--kbb-warning) 7%, var(--surface-strong));
}

tbody tr.overbooked-row:hover {
  background: color-mix(in srgb, var(--kbb-warning) 12%, var(--surface-soft));
}

tbody tr.deleted-row {
  opacity: 0.78;
  background: color-mix(in srgb, var(--kbb-danger) 6%, var(--surface-strong));
}

tbody tr.deleted-row:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--kbb-danger) 10%, var(--surface-soft));
}

.click-row {
  cursor: pointer;
}

.click-row:hover td:first-child {
  color: color-mix(in srgb, var(--kbb-primary-light) 88%, #fff);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.avatar-img,
.avatar-initials {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.avatar-img {
  display: block;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 34%, var(--border));
  background: var(--surface-soft);
}

.avatar-button {
  display: inline-flex;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.avatar-initials {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--kbb-primary), var(--kbb-primary-dark));
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.profile-head h2 {
  margin-bottom: 0.2rem;
}

.profile-photo,
.profile-photo-button {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.profile-photo {
  display: block;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 40%, var(--border));
  background: var(--surface-soft);
}

.profile-photo.placeholder {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--kbb-primary), var(--kbb-primary-dark));
  font-size: 1.6rem;
  font-weight: 800;
}

.profile-photo-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.inline-form {
  margin-top: var(--space-md);
}

.image-modal[hidden] {
  display: none;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

body.modal-open {
  overflow: hidden;
}

.ui-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-primary);
}

.ui-state[hidden] {
  display: none;
}

.today-strip > .ui-state {
  grid-column: 1 / -1;
}

.ui-state-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--kbb-primary) 12%, var(--surface));
  color: var(--kbb-primary);
  font-weight: 800;
}

.ui-state-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.ui-state-copy > span {
  color: var(--text-secondary);
}

.ui-state--error {
  border-color: color-mix(in srgb, var(--kbb-danger) 42%, var(--border));
}

.ui-state--error .ui-state-mark {
  background: color-mix(in srgb, var(--kbb-danger) 12%, var(--surface));
  color: var(--kbb-danger);
}

.ui-state--loading .ui-state-mark {
  background: color-mix(in srgb, var(--kbb-primary) 8%, var(--surface));
}

.ui-state-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, var(--kbb-primary) 24%, transparent);
  border-top-color: var(--kbb-primary);
  border-radius: 999px;
  animation: ui-state-spin 720ms linear infinite;
}

@keyframes ui-state-spin {
  to { transform: rotate(1turn); }
}

@media (max-width: 620px) {
  .ui-state {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ui-state-action {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.68);
  box-shadow: none;
  cursor: pointer;
}

.image-modal-backdrop:hover,
.image-modal-backdrop:focus,
.image-modal-backdrop:active {
  background: rgba(0, 0, 0, 0.68);
  border: 0;
  box-shadow: none;
}

.image-modal-card {
  position: relative;
  max-width: min(680px, 92vw);
  max-height: 86vh;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.image-modal-card img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.image-modal-close {
  margin-bottom: 0.55rem;
}

.toolbar-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-strong) 99%, transparent);
  box-shadow: var(--shadow-sm);
}

.toolbar-card p {
  margin: 0.2rem 0 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.metric-card {
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 99%, transparent);
  box-shadow: var(--shadow-sm);
}

.metric-card.warn {
  border-color: color-mix(in srgb, var(--kbb-warning) 50%, var(--border));
  background: color-mix(in srgb, var(--kbb-warning) 8%, var(--surface-strong));
}

.metric-card.bad {
  border-color: color-mix(in srgb, var(--kbb-danger) 50%, var(--border));
  background: color-mix(in srgb, var(--kbb-danger) 8%, var(--surface-strong));
}

.metric-card span {
  display: block;
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.list-head h2 {
  margin-bottom: 0;
}

.list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin-top: var(--space-md);
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.filter-bar.compact {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.filter-bar > button,
.filter-bar > .btn {
  justify-self: start;
}

fieldset,
.feature-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

legend {
  padding: 0 0.35rem;
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-weight: 800;
}

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

.danger-form {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.danger-zone {
  border-color: color-mix(in srgb, var(--kbb-danger) 52%, var(--border));
  border-left: 4px solid var(--kbb-danger);
  background: color-mix(in srgb, var(--kbb-danger) 8%, var(--surface-strong));
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 30%, var(--border));
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
}

.segmented a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.35rem 0.6rem;
  border-right: 1px solid color-mix(in srgb, var(--kbb-primary) 20%, var(--border));
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 800;
}

.segmented a:last-child {
  border-right: 0;
}

.segmented a:hover,
.segmented a.active {
  color: var(--text-primary);
  text-decoration: none;
  background: color-mix(in srgb, var(--kbb-primary) 13%, var(--surface-soft));
}

.segmented span {
  color: var(--text-muted);
  font-size: var(--font-xs);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: var(--space-lg);
  align-items: start;
}

.stack-list {
  display: grid;
  gap: 0.55rem;
}

.stack-list.compact {
  gap: 0.35rem;
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.compact-actions form {
  margin: 0;
}

.wizard-json-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.wizard-json-grid div {
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
}

.wizard-json-grid strong {
  display: block;
  margin-top: 0.2rem;
}

.wizard-json-grid ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  color: var(--text-secondary);
}

.optional-end-box {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 24%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--kbb-primary) 6%, var(--surface-soft));
}

.optional-end-box p {
  margin: 0;
}

.misc-session-box {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--kbb-warning) 28%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--kbb-warning) 7%, var(--surface-soft));
}

.misc-session-box p {
  margin: 0;
}

.convert-box {
  margin-bottom: var(--space-lg);
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 32%, var(--border));
  border-left: 3px solid var(--kbb-primary);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--kbb-primary) 8%, var(--surface-strong));
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.task-row span {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.task-row.warn {
  border-color: color-mix(in srgb, var(--kbb-warning) 40%, var(--border));
}

.task-row.danger {
  border-color: color-mix(in srgb, var(--kbb-danger) 42%, var(--border));
}

.empty-state {
  color: var(--text-muted);
  padding: 0.8rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  margin: 0;
}

.flash {
  margin-bottom: var(--space-md);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--kbb-info);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  transition: opacity 180ms ease, transform 180ms ease;
}

.flash.is-dismissing {
  opacity: 0;
  transform: translateY(-0.25rem);
}

.flash-dismiss {
  flex: 0 0 auto;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  margin: -0.3rem -0.4rem -0.3rem 0;
  padding: 0;
  border: 0;
  color: currentColor;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.flash-dismiss:hover,
.flash-dismiss:focus-visible {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.flash.success {
  border-left-color: var(--kbb-success);
  color: color-mix(in srgb, var(--kbb-success) 70%, #fff);
}

.flash.error {
  border-left-color: var(--kbb-danger);
  color: color-mix(in srgb, var(--kbb-danger) 66%, #fff);
}

.flash.warning {
  border-left-color: var(--kbb-warning);
  color: color-mix(in srgb, var(--kbb-warning) 72%, #fff);
}

.notice {
  margin-top: var(--space-md);
  padding: 0.65rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--kbb-accent) 28%, var(--border));
  border-left: 3px solid var(--kbb-accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--kbb-accent) 7%, var(--surface-strong));
  color: var(--text-secondary);
}

.danger-text {
  color: var(--kbb-danger);
  font-weight: 700;
}

.ai-job-list {
  display: grid;
  gap: 0.65rem;
}

.ai-job-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--kbb-info);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.ai-job-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.ai-job-card header span {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 800;
}

.ai-job-card p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.ai-job-track {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 18%, transparent);
}

.ai-job-track div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--kbb-primary);
  transition: width 0.35s ease;
}

.ai-job-card.done {
  border-left-color: var(--kbb-success);
}

.ai-job-card.done .ai-job-track div {
  background: var(--kbb-success);
}

.ai-job-card.failed {
  border-left-color: var(--kbb-danger);
}

.ai-job-card.failed .ai-job-track div {
  background: var(--kbb-danger);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chips span {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  font-size: var(--font-xs);
  font-weight: 700;
}

.participant-portal {
  background:
    linear-gradient(180deg, #171a1f 0%, #1a1f24 42%, #14171b 100%);
}

.portal-shell {
  min-height: 100vh;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-md);
  padding: 0.62rem 0.85rem;
  background: color-mix(in srgb, var(--kbb-secondary-dark) 91%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 800;
}

.portal-brand:hover {
  text-decoration: none;
}

.portal-brand img {
  width: 148px;
  height: auto;
  display: block;
}

.portal-brand span {
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--font-sm);
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
}

.portal-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.52rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.portal-nav a:hover,
.portal-nav a.active {
  color: #fff;
  text-decoration: none;
  background: color-mix(in srgb, var(--kbb-primary) 16%, var(--surface-soft));
  border-color: color-mix(in srgb, var(--kbb-primary) 42%, var(--border));
}

.portal-nav-more {
  position: relative;
}

.portal-nav-more summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.52rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.portal-nav-more summary::-webkit-details-marker {
  display: none;
}

.portal-nav-more summary::after {
  content: "▾";
  margin-left: 0.35rem;
  font-size: 0.7rem;
}

.portal-nav-more summary:hover,
.portal-nav-more summary.active,
.portal-nav-more[open] summary {
  color: #fff;
  background: color-mix(in srgb, var(--kbb-primary) 16%, var(--surface-soft));
  border-color: color-mix(in srgb, var(--kbb-primary) 42%, var(--border));
}

.portal-nav-more > div {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 30;
  min-width: 150px;
  padding: 0.35rem;
  display: grid;
  gap: 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--kbb-secondary-dark) 96%, transparent);
  box-shadow: var(--shadow-md);
}

.portal-main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: var(--space-lg);
}

.participant-portal .portal-context {
  border-color: color-mix(in srgb, var(--kbb-primary) 28%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--kbb-primary) 10%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

.portal-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.portal-data-table {
  width: 100%;
}

.portal-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.18rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--font-xs);
  font-weight: 800;
  line-height: 1.25;
}

.portal-status.success {
  color: color-mix(in srgb, var(--kbb-success) 78%, #fff);
  background: color-mix(in srgb, var(--kbb-success) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--kbb-success) 34%, var(--border));
}

.portal-status.pending {
  color: color-mix(in srgb, var(--kbb-warning) 78%, #fff);
  background: color-mix(in srgb, var(--kbb-warning) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--kbb-warning) 34%, var(--border));
}

.portal-message-list {
  display: grid;
  gap: 0.65rem;
}

.portal-message-list article {
  display: grid;
  grid-template-columns: minmax(7rem, 0.2fr) minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.portal-message-list time {
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: 700;
}

.portal-message-list h3,
.portal-message-list p {
  margin: 0;
}

.portal-message-list p {
  margin-top: 0.3rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-state {
  margin: 0;
  padding: 0.8rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
}

.portal-profile-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.portal-profile-data > div {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.portal-profile-data dt {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.portal-profile-data dd {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
}

.portal-history > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.portal-history > summary span:first-child {
  display: grid;
  gap: 0.2rem;
}

.portal-history > summary small {
  color: var(--text-muted);
}

.portal-history[open] > summary {
  margin-bottom: 0.85rem;
}

.portal-review-actions {
  display: grid;
  gap: 0.4rem;
}

.portal-review-actions form {
  margin: 0;
}

.portal-review-actions details > summary {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-sm);
  font-weight: 700;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .portal-header,
  .participant-portal .portal-context {
    -webkit-backdrop-filter: blur(12px) saturate(116%);
    backdrop-filter: blur(12px) saturate(116%);
  }
}

.printable-credentials {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: var(--space-md);
  align-items: center;
  overflow-wrap: anywhere;
}

pre {
  white-space: pre-wrap;
  color: var(--text-secondary);
}

code { color: var(--kbb-accent); }

.section-head,
.iot-device-top,
.iot-device-state {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: space-between;
}

.iot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: var(--space-md);
  align-items: start;
}

.iot-device-grid,
.list-stack {
  display: grid;
  gap: var(--space-sm);
}

.iot-device,
.list-item,
.create-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  background: var(--surface-soft);
}

.iot-device-top strong,
.list-item summary strong {
  display: block;
}

.iot-device-top span,
.list-item summary span,
.iot-device-state {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.iot-device-state {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 0.45rem 0;
}

.status-pill {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.14rem 0.42rem;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill.ok {
  border-color: color-mix(in srgb, var(--kbb-primary) 60%, var(--border));
  color: var(--kbb-primary);
}

.status-pill.success {
  border-color: color-mix(in srgb, var(--kbb-success) 60%, var(--border));
  color: var(--kbb-success);
}

.status-pill.bad {
  color: var(--kbb-danger);
}

.status-pill.warn {
  border-color: color-mix(in srgb, var(--kbb-warning) 62%, var(--border));
  color: var(--kbb-warning);
}

.status-pill.neutral {
  color: var(--text-muted);
}

.newsletter-console {
  display: grid;
  gap: 1rem;
}

.newsletter-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--kbb-primary) 14%, var(--surface-strong)) 0%, var(--surface-strong) 54%),
    var(--surface-strong);
}

.newsletter-hero h2,
.newsletter-section-head h3 {
  margin: 0;
  line-height: 1.15;
}

.newsletter-hero p,
.newsletter-section-head p {
  max-width: 68rem;
  margin: 0.42rem 0 0;
  color: var(--text-secondary);
}

.newsletter-hero-actions,
.newsletter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.newsletter-readiness,
.newsletter-metrics,
.newsletter-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
}

.newsletter-readiness article,
.newsletter-metrics article,
.newsletter-steps a,
.newsletter-workspace,
.newsletter-list article,
.newsletter-campaign-list article {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.newsletter-readiness article {
  display: grid;
  gap: 0.2rem;
  padding: 0.72rem;
  border-left-width: 4px;
}

.newsletter-readiness article.ok {
  border-left-color: var(--kbb-success);
}

.newsletter-readiness article.warn {
  border-left-color: var(--kbb-warning);
}

.newsletter-readiness strong,
.newsletter-metrics span,
.newsletter-steps small,
.newsletter-list small,
.newsletter-campaign-main small {
  color: var(--text-muted);
}

.newsletter-readiness span,
.newsletter-list span,
.newsletter-campaign-main span {
  color: var(--text-secondary);
}

.newsletter-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.newsletter-metrics article {
  padding: 0.78rem;
}

.newsletter-metrics strong {
  display: block;
  margin-top: 0.12rem;
  font-size: 1.55rem;
  line-height: 1;
}

.newsletter-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.newsletter-steps a {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.1rem 0.68rem;
  padding: 0.78rem;
}

.newsletter-steps a > span {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: var(--kbb-primary);
  font-weight: 800;
}

.newsletter-steps strong {
  color: var(--text-primary);
}

.newsletter-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
}

.newsletter-guide article {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 0.15rem 0.7rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.newsletter-guide article > span {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  color: #fff;
  background: var(--kbb-primary);
  font-weight: 900;
}

.newsletter-guide strong {
  line-height: 1.2;
}

.newsletter-guide p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.newsletter-workspace {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.newsletter-section-head {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
}

.newsletter-split {
  display: grid;
  grid-template-columns: minmax(18rem, 0.92fr) minmax(0, 1.35fr);
  gap: 0.85rem;
  align-items: start;
}

.newsletter-split.compact {
  grid-template-columns: minmax(16rem, 0.75fr) minmax(0, 1.4fr);
}

.newsletter-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.newsletter-form-inline {
  grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 1fr) minmax(10rem, 1fr) minmax(14rem, 1.4fr) auto;
  align-items: end;
}

.newsletter-compose-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.newsletter-list-form {
  grid-template-columns: 1fr;
}

.newsletter-form label {
  display: grid;
  gap: 0.28rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.newsletter-form input,
.newsletter-form select,
.newsletter-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.54rem 0.58rem;
  color: var(--text-primary);
  background: var(--surface-strong);
}

.newsletter-form .span-2 {
  grid-column: 1 / -1;
}

.newsletter-form .newsletter-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.newsletter-send-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.newsletter-send-mode legend {
  padding: 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.newsletter-send-mode label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.newsletter-help {
  align-self: end;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.newsletter-form button[type="submit"] {
  align-self: end;
}

.newsletter-list,
.newsletter-campaign-list {
  display: grid;
  gap: 0.62rem;
}

.newsletter-list article,
.newsletter-campaign-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.72rem;
}

.newsletter-list article > div:first-child,
.newsletter-campaign-main {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.newsletter-list small,
.newsletter-campaign-main small {
  overflow-wrap: anywhere;
}

.newsletter-list article.is-muted {
  opacity: 0.7;
}

.newsletter-table {
  overflow-x: auto;
}

.newsletter-table table {
  margin-top: 0;
}

.newsletter-delivery-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.newsletter-delivery-metrics article {
  min-width: 0;
  border-left: 3px solid transparent;
}

.newsletter-delivery-metrics article.needs-attention {
  border-left-color: var(--kbb-danger);
}

.newsletter-delivery-metrics small {
  display: block;
  margin-top: 0.28rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.newsletter-dispatch-list article.newsletter-dispatch-card {
  grid-template-columns: minmax(14rem, 1.25fr) minmax(18rem, 1fr) auto;
  align-items: center;
}

.newsletter-dispatch-card.needs-attention {
  border-left: 4px solid var(--kbb-danger);
}

.newsletter-dispatch-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.newsletter-progress {
  height: 0.38rem;
  margin-top: 0.32rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.newsletter-progress span {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--kbb-primary);
}

.newsletter-dispatch-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(4.7rem, 1fr));
  gap: 0.35rem;
}

.newsletter-dispatch-summary > span {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.42rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--surface-soft);
  font-size: 0.72rem;
  text-align: center;
}

.newsletter-dispatch-summary strong {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.newsletter-dispatch-summary > span.bad,
.newsletter-dispatch-summary > span.bad strong {
  color: var(--kbb-danger);
}

.newsletter-dispatch-actions {
  max-width: 14rem;
}

.newsletter-dispatch-details {
  grid-column: 1 / -1;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.newsletter-dispatch-details > summary,
.newsletter-secondary-workspace > summary {
  min-height: 44px;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 800;
}

.newsletter-dispatch-details > summary {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.newsletter-dispatch-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.newsletter-dispatch-detail-grid span {
  display: grid;
  gap: 0.12rem;
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.newsletter-secondary-workspace > summary {
  display: flex;
  align-items: center;
  list-style: none;
}

.newsletter-secondary-workspace > summary::-webkit-details-marker {
  display: none;
}

.newsletter-secondary-workspace > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--kbb-primary);
  font-size: 1.35rem;
}

.newsletter-secondary-workspace[open] > summary::after {
  content: "−";
}

.newsletter-secondary-workspace > summary span {
  display: grid;
  gap: 0.12rem;
}

.newsletter-secondary-workspace > summary small {
  color: var(--text-muted);
  font-weight: 600;
}

.newsletter-secondary-workspace[open] > summary {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.empty-state {
  margin: 0;
  padding: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--surface-soft);
}

.newsletter-public {
  display: grid;
  gap: 1rem;
  width: min(46rem, 100%);
  margin: 7vh auto;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}

.newsletter-public header {
  display: grid;
  gap: 0.35rem;
}

.newsletter-public h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.1;
}

.newsletter-public p {
  margin: 0;
  color: var(--text-secondary);
}

.newsletter-public-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.newsletter-public-flow span {
  padding: 0.48rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--surface-soft);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 980px) {
  .newsletter-hero,
  .newsletter-section-head,
  .newsletter-list article,
  .newsletter-campaign-list article {
    grid-template-columns: 1fr;
  }

  .newsletter-section-head {
    display: grid;
  }

  .newsletter-readiness,
  .newsletter-metrics,
  .newsletter-steps,
  .newsletter-guide,
  .newsletter-split,
  .newsletter-form,
  .newsletter-compose-form,
  .newsletter-form-inline {
    grid-template-columns: 1fr;
  }

  .newsletter-send-mode {
    grid-template-columns: 1fr;
  }

  .newsletter-hero-actions,
  .newsletter-actions {
    justify-content: flex-start;
  }

  .newsletter-public-flow {
    grid-template-columns: 1fr;
  }

  .newsletter-dispatch-list article.newsletter-dispatch-card,
  .newsletter-dispatch-detail-grid {
    grid-template-columns: 1fr;
  }

  .newsletter-dispatch-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .newsletter-dispatch-actions {
    max-width: none;
  }
}

@media (max-width: 420px) {
  .newsletter-console {
    gap: 0.72rem;
  }

  .newsletter-hero,
  .newsletter-workspace {
    padding: 0.72rem;
  }

  .newsletter-dispatch-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .newsletter-dispatch-summary > span:last-child {
    grid-column: 1 / -1;
  }

  .newsletter-hero-actions > *,
  .newsletter-dispatch-actions > *,
  .newsletter-dispatch-actions button {
    width: 100%;
  }

  .newsletter-hero-actions .btn,
  .newsletter-dispatch-actions button,
  .newsletter-authoring-actions button,
  .newsletter-form input,
  .newsletter-form select {
    min-height: 44px;
  }

  .newsletter-steps a {
    min-width: 0;
  }
}

.color-dot {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-block;
}

.iot-control,
.compact-form {
  display: grid;
  gap: var(--space-sm);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

.device-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-sm);
}

.device-picker legend {
  padding: 0 0.25rem;
  color: var(--text-secondary);
  font-weight: 800;
}

.list-item summary,
.create-box summary {
  cursor: pointer;
  color: var(--text-primary);
}

.list-item textarea {
  min-height: 7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.iot-control textarea {
  width: 100%;
  min-height: 15rem;
  margin-top: var(--space-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.doc-preview {
  display: grid;
  justify-items: center;
  overflow-x: auto;
}

.doc-page {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  background: #fff;
  color: #17212b;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: var(--shadow-md);
  padding: 18mm 18mm 14mm;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12mm;
  overflow-wrap: anywhere;
}

.doc-letterhead,
.doc-footer {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10mm;
  font-size: 0.78rem;
  color: #334155;
}

.doc-header-right {
  text-align: right;
}

.doc-logo {
  display: block;
  max-width: 42mm;
  max-height: 24mm;
  object-fit: contain;
  margin-bottom: 5mm;
}

.doc-letterhead p,
.doc-footer p,
.doc-body p {
  margin: 0 0 0.35rem;
}

.doc-body h1 {
  color: #17212b;
  font-size: 1.45rem;
  margin: 0 0 0.9rem;
}

.doc-body h2 {
  color: #17212b;
  font-size: 1.1rem;
  margin: 1rem 0 0.4rem;
}

.doc-body h3 {
  color: #334155;
  font-size: 0.98rem;
  margin: 0.85rem 0 0.35rem;
}

.doc-body p,
.doc-body dl,
.doc-body h2,
.doc-body h3,
.missing-info {
  break-inside: avoid;
}

.doc-meta {
  display: grid;
  grid-template-columns: 28mm 1fr;
  gap: 0.2rem 0.6rem;
  font-size: 0.82rem;
  color: #334155;
  border-top: 1px solid #d7dce2;
  border-bottom: 1px solid #d7dce2;
  padding: 0.5rem 0;
  margin: 0 0 1rem;
}

.doc-meta dt {
  font-weight: 800;
}

.doc-meta dd {
  margin: 0;
}

.doc-spacer {
  min-height: 0.45rem;
}

.missing-info {
  border-left: 4px solid var(--kbb-warning);
  background: rgba(192, 123, 9, 0.12);
  color: #5f3900;
  padding: 0.45rem 0.55rem;
}

.doc-footer {
  grid-template-columns: 1.28fr 1.1fr 1.28fr 1fr;
  border-top: 1px solid #d7dce2;
  padding-top: 4mm;
  font-size: 0.62rem;
  line-height: 1.28;
}

.code-block {
  white-space: pre-wrap;
  overflow-x: auto;
}

@page {
  size: A4;
  margin: 0;
}

.qm-report-print-header,
.qm-report-print-footer {
  display: none;
}

.qm-report-print-pages {
  display: none;
}

@media print {
  @page qm-report {
    size: A4 portrait;
    margin: 0;
  }

  .sidebar,
  .topbar {
    display: none;
  }

  body:has(.qm-report-print-document) .skip-link,
  body:has(.qm-report-print-document) .portal-breadcrumb,
  body:has(.qm-report-print-document) .portal-context,
  body:has(.qm-report-print-document) .flash {
    display: none;
  }

  html:has(.qm-report-print-document),
  body:has(.qm-report-print-document) {
    width: auto;
    min-height: 0;
  }

  body:has(.qm-report-print-document) {
    page: qm-report;
  }

  body:has(.qm-report-print-document) .shell,
  body:has(.qm-report-print-document) .main {
    width: auto;
    max-width: none;
    margin: 0;
    transform: none;
  }

  body:has(.doc-preview) .panel:not(:has(+ .doc-preview)) {
    display: none;
  }

  html,
  body {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
  }

  body {
    font-size: 10.5pt;
  }

  .shell,
  .main {
    display: block;
    min-height: 0;
  }

  .main {
    padding: 0;
    overflow: visible;
  }

  .content {
    padding: 0;
  }

  .qm-report-print-header {
    display: none;
  }

  .qm-report-print-header img {
    display: block;
    width: auto;
    max-width: 42mm;
    max-height: 15mm;
  }

  .qm-report-print-header div {
    display: grid;
    gap: 1mm;
    text-align: right;
    font-size: 8.5pt;
  }

  .qm-report-print-header span {
    color: #536663;
  }

  .qm-report-print-footer {
    display: none;
  }

  .qm-report-print-document {
    display: none;
  }

  .qm-report-print-pages {
    display: block;
  }

  .qm-report-print-sheet {
    box-sizing: border-box;
    display: grid;
    width: 210mm;
    height: 297mm;
    grid-template-rows: 16mm minmax(0, 1fr) 8mm;
    padding: 10mm 14mm 8mm;
    overflow: visible;
    color: #17211f;
    background: #fff;
    break-after: page;
    page-break-after: always;
  }

  .qm-report-print-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .qm-report-sheet-header,
  .qm-report-sheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .qm-report-sheet-header img {
    width: 37mm;
    height: auto;
  }

  .qm-report-sheet-header div {
    display: grid;
    gap: 1mm;
    text-align: right;
    font-size: 8.5pt;
  }

  .qm-report-sheet-header span,
  .qm-report-sheet-footer {
    color: #536663;
  }

  .qm-report-sheet-content {
    min-height: 0;
    padding-top: 4mm;
  }

  .qm-report-sheet-content h2 {
    margin: 0 0 2mm;
    font-size: 16pt;
  }

  .qm-report-sheet-content p {
    margin: 0 0 4mm;
  }

  .qm-report-sheet-content table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 8pt;
  }

  .qm-report-sheet-content th,
  .qm-report-sheet-content td {
    padding: 1.2mm 1.5mm;
    border: 0.2mm solid #bed0cd;
    vertical-align: top;
    overflow-wrap: anywhere;
  }

  .qm-report-sheet-content th {
    color: #fff;
    background: #1d3134;
  }

  .qm-report-sheet-content td {
    color: #17211f;
    background: #fff;
  }

  .qm-report-sheet-content .status {
    color: #173f3a;
    background: #eef6f4;
    border-color: #8eb5af;
  }

  .qm-report-sheet-content th:first-child,
  .qm-report-sheet-content td:first-child {
    width: 54%;
  }

  .qm-report-sheet-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4mm;
  }

  .qm-report-sheet-summary article {
    display: grid;
    min-height: 34mm;
    align-content: center;
    gap: 2mm;
    padding: 4mm;
    border: 0.2mm solid #bed0cd;
  }

  .qm-report-sheet-summary span {
    color: #536663;
    font-size: 9pt;
    font-weight: 800;
    text-transform: uppercase;
  }

  .qm-report-sheet-summary strong {
    font-size: 22pt;
  }

  .qm-report-sheet-footer {
    align-items: end;
    font-size: 7.5pt;
  }
  .qm-report-print-document {
    width: 100%;
    max-width: none;
    color: #17211f;
    background: #fff;
  }

  .qm-report-print-document .panel,
  .qm-report-print-document .card,
  .qm-report-print-document table,
  .qm-report-print-document th,
  .qm-report-print-document td {
    box-sizing: border-box;
    color: #17211f;
    background: #fff;
    border-color: #c8d4d2;
  }

  .qm-report-print-document table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    table-layout: fixed;
    font-size: 7.5pt;
  }

  .qm-report-print-document th,
  .qm-report-print-document td {
    overflow-wrap: anywhere;
    white-space: normal;
    padding: 1.2mm 1.5mm;
    line-height: 1.25;
    overflow: hidden;
  }

  .qm-report-print-document td a {
    display: block;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .qm-report-print-document table th:first-child {
    width: 55%;
  }

  .qm-report-print-document table th:nth-child(2),
  .qm-report-print-document table th:nth-child(3) {
    width: 14%;
  }

  .qm-report-print-document table th:nth-child(4) {
    width: 17%;
  }

  .qm-report-print-document table:has(th:nth-child(3):last-child) th:first-child {
    width: 64%;
  }

  .qm-report-print-document table:has(th:nth-child(3):last-child) th:not(:first-child) {
    width: 18%;
  }

  .qm-report-print-document a,
  .qm-report-print-document .muted,
  .qm-report-print-document .status {
    color: #284b47;
  }

  .qm-report-print-document .card strong {
    color: #17211f;
  }

  .qm-report-print-document .status {
    min-height: 0;
    padding: 0.5mm 1mm;
    border-color: #9bb4b1;
    color: #183b38;
    background: #edf4f2;
    line-height: 1.2;
  }

  .qm-report-print-document .panel {
    break-inside: auto;
    box-shadow: none;
  }

  .qm-report-print-document .section-heading,
  .qm-report-print-document thead,
  .qm-report-print-document tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .qm-report-print-document .actions,
  .qm-report-print-document .section-heading > .btn {
    display: none;
  }

  .doc-preview {
    display: block;
    overflow: visible;
  }

  .doc-page {
    width: 210mm;
    min-height: 297mm;
    padding: 13mm 14mm 10mm;
    border: 0;
    box-shadow: none;
    gap: 7mm;
    page-break-after: always;
  }

  .doc-logo {
    max-width: 34mm;
    max-height: 18mm;
  }

  .doc-letterhead {
    font-size: 8pt;
  }

  .doc-body h1 {
    font-size: 16pt;
  }

  .doc-body h2 {
    font-size: 13pt;
  }

  .doc-body h3 {
    font-size: 11pt;
  }

  .doc-body p {
    margin-bottom: 0.22rem;
  }

  .doc-footer {
    font-size: 7.5pt;
    line-height: 1.22;
  }
}

/* Public newsletter embed: visually belongs to the public KBB website, not to
   the authenticated portal theme. The technical honeypot remains available to
   the abuse controls, but is absent from the visible and assistive interface. */
body:has(.newsletter-public) {
  color-scheme: light;
  --background: #f5f8f6;
  --background-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-soft: #f5faf8;
  --surface-tint: #eef7f4;
  --border: rgba(21, 51, 40, 0.16);
  --text-primary: #153328;
  --text-secondary: #29483e;
  --text-muted: #526a62;
  --shadow-md: 0 12px 32px rgba(16, 40, 33, 0.08);
  background: #ffffff;
  color: var(--text-primary);
}

body:has(.newsletter-public) .auth-wrap {
  min-height: 0;
  place-items: start center;
  padding: clamp(0.75rem, 2.5vw, 1.5rem);
  background: #ffffff;
}

.newsletter-public {
  gap: 1rem;
  width: min(64rem, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  border: 1px solid rgba(21, 51, 40, 0.14);
  border-left: 4px solid var(--kbb-primary-light);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.newsletter-public .eyebrow {
  color: var(--kbb-primary-dark);
}

.newsletter-public h2 {
  color: #153328;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.newsletter-public header p {
  color: #36544a;
}

.newsletter-public-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.newsletter-public-flow span {
  border-color: rgba(8, 127, 117, 0.2);
  border-radius: 0;
  background: #eef8f6;
  color: #153f36;
  font-weight: 700;
}

.newsletter-public .newsletter-form {
  gap: 0.85rem;
  padding: clamp(0.9rem, 2vw, 1.25rem);
  border-color: rgba(21, 51, 40, 0.14);
  border-radius: 0;
  background: #f8fbf9;
}

.newsletter-public .newsletter-form label {
  color: #29483e;
  font-size: 0.88rem;
  font-weight: 700;
}

.newsletter-public .newsletter-form input:not([type="checkbox"]) {
  min-height: 44px;
  border-color: #a9c7c1;
  border-radius: 0;
  background: #ffffff;
  color: #153328;
}

.newsletter-public .newsletter-form input:focus {
  border-color: var(--kbb-primary);
  box-shadow: 0 0 0 3px rgba(8, 127, 117, 0.16);
}

.newsletter-public .newsletter-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.85rem;
  border-left: 3px solid rgba(8, 127, 117, 0.45);
  background: #eef8f6;
  line-height: 1.5;
}

.newsletter-public .newsletter-consent input {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  accent-color: var(--kbb-primary);
}

.newsletter-public .newsletter-consent a {
  color: #075f58;
  font-weight: 700;
}

.newsletter-public .newsletter-form button[type="submit"] {
  min-height: 46px;
  padding-inline: 1.15rem;
  border-color: #075f58;
  border-radius: 0;
  background: #087f75;
}

.newsletter-public .newsletter-form button[type="submit"]:hover,
.newsletter-public .newsletter-form button[type="submit"]:focus-visible {
  background: #075f58;
}

.newsletter-form .newsletter-honeypot,
.newsletter-form .newsletter-honeypot input {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 620px) {
  body:has(.newsletter-public) .auth-wrap {
    padding: 0.5rem;
  }

  .newsletter-public {
    padding: 0.9rem;
  }

  .newsletter-public-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
  }

  .newsletter-public-flow span {
    padding: 0.45rem 0.3rem;
    font-size: 0.72rem;
  }

  .newsletter-public .newsletter-form {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }
}

 .measure-tabs {
   display: flex;
   flex-wrap: wrap;
   gap: 0.35rem;
   margin: 0.75rem 0 1rem;
 }

 .measure-tabs a,
 .row-actions summary {
   border: 1px solid var(--border);
   border-radius: var(--radius-md);
   color: var(--text-secondary);
   background: var(--surface-strong);
   padding: 0.42rem 0.65rem;
   text-decoration: none;
   font-weight: 800;
 }

 .measure-tabs a:hover,
 .row-actions summary:hover {
   border-color: color-mix(in srgb, var(--kbb-primary) 42%, var(--border));
   color: var(--text-primary);
 }

 .row-actions {
   display: inline-block;
   margin-left: 0.35rem;
   position: relative;
 }

 .row-actions summary {
   cursor: pointer;
   list-style: none;
 }

 .row-actions summary::-webkit-details-marker {
   display: none;
 }

 .row-actions-menu {
   background: var(--surface-strong);
   border: 1px solid var(--border);
   border-radius: var(--radius-md);
   box-shadow: var(--shadow-md);
   display: grid;
   gap: 0.35rem;
   margin-top: 0.35rem;
   min-width: 12rem;
   padding: 0.5rem;
   position: absolute;
   right: 0;
   z-index: 5;
 }

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .main {
    order: 1;
  }

  .sidebar {
    order: 2;
    position: static;
    height: auto;
    max-height: 42vh;
  }

  .grid.cards,
  .dashboard-layout,
  .dashboard-layout.refined,
  .dashboard-hero,
  .process-hero,
  .portal-home-hero,
  .workspace-grid,
  .room-availability-summary,
  .form-grid,
  .action-grid,
  .overview-grid,
  .process-stage-grid,
  .process-checklist,
  .two-column,
  .split-grid,
  .qm-workspace-grid,
  .qm-evidence-board,
  .integration-summary,
  .record-hero,
  .record-summary-grid,
  .content-command-grid,
  .participant-today-grid,
  .document-workflow-grid,
  .participant-workbench,
  .participant-m365-grid,
  .portal-action-grid,
  .wizard-json-grid,
  .iot-layout,
  .control-grid,
  .filter-bar,
  .status-grid,
  .feature-fieldset {
    grid-template-columns: 1fr;
  }

  .record-identity {
    align-items: flex-start;
  }

  .record-avatar-img,
  .record-avatar-initials {
    width: 72px;
    height: 72px;
  }

  .participant-record-tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--border);
  }

  .participant-record-tabs a,
  .participant-record-tabs a:first-child,
  .participant-record-tabs a:last-child {
    justify-content: center;
    min-height: 38px;
    padding: 0.45rem 0.35rem;
    border: 0;
    border-radius: 0;
    background: var(--surface);
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }

  .document-editor-toolbar {
    position: static;
  }

  .document-editor-status {
    flex-basis: 100%;
    margin-left: 0;
  }

  .document-editor-page {
    min-height: 56vh;
    padding: 0.9rem;
  }

  .split-grid > *,
  .action-grid > *,
  .stack-list > *,
  .list-head > * {
    min-width: 0;
  }

  .dms-toolbar,
  .dms-explorer,
  .dms-orientation {
    grid-template-columns: 1fr;
  }

  .dms-inbox-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .qm-work-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .qm-work-item > .status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .dms-tree {
    position: static;
    max-height: none;
  }

  .dms-file {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dms-file-meta,
  .dms-file .inline-actions {
    justify-content: flex-start;
  }

  .span-2 { grid-column: span 1; }

  .topbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .topbar-user {
    display: none;
  }

  .workspace-switcher {
    margin-top: -0.25rem;
  }

  .portal-context {
    grid-template-columns: 1fr;
  }

  .context-links {
    justify-content: flex-start;
  }

  .context-more > div {
    left: 0;
    right: auto;
  }

  .global-search {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-actions,
  .dashboard-hero-actions {
    justify-content: flex-start;
  }

  .sidebar {
    overflow-x: hidden;
  }

  .dashboard-priority {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qm-azav-layout {
    grid-template-columns: 1fr;
  }

  .portal-header {
    grid-template-columns: 1fr;
  }

  .portal-nav {
    justify-content: flex-start;
  }

  .printable-credentials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .vacation-planning-layout .form-actions,
  .vacation-planning-layout .form-actions button {
    width: 100%;
    min-width: 0;
  }

  .vacation-planning-layout .quality-row {
    display: grid;
    gap: 0.2rem;
  }

  .vacation-planning-layout .quality-row span {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 0.65rem;
  }

  .dashboard-priority,
  .dashboard-mini-cards,
  .today-strip,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .priority-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .quality-list a {
    grid-template-columns: 1fr;
  }

  .global-search {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-area {
    font-size: 0.68rem;
  }

  .portal-breadcrumb > span:not([aria-hidden="true"]) {
    display: none;
  }

  .workspace-switcher > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .portal-context {
    padding: 0.65rem;
  }

  .portal-context strong {
    white-space: normal;
  }

  .context-links a {
    flex: 1 1 140px;
    justify-content: center;
  }

  .context-more {
    width: 100%;
  }

  .context-more summary {
    justify-content: center;
    width: 100%;
  }

  .context-more > div {
    position: static;
    margin-top: 0.35rem;
    min-width: 0;
  }

  .button-row,
  .inline-actions,
  .actions,
  .task-actions {
    width: 100%;
    align-items: stretch;
  }

  .button-row > *,
  .inline-actions > *,
  .actions > *,
  .task-actions > * {
    flex: 1 1 100%;
  }

  .button-row .btn,
  .button-row button,
  .inline-actions .btn,
  .inline-actions button,
  .actions .btn,
  .actions button,
  .task-actions .btn,
  .task-actions button {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .inline-form,
  .disclosure-panel > .inline-form {
    display: flex;
    width: 100%;
    align-items: stretch;
  }

  .inline-form button,
  .inline-form .btn,
  button,
  .btn {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .task-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-actions {
    justify-content: flex-start;
  }

  .page-intro {
    align-items: stretch;
  }

  .page-intro .btn {
    width: 100%;
  }

  .dms-file h4,
  .dms-file p {
    white-space: normal;
  }

  .hr-summary-grid,
  .record-summary-grid.hr-summary-grid,
  .staff-summary-grid,
  .record-summary-grid.staff-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-chart-row {
    grid-template-columns: 1fr;
  }

  .staff-archive-grid {
    grid-template-columns: 1fr;
  }

  .staff-save-bar {
    position: static;
    align-items: stretch;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.portal-nav-tree {
  flex: 1 1 auto;
}

.sidebar-quick-actions {
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.time-dock-button {
  align-items: center;
  background: var(--kbb-primary);
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  text-decoration: none;
}

.time-dock-button:hover,
.time-dock-button:focus {
  background: var(--kbb-primary-dark);
  color: #fff;
}

.time-clock-primary {
  font-size: 1.05rem;
  min-height: 52px;
  min-width: 220px;
}

.attention-row {
  background: color-mix(in srgb, var(--kbb-danger) 9%, transparent);
}

.compact-form {
  gap: 0.35rem;
}

.compact-form input {
  min-width: 110px;
}

.hr-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.time-chart-list {
  display: grid;
  gap: 0.65rem;
}

.time-staff-days {
  display: grid;
  gap: var(--space-sm);
}

.time-staff-days .nested-disclosure {
  margin: 0;
}

.time-chart-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 2fr) minmax(90px, auto);
  gap: 0.8rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.time-chart-row.needs-review {
  border-color: color-mix(in srgb, var(--kbb-danger) 38%, var(--border));
  background: color-mix(in srgb, var(--kbb-danger) 8%, var(--surface));
}

.time-chart-row div:first-child {
  min-width: 0;
}

.time-chart-row div:first-child strong,
.time-chart-row div:first-child span {
  display: block;
  overflow-wrap: anywhere;
}

.time-chart-row div:first-child span {
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.time-chart-track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 90%, transparent);
}

.time-chart-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
}

.time-chart-track .positive {
  background: var(--kbb-primary);
}

.time-chart-track .negative {
  background: var(--kbb-danger);
}

.staff-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.staff-record-form {
  display: grid;
  gap: var(--space-md);
}

.staff-form-section {
  display: grid;
  gap: var(--space-md);
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.staff-form-section > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
}

.staff-form-section > header > span {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: var(--kbb-primary);
  font-weight: 900;
}

.staff-form-section h3,
.staff-form-section p {
  margin: 0;
}

.staff-form-section p {
  color: var(--text-muted);
}

.applicant-create-panel {
  max-width: 920px;
  margin-inline: auto;
}

.applicant-create-form .field-error {
  display: block;
  margin-top: 0.4rem;
  color: var(--danger-text, #b42318);
  font-weight: 700;
}

.applicant-create-form .form-help {
  margin: 0;
  color: var(--text-muted);
}

.applicant-create-form [aria-invalid="true"] {
  border-color: var(--danger-text, #b42318);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-text, #b42318) 16%, transparent);
}

.applicant-resume-card {
  display: grid;
  gap: var(--space-md);
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--kbb-primary) 7%, var(--surface)), color-mix(in srgb, var(--surface) 96%, transparent));
}

.applicant-resume-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: end;
  justify-content: space-between;
}

.applicant-resume-head > div {
  flex: 1 1 28rem;
  min-width: 0;
}

.applicant-resume-head h2,
.applicant-resume-head p {
  margin: 0.2rem 0 0;
}

.applicant-resume-card progress {
  width: 100%;
  height: 0.7rem;
  accent-color: var(--kbb-primary);
}

.applicant-progress-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.applicant-progress-steps li {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.applicant-progress-steps li.current {
  border-color: var(--kbb-primary);
  box-shadow: inset 0 0 0 1px var(--kbb-primary);
}

.applicant-progress-steps li.complete {
  border-color: color-mix(in srgb, var(--success, #18864b) 55%, var(--border));
}

.applicant-progress-steps a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.45rem;
  min-height: 4.4rem;
  padding: 0.6rem;
  color: inherit;
  text-decoration: none;
}

.applicant-progress-steps a > span {
  grid-row: 1 / span 2;
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--surface-muted);
  font-weight: 900;
}

.applicant-progress-steps li.complete a > span {
  background: color-mix(in srgb, var(--success, #18864b) 18%, var(--surface));
}

.applicant-progress-steps strong,
.applicant-progress-steps small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.applicant-progress-steps small {
  color: var(--text-muted);
}

.conversion-summary {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 35%, var(--border));
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, color-mix(in srgb, var(--kbb-primary) 7%, var(--surface)), var(--surface));
}

.conversion-summary h3,
.conversion-summary p,
.conversion-summary dl,
.conversion-summary dd {
  margin: 0;
}

.conversion-summary dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.5rem;
}

.conversion-summary dl > div {
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.conversion-summary dt {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.conversion-summary dd,
.conversion-summary p {
  overflow-wrap: anywhere;
}

.staff-save-bar {
  position: sticky;
  bottom: 0.6rem;
  z-index: 11;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
  box-shadow: var(--shadow-md);
}

.staff-save-bar span {
  color: var(--text-secondary);
  font-weight: 800;
}

.staff-archive-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.4fr);
  gap: var(--space-lg);
  align-items: start;
}

.staff-archive-grid > article {
  min-width: 0;
}

.lifecycle-start-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.lifecycle-start-card {
  display: grid;
  gap: var(--space-sm);
  align-content: start;
  min-width: 0;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--kbb-primary) 28%, var(--border));
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, color-mix(in srgb, var(--kbb-primary) 8%, var(--surface)), var(--surface));
}

.lifecycle-start-card--danger {
  border-color: color-mix(in srgb, var(--kbb-danger) 30%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--kbb-danger) 7%, var(--surface)), var(--surface));
}

.lifecycle-start-card h3,
.lifecycle-start-card p {
  margin: 0;
}

.lifecycle-run-notice {
  display: grid;
  gap: 0.2rem;
}

.lifecycle-warning {
  color: var(--kbb-warning);
  font-weight: 800;
}

.lifecycle-step-list {
  display: grid;
  gap: var(--space-sm);
  padding: 0;
  list-style: none;
  counter-reset: lifecycle-step;
}

.lifecycle-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(190px, auto);
  gap: var(--space-sm);
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
}

.lifecycle-step--next {
  border-color: color-mix(in srgb, var(--kbb-primary) 55%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--kbb-primary) 12%, transparent);
}

.lifecycle-step--completed,
.lifecycle-step--skipped {
  opacity: 0.78;
}

.lifecycle-step--failed {
  border-color: color-mix(in srgb, var(--kbb-danger) 55%, var(--border));
}

.lifecycle-step-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: var(--text-on-accent);
  background: var(--kbb-primary);
  font-weight: 900;
}

.lifecycle-step-copy,
.lifecycle-step-action {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.lifecycle-step-copy .status-pill {
  width: fit-content;
}

.lifecycle-step-copy small {
  overflow-wrap: anywhere;
}

.lifecycle-step-action {
  justify-items: stretch;
}

.lifecycle-history {
  margin-top: var(--space-md) !important;
}

.staff-conversation-layout {
  display: grid;
  gap: var(--space-md);
}

.staff-conversation-form {
  display: grid;
  gap: var(--space-md);
  max-width: 980px;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.staff-conversation-form textarea {
  min-height: 72px;
  max-height: 120px;
  resize: vertical;
}

.staff-card-toolbar {
  align-items: end;
  justify-content: flex-start;
}

.staff-card-toolbar .inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: end;
}

.staff-card-toolbar .inline-form label {
  min-width: 150px;
}

.staff-card-toolbar .btn,
.staff-card-toolbar button {
  min-width: auto;
}

.portal-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 460px));
  gap: var(--space-sm);
  align-items: stretch;
  justify-content: start;
  margin-bottom: var(--space-md);
}

.portal-action-grid.compact-actions {
  display: grid;
}

.portal-action-card {
  display: grid;
  gap: 0.45rem;
  align-content: center;
  min-height: 88px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  text-decoration: none;
}

.portal-action-card > button {
  justify-self: start;
  width: auto;
  min-width: 180px;
}

.portal-action-card.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-width: 180px;
  min-height: 42px;
  padding: 0.62rem 0.9rem;
  border-color: color-mix(in srgb, var(--kbb-primary) 84%, #000);
  border-radius: var(--radius-sm);
  background: var(--kbb-primary);
  color: #fff;
  box-shadow: none;
}

.portal-action-card.btn:hover,
.portal-action-card.btn:focus-visible {
  background: var(--kbb-primary-dark);
  color: #fff;
}

.portal-action-card label {
  width: 100%;
}

.portal-action-card input {
  width: min(100%, 360px);
}

.staff-self-record .table-wrap {
  margin-bottom: 0;
}

.card-registry-toolbar {
  justify-content: space-between;
  align-items: center;
}

.card-registry-toolbar input[type="search"] {
  min-width: min(420px, 100%);
}

.card-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.nested-card-tools {
  margin-top: 0.6rem;
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}

.nested-card-tools summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.nested-card-tools[open] summary {
  margin-bottom: 0.65rem;
}

.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.bulk-toolbar select,
.bulk-toolbar input {
  min-width: 180px;
}

.scan-result {
  max-width: 560px;
  margin: 0 auto;
}

.scan-result-head {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.scan-result-gueltig {
  border-color: color-mix(in srgb, var(--kbb-success) 30%, var(--border));
}

.scan-result-ungueltig {
  border-color: color-mix(in srgb, var(--kbb-danger) 30%, var(--border));
}

/* Layered navigation may use glass; forms and tables remain solid work surfaces. */
.nav-toggle,
.sidebar-close,
.nav-backdrop {
  display: none;
}

.form-required-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 700;
}

.access-section {
  border-color: color-mix(in srgb, var(--kbb-warning) 30%, var(--border));
}

.risk-check {
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--kbb-warning) 46%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--kbb-warning) 9%, var(--surface));
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar,
  .staff-save-bar {
    background: color-mix(in srgb, var(--surface-strong) 91%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(118%);
    backdrop-filter: blur(10px) saturate(118%);
  }
}

@media (max-width: 980px) {
  .shell {
    display: block;
  }

  .main {
    order: initial;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: min(320px, calc(100vw - 3rem));
    height: 100dvh;
    max-height: none;
    padding-top: 3.25rem;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow-md);
  }

  .shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(5, 10, 14, 0.54);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .shell.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle,
  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
  }

  .sidebar-close {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    width: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 1.35rem;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "navigation title actions"
      "search search search";
    align-items: center;
  }

  .nav-toggle { grid-area: navigation; }

  .topbar-title { grid-area: title; }

  .global-search {
    grid-area: search;
    grid-column: 1 / -1;
  }

  .topbar-actions {
    grid-area: actions;
    justify-content: flex-end;
  }

  body.nav-locked {
    overflow: hidden;
  }

  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .sidebar {
      background: color-mix(in srgb, var(--background-alt) 88%, transparent);
      -webkit-backdrop-filter: blur(12px) saturate(116%);
      backdrop-filter: blur(12px) saturate(116%);
    }

    .nav-backdrop {
      -webkit-backdrop-filter: blur(3px);
      backdrop-filter: blur(3px);
    }
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 0.45rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .global-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar :is(button, input) {
    min-height: 44px;
  }

  .topbar .theme-toggle {
    width: 44px;
    min-width: 44px;
  }

  .topbar-actions {
    width: auto;
  }

  .topbar-title span {
    display: none;
  }

  .nav-toggle span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .lifecycle-start-grid {
    grid-template-columns: 1fr;
  }

  .lifecycle-step {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .lifecycle-step-action {
    grid-column: 1 / -1;
  }
}

.attendance-toolbar {
  align-items: center;
  justify-content: space-between;
}

.attendance-table :is(select, input, .btn) {
  min-height: 44px;
}

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

  .recruiting-table-wrap {
    overflow: visible;
  }

  .recruiting-table,
  .recruiting-table tbody,
  .recruiting-table tr,
  .recruiting-table td {
    display: block;
    width: 100%;
  }

  .recruiting-table thead {
    display: none;
  }

  .recruiting-table tr {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .recruiting-table td {
    display: grid;
    grid-template-columns: minmax(108px, 38%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .recruiting-table td:last-child {
    border-bottom: 0;
  }

  .recruiting-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .recruiting-table td .btn.small,
  .process-hero .btn {
    min-height: 44px;
  }

  .recruiting-table td .btn.small {
    width: 100%;
  }

  .attendance-table-wrap { overflow: visible; }
  .attendance-table,
  .attendance-table tbody,
  .attendance-table tr,
  .attendance-table td { display: block; width: 100%; }
  .attendance-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .attendance-table tr {
    margin-block: 0 1rem;
    padding: .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
  }
  .attendance-table td {
    display: grid;
    grid-template-columns: minmax(7rem, 35%) minmax(0, 1fr);
    gap: .6rem;
    align-items: center;
    border: 0;
    padding: .45rem 0;
  }
  .attendance-table td::before { content: attr(data-label); font-weight: 700; color: var(--muted); }
  .attendance-table td > :is(input, select) { width: 100%; min-width: 0; }

  .participant-portal .portal-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    padding: 0.5rem 0.65rem 0.65rem;
  }

  .participant-portal .portal-brand img {
    width: 124px;
  }

  .participant-portal .portal-brand span {
    display: none;
  }

  .participant-portal .portal-nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .participant-portal .portal-nav > a,
  .participant-portal .portal-nav-more > summary {
    justify-content: center;
    width: 100%;
    padding-inline: 0.25rem;
    text-align: center;
  }

  .participant-portal .portal-nav-more > div {
    right: 0;
    min-width: min(220px, calc(100vw - 1.3rem));
  }

  .participant-portal .portal-main {
    padding: 0.65rem;
  }

  .participant-portal .topbar {
    display: none;
  }

  .participant-portal .portal-context {
    margin-top: 0;
  }

  .portal-message-list article,
  .portal-profile-data {
    grid-template-columns: 1fr;
  }

  .participant-portal .section-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .participant-portal .profile-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .portal-table-wrap {
    overflow: visible;
  }

  .portal-data-table,
  .portal-data-table tbody,
  .portal-data-table tr,
  .portal-data-table td {
    display: block;
    width: 100%;
  }

  .portal-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .portal-data-table tr {
    margin-block: 0 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
  }

  .portal-data-table td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 34%) minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    padding: 0.42rem 0;
    border: 0;
    white-space: normal;
  }

  .portal-data-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-weight: 800;
  }

  .portal-data-table td[colspan] {
    display: block;
  }

  .portal-data-table td[colspan]::before {
    content: none;
  }

  .portal-data-table .inline-actions {
    align-items: stretch;
  }

  .portal-data-table .inline-actions > * {
    width: 100%;
  }

  .portal-history > summary {
    align-items: flex-start;
  }
}

.recruiting-workbench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.recruiting-workbench-grid .panel {
  margin: 0;
  min-width: 0;
  background: linear-gradient(145deg, rgb(255 255 255 / 94%), rgb(245 249 251 / 88%));
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  backdrop-filter: blur(10px) saturate(115%);
}

.workbench-focus-card {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 78%, white);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 72%);
}

.workbench-focus-card h3 {
  margin: 0.55rem 0 0.2rem;
}

.compact-timeline p,
.break-word,
.recruiting-workbench-grid a {
  overflow-wrap: anywhere;
}

.recruiting-workbench-grid summary,
.recruiting-workbench-grid button,
.recruiting-workbench-grid .btn {
  min-height: 44px;
}

.newsletter-block-builder {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 92%, var(--accent) 8%);
}

.newsletter-block-builder > legend {
  padding: 0 0.45rem;
  font-weight: 800;
}

.newsletter-block-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.newsletter-block-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  overflow: clip;
}

.newsletter-block-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
}

.newsletter-block-card > summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.newsletter-block-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 0 0.9rem 0.9rem;
}

.newsletter-authoring-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
}

.newsletter-preview-workbench {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
}

.newsletter-preview-workbench h4 {
  margin: 0.2rem 0;
  font-size: 1.15rem;
}

.newsletter-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.46fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.newsletter-preview-grid article {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.newsletter-preview-grid iframe {
  width: 100%;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef4f1;
}

.newsletter-preview-grid .mobile iframe {
  max-width: 390px;
  justify-self: center;
}

@media (max-width: 820px) {
  .recruiting-workbench-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .newsletter-block-fields,
  .newsletter-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .newsletter-preview-grid iframe {
    min-height: 540px;
  }
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-transparency: reduce) {
  .sidebar,
  .nav-backdrop {
    transition: none;
  }

  .topbar,
  .sidebar,
  .staff-save-bar,
  .nav-backdrop,
  .portal-header,
  .participant-portal .portal-context {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .recruiting-workbench-grid .panel {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .ui-state-spinner {
    animation: none;
  }
}

/* Guided job editor: progressive disclosure without changing the server contract. */
.job-editor { display: grid; gap: 1.25rem; }
.job-editor-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.job-editor-progress button {
  min-height: 3.25rem; display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left;
}
.job-editor-progress button span {
  width: 1.8rem; height: 1.8rem; flex: 0 0 1.8rem; display: grid; place-items: center;
  border-radius: 999px; background: var(--surface-muted); font-weight: 800;
}
.job-editor-progress button[aria-current="step"] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.job-editor-progress button[aria-current="step"] span { background: var(--primary); color: #fff; }
.job-editor-progress button:disabled { opacity: .58; cursor: not-allowed; }
.job-editor-step {
  min-inline-size: 0; margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
}
.job-editor-step legend { display: grid; gap: .2rem; padding: 0 .45rem; font-size: 1.2rem; font-weight: 800; }
.job-editor-step > label { display: grid; gap: .4rem; margin-block: .85rem; }
.job-editor-step textarea { width: 100%; }
.job-preview-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1rem; }
.job-preview-frame {
  width: 100%; margin-inline: auto; padding: .75rem; border: 1px dashed var(--border);
  border-radius: 18px; background: var(--surface-muted); transition: max-width .2s ease;
}
.job-preview-frame[data-job-preview-frame="tablet"] { max-width: 760px; }
.job-preview-frame[data-job-preview-frame="mobile"] { max-width: 390px; }
.job-public-preview { padding: clamp(1rem, 3vw, 2rem); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.job-public-preview h2 { margin-block: .35rem .5rem; }
.job-public-preview h3 { margin-block: 1rem .25rem; font-size: 1rem; }
.job-preview-meta, .job-preview-contact { color: var(--text-muted); }
.pre-line { white-space: pre-line; }

@media (max-width: 760px) {
  .job-editor-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-editor-progress button { min-height: 44px; }
}

@media (max-width: 430px) {
  .job-editor-progress strong { font-size: .85rem; }
  .job-editor-step { padding: .75rem; }
  .job-editor-actions .btn { width: 100%; }
}

.marketing-subnav {
  margin-bottom: 18px;
}

.marketing-subnav a[aria-current="page"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent-strong);
}

.marketing-entry-grid {
  margin: 18px 0;
}

.marketing-entry-grid .workspace-card {
  min-height: 210px;
}

.marketing-entry-grid .workspace-card .btn {
  margin-top: auto;
}

.marketing-quick-start {
  margin-bottom: 1rem;
}

.marketing-project-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, .35fr) auto auto;
  gap: .75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.marketing-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr);
  gap: 18px;
  align-items: start;
  margin: 18px 0;
}

.marketing-workspace > aside {
  display: grid;
  gap: 18px;
}

.marketing-project-form .span-2 {
  grid-column: 1 / -1;
}

.marketing-safety-panel {
  border-left: 4px solid var(--accent);
}

.marketing-version-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.marketing-version-list li {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.marketing-version-list span {
  color: var(--muted);
  font-size: .88rem;
}

.marketing-fieldset {
  margin: 8px 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
}

.marketing-fieldset legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 800;
}

.marketing-profile-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 16px 0 22px;
}

.marketing-profile-facts > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.marketing-profile-facts span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.marketing-profile-facts strong {
  overflow-wrap: anywhere;
}

.marketing-layout-editor {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.marketing-layout-toolbar,
.marketing-layout-surfaces {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 14px;
}

.marketing-layout-toolbar output {
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.marketing-layout-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.marketing-layout-surfaces {
  border-bottom: 1px solid var(--line);
}

.marketing-layout-surfaces button {
  padding: 8px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}

.marketing-layout-surfaces button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.marketing-layout-viewport {
  position: relative;
  overflow: auto;
  min-height: 32rem;
  padding: 2.2rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    var(--soft);
  background-size: 20px 20px;
}

.marketing-layout-page {
  position: relative;
  width: var(--layout-width);
  height: var(--layout-height);
  overflow: hidden;
  transform: scale(var(--layout-zoom));
  transform-origin: top left;
  background: #fff;
  color: #153328;
  box-shadow: var(--shadow);
}

.marketing-layout-guide {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.marketing-layout-guide.trim {
  inset: 0;
  border: 1px solid var(--muted);
}

.marketing-layout-guide.safety {
  inset: 16px;
  display: none;
  border: 1px dashed var(--accent);
}

.show-safety .marketing-layout-guide.safety {
  display: block;
}

.marketing-layout-guide.folds {
  inset: 0 33.333% 0 auto;
  display: none;
  width: 33.333%;
  border-inline: 1px dashed var(--warning);
}

.show-folds .marketing-layout-guide.folds {
  display: block;
}

.show-overlay .marketing-layout-page::after {
  content: "Duplex-Überlagerung";
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  pointer-events: none;
}

.marketing-layout-element {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  padding: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: move;
  touch-action: none;
}

.marketing-layout-element:hover,
.marketing-layout-element:focus-visible {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 1px;
}

.marketing-layout-element.image {
  background: var(--soft);
  color: var(--muted);
}

.marketing-workflow-console {
  margin-top: 24px;
}

.marketing-workflow-feedback {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .55rem;
  max-width: min(100%, 38rem);
}

.marketing-workflow-feedback .status-pill {
  max-width: 100%;
  text-align: left;
  text-transform: none;
  white-space: normal;
}

.marketing-workflow-feedback [data-marketing-recovery-action] {
  flex: 0 0 auto;
}

.marketing-workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.marketing-workflow-grid > .panel {
  min-width: 0;
}

.marketing-asset-list,
.marketing-ai-list,
.marketing-package-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.marketing-asset-list article,
.marketing-package-list article,
.marketing-ai-list article {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.marketing-asset-list article > div:first-child,
.marketing-package-list article > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.marketing-asset-list strong,
.marketing-package-list strong {
  overflow-wrap: anywhere;
}

.marketing-ai-list details {
  padding: 10px;
  border: 1px solid var(--line);
}

.marketing-ai-list summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

@media (max-width: 980px) {
  .marketing-workspace {
    grid-template-columns: 1fr;
  }

  .marketing-workflow-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .marketing-layout-editor::before {
    content: "Der grafische Editor ist für Desktop-Arbeitsplätze optimiert. Auf kleinen Bildschirmen bleiben Grunddaten und Freigaben verfügbar.";
    display: block;
    margin-bottom: 14px;
    padding: 12px;
    border-left: 4px solid var(--warning);
    background: var(--soft);
  }

  .marketing-layout-viewport {
    min-height: 24rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .job-preview-frame { transition: none; }
}

.marketing-create-hero { margin-bottom: 1rem; }
.marketing-create-shell { max-width: 1320px; margin: 0 auto; }
.marketing-wizard-progress,
.marketing-project-journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin: 0 0 1rem;
}
.marketing-wizard-progress button,
.marketing-project-journey a {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 48px;
  padding: .65rem .85rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.marketing-wizard-progress span,
.marketing-project-journey span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-strong);
}
.marketing-wizard-progress button[aria-current="step"] {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
  color: var(--accent-strong);
}
.marketing-project-journey a[aria-current="step"] {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
  color: var(--accent-strong);
}
.marketing-guided-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1rem;
  align-items: start;
}
.marketing-guided-layout > aside {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}
.marketing-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.marketing-choice-card { display: block; cursor: pointer; }
.marketing-choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.marketing-choice-card > span {
  display: grid;
  gap: .35rem;
  min-height: 118px;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.marketing-choice-card small { color: var(--muted); line-height: 1.45; }
.marketing-choice-card input:checked + span {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translateY(-2px);
}
.marketing-choice-card input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}
.marketing-simple-options,
.marketing-source-box { margin-top: 1rem; }
[data-marketing-wizard] [data-material-field][hidden] { display: none !important; }
[data-marketing-wizard] [data-wizard-step][hidden],
[data-marketing-wizard] [data-wizard-back][hidden],
[data-marketing-wizard] [data-wizard-next][hidden] { display: none !important; }
.marketing-wizard-actions { display: flex; justify-content: space-between; margin-top: 1rem; }
.marketing-wizard-step h2[tabindex="-1"]:focus { outline: none; }
.marketing-review-list { display: grid; gap: .5rem; padding: 0; list-style: none; }
.marketing-review-list li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
}
.marketing-primary-action { width: 100%; justify-content: center; min-height: 50px; }
.marketing-guidance-card ol { display: grid; gap: .65rem; padding-left: 1.25rem; }
.marketing-project-journey {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: .5rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
}
.marketing-expert-details {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 86%, var(--surface));
}
.marketing-expert-details > summary,
.marketing-history-details > summary { cursor: pointer; padding: .9rem 1rem; }
.marketing-expert-details > summary span { display: grid; gap: .2rem; }
.marketing-expert-details > summary small { color: var(--muted); font-weight: 400; }
.marketing-expert-details[open] > summary { border-bottom: 1px solid var(--line); }
.marketing-expert-details > :not(summary) { margin: 1rem; }
.marketing-quality-card { border-top: 4px solid var(--accent); }
.marketing-step-page {
  display: grid;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
}
.marketing-step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
}
.marketing-review-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr);
  gap: 1rem;
  align-items: start;
}
.marketing-review-sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 5.25rem;
}
.marketing-pdf-preview {
  width: 100%;
  min-height: 68vh;
  border: 1px solid var(--line);
  background: #fff;
}
.marketing-ai-style-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  padding: 0;
  border: 0;
}
.marketing-ai-style-picker label { cursor: pointer; }
.marketing-ai-style-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.marketing-ai-style-picker label > span {
  display: grid;
  gap: .2rem;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  background: var(--panel);
}
.marketing-ai-style-picker input:checked + span {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.marketing-ai-style-picker input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}
.marketing-ai-style-picker small { color: var(--muted); }

.marketing-create-expert {
  grid-column: 1 / -1;
  margin-top: .35rem;
}

.marketing-ai-workbench {
  display: grid;
  gap: 1.2rem;
}

.marketing-ai-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .45fr);
  gap: 1rem;
  align-items: start;
}

.marketing-ai-brief dl {
  display: grid;
  gap: .65rem;
  margin: 0;
}

.marketing-ai-brief dl > div {
  display: grid;
  gap: .15rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  background: var(--soft);
}

.marketing-ai-brief dt {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.marketing-ai-brief dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.marketing-ai-request {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
}

.marketing-ai-request > .btn {
  justify-self: start;
}

.marketing-ai-request > .btn:disabled {
  opacity: .48;
  filter: saturate(.35);
  cursor: not-allowed;
}

.marketing-variant-batch > summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  cursor: pointer;
}

.marketing-variant-batch > summary > span:first-child {
  display: grid;
  gap: .15rem;
}

.marketing-variant-batch > summary small {
  color: var(--muted);
}

.marketing-variant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  padding: 0 1rem 1rem;
}

.marketing-variant-card {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 1rem !important;
  background: var(--panel) !important;
  border-radius: var(--radius);
}

.marketing-variant-card h3 {
  margin: 0;
  font-size: 1.12rem;
}

.marketing-variant-copy {
  flex: 1;
}

.marketing-variant-copy p {
  white-space: pre-line;
}

.marketing-variant-cta {
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

.marketing-variant-card form,
.marketing-variant-card .status-pill {
  margin-top: auto;
}

.marketing-variant-edit {
  margin-top: .75rem;
  border-top: 1px solid var(--line);
}

.marketing-variant-edit > summary {
  padding: .75rem 0;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
}

.marketing-variant-edit form {
  margin-top: 0;
  padding-top: .25rem;
}

.marketing-variant-review {
  margin: 0 1rem 1rem;
  padding: 1rem;
  border-left: 4px solid var(--accent);
  background: var(--soft);
}

.marketing-variant-note {
  margin: 0 1rem 1rem;
  color: var(--muted);
  font-size: .9rem;
}

.marketing-media-details,
.marketing-distribution-details {
  margin-top: 1rem;
}

.marketing-media-details > :not(summary),
.marketing-distribution-details > :not(summary) {
  margin-inline: 1rem;
}

@media (max-width: 980px) {
  .marketing-guided-layout { grid-template-columns: 1fr; }
  .marketing-guided-layout > aside { position: static; }
  .marketing-review-workspace { grid-template-columns: 1fr; }
  .marketing-review-sidebar { position: static; }
  .marketing-variant-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .marketing-wizard-progress,
  .marketing-project-journey { grid-template-columns: 1fr 1fr; }
  .marketing-choice-grid { grid-template-columns: 1fr; }
  .marketing-review-list li { grid-template-columns: 1fr; }
  .marketing-project-filters { grid-template-columns: 1fr; }
  .marketing-step-footer { align-items: stretch; flex-direction: column; }
  .marketing-ai-style-picker,
  .marketing-ai-brief { grid-template-columns: 1fr; }
}
.process-help {
  display: inline-flex;
  position: relative;
  vertical-align: middle;
  margin-inline-start: 0.35rem;
}

.process-help-trigger {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 1px solid var(--border, #b9cfcc);
  border-radius: 50%;
  background: var(--surface, #fff);
  color: var(--primary, #006b60);
  font: inherit;
  font-weight: 800;
  line-height: 1;
}

.process-help-popover {
  position: absolute;
  z-index: 30;
  inset-block-start: calc(100% + 0.4rem);
  inset-inline-start: 0;
  display: none;
  width: min(22rem, 78vw);
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border, #b9cfcc);
  border-radius: 0.75rem;
  background: var(--surface, #fff);
  color: var(--text, #142328);
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 18%);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
}

.process-help:focus-within .process-help-popover,
.process-help:hover .process-help-popover {
  display: block;
}

.process-help-trigger:focus-visible {
  outline: 3px solid var(--focus, #f2c94c);
  outline-offset: 2px;
}
/* Administration: kompakter Secret-Vault */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.vault-list { display: grid; gap: var(--space-3); }
.vault-row {
  display: grid;
  grid-template-columns: minmax(15rem, 1.2fr) minmax(13rem, 1fr) minmax(12rem, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.vault-identity { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.vault-identity div, .vault-state { display: grid; gap: var(--space-1); min-width: 0; }
.vault-identity small, .vault-state small { color: var(--text-muted); overflow-wrap: anywhere; }
.status-dot { width: .75rem; height: .75rem; flex: 0 0 .75rem; border-radius: 50%; background: var(--text-muted); }
.status-dot.ok { background: var(--kbb-success); }
.status-dot.warn { background: var(--kbb-warning); }
.vault-action summary, .danger-zone summary { cursor: pointer; color: var(--kbb-primary); font-weight: 700; }
.vault-secret-form { margin-top: var(--space-2); align-items: end; }
.vault-secret-form input { min-width: min(22rem, 100%); }
.vault-buttons { justify-content: flex-end; align-items: center; }
.danger-zone form { display: grid; gap: var(--space-2); margin-top: var(--space-2); min-width: 14rem; }
.text-success { color: var(--kbb-success); }
.text-danger { color: var(--kbb-danger); }

/* Guided measure workflow: progressive, readable and usable on touch devices. */
.measure-stepper {
  position: sticky;
  top: .5rem;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(7, minmax(7rem, 1fr));
  gap: .5rem;
  margin: 1rem 0;
  padding: .65rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
}
.measure-stepper a { display: grid; grid-template-columns: 2rem 1fr; gap: .05rem .5rem; min-width: 7rem; padding: .55rem; border-radius: var(--radius-md); color: var(--text); text-decoration: none; }
.measure-stepper a:hover, .measure-stepper a:focus-visible { background: var(--surface-strong); outline: 2px solid var(--primary); }
.measure-stepper span { grid-row: 1 / 3; display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; }
.measure-stepper strong, .measure-stepper small { white-space: nowrap; }
.measure-stepper small { color: var(--text-muted); }
.workflow-section { scroll-margin-top: 7rem; }
.decision-hint { display: grid; gap: .25rem; margin: 1rem 0; padding: .9rem 1rem; border-inline-start: .3rem solid var(--primary); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.decision-hint.ok { border-color: var(--kbb-success); }
.decision-hint.warn { border-color: var(--kbb-warning); }
.decision-hint span { color: var(--text-muted); }
.workflow-card-grid, .guardrail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.workflow-card-grid article, .guardrail-grid article { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.workflow-card-grid article { display: grid; gap: .35rem; }
.workflow-card-grid article span { color: var(--primary); font-weight: 800; }
.schedule-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .65rem; }
.schedule-preview article { display: grid; gap: .2rem; padding: .8rem; border: 1px solid var(--border); border-radius: var(--radius-md); }
.schedule-preview small { color: var(--text-muted); }
.two-column-workflow { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.25rem; align-items: start; }
.plain-list { display: grid; gap: .4rem; padding: 0; list-style: none; }
.plain-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem; border-bottom: 1px solid var(--border); }
.blocker-list { margin: 1rem 0; padding: 1rem; border: 1px solid var(--kbb-warning); border-radius: var(--radius-md); background: color-mix(in srgb, var(--kbb-warning) 10%, var(--surface)); }
.approval-form { margin-top: 1rem; }
.timeline-list { display: grid; gap: .5rem; padding: 0; list-style: none; }
.timeline-list li { display: flex; justify-content: space-between; gap: 1rem; }
@media (max-width: 920px) {
  .workflow-card-grid, .guardrail-grid, .two-column-workflow { grid-template-columns: 1fr; }
  .measure-stepper { position: static; grid-template-columns: repeat(7, minmax(8.5rem, 1fr)); }
}
@media (max-width: 1100px) {
  .vault-row { grid-template-columns: 1fr 1fr; align-items: start; }
  .vault-buttons { justify-content: flex-start; }
}
@media (max-width: 680px) {
  .vault-row { grid-template-columns: 1fr; }
  .vault-secret-form { display: grid; }
}

/* Goal-oriented work pages: one dominant page action, all other actions remain available. */
[data-page-primary-action] {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kbb-accent) 20%, transparent);
}
.task-workbench { display: grid; gap: var(--space-4); }
.task-next-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-5);
  border: 1px solid color-mix(in srgb, var(--kbb-accent) 45%, var(--border));
  border-inline-start: 5px solid var(--kbb-accent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--kbb-accent) 7%, var(--surface));
}
.task-next-card h3, .task-row h3 { margin: .2rem 0; }
.task-next-card p, .task-row p { margin: 0; color: var(--text-secondary); }
.task-list { display: grid; gap: var(--space-3); }
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.task-row.is-next { border-color: color-mix(in srgb, var(--kbb-accent) 45%, var(--border)); }
.task-row-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.task-resolution .breadcrumb { margin-bottom: var(--space-4); }
.guided-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-5) 0 0; padding: 0; list-style: none; counter-reset: guided-step; }
.guided-steps li { display: grid; gap: .35rem; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); counter-increment: guided-step; }
.guided-steps li::before { content: counter(guided-step); display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; background: var(--kbb-primary); color: white; font-weight: 800; }
.guided-steps span { color: var(--text-secondary); }
.task-completion-form { display: grid; gap: var(--space-4); max-width: 52rem; }
@media (max-width: 720px) {
  .task-next-card, .task-row { grid-template-columns: 1fr; }
  .task-next-card > a, .task-row > a { justify-self: start; }
  .guided-steps { grid-template-columns: 1fr; }
}
