:root {
  color-scheme: light;
  --color-bg: #f6f8fc;
  --color-bg-dark: #06101f;
  --color-surface: rgba(255, 255, 255, 0.76);
  --color-surface-solid: #ffffff;
  --color-surface-muted: rgba(235, 241, 249, 0.76);
  --color-surface-dark: rgba(8, 19, 35, 0.78);
  --color-surface-solid-dark: #081323;
  --color-surface-muted-dark: rgba(16, 34, 59, 0.72);
  --color-text: #0b1224;
  --color-text-muted: #617189;
  --color-text-dark: #f4f8ff;
  --color-text-muted-dark: #a9cfff;
  --color-border: rgba(164, 181, 205, 0.58);
  --color-border-dark: rgba(95, 123, 164, 0.46);
  --color-primary: #0a84ff;
  --color-primary-hover: #075fc2;
  --color-button-primary: #0a84ff;
  --color-button-primary-hover: #075fc2;
  --color-button-secondary: #edf3fa;
  --color-danger: #dc2626;
  --color-warning: #c97700;
  --color-success: #16834a;
  --brand-navy: #0b1224;
  --brand-deep: #081323;
  --brand-gold: #ffb43d;
  --brand-warm-haze: #ff7f84;
  --brand-yellow: #ffd60a;
  --brand-blue: #0a84ff;
  --brand-mist: #a9cfff;
  --brand-green: #39d98a;
  --brand-haze: #ffd399;
  --brand-wave-mid: var(--brand-yellow);
  --brand-ink: var(--brand-navy);
  --brand-logo-fill: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  --brand-logo-stroke: color-mix(in srgb, var(--brand-navy) 86%, var(--line));
  --brand-logo-glow: 0 0 2px currentColor;
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface-solid: #ffffff;
  --surface-muted: var(--color-surface-muted);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --border: var(--color-border);
  --primary: var(--color-primary);
  --primary-strong: var(--color-primary-hover);
  --button-primary: var(--color-button-primary);
  --button-primary-hover: var(--color-button-primary-hover);
  --danger: var(--color-danger);
  --warning: var(--color-warning);
  --success: var(--color-success);
  --focus: rgba(10, 132, 255, 0.18);
  --panel: var(--surface);
  --line: var(--border);
  --accent: var(--primary);
  --accent-dark: var(--primary-strong);
  --accent-soft: rgba(10, 132, 255, 0.12);
  --on-primary: #ffffff;
  --on-danger: #ffffff;
  --button-secondary-bg: color-mix(in srgb, var(--surface-solid) 72%, var(--surface-muted));
  --button-secondary-bg-hover: color-mix(in srgb, var(--accent-soft) 48%, var(--surface-solid));
  --button-secondary-text: var(--text);
  --button-secondary-border: color-mix(in srgb, var(--border) 84%, transparent);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-button: 999px;
  --radius-field: 16px;
  --radius-field-compact: 14px;
  --border-width: 1px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.035), 0 14px 34px rgba(0, 0, 0, 0.07);
  --glass-blur: blur(24px) saturate(1.18);
  --spacing-md: 12px;
  --page-spacing: 20px;
  --content-max-width: 1440px;
  --modal-wide-max-width: 1360px;
  --content-gutter: clamp(16px, 2vw, 28px);
  --app-header-height: 52px;
  --workspace-bar-height: 52px;
  --dashboard-content-padding-vertical: 58px;
  --dashboard-content-viewport: calc(100dvh - var(--app-header-height) - var(--workspace-bar-height) - var(--dashboard-content-padding-vertical));
  --work-panel-min-height: clamp(340px, calc(100dvh - 330px), 620px);
  --form-spacing: 10px;
  --table-row-height: 42px;
  --button-height: 34px;
  --button-pad-y: 7px;
  --button-pad-x: 13px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-heading: 24px;
  --font-size-label: 12px;
  --font-size-button: 13px;
  --line-height-base: 1.42;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--color-bg-dark);
  --surface: var(--color-surface-dark);
  --surface-solid: var(--color-surface-solid-dark);
  --surface-muted: var(--color-surface-muted-dark);
  --text: var(--color-text-dark);
  --muted: var(--color-text-muted-dark);
  --border: var(--color-border-dark);
  --primary: #4da6ff;
  --primary-strong: #a9cfff;
  --accent-soft: rgba(77, 166, 255, 0.2);
  --button-primary: #0a84ff;
  --button-primary-hover: #3aa0ff;
  --on-primary: #ffffff;
  --button-secondary-bg: color-mix(in srgb, var(--surface-solid) 72%, #ffffff 4%);
  --button-secondary-bg-hover: color-mix(in srgb, var(--accent-soft) 48%, var(--surface-solid));
  --button-secondary-border: color-mix(in srgb, var(--border) 84%, #ffffff 6%);
  --danger: #ff5a52;
  --warning: #ffb43d;
  --success: #39d98a;
  --focus: rgba(77, 166, 255, 0.28);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.34), 0 18px 44px rgba(0, 0, 0, 0.26);
  --brand-gold: #ffb43d;
  --brand-warm-haze: #ff7f84;
  --brand-yellow: #ffcb66;
  --brand-blue: #4da6ff;
  --brand-mist: #a9cfff;
  --brand-green: #39d98a;
  --brand-wave-mid: var(--brand-yellow);
  --brand-ink: #f5f8ff;
  --brand-logo-fill: color-mix(in srgb, var(--brand-deep) 78%, transparent);
  --brand-logo-stroke: color-mix(in srgb, var(--brand-ink) 82%, var(--brand-blue));
  --brand-logo-glow: 0 0 7px currentColor;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

body.app-booting .app-header,
body.app-booting .workspace-bar,
body.app-booting .content {
  opacity: 0;
  visibility: hidden;
}

.app-boot-loader {
  align-items: center;
  background:
    radial-gradient(circle at 42% 24%, color-mix(in srgb, var(--brand-blue) 18%, transparent), transparent 36%),
    radial-gradient(circle at 58% 74%, color-mix(in srgb, var(--brand-gold) 14%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface-solid) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-blue) 22%, var(--line));
  border-radius: 28px;
  box-shadow: var(--shadow-card), 0 22px 80px color-mix(in srgb, var(--brand-blue) 16%, transparent);
  display: none;
  gap: 7px;
  left: 50%;
  min-width: min(320px, calc(100vw - 48px));
  padding: 24px 28px 20px;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5000;
}

body.app-booting .app-boot-loader,
body.gui-loading .app-boot-loader {
  animation: mpBootFloat 2.8s ease-in-out infinite;
  display: grid;
}

body.gui-loading .app-boot-loader {
  z-index: 7000;
}

body.gui-loading .app-shell::after {
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 6990;
}

.app-boot-loader::before {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand-gold) 34%, transparent), color-mix(in srgb, var(--brand-blue) 38%, transparent), transparent);
  border-radius: inherit;
  content: "";
  inset: -1px;
  opacity: .72;
  pointer-events: none;
  position: absolute;
  transform: translateX(-42%);
  z-index: -1;
  animation: mpBootSheen 2.4s ease-in-out infinite;
}

.app-boot-loader__mark {
  animation: mpBootMarkPulse 2.2s ease-in-out infinite;
  height: 76px;
  justify-self: center;
  width: 76px;
}

.app-boot-loader strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.24em;
  line-height: 1;
  text-align: center;
}

.app-boot-loader span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.app-boot-loader__bar {
  height: 26px;
  justify-self: center;
  margin-top: 3px;
  width: min(240px, 100%);
}

@keyframes mpBootFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-8px); }
}

@keyframes mpBootSheen {
  0% { opacity: .1; transform: translateX(-46%); }
  42% { opacity: .78; }
  100% { opacity: .1; transform: translateX(46%); }
}

@keyframes mpBootMarkPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(10, 132, 255, 0)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 18px rgba(10, 132, 255, .42)); transform: scale(1.045); }
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 620ms ease,
    background 620ms ease,
    border-color 620ms ease,
    box-shadow 620ms ease,
    color 620ms ease,
    fill 620ms ease,
    filter 620ms ease,
    opacity 620ms ease,
    stroke 620ms ease !important;
}

html.theme-transitioning body {
  transition: background-color 980ms ease, color 980ms ease !important;
}

html.theme-transitioning .app-scope-canvas,
html.theme-transitioning .auth-scope-canvas {
  transition: opacity 980ms ease, filter 980ms ease !important;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-scope-canvas {
  inset: 0;
  opacity: 0.36;
  pointer-events: none;
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.app-shell > :not(.app-scope-canvas):not(.app-boot-loader) {
  position: relative;
  z-index: 1;
}

.app-ui-surface .app-scope-canvas {
  display: block;
}

.app-scope-canvas[hidden],
.auth-mode .app-scope-canvas {
  display: none;
}

.github-profile-link {
  align-items: center;
  background: color-mix(in srgb, var(--surface-solid) 76%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 14px;
  box-shadow: var(--shadow-card);
  color: var(--text);
  display: inline-flex;
  justify-content: center;
  left: 14px;
  height: 36px;
  padding: 0;
  position: fixed;
  text-decoration: none;
  width: 36px;
  z-index: 1000;
}

body.hide-github-profile-link .github-profile-link {
  display: none !important;
}

.github-profile-link:hover {
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent-dark);
}

.github-profile-link svg {
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.auth-mode .github-profile-link {
  bottom: 24px !important;
  height: 32px;
  left: 16px !important;
  position: absolute;
  right: auto !important;
  top: auto !important;
  width: 32px;
  z-index: 5000;
}

.app-header {
  align-items: center;
  background: color-mix(in srgb, var(--surface-solid) 74%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  min-height: var(--app-header-height);
  max-width: 100vw;
  overflow: visible;
  padding: 6px 18px;
  position: sticky;
  top: 0;
  z-index: 120;
  pointer-events: auto;
  isolation: isolate;
}

.brand {
  align-items: center;
  color: var(--accent-dark);
  display: inline-flex;
  flex: 0 1 180px;
  font-size: 16px;
  font-weight: 700;
  gap: 8px;
  line-height: 1.1;
  min-width: 0;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  align-items: center;
  background: color-mix(in srgb, var(--accent-soft) 68%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 10px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
  color: var(--accent-dark);
  display: grid;
  flex: 0 0 auto;
  height: 30px;
  justify-items: center;
  width: 30px;
}

.brand-mark svg {
  height: 22px;
  overflow: hidden;
  width: 22px;
}

.brand-mark img {
  display: block;
  filter: var(--brand-logo-glow);
  height: 22px;
  width: 22px;
}

.topbar-brand-logo {
  height: 22px;
  width: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .topbar-brand-logo {
    animation: none;
  }
}

.logo-field {
  fill: var(--brand-logo-fill);
  stroke: var(--brand-logo-stroke);
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.logo-crosshair {
  fill: none;
  stroke: var(--brand-logo-stroke);
  stroke-linecap: round;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.logo-mark {
  display: inline-block;
  overflow: hidden;
}

.logo-mark--xs {
  height: 22px;
  width: 22px;
}

.logo-mark--sm {
  height: 32px;
  width: 32px;
}

.logo-mark--md {
  height: 48px;
  width: 48px;
}

.logo-mark--lg {
  height: 64px;
  width: 64px;
}

.logo-mark--xl {
  height: 96px;
  width: 96px;
}

.logo-wave {
  fill: none;
  filter: drop-shadow(var(--brand-logo-glow));
  opacity: 0.86;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
  vector-effect: non-scaling-stroke;
}

.brand-mark .logo-wave {
  filter: none;
  stroke-width: 1.55;
}

.auth-brand-mark .logo-wave,
.qr-center-logo .logo-wave,
.qr-logo-preview .logo-wave {
  filter: none;
  stroke-width: 2.15;
}

.logo-wave-orange {
  stroke: var(--brand-gold);
}

.logo-wave-blue {
  stroke: var(--brand-blue);
}

.logo-wave-mist {
  stroke: var(--brand-wave-mid);
}

.logo-pulse {
  fill: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 42%, transparent));
  stroke: color-mix(in srgb, var(--text) 64%, var(--accent));
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.brand-mark .logo-pulse {
  stroke-width: 0.95;
}

.brand strong {
  display: block;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.105em;
  line-height: 1;
}

.brand-beta {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-left: 2px;
  position: static;
  transform: translateY(-0.08em);
  display: inline-block;
  text-transform: uppercase;
  vertical-align: super;
}

.hide-beta-hints .brand-beta,
.hide-beta-hints .auth-background-word sup {
  display: none;
}

.nav,
.main-nav {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  isolation: isolate;
  justify-content: center;
  left: 50%;
  max-width: calc(100vw - 620px);
  min-width: 0;
  overflow: hidden;
  position: absolute;
  transform: translateX(-50%);
}

.nav-link {
  align-items: center;
  border-radius: 999px;
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  max-width: 138px;
  min-width: 0;
  padding: 0 11px;
  position: relative;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.nav-link::after {
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-green), var(--brand-blue), var(--brand-gold));
  background-size: 220% 100%;
  border-radius: 999px;
  bottom: 2px;
  content: "";
  height: 2px;
  left: 18px;
  opacity: 0;
  position: absolute;
  right: 18px;
  transform: scaleX(0.42);
  transition: opacity 160ms ease, transform 180ms ease;
}

.nav-link span:last-child {
  display: inline-block;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover,
.nav-link.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: none;
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  animation: mpNavWaveLine 1.65s linear infinite;
  opacity: .78;
  transform: scaleX(1);
}

.nav-icon {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  height: 15px;
  justify-content: center;
  width: 15px;
}

.nav-icon svg,
.nav-icon img,
.header-icon-button svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

.nav-icon img {
  object-fit: contain;
  transition: filter 180ms ease, transform 180ms ease;
}

[data-theme="dark"] .nav-icon img {
  filter:
    brightness(0)
    saturate(100%)
    invert(84%)
    sepia(18%)
    saturate(1380%)
    hue-rotate(177deg)
    brightness(105%)
    contrast(104%)
    drop-shadow(0 0 5px rgba(10, 132, 255, 0.3));
}

.nav-link.active .nav-icon img {
  animation: mpNavIconPulse 2.2s ease-in-out infinite;
  filter:
    brightness(0)
    saturate(100%)
    invert(42%)
    sepia(94%)
    saturate(1766%)
    hue-rotate(196deg)
    brightness(101%)
    contrast(101%)
    drop-shadow(0 0 6px color-mix(in srgb, var(--brand-blue) 34%, transparent));
}

@keyframes mpNavWaveLine {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

@keyframes mpNavIconPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.18); }
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.header-icon-button {
  align-items: center;
  background: var(--button-secondary-bg);
  border: var(--border-width) solid var(--button-secondary-border);
  border-radius: 999px;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  width: 32px;
}

.header-icon-button:hover,
.header-icon-button.active {
  background: var(--button-secondary-bg-hover);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  color: var(--accent-dark);
}

.modal-head .header-icon-button {
  height: 36px;
  min-height: 36px;
  min-width: 36px;
  width: 36px;
}

.modal-head .header-icon-button svg {
  height: 17px;
  width: 17px;
}

.user-session {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  position: relative;
  pointer-events: auto;
  z-index: 2;
}

.topbar-inprogress-protocols {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  max-width: 360px;
  min-width: 0;
  overflow: hidden;
}

.topbar-protocol-pill {
  align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  flex: 0 1 auto;
  font-size: 11px;
  gap: 5px;
  max-width: 130px;
  min-width: 0;
  overflow: hidden;
  padding: 0 10px;
  text-align: left;
  white-space: nowrap;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.topbar-protocol-pill:hover,
.topbar-protocol-pill:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.topbar-protocol-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-protocol-pill svg {
  fill: none;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  width: 12px;
}

.topbar-account-actions {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.topbar-settings-button {
  min-height: 28px;
  min-width: 28px;
  height: 28px;
  width: 28px;
}

.topbar-settings-button svg {
  fill: none;
  height: 15px;
  transform-origin: center;
  transition: transform 180ms ease, filter 180ms ease;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

body.settings-route .topbar-settings-button,
.topbar-settings-button.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  color: var(--accent-dark);
}

body.settings-route .topbar-settings-button svg,
.topbar-settings-button.active svg {
  animation: mpNavIconPulse 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--brand-blue) 34%, transparent));
}

.user-menu {
  position: relative;
  pointer-events: auto;
  z-index: 4200;
  isolation: isolate;
}

.user-trigger span {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
}

.user-trigger {
  min-height: 28px;
  min-width: 28px;
  height: 28px;
  width: 28px;
}

.user-trigger-icon {
  align-items: center;
  display: inline-flex;
  height: 15px;
  justify-content: center;
  width: 15px;
}

.user-trigger-icon svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

.user-dropdown {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  min-width: 140px;
  padding: 6px;
  pointer-events: auto;
  position: fixed;
  right: 18px;
  top: calc(var(--app-header-height) + 8px);
  z-index: 10000;
}


.user-dropdown-head {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1px;
  margin-bottom: 5px;
  padding: 6px 8px 8px;
}

.user-dropdown-head small,
.user-dropdown-head span {
  color: var(--muted);
  font-size: 11px;
}

.user-dropdown-head strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.user-dropdown button,
.user-dropdown a {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 34px;
  padding: 8px 9px;
  text-decoration: none;
  text-align: left;
  width: 100%;
}

.user-dropdown-label {
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown button:hover,
.user-dropdown a:hover {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-muted));
}

.user-theme-mode {
  background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 3px 6px;
  padding: 2px;
}

.user-dropdown .user-theme-mode button {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  grid-template-columns: none;
  justify-content: center;
  min-height: 26px;
  padding: 0;
}

.user-dropdown .user-theme-mode button.active {
  background: color-mix(in srgb, var(--accent-soft) 74%, var(--surface-solid));
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent);
}

.user-theme-mode svg {
  fill: none;
  height: 13px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 13px;
}

.user-dropdown-danger {
  color: var(--danger) !important;
}

.user-dropdown-danger .user-dropdown-icon {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
  color: var(--danger);
}

.user-dropdown-danger:hover {
  background: color-mix(in srgb, var(--danger) 9%, var(--surface-muted)) !important;
}

.user-dropdown-icon {
  align-items: center;
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-flex;
  height: 23px;
  justify-content: center;
  width: 23px;
}

.user-dropdown-icon svg {
  fill: none;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 14px;
}

.auth-mode .app-header,
.auth-mode .settings-link,
.auth-mode .user-session,
.auth-mode .customer-context {
  display: none;
}

.auth-mode .app-shell {
  grid-template-rows: minmax(0, 1fr);
}

.auth-mode .main-shell,
.auth-mode .workspace,
.auth-mode .content {
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-mode .content {
  gap: 0;
  margin: 0;
  max-width: none;
  padding: 0;
}

.main-shell {
  display: block;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.workspace {
  min-width: 0;
}

.workspace-bar {
  align-items: center;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  min-height: 58px;
  padding: 10px 18px 8px;
}

.workspace-bar > div:first-child {
  display: none;
}

.workspace-bar h1 {
  font-size: 16px;
  line-height: 1.1;
  margin: 0;
}

.customer-context {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.context-pill {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  gap: 6px;
  height: 32px;
  max-width: min(48vw, 520px);
  min-width: 0;
  padding: 0 10px;
  white-space: nowrap;
}

.context-pill.active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  color: var(--text);
}

.context-pill-customer.active {
  background:
    linear-gradient(135deg, color-mix(in srgb, #0a84ff 16%, var(--surface)) 0%, color-mix(in srgb, #ff9f0a 13%, var(--surface)) 100%);
  border-color: color-mix(in srgb, #0a84ff 36%, #ff9f0a 24%);
}

.context-pill-customer.active strong {
  color: #0a84ff;
}

.context-pill-customer.active button {
  color: #ff7a00;
}

.context-pill-room.active {
  background: color-mix(in srgb, #af52de 15%, var(--surface));
  border-color: color-mix(in srgb, #af52de 42%, var(--line));
}

.context-pill-room.active strong {
  color: #af52de;
}

.context-pill strong {
  color: var(--accent-dark);
  font-size: 10px;
  flex: 0 0 auto;
  text-transform: uppercase;
}

.context-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-pill button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 15px;
  height: 18px;
  justify-content: center;
  padding: 0;
  width: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.tabs {
  align-items: center;
  background: color-mix(in srgb, var(--surface-solid) 66%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(21, 35, 60, 0.05);
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 3px;
}

.tab-button,
.tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 10px;
  white-space: nowrap;
}

.tab-button:hover,
.tab-button.active,
.tab:hover,
.tab.active {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-dark);
}

.module-tabs {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: transparent;
  box-shadow: none;
  gap: 6px;
  grid-column: 1;
  justify-self: center;
  justify-content: flex-start;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  width: max-content;
}

.module-tabs .tab-button {
  background: color-mix(in srgb, var(--surface-solid) 62%, transparent);
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  min-height: 30px;
  padding-inline: 11px;
}

.module-tabs .tab-button:hover,
.module-tabs .tab-button.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 13%, transparent);
}

.modal-mode-switch .tab-button {
  font-size: 13px;
  min-height: 32px;
  padding: 5px 12px;
}

.content {
  display: grid;
  gap: var(--spacing-md);
  margin: 0 auto;
  max-width: var(--content-max-width);
  min-height: 0;
  padding: 10px var(--content-gutter) 48px;
  width: 100%;
}

.page-head {
  align-items: flex-end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.page-head h2 {
  font-size: var(--font-size-heading);
  line-height: 1.15;
  margin: 0 0 8px;
}

.page-head p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  max-width: 780px;
}

.page-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  min-height: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button {
  align-items: center;
  background: var(--button-primary);
  border: var(--border-width) solid color-mix(in srgb, var(--button-primary) 82%, #000 12%);
  border-radius: var(--radius-button);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent),
    0 5px 14px color-mix(in srgb, var(--button-primary) 18%, transparent);
  color: var(--on-primary);
  display: inline-flex;
  font-size: var(--font-size-button);
  font-weight: 800;
  justify-content: center;
  min-height: var(--button-height);
  padding: var(--button-pad-y) var(--button-pad-x);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button:hover {
  background: var(--button-primary-hover);
  border-color: color-mix(in srgb, var(--button-primary-hover) 86%, #000 10%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent),
    0 7px 18px color-mix(in srgb, var(--button-primary-hover) 22%, transparent);
  transform: translateY(-0.5px);
}

.button:focus-visible,
.header-icon-button:focus-visible,
.export-pdf-action:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.button:disabled,
.button[disabled],
.header-icon-button:disabled,
.export-pdf-action:disabled {
  background: color-mix(in srgb, var(--muted) 10%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  box-shadow: none;
  color: color-mix(in srgb, var(--muted) 72%, var(--surface-solid));
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.button.secondary,
.button.ghost {
  background: var(--button-secondary-bg);
  border: var(--border-width) solid var(--button-secondary-border);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent),
    0 2px 8px color-mix(in srgb, #000 5%, transparent);
  color: var(--button-secondary-text);
}

.button.secondary:hover,
.button.ghost:hover {
  background: var(--button-secondary-bg-hover);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border));
  color: var(--accent-dark);
}

.button.danger {
  background: color-mix(in srgb, var(--danger) 13%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--danger) 56%, var(--line));
  color: var(--danger);
}

.button.danger:hover {
  background: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 82%, #000);
  color: var(--on-danger);
}

.button.table-action {
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 9px;
}

.button.table-action.icon-only {
  height: 30px;
  justify-content: center;
  min-height: 30px;
  min-width: 30px;
  padding: 0;
  width: 30px;
}

.button.table-action.icon-only svg {
  fill: none;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 14px;
}

.button.table-action.icon-only.active {
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent-dark);
}

.button.table-action.icon-only.add-action {
  background: var(--button-secondary-bg);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--button-secondary-border));
  color: var(--accent-dark);
  height: 34px;
  min-height: 34px;
  min-width: 34px;
  width: 34px;
}

.button.table-action.icon-only.add-action svg {
  height: 16px;
  stroke-width: 2.8;
  width: 16px;
}

.button.table-action.icon-only.add-action:hover {
  background: color-mix(in srgb, var(--accent-soft) 64%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
}

.button.table-action.danger {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  color: var(--danger);
}

.button.table-action.danger:hover {
  background: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 82%, #000);
  color: var(--on-danger);
}

.export-pdf-action {
  align-items: center;
  background: var(--button-secondary-bg);
  border: var(--border-width) solid var(--button-secondary-border);
  border-radius: var(--radius-button);
  color: var(--button-secondary-text);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  text-decoration: none;
}

.export-pdf-action:hover {
  background: var(--button-secondary-bg-hover);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  color: var(--accent-dark);
}

.export-pdf-action.active {
  background: color-mix(in srgb, var(--accent-soft) 82%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-dark);
}

.export-pdf-action svg {
  height: 15px;
  stroke-width: 2.3;
  width: 15px;
}

.pdf-preview-frame {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.pdf-preview-frame-wrap {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 12px 12px;
  position: relative;
}

.pdf-preview-loader {
  align-items: center;
  background:
    radial-gradient(circle at 46% 34%, color-mix(in srgb, var(--brand-blue) 10%, transparent), transparent 44%),
    color-mix(in srgb, var(--surface-solid) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 8px;
  left: 50%;
  min-width: 300px;
  padding: 20px 22px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, visibility 180ms ease;
  z-index: 2;
  animation: mpPdfLoaderBreath 1.8s ease-in-out infinite;
}

.pdf-preview-loader img {
  height: 46px;
  justify-self: center;
  object-fit: contain;
  width: 220px;
}

.pdf-preview-loader span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.pdf-preview-frame-wrap.is-loaded .pdf-preview-loader {
  opacity: 0;
  visibility: hidden;
}

.pdf-motion-action {
  position: relative;
}

.pdf-motion-action.is-loading {
  color: var(--accent-dark);
  pointer-events: none;
}

.pdf-motion-action.is-loading::after {
  background: url("/assets/loaders/messpilot-loader-wave.svg?v=20260704-46") center / contain no-repeat;
  content: "";
  flex: 0 0 auto;
  height: 22px;
  margin-left: 4px;
  width: 64px;
  animation: mpPdfActionPulse 1.05s ease-in-out infinite;
}

@keyframes mpPdfLoaderBreath {
  0%, 100% { box-shadow: var(--shadow-card), 0 0 0 rgba(10, 132, 255, 0); transform: translate(-50%, -50%) scale(1); }
  50% { box-shadow: var(--shadow-card), 0 0 34px rgba(10, 132, 255, .22); transform: translate(-50%, -50%) scale(1.018); }
}

@keyframes mpPdfActionPulse {
  0%, 100% { opacity: .62; transform: scaleX(.86); }
  50% { opacity: 1; transform: scaleX(1.08); }
}

.pdf-preview-backdrop {
  align-items: center;
  padding: 10px;
}

.pdf-preview-modal {
  display: flex;
  flex-direction: column;
  height: min(96vh, 1020px);
  max-width: 1680px;
  padding-bottom: 8px;
  width: min(98vw, 1680px);
}

.pdf-preview-modal .modal-head {
  align-items: flex-start;
  flex: 0 0 auto;
  gap: 6px;
  justify-content: space-between;
  padding: 8px 12px;
}

.pdf-preview-modal .modal-head > div:first-child {
  display: grid;
  gap: 2px;
}

.pdf-preview-head-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  justify-content: flex-end;
  margin-left: auto;
}

.pdf-preview-head-actions .button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 30px;
  justify-content: center;
  padding-inline: 10px;
}

.pdf-preview-head-actions .button.table-action {
  min-width: auto;
}

.pdf-preview-head-actions .button svg {
  height: 14px;
  width: 14px;
}

.pdf-preview-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  margin: 0;
}

.pdf-preview-title {
  line-height: 1.08;
  margin: 0;
  font-size: 17px;
}

.pdf-preview-frame-wrap {
  padding-top: 4px;
}

.pdf-preview-status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  min-height: 30px;
}

.pdf-preview-status:has(.protocol-status-dot) {
  min-width: 30px;
  padding-inline: 0;
}

.pdf-preview-status .protocol-status-dot {
  height: 14px;
  width: 14px;
}

.summary-strip,
.panel,
.filter-panel,
.notice-panel,
.empty-state {
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.summary-card {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 10px;
}

.summary-card:last-child {
  border-right: 0;
}

.dashboard-summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card span,
.summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  font-size: 20px;
  line-height: 1.1;
}

.summary-card.success strong {
  color: var(--success);
}

.summary-card.warning strong {
  color: var(--warning);
}

.summary-card.danger strong {
  color: var(--danger);
}

.workbench {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  margin-inline: auto;
  max-width: 100%;
  width: 100%;
}

.workbench.no-aside {
  grid-template-columns: minmax(0, 1fr);
}

.workbench-main,
.workbench-aside {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.dashboard-shell {
  display: grid;
  gap: 12px;
}

.dashboard-shell .table-action-cell .button.dashboard-icon-action {
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 72%, var(--text));
  min-height: 32px;
  min-width: 32px;
  width: 32px;
}

.dashboard-shell .button.dashboard-icon-action svg {
  height: 15px;
  stroke-width: 2.2;
  width: 15px;
}

.dashboard-shell .button.dashboard-icon-action[disabled],
.dashboard-shell .button.dashboard-icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.dashboard-shell .table-action-cell {
  width: 42px;
}

.dashboard-table {
  min-width: 720px;
}

.distributor-layout-panel {
  min-height: 420px;
}

.distributor-editor-shell {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  padding: 0 8px 8px;
}

.distributor-tree-label {
  align-items: center;
  --tree-line-color: color-mix(in srgb, var(--accent) 42%, var(--muted));
  display: grid;
  gap: 5px;
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 34px;
  padding-left: 0;
  position: relative;
}

.distributor-tree-label.is-leaf-row {
  grid-template-columns: minmax(0, 1fr);
}

.distributor-tree-label.is-leaf-row .distributor-tree-spacer,
.distributor-tree-label.is-leaf-row .distributor-tree-marker {
  display: none;
}

.distributor-tree-list {
  display: grid;
  gap: 3px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.distributor-tree-list.is-root-list {
  border-left: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  margin: 6px 0 0 11px;
  padding-left: 10px;
}

.distributor-tree-list.is-nested {
  border-left: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  margin: 2px 0 2px 11px;
  padding-left: 10px;
}

.distributor-tree-item {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.distributor-tree-branches {
  color: var(--tree-line-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  opacity: .72;
  overflow: hidden;
  white-space: pre;
}

.distributor-tree-rowgrid,
.distributor-tree-header {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 84px minmax(150px, 1fr) minmax(92px, .55fr) 70px minmax(122px, .7fr);
  min-width: 0;
}

.distributor-tree-header {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  margin: 2px 0 6px;
  padding: 0 8px 6px 31px;
  text-transform: uppercase;
}

.distributor-tree-rowgrid {
  border-radius: 8px;
  padding: 5px 8px;
}

.distributor-tree-rowgrid strong,
.distributor-tree-rowgrid span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distributor-tree-rowgrid strong {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.distributor-tree-rowgrid span {
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 11px;
  font-weight: 750;
}

.distributor-tree-toggle,
.distributor-tree-spacer {
  align-items: center;
  background: color-mix(in srgb, var(--surface-solid) 92%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  line-height: 1;
  position: relative;
  width: 18px;
  z-index: 1;
}

.distributor-tree-toggle:hover {
  background: color-mix(in srgb, var(--accent-soft) 64%, var(--surface-solid));
  color: var(--accent-dark);
}

.distributor-tree-spacer {
  background: transparent;
  border-color: transparent;
}

.distributor-tree-spacer.is-root-spacer {
  display: none;
}

.distributor-tree-marker {
  align-items: center;
  background: color-mix(in srgb, var(--surface-muted) 76%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  position: relative;
  text-align: center;
  width: 22px;
  z-index: 1;
}

.distributor-tree-label:not(.distributor-tree-root) .distributor-tree-marker {
  display: none;
}

.distributor-tree-marker.is-folder {
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  color: var(--accent-dark);
}

.distributor-tree-marker.is-leaf {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
  height: 1px;
  justify-self: center;
  width: 1px;
}

.distributor-tree-label.is-cable {
  gap: 5px;
  min-height: 27px;
}

.distributor-tree-marker.is-root {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent-dark);
}

.distributor-tree-marker.is-root svg {
  height: 14px;
  width: 14px;
}

.distributor-work-area {
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(660px, 1fr) minmax(340px, .42fr);
  min-height: 480px;
  overflow: hidden;
}

.distributor-project-pane {
  background: color-mix(in srgb, var(--surface-muted) 54%, var(--surface-solid));
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
}

.distributor-pane-title {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 4px;
  padding: 0 2px 7px;
}

.distributor-project-pane .distributor-tree-label,
.distributor-project-pane .distributor-tree-root {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  min-width: 0;
  padding-right: 6px;
  text-align: left;
  width: 100%;
}

.distributor-project-pane .distributor-tree-root {
  grid-template-columns: 26px minmax(0, 1fr);
  margin-bottom: 4px;
  min-height: 40px;
}

.distributor-tree-root-wrap {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.distributor-project-pane .distributor-tree-label[draggable="true"],
.distributor-project-pane .distributor-tree-label[draggable="true"] {
  cursor: grab;
}

.distributor-project-pane .distributor-tree-label.is-dragging,
.distributor-project-pane .distributor-tree-label.is-dragging {
  opacity: .46;
}

.distributor-project-pane .distributor-tree-label:hover {
  background: transparent;
}

.distributor-project-pane .distributor-tree-label.is-selected {
  background: transparent;
  box-shadow: none;
}

.distributor-project-pane .distributor-tree-label:hover .distributor-tree-rowgrid {
  background: color-mix(in srgb, var(--accent-soft) 18%, transparent);
}

.distributor-project-pane .distributor-tree-label.is-selected .distributor-tree-marker,
.distributor-project-pane .distributor-tree-label.is-selected .distributor-tree-toggle {
  background: color-mix(in srgb, var(--accent-soft) 88%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  color: var(--accent-dark);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-soft) 52%, transparent);
}

.distributor-project-pane .distributor-tree-label.is-selected .distributor-tree-rowgrid {
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface-solid));
  box-shadow: inset 3px 0 0 var(--accent);
}

.distributor-project-pane .distributor-tree-label.is-drop-target {
  position: relative;
}

.distributor-project-pane .distributor-tree-label.is-drop-into .distributor-tree-rowgrid {
  background: color-mix(in srgb, var(--accent-soft) 86%, var(--surface-solid));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 72%, var(--line));
}

.distributor-project-pane .distributor-tree-label.is-drop-before::before {
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 76%, transparent);
  content: "";
  height: 3px;
  left: 26px;
  position: absolute;
  right: 8px;
  top: -3px;
  z-index: 2;
}

.distributor-project-pane .distributor-tree-label.is-drop-target::after {
  background: color-mix(in srgb, var(--accent-soft) 88%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 58%, var(--line));
  border-radius: 999px;
  color: var(--accent-dark);
  content: attr(data-drop-label);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.distributor-properties-pane {
  background: color-mix(in srgb, var(--surface-muted) 62%, var(--surface-solid));
  border-left: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.distributor-editor-form {
  display: grid;
  gap: 8px;
}

.distributor-fieldset {
  background: color-mix(in srgb, var(--surface-solid) 74%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 12px;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 8px;
}

.distributor-fieldset legend {
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 850;
  padding: 3px 8px;
}

.distributor-fieldset label:has(.distributor-option-grid),
.distributor-fieldset label:has(.inline-check),
.distributor-fieldset label:has(input[name="target"]),
.distributor-fieldset label:has(input[name="note"]) {
  grid-column: 1 / -1;
}

.distributor-editor-form label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.distributor-editor-form label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.distributor-editor-form input,
.distributor-editor-form select {
  background: color-mix(in srgb, var(--surface-solid) 92%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 10px;
  color: var(--text);
  min-height: 30px;
  min-width: 0;
  padding: 6px 8px;
  width: 100%;
}

.distributor-editor-form input[readonly] {
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--accent-dark);
  font-weight: 850;
}

.distributor-editor-form input:focus,
.distributor-editor-form select:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  outline: 3px solid var(--focus);
}

.distributor-editor-form .inline-check {
  align-items: center;
  background: color-mix(in srgb, var(--surface-solid) 86%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 10px;
  display: flex;
  gap: 8px;
  min-height: 30px;
  padding: 5px 8px;
}

.distributor-editor-form .inline-check input {
  accent-color: var(--accent);
  min-height: 16px;
  padding: 0;
  width: 16px;
}

.distributor-editor-form .inline-check span {
  color: var(--text);
  font-size: 12px;
}

.distributor-option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.distributor-option-grid.is-compact {
  gap: 4px;
}

.distributor-option-pill {
  display: inline-flex;
  min-width: 0;
}

.distributor-option-pill input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.distributor-option-pill span {
  background: var(--button-secondary-bg);
  border: 1px solid var(--button-secondary-border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  min-height: 25px;
  padding: 6px 8px;
  white-space: nowrap;
}

.distributor-option-grid.is-compact .distributor-option-pill span {
  min-height: 24px;
  padding: 5px 7px;
}

.distributor-option-pill input:checked + span {
  background: color-mix(in srgb, var(--accent-soft) 86%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 44%, transparent);
  color: var(--accent-dark);
}

.distributor-option-pill input:focus-visible + span {
  outline: 3px solid var(--focus);
}

.compact-info-list {
  margin-top: 2px;
}

.distributor-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  padding-top: 2px;
}

.distributor-live-status {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 750;
  gap: 6px;
  justify-self: end;
  margin: -2px 2px 0;
}

.distributor-live-status::before {
  background: var(--success);
  border-radius: 999px;
  content: "";
  height: 7px;
  width: 7px;
}

.distributor-selection-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.distributor-selection-head > div {
  display: grid;
  gap: 2px;
}

.distributor-selection-head strong {
  color: var(--text);
  font-size: 16px;
}

.distributor-selection-head small,
.distributor-selection-head > span {
  color: var(--muted);
  font-size: 12px;
}

.distributor-selection-head > span {
  background: color-mix(in srgb, var(--surface-solid) 82%, var(--surface-muted));
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  padding: 4px 8px;
}

.distributor-summary-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.distributor-summary-grid span {
  background: color-mix(in srgb, var(--surface-solid) 82%, var(--surface-muted));
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  font-size: 10px;
  gap: 2px;
  padding: 8px;
}

.distributor-summary-grid strong {
  color: var(--text);
  font-size: 17px;
}

.distributor-toolbox-head {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1px;
  padding: 0 2px 7px;
}

.distributor-toolbox-head strong {
  color: var(--text);
  font-size: 13px;
}

.distributor-toolbox-head small {
  color: var(--muted);
  font-size: 11px;
}

.panel {
  overflow: hidden;
}

.panel:has(.pdf-actions-menu),
.panel:has(.protocol-create-menu) {
  overflow: visible;
}

.panel-head {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 12px 10px;
}

.panel-head h3 {
  font-size: var(--font-size-lg);
  margin: 0 0 4px;
}

.panel-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.panel-head-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.dashboard-window-filter {
  align-items: center;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.dashboard-window-filter__button {
  min-height: 30px;
  padding: 4px 8px;
  white-space: nowrap;
}

.dashboard-window-filter__button.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  color: var(--accent-dark);
  font-weight: 800;
}

.test-device-export-action {
  position: relative;
}

.table-wrap {
  background: transparent;
  overflow-x: auto;
}

.panel:has(.pdf-actions-menu) .table-wrap {
  overflow: visible;
}

.protocol-create-action {
  position: relative;
}

.protocol-create-menu {
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 32px rgba(21, 35, 60, 0.18);
  display: grid;
  gap: 4px;
  min-width: 280px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.protocol-create-menu.is-idle-faded {
  filter: saturate(0.86);
  opacity: 0.34;
  transform: translateY(-2px) scale(0.985);
}

.protocol-create-menu.is-idle-faded:hover,
.protocol-create-menu:focus-within {
  filter: none;
  opacity: 1;
  transform: none;
}

.protocol-create-menu__item {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 2px;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.protocol-create-menu__item:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-solid));
}

.protocol-create-menu__item strong {
  font-size: 13px;
}

.protocol-create-menu__item span {
  color: var(--muted);
  font-size: 12px;
}

.protocol-create-menu__item small {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.protocol-archive-title {
  color: #a855f7;
}

.protocol-archive-title + p {
  color: var(--muted);
}

.protocol-archive-toggle {
  color: #1d4ed8;
}

.protocol-archive-toggle:hover {
  color: #3b82f6;
}

.protocol-archive-toggle--back {
  border-color: color-mix(in srgb, #a855f7 76%, var(--button-secondary-border));
  background: color-mix(in srgb, #a855f7 18%, var(--button-secondary-bg));
  color: #6b21a8;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 30px;
}

.protocol-archive-toggle--back svg {
  margin: 0;
}

.protocol-archive-toggle--back:hover {
  background: color-mix(in srgb, #a855f7 28%, var(--button-secondary-bg-hover));
  border-color: color-mix(in srgb, #a855f7 82%, var(--button-secondary-border));
  color: #4c1d95;
}

.protocol-list-stage {
  animation: none;
  display: grid;
  gap: 12px;
}

.protocol-list-stage--archive {
  animation: none;
}

@keyframes protocolSlideInRight {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes protocolSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.customer-table {
  min-width: 980px;
}

.customer-table tr.is-pinned-customer td {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.customer-name-cell {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-width: 0;
}

.customer-location-tree-row td {
  background: color-mix(in srgb, var(--surface-muted) 44%, transparent);
  border-top: 0;
  font-size: 12px;
}

.customer-location-tree-row.is-pinned-location td {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.customer-location-tree-label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  gap: 8px;
  min-width: 0;
}

.customer-location-tree-label span {
  color: var(--accent);
  font-weight: 800;
}

.customer-table-action-cell {
  width: 92px;
}

.customer-table .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.table-action-placeholder {
  flex: 0 0 34px;
  height: 34px;
  width: 34px;
}

.table-wrap tr:has(.button.table-action.icon-only.active) td {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

th,
td {
  border-bottom: var(--border-width) solid var(--line);
  min-height: var(--table-row-height);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.table-sort-button {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 6px;
  justify-content: flex-start;
  min-height: 22px;
  padding: 0;
  text-align: left;
  width: 100%;
}

.table-sort-button small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.table-sort-button.active {
  color: var(--accent-dark);
}

.table-sort-button:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.protocol-progress {
  display: grid;
  gap: 5px;
  min-width: 118px;
}

.protocol-repeat-label {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.protocol-repeat-badge {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  font-size: 11px;
  padding: 2px 7px;
}

.protocol-progress__meta {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: space-between;
  line-height: 1;
}

.protocol-progress__meta small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.protocol-progress__track {
  background: color-mix(in srgb, var(--line) 72%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.protocol-progress__track span {
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: inherit;
  display: block;
  height: 100%;
}

td {
  color: var(--text);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  padding: 2px 7px;
  text-align: center;
}

.badge.success {
  background: color-mix(in srgb, var(--success) 18%, var(--surface));
  color: color-mix(in srgb, var(--success) 72%, var(--text));
}

.badge.warning {
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  color: var(--warning);
}

.badge.danger {
  background: color-mix(in srgb, var(--danger) 18%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 26%, transparent);
  color: color-mix(in srgb, var(--danger) 88%, #7a0000 12%);
}

.badge.neutral {
  background: var(--surface-muted);
  color: var(--muted);
}

.protocol-status-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
  filter: saturate(132%) brightness(1.02);
}

.protocol-status-dot.success {
  background: color-mix(in srgb, var(--success) 62%, var(--surface) 38%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 68%, #000 32%), 0 0 5px color-mix(in srgb, var(--success) 28%, transparent);
}

.protocol-status-dot.warning {
  background: color-mix(in srgb, var(--warning) 60%, var(--surface) 40%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 66%, #000 34%), 0 0 5px color-mix(in srgb, var(--warning) 26%, transparent);
}

.protocol-status-dot.danger {
  background: color-mix(in srgb, var(--danger) 60%, var(--surface) 40%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 68%, #000 32%), 0 0 5px color-mix(in srgb, var(--danger) 28%, transparent);
}

.protocol-status-dot.neutral {
  background: color-mix(in srgb, var(--muted) 66%, var(--surface-muted) 34%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--muted) 58%, var(--surface-muted) 42%);
}

.filter-panel {
  align-items: end;
  display: grid;
  gap: var(--form-spacing);
  grid-template-columns: minmax(240px, 1fr) repeat(auto-fit, minmax(150px, 210px));
  padding: 12px;
}

.field {
  display: grid;
  gap: 4px;
}

.field label {
  color: var(--text);
  font-size: var(--font-size-label);
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  background-color: var(--surface);
  background-clip: padding-box;
  border: var(--border-width) solid var(--line);
  border-radius: var(--radius-field);
  color: var(--text);
  font: inherit;
  min-height: 40px;
  min-width: 0;
  padding: 8px 11px;
  width: 100%;
}

.field select,
.vde-setup-grid select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  padding-inline-end: 34px;
}

.readonly-field {
  align-items: center;
  background: var(--surface-muted);
  border: var(--border-width) solid var(--line);
  border-radius: var(--radius-field);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  min-height: 40px;
  min-width: 0;
  padding: 8px 11px;
  width: 100%;
}

.protocol-status-field {
  align-items: flex-start;
  display: grid;
  gap: 5px;
}

.protocol-status-field > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.protocol-status-field > strong {
  align-items: center;
  display: flex;
  min-height: 22px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: 3px solid var(--focus);
}

.field textarea {
  line-height: 1.4;
  min-height: 170px;
  resize: vertical;
}

.field select:disabled {
  color: var(--muted);
  opacity: 1;
}

.quick-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  padding: 0 12px 12px;
}

.quick-card {
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 78px;
  padding: 9px 10px;
}

.quick-card strong {
  display: block;
  font-size: 13px;
}

.quick-card p {
  color: var(--muted);
  font-size: 12px;
  margin: 5px 0 0;
}

.quick-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.qr-code-layout {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  padding: 0 12px 12px;
}

.qr-code-form {
  min-width: 0;
}

.qr-logo-settings {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: 96px minmax(0, 1fr);
}

.qr-logo-preview {
  align-items: center;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  justify-content: center;
  justify-items: center;
  min-height: 96px;
  overflow: hidden;
  padding: 12px;
  place-items: center;
  text-align: center;
}

.qr-logo-preview img,
.qr-logo-preview svg {
  display: block;
  height: auto;
  object-fit: contain;
  object-position: center;
  width: 100%;
  max-height: 70px;
  max-width: 70px;
}

.qr-logo-preview span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.qr-logo-file-row {
  align-items: center;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 38px;
  padding: 6px 8px 6px 11px;
}

.qr-logo-file-row span {
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-link-output {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.qr-link-output code {
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  display: block;
  font-size: 12px;
  min-height: 36px;
  overflow: hidden;
  padding: 10px 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-preview-card {
  align-items: center;
  align-self: start;
  background: color-mix(in srgb, var(--surface-solid) 58%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: auto;
  padding: 14px;
  text-align: center;
}

.qr-preview-frame {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
  color: #111827;
  cursor: zoom-in;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  max-width: 280px;
  padding: 12px;
  position: relative;
  width: 100%;
}

.qr-preview-frame::before {
  content: "";
  display: block;
  padding-top: 100%;
}

.qr-preview-frame .qr-render-stack {
  inset: 12px;
  position: absolute;
}

.qr-render-stack {
  align-items: center;
  display: grid;
  justify-items: center;
  position: relative;
}

.qr-code-image,
.qr-render-stack > svg {
  display: block;
  height: auto;
  max-width: 100%;
  width: min(100%, 220px);
}

.qr-center-logo {
  align-items: center;
  background: #fff;
  border: 4px solid #fff;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgb(15 23 42 / 18%);
  display: flex;
  height: 50px;
  justify-content: center;
  left: 50%;
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
}

.qr-center-logo img,
.qr-center-logo svg {
  display: block;
  height: 100%;
  object-fit: contain;
  object-position: center;
  max-height: 40px;
  max-width: 40px;
  width: 100%;
}

.qr-preview-frame:disabled {
  cursor: default;
}

.qr-preview-frame:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.qr-preview-backdrop {
  z-index: 3200;
}

.qr-preview-modal {
  width: min(94vw, 620px);
}

.qr-preview-large-frame {
  align-items: center;
  background: #fff;
  border-radius: 38px;
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: center;
  margin: 0 12px 12px;
  min-height: min(72vh, 560px);
  padding: clamp(18px, 4vw, 34px);
}

.qr-preview-large-frame .qr-code-image,
.qr-preview-large-frame .qr-render-stack > svg {
  max-height: min(64vh, 500px);
  max-width: min(78vw, 500px);
  width: min(78vw, 500px);
}

.qr-preview-large-frame .qr-center-logo {
  height: 70px;
  width: 70px;
}

.qr-preview-large-frame .qr-center-logo img,
.qr-preview-large-frame .qr-center-logo svg {
  height: 100%;
  max-height: 54px;
  max-width: 54px;
  object-position: center;
  object-fit: contain;
  width: 100%;
}

.qr-preview-card strong {
  display: block;
  font-size: 13px;
  margin-top: 10px;
}

.qr-preview-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.qr-use-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 0;
}

.qr-use-card {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
}

.qr-use-card strong {
  font-size: 12.5px;
}

.qr-use-card span {
  display: none;
}

.company-settings-form {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.company-settings-layout {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
}

.company-settings-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.company-logo-card {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  padding: 12px;
  position: sticky;
  top: 12px;
}

.company-logo-preview {
  align-items: center;
  aspect-ratio: 1;
  background: var(--surface-solid);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--accent-dark);
  display: flex;
  justify-content: center;
  padding: 6%;
  overflow: hidden;
}

.company-logo-preview img {
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  width: 100%;
}

.company-logo-preview svg {
  height: 100%;
  object-fit: contain;
  object-position: center;
  width: 100%;
}

.company-settings-actions {
  display: flex;
  justify-content: flex-end;
}

.checkbox-line {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.checkbox-line input {
  height: 16px;
  width: 16px;
}

.theme-current-label {
  align-items: center;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 10px;
  white-space: nowrap;
}

.system-settings-panel {
  --system-settings-control-width: 360px;
  max-width: none;
  width: 100%;
}

.system-settings-panel .panel-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  padding-bottom: 10px;
}

.theme-mode-panel,
.system-toggle-panel {
  align-content: start;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  gap: 18px;
  padding: 11px 6px;
}

.theme-mode-panel {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.system-toggle-panel {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.system-toggle-panel:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.theme-mode-panel > div:first-child,
.system-toggle-panel > div:first-child {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 210px;
}

.theme-mode-panel strong,
.system-toggle-panel strong {
  color: var(--text);
  font-size: 14px;
}

.theme-mode-panel > div:first-child span,
.system-toggle-panel > div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.theme-mode-switch {
  background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  gap: 3px;
  flex: 0 0 var(--system-settings-control-width, 380px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: var(--system-settings-control-width, 380px);
  min-width: var(--system-settings-control-width, 380px);
  padding: 3px;
}

.theme-mode-switch--icons {
  flex-basis: var(--system-settings-control-width);
  max-width: var(--system-settings-control-width);
  min-width: var(--system-settings-control-width);
}

.system-binary-switch {
  flex-basis: var(--system-settings-control-width);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: var(--system-settings-control-width);
  min-width: var(--system-settings-control-width);
}

.system-option-switch {
  --system-option-columns: 3;
  flex: 0 0 clamp(184px, calc(var(--system-option-columns) * 42px), 250px);
  grid-template-columns: repeat(var(--system-option-columns), minmax(0, 1fr));
  max-width: clamp(184px, calc(var(--system-option-columns) * 42px), 250px);
  min-width: clamp(184px, calc(var(--system-option-columns) * 42px), 250px);
}

.system-option-switch--slider {
  flex-basis: var(--system-settings-control-width);
  max-width: var(--system-settings-control-width);
  min-width: var(--system-settings-control-width);
}

.system-option-switch--wave-meter {
  flex-basis: var(--system-settings-control-width);
  max-width: var(--system-settings-control-width);
  min-width: var(--system-settings-control-width);
}

.system-option-switch--slider-icons {
  flex-basis: var(--system-settings-control-width);
  gap: 0;
  max-width: var(--system-settings-control-width);
  min-width: var(--system-settings-control-width);
}

.system-option-switch button,
.system-option-switch label,
.system-option-switch label span {
  font-size: 12px;
  min-height: 28px;
  padding: 0 10px;
}

.system-option-switch--slider label,
.system-option-switch--slider-icons label,
.system-option-switch--wave-meter label {
  min-height: 34px;
}

.system-option-switch--slider-icons label {
  padding: 0;
}

.system-option-switch--slider label span {
  font-size: 12px;
  font-weight: 800;
}

.system-option-switch--wave-meter label {
  padding: 0 4px;
}

.system-option-switch--wave-meter .system-option-switch-content {
  min-width: 0;
}

.system-option-switch--wave-meter .system-option-switch-icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.system-option-switch label {
  justify-content: center;
  padding: 0;
}

.system-option-switch .system-option-switch-content {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
}

.system-option-switch--slider-icons .system-option-switch-content {
  height: 100%;
  min-width: 0;
  width: 100%;
}

.system-option-switch--slider-icons .system-option-switch-icon {
  align-items: center;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.system-option-switch--slider-icons .system-option-switch-icon svg {
  display: block;
  height: 18px;
  width: 18px;
}

.system-option-switch--slider-icons label.active .system-option-switch-icon svg {
  height: 20px;
  width: 20px;
}

.system-option-switch .system-option-switch-sr {
  clip: rect(0 0 0 0);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.system-option-switch svg {
  height: 14px;
  width: 14px;
}

.system-level-icon {
  align-items: flex-end;
  display: inline-flex;
  gap: 2px;
}

.system-level-segment {
  background: currentColor;
  border-radius: 999px;
  display: block;
  opacity: 0.3;
  width: 3px;
}

.system-level-segment:nth-child(1) {
  height: 3px;
}

.system-level-segment:nth-child(2) {
  height: 6px;
}

.system-level-segment:nth-child(3) {
  height: 9px;
}

.system-level-segment.active {
  opacity: 1;
}

.system-wave-icon {
  display: block;
  height: 18px;
  width: 18px;
}

.system-wave-icon--speed path,
.system-wave-icon--density circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.system-wave-icon--speed path {
  stroke-width: 2.2;
}

.system-wave-icon--density circle {
  fill: currentColor;
  stroke: none;
}

.theme-mode-switch button,
.theme-mode-switch label {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
}

.theme-mode-switch label input {
  clip: rect(0 0 0 0);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.theme-mode-switch button.active,
.theme-mode-switch label.active {
  background: color-mix(in srgb, var(--surface-solid) 92%, var(--accent-soft));
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08), inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--accent-dark);
}

.theme-mode-switch button.active span,
.theme-mode-switch label.active span {
  color: var(--accent-dark);
}

.theme-mode-switch label:has(input:focus-visible) {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.theme-mode-switch svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.theme-mode-switch--icons button {
  min-height: 34px;
  padding: 0;
}

.system-option-switch.theme-mode-switch label,
.system-option-switch.theme-mode-switch button {
  min-height: 28px;
}

.system-select-control {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, currentColor 50%) right 16px center / 6px 6px no-repeat,
    linear-gradient(135deg, currentColor 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
    color-mix(in srgb, var(--surface-muted) 58%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  flex: 0 0 260px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  min-height: 40px;
  min-width: 260px;
  padding: 0 34px 0 18px;
}

.system-select-control:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.compact-panel .quick-grid {
  grid-template-columns: 1fr;
}

.info-list {
  display: grid;
  gap: 0;
  padding: 0 12px 12px;
}

.info-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-width: 0;
  padding: 8px 0;
}

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

.info-row span {
  color: var(--muted);
  min-width: 0;
  font-size: 13px;
}

.info-row strong {
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

.warning-text {
  color: var(--warning);
}

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

.version-summary {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 12px 12px;
}

.version-summary > div {
  background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface-solid));
  border: 1px solid var(--line);
  border-right: 0;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
}

.version-summary > div:first-child {
  border-radius: 16px 0 0 16px;
}

.version-summary > div:last-child {
  border-radius: 0 16px 16px 0;
  border-right: 1px solid var(--line);
}

.version-summary span,
.version-component-name small {
  color: var(--muted);
  font-size: 12px;
}

.version-summary strong {
  color: var(--text);
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-meta {
  padding-top: 0;
}

.version-changelog-card {
  align-items: center;
  background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 0 12px 12px;
  padding: 12px 14px;
}

.version-changelog-card > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.version-changelog-card strong {
  color: var(--text);
  font-size: 14px;
}

.version-changelog-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.version-rules {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 12px 12px;
}

.version-rules > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
}

.version-rules strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.version-rules span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.version-component-section {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.icon-asset-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 12px 12px;
  scrollbar-width: thin;
}

.icon-asset-tab {
  align-items: center;
  background: color-mix(in srgb, var(--surface-muted) 52%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 999px;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
}

.icon-asset-tab small {
  align-items: center;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface-solid));
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  min-width: 22px;
  padding: 2px 6px;
}

.icon-asset-tab:hover,
.icon-asset-tab.active {
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  color: var(--accent-dark);
}

.version-component-section__head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.version-component-section__head strong {
  color: var(--text);
  font-size: 13px;
}

.version-component-section__head span {
  color: var(--muted);
  font-size: 11px;
}

.version-component-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
}

.version-svg-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  padding: 0 12px 12px;
}

.version-svg-card {
  background: color-mix(in srgb, var(--surface-muted) 46%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}

.version-svg-card--ui-iconset {
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--brand-blue) 12%, transparent), transparent 38%),
    color-mix(in srgb, var(--surface-muted) 52%, var(--surface-solid));
}

.version-svg-card--app-icon {
  background:
    radial-gradient(circle at 28% 22%, color-mix(in srgb, var(--brand-gold) 13%, transparent), transparent 38%),
    radial-gradient(circle at 78% 76%, color-mix(in srgb, var(--brand-blue) 15%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface-muted) 54%, var(--surface-solid));
}

.version-svg-preview-link {
  align-items: center;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  min-height: 96px;
  overflow: hidden;
  padding: 8px;
}

.version-svg-card--ui-iconset .version-svg-preview-link {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-solid) 92%, transparent), color-mix(in srgb, var(--brand-blue) 7%, var(--surface-solid))),
    color-mix(in srgb, var(--surface-solid) 92%, transparent);
}

.version-svg-card--app-icon .version-svg-preview-link {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-solid) 94%, transparent), color-mix(in srgb, var(--brand-blue) 6%, var(--surface-solid))),
    color-mix(in srgb, var(--surface-solid) 92%, transparent);
}

.version-svg-card--app-icon .version-svg-preview {
  border-radius: 22%;
  box-shadow: 0 12px 28px color-mix(in srgb, #000 18%, transparent);
  height: 76px;
  width: 76px;
}

[data-theme="dark"] .version-svg-card--app-icon {
  background:
    radial-gradient(circle at 26% 22%, rgba(255, 180, 61, 0.14), transparent 36%),
    radial-gradient(circle at 78% 74%, rgba(10, 132, 255, 0.2), transparent 42%),
    color-mix(in srgb, var(--surface-solid) 76%, #050b16);
  border-color: rgba(112, 169, 255, 0.22);
}

[data-theme="dark"] .version-svg-card--ui-iconset {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 180, 61, 0.14), transparent 34%),
    radial-gradient(circle at 82% 72%, rgba(10, 132, 255, 0.18), transparent 38%),
    color-mix(in srgb, var(--surface-solid) 74%, #050b16);
  border-color: rgba(112, 169, 255, 0.22);
}

[data-theme="dark"] .version-svg-card--ui-iconset .version-svg-preview-link {
  background:
    linear-gradient(135deg, rgba(8, 19, 35, 0.98), rgba(13, 31, 56, 0.94)),
    var(--surface-solid);
  border-color: rgba(112, 169, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 28px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .version-svg-card--ui-iconset:not(.version-svg-card--status-icon) .version-svg-preview {
  filter:
    brightness(0)
    saturate(100%)
    invert(83%)
    sepia(18%)
    saturate(1410%)
    hue-rotate(177deg)
    brightness(105%)
    contrast(104%)
    drop-shadow(0 0 7px rgba(10, 132, 255, 0.42));
}

[data-theme="dark"] .version-svg-card--ui-iconset.version-svg-card--status-icon .version-svg-preview {
  filter: drop-shadow(0 0 7px rgba(10, 132, 255, 0.18));
}

.version-svg-preview {
  display: block;
  height: 64px;
  width: 100%;
  object-fit: contain;
}

.version-svg-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.version-svg-meta strong {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-svg-meta span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-component-card {
  background: color-mix(in srgb, var(--surface-muted) 46%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  grid-template-rows: auto auto auto;
}

.version-component-card--compact {
  cursor: pointer;
  display: grid;
  gap: 5px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.version-component-card--compact:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(23, 37, 61, 0.15);
}

.version-component-card--compact:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.version-component-card__head {
  align-items: flex-start;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  min-width: 0;
}

.version-component-card__head .version-component-name {
  min-width: 0;
  width: 100%;
}

.version-component-card__head .version-component-name strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.version-component-card__meta {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.version-component-card .badge {
  border-radius: 999px;
  font-size: 11px;
  min-width: 24px;
  padding: 2px 7px;
}

.version-component-card__meta span,
.version-component-card p {
  color: var(--muted);
  font-size: 10px;
}

.version-component-card p {
  line-height: 1.42;
  margin: 0;
}

.version-component-card__status {
  margin-top: auto;
}

.version-component-progress-indicator {
  background: color-mix(in srgb, var(--line) 65%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.version-component-progress-indicator span {
  background: linear-gradient(90deg, var(--warning), var(--success));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.25s ease;
  width: 0;
}

.version-component-progress-indicator.is-complete {
  border-color: color-mix(in srgb, var(--success) 45%, var(--line));
}

.version-component-progress-indicator.is-complete span {
  background: linear-gradient(90deg, var(--success), var(--success));
}

.version-component-details-description {
  color: var(--muted);
  display: grid;
  gap: 6px;
  padding: 0 8px 10px;
}

.version-component-details-description strong {
  color: var(--text);
  font-size: 12px;
}

.version-component-details-description p {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.version-component-details-changelog {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 6px;
  padding: 10px 8px 0;
}

.version-component-details-changelog strong {
  color: var(--text);
  font-size: 13px;
}

.version-component-details-changelog p {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.version-component-details-list {
  padding-top: 0;
}

.version-component-details-modal .modal-head h3 {
  font-size: 16px;
}

.version-component-name {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.version-component-name small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-component-name strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .version-changelog-card {
    align-items: stretch;
    display: grid;
  }
}

.notice-panel {
  align-items: flex-start;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  display: flex;
  gap: 10px;
  padding: 12px 14px;
}

.notice-panel strong {
  color: var(--accent-dark);
  flex: 0 0 auto;
}

.notice-panel span {
  color: var(--muted);
}

.notice-panel.danger {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.notice-panel.danger strong {
  color: var(--danger);
}

.auth-page {
  align-items: center;
  background:
    radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--accent-soft) 68%, transparent), transparent 32%),
    radial-gradient(circle at 82% 78%, color-mix(in srgb, var(--success) 10%, transparent), transparent 34%),
    var(--bg);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.auth-scope-canvas {
  inset: 0;
  opacity: .72;
  pointer-events: none;
  position: absolute;
  width: 100%;
  height: 100%;
}

.auth-background-word {
  color: color-mix(in srgb, var(--text) 16%, transparent);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(64px, 10vw, 180px);
  font-weight: 900;
  inset: clamp(34px, 8vh, 92px) 0 auto;
  letter-spacing: 0.04em;
  line-height: 0.9;
  opacity: 0.46;
  pointer-events: none;
  position: absolute;
  text-align: center;
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  text-transform: uppercase;
  transform: none;
  white-space: nowrap;
  z-index: 0;
}

.auth-background-word sup {
  font-size: 0.16em;
  letter-spacing: 0.14em;
  margin-left: 0.22em;
  position: relative;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  top: -2.2em;
}

.auth-shell {
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  display: grid;
  max-width: 400px;
  min-height: 0;
  overflow: hidden;
  position: relative;
  width: min(100%, 400px);
  z-index: 1;
}

.app-version-link {
  display: inline-flex;
  position: fixed !important;
  right: 18px !important;
  left: auto !important;
  bottom: 16px !important;
  top: auto !important;
  z-index: 5000;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 11px;
  width: auto;
  text-align: right;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  pointer-events: auto;
  text-shadow: 0 1px 2px color-mix(in srgb, var(--bg) 82%, transparent);
}

body.hide-app-version-link .app-version-link {
  display: none !important;
}

.auth-mode .app-version-link {
  display: inline-flex;
}

.app-version-link:hover {
  color: var(--accent);
}

.auth-theme-mode {
  bottom: 18px;
  left: 50%;
  margin: 0;
  min-width: 128px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 5000;
}

.auth-theme-mode button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  justify-content: center;
  min-height: 28px;
  padding: 0;
}

.auth-theme-mode button.active {
  background: color-mix(in srgb, var(--accent-soft) 74%, var(--surface-solid));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--accent-dark);
}

.auth-brand-mark {
  align-items: center;
  background:
    radial-gradient(circle at 45% 38%, color-mix(in srgb, var(--brand-mist) 22%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface-solid) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-blue) 30%, var(--line));
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent),
    0 10px 28px color-mix(in srgb, var(--brand-blue) 14%, transparent);
  color: var(--brand-blue);
  display: inline-flex;
  flex: 0 0 auto;
  height: 58px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: 58px;
  animation: mpAuthMarkFloat 2.6s ease-in-out infinite;
}

.auth-brand-mark::before {
  background: conic-gradient(from 90deg, var(--brand-gold), var(--brand-green), var(--brand-blue), var(--brand-mist), var(--brand-gold));
  border-radius: inherit;
  content: "";
  inset: -2px;
  opacity: .42;
  position: absolute;
  animation: mpAuthOrbit 3.2s linear infinite;
}

.auth-brand-mark::after {
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  border-radius: inherit;
  content: "";
  inset: 2px;
  position: absolute;
}

.auth-brand-mark img,
.auth-brand-mark svg {
  animation: mpAuthIconPulse 2.1s ease-in-out infinite;
  display: block;
  height: 50px;
  overflow: hidden;
  position: relative;
  width: 50px;
  z-index: 1;
}

@keyframes mpAuthMarkFloat {
  0%, 100% { box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent), 0 10px 28px color-mix(in srgb, var(--brand-blue) 14%, transparent); transform: translateY(0) scale(1); }
  50% { box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent), 0 18px 42px color-mix(in srgb, var(--brand-blue) 30%, transparent); transform: translateY(-4px) scale(1.045); }
}

@keyframes mpAuthOrbit {
  from { transform: rotate(0deg) scale(1.08); }
  to { transform: rotate(360deg) scale(1.08); }
}

@keyframes mpAuthIconPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(10, 132, 255, 0)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 12px rgba(10, 132, 255, .38)); transform: scale(1.06); }
}

.auth-card {
  align-content: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 11px;
  max-width: none;
  padding: 28px 30px;
  width: 100%;
}

.auth-card h2 {
  color: color-mix(in srgb, var(--text) 86%, var(--brand-navy));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0.14em;
  line-height: 1.1;
  margin: 0 0 5px;
}

.auth-brand-claim {
  color: color-mix(in srgb, var(--muted) 86%, var(--brand-blue));
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.22em;
  margin: 0;
  text-transform: uppercase;
}

.auth-card-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.auth-card p,
.auth-card .form-hint {
  color: var(--muted);
  margin: 0;
}

.auth-actions {
  display: flex;
  justify-content: stretch;
  padding-top: 4px;
}

.auth-actions .button {
  min-height: 42px;
  width: 100%;
}

.compact-select {
  background: color-mix(in srgb, var(--surface-muted) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 999px;
  color: var(--text);
  min-height: 30px;
  padding: 4px 10px;
}

.form-actions-inline {
  align-items: center;
  display: flex;
  gap: 12px;
  grid-column: 1 / -1;
}

.modal-backdrop {
  align-items: center;
  background: rgba(31, 35, 40, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 3200;
}

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

.modal {
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(21, 35, 60, 0.18);
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: min(92vh, 880px);
  max-width: 940px;
  overflow: hidden;
  width: min(96vw, 940px);
}

.entity-modal {
  height: min(88vh, 760px);
  max-height: min(88vh, 760px);
  max-width: 820px;
  width: min(94vw, 820px);
}

[data-user-create-modal] .entity-modal,
[data-user-edit-modal] .entity-modal {
  height: auto;
  max-height: min(88vh, 760px);
}

.compact-assignment-modal {
  height: auto;
  max-height: min(86vh, 640px);
  max-width: 720px;
  width: min(92vw, 720px);
}

.version-component-details-backdrop {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.version-component-details-backdrop .modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.pdf-preview-modal {
  height: min(96vh, 1020px);
  max-height: min(96vh, 1020px);
  width: min(98vw, 1680px);
}

@media (max-width: 960px) {
  .pdf-preview-modal .modal-head,
  .pdf-preview-toolbar,
  .pdf-preview-frame-wrap {
    padding-left: 10px;
    padding-right: 10px;
  }

  .pdf-preview-toolbar {
    gap: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
    flex-wrap: wrap;
  }

  .pdf-preview-toolbar .button {
    min-height: 28px;
  }
}

sup,
sub {
  font-size: 0.72em;
  line-height: 0;
}

.protocol-delete-modal {
  height: auto;
  max-height: min(90vh, 620px);
  max-width: 640px;
  width: min(100%, 640px);
}

.protocol-export-modal {
  height: auto;
  max-height: min(90vh, 680px);
  max-width: 720px;
  width: min(94vw, 720px);
}

.protocol-delete-form {
  gap: 16px;
}

.delete-confirm-summary {
  background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.delete-confirm-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.delete-confirm-summary strong {
  color: var(--text);
  font-size: 14px;
}

.room-modal {
  display: flex;
  flex-direction: column;
  height: min(96vh, 1040px);
  max-height: min(96vh, 1040px);
  max-width: 1760px;
  width: min(98vw, 1760px);
}

.protocol-modal {
  height: auto;
  max-height: min(92vh, 820px);
  max-width: 1040px;
  width: min(96vw, 1040px);
}

.modal-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
  justify-content: space-between;
  padding: 16px;
}

.modal-head-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.modal-head-actions .button {
  min-height: 36px;
  min-width: 0;
  padding: 0 12px;
}

.modal-head h3 {
  font-size: 18px;
  margin: 0;
}

.modal-mode-switch {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 8px 16px;
}

.entity-modal-tabs {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 8px 16px;
}

.entity-modal-tabs .tab-button.danger-tab {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.entity-modal-tabs .tab-button.danger-tab.active {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--danger) 52%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 28%, transparent);
}

.compact-assignment-modal .modal-head {
  align-items: center;
  padding: 12px 14px;
}

.compact-assignment-modal .modal-head h3 {
  font-size: 16px;
}

.compact-assignment-modal .header-icon-button {
  height: 38px;
  width: 38px;
}

.compact-assignment-modal .modal-head-actions .button {
  min-height: 34px;
  padding: 0 12px;
}

.compact-assignment-modal .entity-modal-tabs {
  padding: 6px 14px;
}

.compact-assignment-modal .tab-button {
  min-height: 34px;
  padding: 6px 12px;
}

.entity-properties-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.entity-properties-panel[hidden] {
  display: none;
}

.modal-form {
  align-content: start;
  display: grid;
  flex: 1;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.compact-assignment-modal .modal-form {
  gap: 9px;
  padding: 12px 14px;
}

.compact-assignment-modal .form-section {
  border-radius: var(--radius-sm);
  gap: 8px;
  padding: 9px 10px 10px;
}

.compact-assignment-modal .form-section legend {
  font-size: 11.5px;
}

.compact-assignment-modal .form-grid {
  gap: 8px 10px;
}

.compact-assignment-modal .field {
  gap: 4px;
}

.compact-assignment-modal .field label {
  font-size: 11.5px;
}

.compact-assignment-modal .field input,
.compact-assignment-modal .field select,
.compact-assignment-modal .field textarea,
.compact-assignment-modal .readonly-field {
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-height: 34px;
  padding: 6px 9px;
}

.compact-assignment-modal .form-hint {
  font-size: 11.5px;
  margin: 0;
}

.entity-link-panel {
  align-content: flex-start;
  background: color-mix(in srgb, var(--surface-muted) 48%, var(--surface-solid));
  gap: 10px;
  overflow-y: auto;
}

.danger-zone-panel {
  align-content: flex-start;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-muted));
  gap: 10px;
  overflow-y: auto;
}

.danger-zone-card {
  background: color-mix(in srgb, var(--surface-solid) 86%, var(--danger));
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: var(--radius-md);
  color: var(--text);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.danger-zone-title {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.entity-link-section {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.entity-link-section h4 {
  background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface-solid));
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  padding: 7px 10px;
  text-transform: uppercase;
}

.entity-link-list {
  display: grid;
  list-style: none;
  margin: 0;
  padding: 0;
}

.entity-link-list li {
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 0;
  display: block;
  overflow: hidden;
}

.entity-link-list li:last-child {
  border-bottom: 0;
}

.entity-link-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 18px;
  justify-items: stretch;
  min-height: 34px;
  padding: 6px 10px;
  text-align: left;
  width: 100%;
}

.entity-link-button:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.entity-link-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.entity-link-arrow {
  align-items: center;
  color: var(--accent);
  display: inline-flex;
  justify-content: center;
}

.entity-link-arrow svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

.entity-link-list strong {
  color: var(--text);
  font-size: 12.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-link-copy span,
.entity-link-empty {
  color: var(--muted);
  font-size: 11.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-row-highlight > td {
  animation: entity-row-highlight-fade 5s ease-out;
}

@keyframes entity-row-highlight-fade {
  0%,
  70% {
    background: color-mix(in srgb, var(--accent) 20%, var(--surface-solid));
  }

  100% {
    background: transparent;
  }
}

.protocol-modal .modal-form {
  flex: 0 1 auto;
  gap: 12px;
  overflow-y: auto;
  padding: 14px 16px 0;
}

.room-modal .modal-form {
  display: grid;
  flex: 1;
  gap: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(96vh - 72px);
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.room-form-scroll {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.form-section {
  background: color-mix(in srgb, var(--surface-solid) 44%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
}

.form-section legend {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 0 6px;
}

.customer-location-section {
  display: grid;
  gap: 10px;
}

.customer-location-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-location-tabs .tab-button {
  min-height: 32px;
  padding: 0 12px;
}

.customer-location-add {
  aspect-ratio: 1;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.customer-location-add svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

.customer-location-panel .form-section {
  margin: 0;
}

.inline-create-form {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 12px;
}

.workflow-create-panel {
  margin-inline: auto;
  max-width: 980px;
}

.workflow-create-panel[data-room-create-inline] {
  max-width: none;
  width: 100%;
}

.workflow-create-panel .panel-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  padding-bottom: 10px;
}

.workflow-create-panel .inline-create-form {
  border: 0;
  margin: 0;
  padding: 14px;
}

.room-inline-form .room-sketch-workspace {
  grid-template-columns: minmax(0, 1.45fr) minmax(420px, 0.55fr);
}

.room-inline-form .room-sketch-svg {
  height: clamp(420px, 58vh, 680px);
}

.inline-create-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.inline-create-actions .button.danger {
  margin-right: auto;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-list {
  display: grid;
  gap: 8px;
}

.compact-choice-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.equal-choice-grid {
  align-items: stretch;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 96px;
  padding: 10px 12px;
}

.choice-card:hover,
.choice-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.choice-card input {
  accent-color: var(--accent);
  margin: 0;
}

.choice-card span {
  display: grid;
  gap: 2px;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.choice-card strong {
  font-size: 13px;
}

.choice-card small {
  color: var(--muted);
  font-size: 12px;
}

.vde-inspection-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vde-inspection-card {
  background: color-mix(in srgb, var(--surface-solid) 86%, var(--surface-muted));
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 8px;
  min-height: 76px;
  padding: 10px;
}

.vde-inspection-card.is-required-open {
  border-color: color-mix(in srgb, var(--warning) 58%, var(--line));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--warning) 78%, transparent);
}

.vde-inspection-card > strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.vde-inspection-options {
  align-items: end;
  display: flex;
  gap: 7px;
}

.vde-choice {
  align-items: center;
  background: var(--button-secondary-bg);
  border: 1px solid var(--button-secondary-border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  line-height: 1;
  min-height: 32px;
  padding: 0;
  text-align: center;
  width: 32px;
}

.vde-choice::before {
  content: "–";
}

.vde-choice-ok::before {
  content: "✓";
}

.vde-choice-warning::before {
  content: "×";
}

.vde-choice span {
  font-size: 0;
  height: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.vde-choice input {
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

.vde-choice:has(input:focus-visible) {
  outline: 3px solid var(--focus);
}

.vde-choice-ok:has(input:checked) {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent-dark) 44%, var(--accent));
  color: #fff;
}

.vde-choice-warning:has(input:checked) {
  background: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 82%, #000);
  color: var(--on-danger);
}

.vde-choice-open:has(input:checked) {
  background: color-mix(in srgb, var(--muted) 16%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--muted) 46%, var(--line));
  color: var(--text);
}

.protocol-workspace {
  gap: 0;
}

.protocol-workspace:has(.vde-measurement-matrix-wrap) {
  justify-self: start;
  margin-left: min(0px, calc((var(--content-max-width) - 100vw) / 2));
  max-width: none;
  width: calc(100vw - (var(--content-gutter) * 2));
}

.protocol-workspace > .panel-head {
  padding-bottom: 8px;
}

.protocol-workspace > .panel-head p {
  margin-top: 2px;
}

.protocol-workflow-hint:empty {
  display: none;
}

.protocol-flow-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.1fr 1.1fr 1.4fr;
}

.protocol-flow-card {
  background: color-mix(in srgb, var(--surface) 88%, var(--soft));
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
}

.protocol-flow-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.protocol-flow-card strong {
  color: var(--text);
  font-size: 14px;
}

.protocol-flow-card small,
.section-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.protocol-modal-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.protocol-assignment-section {
  background: color-mix(in srgb, var(--surface-solid) 46%, var(--accent-soft));
}

.assignment-select-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.assignment-select-card {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 9px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.assignment-select-card:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}

.assignment-select-card.is-complete {
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.assignment-select-card.is-disabled {
  background: color-mix(in srgb, var(--surface-muted) 76%, var(--surface));
  opacity: 0.72;
}

.assignment-select-card__top {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.assignment-select-card__top > label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.assignment-select-card__top small {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.assignment-select-card.is-complete .assignment-select-card__top small {
  background: color-mix(in srgb, var(--accent-soft) 82%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  color: var(--accent-dark);
}

.assignment-select-card select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 17px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 12px) 50% / 6px 6px no-repeat,
    var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  min-height: 38px;
  overflow: hidden;
  padding: 7px 30px 7px 10px;
  position: relative;
  text-overflow: ellipsis;
  width: 100%;
  z-index: 1;
}

.assignment-select-card select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  outline: 0;
}

.assignment-select-card select:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.assignment-select-card em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.25;
}

.selected-protocol-type {
  background: color-mix(in srgb, var(--accent-soft) 46%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius-md);
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.selected-protocol-type span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.selected-protocol-type strong {
  color: var(--text);
  font-size: 15px;
}

.selected-protocol-type small {
  color: var(--muted);
  font-size: 12px;
}

.protocol-inline-wizard {
  gap: 0;
  overflow: hidden;
}

.protocol-wizard-head {
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.protocol-inline-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.protocol-inline-actions {
  border-top: 1px solid var(--line);
  margin: 0 -16px -16px;
}

.protocol-steps-clickable li {
  padding: 0;
}

.protocol-steps-clickable button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
}

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

.protocol-editor {
  display: grid;
  gap: 0;
  grid-template-rows: auto;
  min-height: 0;
  width: 100%;
}

.protocol-context-strip {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.protocol-context-strip span {
  border-right: 1px solid var(--line);
  color: var(--text);
  display: grid;
  font-size: 13px;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
}

.protocol-context-strip span:last-child {
  border-right: 0;
}

.protocol-context-strip strong {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.compact-context-strip span {
  font-size: 12px;
  padding: 7px 10px;
}

.vde-circuit-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.vde-circuit-list {
  margin: 10px 0 14px;
}

.vde-circuit-table {
  min-width: 980px;
}

.vde-circuit-table td,
.vde-circuit-table th {
  vertical-align: middle;
}

.vde-circuit-table tr.is-active-circuit td {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.table-action-cell {
  position: relative;
  text-align: right;
  white-space: nowrap;
}

.table-action-cell .button + .button {
  margin-left: 6px;
}

.is-archived-protocol td {
  color: var(--muted);
}

.pdf-actions-menu {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 32px rgba(21, 35, 60, 0.18);
  display: grid;
  gap: 4px;
  min-width: 236px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.pdf-actions-menu--up {
  bottom: calc(100% + 6px);
  top: auto;
}

.pdf-actions-menu__head {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 2px;
  padding: 4px 6px 8px;
  text-align: left;
}

.pdf-actions-menu__head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pdf-actions-menu__head strong {
  color: var(--text);
  font-size: 13px;
}

.pdf-actions-menu__item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 8px;
  line-height: 1.2;
  min-height: 32px;
  padding: 6px 8px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.pdf-actions-menu__item svg {
  flex: 0 0 15px;
  fill: none;
  height: 15px;
  max-height: 15px;
  max-width: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

.pdf-actions-menu__item span {
  min-width: 0;
}

.pdf-actions-menu__item:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-solid));
}

.pdf-actions-menu__item.danger {
  color: var(--danger);
}

.pdf-actions-menu__item.muted {
  color: var(--muted);
}

.vde-circuit-table .button.table-action {
  min-width: 86px;
}

.vde-circuit-tree {
  display: grid;
  gap: 12px;
  margin: 10px 0 14px;
}

.vde-tree-root {
  align-items: center;
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 18px;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
}

.vde-tree-icon {
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--accent-dark);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.vde-tree-root strong,
.vde-tree-group-head strong,
.vde-tree-main strong {
  color: var(--text);
}

.vde-tree-root small,
.vde-tree-group-head small,
.vde-tree-main small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.vde-tree-groups {
  display: grid;
  gap: 10px;
}

.vde-tree-group {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.vde-tree-group-head {
  align-items: center;
  background: color-mix(in srgb, var(--surface-muted) 62%, var(--surface-solid));
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.vde-tree-items {
  display: grid;
}

.vde-tree-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 10px;
}

.vde-tree-item:last-child {
  border-bottom: 0;
}

.vde-tree-item > button:first-child {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  min-height: 48px;
  padding: 8px;
  text-align: left;
}

.vde-tree-item > button:first-child:hover {
  background: color-mix(in srgb, var(--accent-soft) 42%, transparent);
}

.vde-tree-item.is-active-circuit {
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface-solid));
}

.vde-tree-code {
  color: var(--accent-dark);
  font-weight: 850;
  white-space: nowrap;
}

.vde-tree-main {
  min-width: 0;
}

.vde-tree-main strong,
.vde-tree-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vde-circuit-modal {
  height: auto;
  max-height: min(90vh, 760px);
  max-width: 820px;
  width: min(92vw, 820px);
}

.vde-circuit-import-modal {
  height: auto;
  max-height: min(92vh, 840px);
  max-width: 1160px;
  width: min(96vw, 1160px);
}

.vde-circuit-modal .modal-form {
  flex: 1 1 auto;
  gap: 10px;
  overflow-y: auto;
  padding: 14px 16px 0;
}

.vde-circuit-modal .modal-head {
  padding: 14px 16px;
}

.vde-circuit-modal .notice-panel {
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
}

.vde-circuit-edit-layout {
  display: grid;
  gap: 12px;
}

.vde-circuit-edit-section {
  background: color-mix(in srgb, var(--surface-solid) 86%, var(--surface-muted));
  gap: 10px;
  padding: 12px;
}

.vde-circuit-edit-section legend {
  color: var(--accent-dark);
}

.vde-circuit-modal .form-grid {
  gap: 10px 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vde-circuit-modal label {
  display: grid;
  gap: 5px;
}

.vde-circuit-modal label span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.vde-circuit-modal input,
.vde-circuit-modal select {
  min-height: 34px;
  width: 100%;
}

.vde-circuit-modal .wide-field {
  grid-column: 1 / -1;
}

.vde-circuit-modal .modal-actions {
  margin: 4px -16px 0;
  padding: 11px 16px 13px;
}

.vde-circuit-import-form {
  flex: 0 1 auto;
}

.import-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(220px, 1.2fr);
  overflow: hidden;
}

.import-summary span {
  border-right: 1px solid var(--line);
  color: var(--text);
  display: grid;
  font-size: 13px;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
}

.import-summary span:last-child {
  border-right: 0;
}

.import-summary strong {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.import-preview-table {
  max-height: 280px;
  overflow: auto;
}

.template-download-panel {
  margin-bottom: 12px;
}

.sub-panel {
  background: color-mix(in srgb, var(--surface-solid) 72%, var(--surface-muted));
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.panel-head.compact {
  border-bottom: 0;
  margin: 0;
  padding: 0;
}

.vde-measure-layout {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.vde-measure-tabs {
  background: color-mix(in srgb, var(--surface-solid) 76%, var(--surface-muted));
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 6px;
  margin: 10px 0 12px;
  overflow-x: auto;
  padding: 5px;
}

.vde-measure-tabs button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  flex: 1 0 max-content;
  font-size: 12px;
  font-weight: 850;
  min-height: 32px;
  padding: 5px 13px;
  white-space: nowrap;
}

.vde-measure-tabs button:hover,
.vde-measure-tabs button.active {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface-solid));
  color: var(--accent-dark);
}

.vde-measure-tabs button.active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 36%, var(--line));
}

.vde-measure-panel {
  margin-bottom: 12px;
}

.vde-measurement-matrix-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 10px 0 14px;
  max-height: min(64vh, 720px);
  overflow: auto;
  width: 100%;
}

.vde-measurement-matrix {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  min-width: max(2380px, 100%);
  table-layout: fixed;
  width: 100%;
}

.vde-measurement-matrix .col-code { width: 62px; }
.vde-measurement-matrix .col-target { width: 220px; }
.vde-measurement-matrix .col-cable { width: 126px; }
.vde-measurement-matrix .col-choice { width: 74px; }
.vde-measurement-matrix .col-measure { width: 88px; }
.vde-measurement-matrix .col-insulation { width: 62px; }
.vde-measurement-matrix .col-breaker-static { width: 54px; }
.vde-measurement-matrix .col-rcd-static { width: 62px; }
.vde-measurement-matrix .col-note { width: 210px; }

.vde-measurement-matrix th,
.vde-measurement-matrix td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  padding: 5px 6px;
  text-align: center;
  vertical-align: middle;
}

.vde-measurement-matrix th {
  background: color-mix(in srgb, var(--surface-solid) 72%, var(--surface-muted));
  color: var(--text);
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.15;
  position: sticky;
  top: 0;
  z-index: 2;
}

.vde-measurement-matrix thead tr:first-child th {
  background: color-mix(in srgb, var(--surface-muted) 84%, var(--surface-solid));
  border-bottom-color: color-mix(in srgb, var(--line) 88%, var(--text));
  height: 28px;
  text-transform: none;
}

.vde-measurement-matrix thead tr + tr th {
  height: 48px;
  top: 29px;
}

.vde-measurement-matrix thead tr:first-child th:nth-child(3),
.vde-measurement-matrix thead tr:first-child th:nth-child(4),
.vde-measurement-matrix thead tr:first-child th:nth-child(5),
.vde-measurement-matrix thead tr:first-child th:nth-child(6),
.vde-measurement-matrix thead tr:first-child th:nth-child(7),
.vde-measurement-matrix thead tr:nth-child(2) th:nth-child(3),
.vde-measurement-matrix thead tr:nth-child(2) th:nth-child(13),
.vde-measurement-matrix thead tr:nth-child(2) th:nth-child(19),
.vde-measurement-matrix thead tr:nth-child(2) th:nth-child(24) {
  border-right-color: color-mix(in srgb, var(--line) 55%, var(--text));
  border-right-width: 2px;
}

.vde-measurement-matrix td:nth-child(1),
.vde-measurement-matrix td:nth-child(2),
.vde-measurement-matrix td:nth-child(3) {
  text-align: left;
}

.vde-measurement-matrix td:nth-child(3) {
  font-size: 10.5px;
  line-height: 1.2;
}

.vde-measurement-matrix td:nth-child(6),
.vde-measurement-matrix td:nth-child(16),
.vde-measurement-matrix td:nth-child(22),
.vde-measurement-matrix td:nth-child(27) {
  border-right-color: color-mix(in srgb, var(--line) 55%, var(--text));
  border-right-width: 2px;
}

.vde-measurement-matrix tr.is-active-circuit td {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.vde-measurement-matrix td.vde-cell-error {
  background: color-mix(in srgb, var(--danger) 13%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 54%, transparent);
}

.vde-measurement-matrix td.vde-cell-warning {
  background: color-mix(in srgb, var(--warning) 15%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 46%, transparent);
}

.vde-measurement-matrix input,
.vde-measurement-matrix select {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 86%, var(--surface-muted));
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  min-height: 28px;
  padding: 3px 6px;
  width: 100%;
}

.vde-measurement-matrix input {
  min-width: 0;
}

.vde-measurement-matrix td.vde-cell-error input,
.vde-measurement-matrix td.vde-cell-error select {
  border-color: color-mix(in srgb, var(--danger) 64%, var(--line));
}

.vde-measurement-matrix td.vde-cell-warning input,
.vde-measurement-matrix td.vde-cell-warning select {
  border-color: color-mix(in srgb, var(--warning) 58%, var(--line));
}

.vde-matrix-choice-group {
  align-items: center;
  display: inline-flex;
  gap: 3px;
  justify-content: center;
  padding: 2px;
  border-radius: 999px;
  white-space: nowrap;
}

.vde-matrix-choice-group.is-required-open {
  background: color-mix(in srgb, var(--warning) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 48%, transparent);
}

.vde-matrix-choice {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  line-height: 1;
  width: 26px;
}

.vde-matrix-choice input {
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

.vde-matrix-choice:has(input:focus-visible) {
  outline: 3px solid var(--focus);
}

.vde-matrix-choice.is-ok:has(input:checked) {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent-dark) 44%, var(--accent));
  color: #fff;
}

.vde-matrix-choice.is-danger:has(input:checked) {
  background: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 82%, #000);
  color: var(--on-danger);
}

.vde-matrix-choice.is-neutral:has(input:checked) {
  background: color-mix(in srgb, var(--muted) 16%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--muted) 46%, var(--line));
  color: var(--text);
}

.vde-matrix-row-button {
  background: transparent;
  border: 0;
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.vde-table-na {
  color: var(--muted);
  display: inline-block;
  font-weight: 900;
  min-width: 26px;
}

.vde-measure-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.vde-measure-grid label {
  display: grid;
  gap: 5px;
}

.vde-measure-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.compact-context-strip strong {
  font-size: 9px;
}

.protocol-step-intro {
  display: none;
}

.protocol-step-panel {
  align-content: start;
  display: grid;
  min-height: 0;
}

.protocol-step-section {
  align-content: start;
  min-height: 0;
}

.vde-setup-section {
  gap: 12px;
  padding: 12px;
}

.vde-setup-section .form-hint {
  font-size: 12px;
  margin: 0;
}

.vde-setup-layout {
  display: grid;
  gap: 12px;
}

.vde-setup-card {
  background: color-mix(in srgb, var(--surface-solid) 88%, var(--surface-muted));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.vde-setup-card h4 {
  color: var(--accent-dark);
  font-size: 13px;
  margin: 0;
}

.vde-assignment-summary {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
}

.vde-assignment-summary span {
  color: var(--text);
  display: grid;
  gap: 2px;
  min-width: 0;
}

.vde-assignment-summary strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.vde-setup-grid {
  display: grid;
  gap: 9px 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.vde-setup-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vde-setup-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.vde-compact-extra-grid {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

.vde-assessment-report {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 10px;
}

.vde-assessment-report.is-ok {
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 26%, var(--line));
}

.vde-assessment-report.is-ok span,
.vde-assessment-report-head span,
.vde-assessment-item small {
  color: var(--muted);
}

.vde-assessment-report-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.vde-assessment-list {
  display: grid;
  gap: 6px;
}

.vde-assessment-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 9px;
  grid-template-columns: auto 1fr auto;
  padding: 8px 10px;
}

.vde-assessment-item.is-error {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.vde-assessment-item.is-warning {
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
}

.vde-assessment-mark {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.vde-assessment-item.is-error .vde-assessment-mark {
  background: var(--danger);
  color: var(--danger-contrast, #fff);
}

.vde-assessment-item.is-warning .vde-assessment-mark {
  background: var(--warning);
  color: var(--warning-contrast, #1f2937);
}

.vde-assessment-jump {
  min-height: 30px;
  min-width: 36px;
}

.computed-rating-card {
  align-content: center;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 12px;
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px 12px;
}

.computed-rating-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.computed-rating-card strong {
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1.1;
}

.vde-measurement-matrix td.vde-focus-target {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--danger) 62%, transparent);
}

.vde-measurement-matrix td.vde-focus-target input,
.vde-measurement-matrix td.vde-focus-target select {
  border-color: color-mix(in srgb, var(--danger) 68%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 22%, transparent);
}

.vde-measurement-matrix td.vde-focus-target .vde-matrix-choice-group {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 52%, transparent);
}

.vde-setup-grid label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.vde-setup-grid label span {
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
}

.vde-setup-grid input,
.vde-setup-grid select {
  background-color: var(--surface);
  background-clip: padding-box;
  border: var(--border-width) solid var(--line);
  border-radius: var(--radius-field-compact);
  color: var(--text);
  font-size: 14px;
  min-height: 40px;
  padding: 7px 12px;
  width: 100%;
}

.vde-setup-grid select {
  padding-inline-end: 34px;
}

.field input[type="date"],
.field input[type="time"],
.vde-setup-grid input[type="date"],
.vde-setup-grid input[type="time"] {
  appearance: none;
  -webkit-appearance: none;
}

.field input[type="date"],
.field input[type="time"],
.vde-setup-grid input[type="date"],
.vde-setup-grid input[type="time"] {
  color-scheme: inherit;
}

.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="time"]::-webkit-calendar-picker-indicator,
.vde-setup-grid input[type="date"]::-webkit-calendar-picker-indicator,
.vde-setup-grid input[type="time"]::-webkit-calendar-picker-indicator {
  margin-inline-end: 2px;
}

.vde-setup-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.vde-setup-grid label span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.vde-setup-grid .wide-field {
  grid-column: span 2;
}

.protocol-sketch-step .protocol-room-sketch-svg {
  height: clamp(260px, 42vh, 460px);
}

.protocol-values-workspace {
  min-height: 0;
}

.compact-values-table {
  max-height: clamp(260px, 46vh, 520px);
  overflow: auto;
}

.measurement-plan-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.measurement-plan-summary span {
  border-right: 1px solid var(--line);
  color: var(--text);
  display: grid;
  font-size: 13px;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
}

.measurement-plan-summary span:last-child {
  border-right: 0;
}

.measurement-plan-summary strong {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.protocol-review-grid {
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.protocol-review-grid span {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--text);
  display: grid;
  font-size: 13px;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
}

.protocol-review-grid span:nth-child(3n) {
  border-right: 0;
}

.protocol-review-grid span:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.protocol-review-grid strong {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.protocol-steps {
  align-items: center;
  background: color-mix(in srgb, var(--surface) 86%, var(--soft));
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 6px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 6px;
}

.protocol-subnav-shell {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0 auto 8px;
  max-width: 100%;
  width: 100%;
}

.protocol-subnav-shell .protocol-steps {
  flex: 1 1 auto;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  width: auto;
}

.protocol-step-rail {
  align-items: center;
  background: color-mix(in srgb, var(--surface) 86%, var(--soft));
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  flex: 1 1 auto;
  gap: 4px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 4px;
}

.protocol-step-rail.is-compact {
  flex: 0 1 auto;
  grid-template-columns: auto auto auto;
  justify-content: center;
  max-width: max-content;
}

.protocol-subnav-shell .protocol-step-rail.is-compact .protocol-steps {
  flex: 0 0 auto;
  max-width: max-content;
}

.protocol-step-rail.is-dense {
  flex: 0 1 auto;
  gap: 3px;
  grid-template-columns: auto auto auto;
  justify-content: center;
  max-width: min(100%, max-content);
  padding: 3px;
}

.protocol-subnav-shell .protocol-step-rail.is-dense .protocol-steps {
  flex: 0 1 auto;
  max-width: max-content;
}

.protocol-step-rail.is-dense .protocol-step-switch {
  height: 32px;
  min-width: 38px;
  padding: 0 10px;
}

.protocol-step-rail.is-dense .protocol-step-switch.protocol-step-next,
.protocol-step-rail.is-dense .protocol-step-switch.protocol-step-finish {
  min-width: 44px;
}

.protocol-step-rail.is-dense .protocol-steps.protocol-substeps {
  gap: 6px;
  padding: 0 1px;
}

.protocol-step-rail.is-dense .protocol-steps.protocol-substeps li {
  font-size: 12px;
  max-width: none;
  min-height: 32px;
  padding: 4px 14px;
}

.protocol-step-rail.is-dense .protocol-steps.protocol-substeps button {
  font-size: 12px;
  overflow: visible;
  text-overflow: initial;
  min-height: 32px;
  min-width: max-content;
  padding: 4px 14px;
}

.protocol-step-rail.is-dense .protocol-steps.protocol-substeps li.active {
  max-width: none;
}

.protocol-step-rail.is-dense .protocol-steps.protocol-substeps li span,
.protocol-step-rail.is-dense .protocol-steps.protocol-substeps button span {
  height: 20px;
  width: 20px;
}

.protocol-step-switch {
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  min-width: 42px;
  padding: 0 12px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.protocol-step-switch svg {
  display: block;
  height: 16px;
  width: 16px;
}

.protocol-step-switch svg path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.protocol-step-switch:disabled {
  cursor: default;
  opacity: 0.42;
}

.protocol-step-switch:hover {
  background: color-mix(in srgb, var(--accent-soft) 54%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent-dark);
}

.protocol-step-switch.protocol-step-next {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent-dark) 40%, var(--accent));
  color: #fff;
  min-width: 48px;
}

.protocol-step-switch.protocol-step-next:hover {
  background: var(--button-primary-hover);
  color: #fff;
}

.protocol-step-switch.protocol-step-finish {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent-dark) 44%, var(--accent));
  color: #fff;
  min-width: 48px;
}

.protocol-step-switch.protocol-step-preview {
  color: var(--text);
}

.protocol-step-switch.protocol-step-preview svg {
  display: block;
  width: 16px;
  height: 16px;
}

.protocol-step-switch.protocol-step-preview svg path,
.protocol-step-switch.protocol-step-preview svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.protocol-overview-button {
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  flex: 0 0 auto;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  min-width: 40px;
  padding: 0 10px;
}

.protocol-overview-button:hover {
  background: color-mix(in srgb, var(--accent-soft) 54%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent-dark);
}

.protocol-steps li {
  align-items: center;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  white-space: nowrap;
}

.protocol-steps li span {
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.protocol-steps li.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-dark);
}

.protocol-steps li.active span {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
}

.protocol-steps li.done {
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  color: color-mix(in srgb, var(--success) 78%, var(--text));
}

.protocol-steps li.done span {
  border-color: color-mix(in srgb, var(--success) 38%, var(--line));
}

.protocol-steps li.available {
  background: color-mix(in srgb, var(--surface-solid) 90%, var(--surface-muted));
  color: var(--text);
}

.protocol-steps li.available span {
  border-color: color-mix(in srgb, var(--success) 24%, var(--line));
}

.protocol-steps li.incomplete {
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  color: color-mix(in srgb, var(--warning) 78%, var(--text));
}

.protocol-steps li.incomplete span {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
}

.protocol-steps li.blocked {
  background: color-mix(in srgb, var(--surface-muted) 84%, var(--surface));
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
}

.protocol-steps li.blocked span {
  background: color-mix(in srgb, var(--surface-muted) 88%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--warning) 26%, var(--line));
}

.protocol-steps.protocol-substeps {
  background: transparent;
  border: 0;
  border-radius: 18px;
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px;
  scrollbar-width: thin;
}

.protocol-steps.protocol-substeps li {
  flex: 0 1 auto;
  justify-content: center;
  font-size: 12px;
  min-height: 32px;
  min-width: max-content;
  padding: 4px 14px;
  text-align: center;
}

.protocol-steps.protocol-substeps button {
  justify-content: center;
  font-size: 12px;
  min-height: 32px;
  min-width: max-content;
  padding: 4px 0;
  width: 100%;
}

.protocol-steps.protocol-substeps li span,
.protocol-steps.protocol-substeps button span {
  height: 20px;
  width: 20px;
}

.protocol-steps li.locked {
  background: color-mix(in srgb, var(--surface-muted) 76%, var(--surface));
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
}

.protocol-steps li.locked span {
  background: var(--surface-solid);
  border-color: color-mix(in srgb, var(--line) 82%, var(--muted));
}

.protocol-steps li.protocol-return-step {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  min-width: 64px;
  padding-inline: 12px;
}

.protocol-steps li.protocol-return-step button {
  align-items: center;
  color: var(--text);
  justify-content: center;
  min-width: 30px;
}

.protocol-overview-icon {
  align-items: center;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.protocol-overview-icon svg {
  display: block;
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
  width: 18px;
}

.protocol-steps li.protocol-next-step {
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent-dark) 40%, var(--accent));
  color: #fff;
  min-width: 96px;
  padding-inline: 16px;
}

.protocol-steps li.protocol-next-step.finish {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent-dark) 44%, var(--accent));
}

.protocol-steps li.protocol-next-step button {
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  justify-content: center;
  min-width: 30px;
}

.protocol-tab-page {
  align-content: start;
  display: grid;
  min-height: var(--work-panel-min-height);
}

.protocol-modal .protocol-steps {
  background: transparent;
  border: 0;
  justify-content: flex-start;
  padding: 0;
}

.protocol-modal .protocol-steps li {
  background: var(--surface-muted);
  font-size: 12px;
  min-height: 28px;
  padding: 3px 9px 3px 4px;
}

.protocol-modal .protocol-steps li span {
  height: 22px;
  width: 22px;
}

.protocol-modal .form-section {
  border-radius: 18px;
  gap: 12px;
  padding: 14px;
}

.protocol-modal .form-grid label {
  display: grid;
  gap: 6px;
}

.protocol-modal .form-grid label span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.protocol-modal .form-hint {
  padding: 0 2px;
}

.protocol-modal .modal-actions {
  margin: 0 -16px;
  position: static;
}

.protocol-editor .form-grid label {
  display: grid;
  gap: 6px;
}

.protocol-editor .form-grid label span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.wide-field {
  grid-column: 1 / -1;
}

.protocol-values-table input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  max-width: 128px;
  min-height: 28px;
  padding: 4px 6px;
  width: 100%;
}

.protocol-measurement-workspace {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(500px, 1fr) minmax(400px, 420px);
  min-height: 0;
}

.esd-measurement-workspace {
  align-items: start;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 360px);
  grid-template-areas:
    "sketch points"
    "sketch components";
  grid-template-rows: auto auto;
}

.esd-measurement-workspace .esd-sketch-pane {
  grid-area: sketch;
  min-width: 0;
}

.esd-measurement-workspace .protocol-point-panel {
  grid-area: points;
  min-width: 0;
  width: 100%;
}

.esd-measurement-workspace .esd-bonding-side-panel {
  grid-area: components;
  min-width: 0;
  width: 100%;
}

.esd-measurement-workspace .room-opening-list {
  max-height: min(28vh, 300px);
}

.esd-measurement-workspace .esd-values-list-wrap {
  max-width: none;
  width: 100%;
}

.esd-measurement-workspace .protocol-point-entry {
  grid-template-columns: minmax(120px, 1fr) minmax(112px, 0.85fr) minmax(114px, auto);
  padding: 10px;
}

.esd-measurement-workspace .protocol-values-table--esd {
  min-width: 0;
  width: 100%;
  table-layout: auto;
}

.esd-measurement-workspace .protocol-values-table--esd th,
.esd-measurement-workspace .protocol-values-table--esd td {
  white-space: nowrap;
}

.esd-measurement-workspace .protocol-values-table--esd th:nth-child(1),
.esd-measurement-workspace .protocol-values-table--esd td:nth-child(1) {
  width: 72px;
}

.esd-measurement-workspace .protocol-values-table--esd th:nth-child(2),
.esd-measurement-workspace .protocol-values-table--esd td:nth-child(2) {
  width: 92px;
}

.esd-measurement-workspace .protocol-values-table--esd th:nth-child(3),
.esd-measurement-workspace .protocol-values-table--esd td:nth-child(3) {
  width: 88px;
}

.esd-measurement-workspace .protocol-values-table--esd th:nth-child(4),
.esd-measurement-workspace .protocol-values-table--esd td:nth-child(4) {
  width: 130px;
}

.esd-measurement-workspace .room-opening-row-compact {
  grid-template-columns: minmax(58px, 0.44fr) minmax(0, 1fr) auto 32px;
}

.esd-measurement-workspace .room-opening-row label span {
  font-size: 10px;
}

.esd-measurement-workspace .room-opening-row input,
.esd-measurement-workspace .room-opening-row select {
  min-height: 28px;
  padding: 3px 7px;
}

.esd-measurement-workspace .room-openings-head strong {
  font-size: 11px;
}

.protocol-measurement-workspace .protocol-room-sketch-svg {
  height: clamp(420px, 58vh, 680px);
}

.protocol-measurement-workspace .compact-values-table {
  max-height: clamp(420px, 58vh, 680px);
}

.protocol-values-table th,
.protocol-values-table td {
  min-height: 34px;
  padding: 5px 6px;
  vertical-align: middle;
}

.protocol-values-table table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.protocol-values-table .protocol-point-col {
  width: 64px;
}

.protocol-values-table .protocol-value-col {
  width: 74px;
}

.protocol-values-table .protocol-note-col {
  width: 148px;
}

.protocol-values-table .protocol-action-col {
  width: 42px;
}

.protocol-values-table td:last-child {
  text-align: right;
}

.protocol-values-table th,
.protocol-values-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.protocol-values-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.protocol-values-table .button.table-action.icon-only {
  height: 30px;
  min-height: 30px;
  width: 30px;
}

.protocol-range-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.protocol-range-card {
  background: color-mix(in srgb, var(--surface) 92%, var(--soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 6px;
  padding: 9px 10px;
}

.protocol-range-card__head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.protocol-range-card__head > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.protocol-range-card__head strong {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  min-width: 68px;
  padding: 5px 9px;
  text-align: center;
}

.protocol-range-card input[type="range"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 100%;
}

.protocol-stepper-control {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 34px minmax(84px, 1fr) auto 34px;
}

.protocol-stepper-control .button.icon-only {
  height: 34px;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.protocol-stepper-control input {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  min-height: 34px;
  padding: 6px 8px;
  text-align: center;
  width: 100%;
}

.protocol-stepper-control > span {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 11.5px;
  font-weight: 800;
  min-width: 62px;
  padding: 5px 8px;
  text-align: center;
}

.protocol-range-card small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
}

.protocol-point-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.protocol-point-entry {
  align-items: end;
  background: color-mix(in srgb, var(--surface) 90%, var(--soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 8px 10px;
  grid-template-columns: minmax(120px, 1fr) minmax(112px, 0.7fr) minmax(112px, auto);
  padding: 12px;
}

.protocol-next-point-button {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
  min-height: 38px;
  min-width: 112px;
  padding-inline: 12px;
  white-space: nowrap;
}

.protocol-next-point-button svg {
  height: 16px;
  width: 16px;
}

.protocol-point-entry > div,
.protocol-point-entry label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.protocol-point-entry span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.protocol-point-entry strong {
  color: var(--accent-dark);
  font-size: 18px;
}

.protocol-point-entry small {
  color: var(--muted);
  font-size: 12px;
}

.protocol-point-entry input {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  min-height: 34px;
  padding: 7px 10px;
  width: 100%;
}

.protocol-values-table tr.is-filled-point td {
  background: color-mix(in srgb, var(--success) 10%, transparent);
}

.protocol-values-table tr[data-esd-point-ref] {
  --esd-point-ref-color: var(--muted);
  --esd-point-ref-color-dark: color-mix(in srgb, var(--text) 50%, var(--muted) 50%);
}

.esd-point-filter-bar {
  display: grid;
  gap: 7px;
}

.esd-point-filter-bar > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.esd-point-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.esd-point-filter-pill {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-height: 28px;
  padding: 4px 10px;
}

.esd-point-filter-pill.is-active,
.esd-point-filter-pill.is-active:hover {
  background: color-mix(in srgb, var(--esd-point-ref-color, var(--accent)) 13%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--esd-point-ref-color, var(--accent)) 64%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--esd-point-ref-color, var(--accent)) 34%, transparent);
  color: var(--text);
}

.protocol-values-table .esd-point-ref-chip {
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--surface-solid);
  display: inline-block;
  height: 10px;
  width: 10px;
}

.protocol-values-table .esd-point-ref-pill {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.protocol-values-table tr[data-esd-point-ref] .esd-point-ref-chip {
  background: var(--esd-point-ref-color);
}

.protocol-values-table tr[data-esd-point-ref].is-active-point td:last-child {
  box-shadow: inset 0 0 0 1px var(--esd-point-ref-color-dark);
}

.esd-bonding-filter-index {
  border-color: color-mix(in srgb, var(--esd-point-ref-color, var(--line)) 44%, var(--line));
}

.esd-bonding-filter-index::before {
  background: var(--esd-point-ref-color);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--surface-solid);
  content: "";
  height: 9px;
  width: 9px;
}

.esd-bonding-filter-index.is-active {
  background: color-mix(in srgb, var(--esd-point-ref-color, var(--accent)) 12%, var(--surface-solid));
  border-color: var(--esd-point-ref-color);
}

.esd-bonding-color-swatches {
  align-items: center;
  display: flex;
  gap: 5px;
}

.esd-bonding-color-swatch {
  appearance: none;
  background: var(--esd-point-ref-color);
  border: 1px solid color-mix(in srgb, var(--esd-point-ref-color-dark, var(--text)) 72%, var(--surface-solid));
  border-radius: 999px;
  cursor: pointer;
  height: 18px;
  padding: 0;
  width: 18px;
}

.esd-bonding-color-swatch.is-active {
  box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--esd-point-ref-color);
}

.esd-bonding-measurements {
  display: grid;
  gap: 5px;
  grid-column: 1 / -1;
}

.esd-bonding-measurement {
  align-items: center;
  appearance: none;
  background: color-mix(in srgb, var(--esd-point-ref-color) 8%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--esd-point-ref-color) 34%, var(--line));
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 8px;
  grid-template-columns: 58px minmax(70px, 1fr) auto;
  min-height: 30px;
  padding: 4px 6px;
  text-align: left;
}

.esd-bonding-measurement:hover,
.esd-bonding-measurement.is-active {
  background: color-mix(in srgb, var(--esd-point-ref-color) 16%, var(--surface-solid));
  border-color: var(--esd-point-ref-color);
}

.esd-bonding-measurement > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.esd-bonding-measurement > strong {
  color: var(--esd-point-ref-color-dark, var(--text));
  font-size: 12px;
}

.esd-bonding-measurement-empty {
  color: var(--muted);
  font-size: 11px;
  padding: 2px 4px;
}

.protocol-room-sketch,
.protocol-room-sketch-empty {
  background: color-mix(in srgb, var(--surface) 88%, var(--soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.protocol-room-sketch-empty {
  color: var(--muted);
  min-height: 260px;
  place-items: center;
  text-align: center;
}

.protocol-room-sketch-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.protocol-room-sketch-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.protocol-room-sketch-head strong {
  font-size: 13px;
}

.protocol-room-sketch-head span {
  color: var(--muted);
  font-size: 12px;
}

.protocol-room-sketch-svg {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  height: clamp(300px, 42vh, 520px);
  width: 100%;
  touch-action: none;
}

.protocol-measurement-point {
  cursor: pointer;
  outline: none;
}

.protocol-edge-zone {
  fill: url("#protocol-edge-hatch");
  stroke: color-mix(in srgb, var(--warning) 42%, var(--line));
  stroke-width: 0.04;
}

.protocol-edge-hatch-base {
  fill: color-mix(in srgb, var(--warning) 16%, var(--surface-solid));
}

.protocol-edge-hatch-line {
  stroke: color-mix(in srgb, var(--warning) 58%, var(--line));
  stroke-width: 0.045;
}

.protocol-measurement-zone {
  fill: color-mix(in srgb, var(--accent-soft) 34%, var(--surface-solid));
  stroke: color-mix(in srgb, var(--accent) 28%, var(--line));
  stroke-width: 0.04;
}

.protocol-measurement-point rect {
  fill: color-mix(in srgb, var(--surface-solid) 72%, var(--accent-soft));
  stroke: color-mix(in srgb, var(--accent) 48%, var(--text));
  stroke-width: 0.035;
}

.protocol-measurement-point text {
  alignment-baseline: middle;
  dominant-baseline: middle;
  fill: color-mix(in srgb, var(--text) 72%, var(--accent-dark));
  font-size: 0.14px;
  font-weight: 800;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--surface-solid);
  stroke-width: 0.035;
  text-anchor: middle;
}

.protocol-room-sketch.is-dense-points .protocol-measurement-point text {
  font-size: 0.105px;
  font-weight: 750;
}

.protocol-measurement-point:hover rect,
.protocol-measurement-point:focus rect,
.protocol-measurement-point.is-active-point rect {
  fill: color-mix(in srgb, var(--accent) 46%, var(--surface));
  stroke: var(--accent-dark);
  stroke-width: 0.06;
}

.protocol-measurement-point.is-filled rect {
  fill: color-mix(in srgb, var(--success) 46%, var(--surface));
  stroke: color-mix(in srgb, var(--success) 60%, var(--text));
}

.esd-room-sketch .protocol-measurement-zone {
  fill: color-mix(in srgb, var(--warning) 12%, var(--surface-solid));
  stroke: color-mix(in srgb, var(--warning) 34%, var(--line));
}

.esd-bonding-list-wrap {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.esd-bonding-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.esd-bonding-toolbar strong {
  font-size: 12px;
}

.esd-bonding-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
}

.esd-bonding-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 6px;
  padding: 8px;
}

.esd-bonding-row-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.esd-bonding-row-head strong {
  font-size: 12px;
}

.esd-bonding-row-head .header-icon-button {
  height: 28px;
  min-height: 28px;
  width: 28px;
}

.esd-bonding-row-grid {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
}

.esd-bonding-list input {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  min-height: 30px;
  padding: 6px 8px;
  width: 100%;
}

.esd-bonding-row-grid label {
  align-items: center;
  display: grid;
  gap: 4px;
}

.esd-bonding-list .header-icon-button,
.esd-bonding-list .button.icon-only {
  margin-left: auto;
}

.esd-measurement-point rect {
  fill: color-mix(in srgb, var(--surface-solid) 72%, var(--esd-point-ref-color, var(--warning)));
  stroke: color-mix(in srgb, var(--esd-point-ref-color, var(--warning)) 70%, var(--text));
}

.esd-measurement-point.is-filled rect {
  fill: color-mix(in srgb, var(--surface-solid) 64%, var(--esd-point-ref-color, var(--warning)) 36%);
  stroke: color-mix(in srgb, var(--esd-point-ref-color, var(--warning)) 70%, var(--success) 30%);
}

.esd-measurement-point:hover rect,
.esd-measurement-point:focus rect,
.esd-measurement-point.is-active-point rect {
  fill: color-mix(in srgb, var(--esd-point-ref-color, var(--warning)) 40%, var(--surface) 60%);
  stroke: var(--esd-point-ref-color-dark, var(--warning));
  stroke-width: 0.06;
}

.esd-bonding-point {
  cursor: grab;
}

.esd-bonding-point circle {
  fill: color-mix(in srgb, var(--esd-point-ref-color, var(--warning)) 72%, var(--surface-solid));
  stroke: var(--esd-point-ref-color-dark, var(--text));
  stroke-width: 0.06;
}

.esd-bonding-point text {
  fill: var(--esd-point-ref-color-dark, var(--text));
  font-weight: 800;
}

.esd-bonding-point.is-dragging circle {
  cursor: grabbing;
}

.esd-bonding-point text {
  font-size: 0.16px;
  font-weight: 850;
  paint-order: stroke;
  stroke: var(--surface-solid);
  stroke-width: 0.045;
}

.protocol-values-table tr.is-active-point td {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.vde-previous-measurement-table {
  font-size: 12px;
}

.vde-previous-measurement-table td,
.vde-previous-measurement-table th {
  white-space: nowrap;
}

.vde-consumption-trend {
  background: linear-gradient(150deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface) 90%, var(--soft)));
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px 12px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--text) 4%, transparent);
}

.vde-consumption-trend-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.vde-consumption-trend-header strong {
  color: var(--text);
  font-size: 14px;
}

.vde-consumption-trend-header span {
  color: var(--muted);
  font-size: 12px;
}

.vde-consumption-chart-shell {
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  padding: 8px 6px 6px;
}

.vde-consumption-chart {
  display: block;
  width: clamp(180px, 42%, 360px);
  max-width: 100%;
  margin: 0 auto;
  overflow: visible;
}

.vde-consumption-grid-line {
  stroke: color-mix(in srgb, var(--line) 80%, transparent);
  stroke-width: 0.34;
  stroke-dasharray: 1.8 2.2;
}

.vde-consumption-chart-point,
.vde-consumption-chart-point-highlight {
  stroke-width: 0.36;
  stroke: var(--surface-solid);
}

.vde-consumption-grid-label {
  fill: var(--muted);
  font-size: 6.1px;
  font-weight: 600;
  text-anchor: end;
}

.vde-consumption-area-fill {
  fill: color-mix(in srgb, var(--accent) 18%, transparent);
  opacity: 0.36;
}

.vde-consumption-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vde-consumption-chart-point {
  fill: color-mix(in srgb, var(--accent) 85%, white);
  stroke: var(--accent);
}

.vde-consumption-chart-point-highlight {
  fill: color-mix(in srgb, var(--success) 80%, white);
  stroke: color-mix(in srgb, var(--success) 70%, var(--accent));
}

.vde-consumption-range {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.vde-consumption-summary {
  display: flex;
  gap: 12px;
}

.vde-consumption-summary span {
  color: var(--muted);
  font-size: 12px;
}

.vde-consumption-summary strong {
  color: var(--text);
  font-size: 13px;
}

.vde-consumption-history-list {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.vde-consumption-history-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.vde-consumption-history-item span {
  color: var(--muted);
  font-size: 12px;
}

.vde-consumption-history-item strong {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.protocol-editor-actions {
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  border-top: 1px solid var(--line);
  margin: 0;
  padding-top: 10px;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.customer-search-results {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 3px;
  max-height: 146px;
  overflow-y: auto;
  padding: 5px;
}

.compact-assignment-modal .customer-search-results.is-selection-made {
  max-height: 48px;
}

.customer-search-option {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  display: block;
  padding: 6px 8px;
  text-align: left;
  width: 100%;
}

.customer-search-option:hover,
.customer-search-option:focus {
  background: var(--surface-muted);
  border-color: var(--line);
  outline: none;
}

.customer-search-option span {
  display: grid;
  gap: 2px;
}

.customer-search-option strong {
  font-size: 12px;
}

.customer-search-option small,
.customer-search-empty {
  color: var(--muted);
  font-size: 12px;
}

.customer-search-empty {
  padding: 8px 10px;
}

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

.room-sketch-shell {
  display: grid;
  gap: 10px;
}

.room-shape-picker {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.room-shape-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 3px;
  justify-items: center;
  min-height: 68px;
  padding: 6px;
  text-align: center;
}

.room-shape-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}

.room-shape-card.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}

.room-shape-card svg {
  height: 24px;
  width: 40px;
}

.room-shape-card polygon {
  fill: color-mix(in srgb, var(--accent) 12%, var(--surface-solid));
  stroke: color-mix(in srgb, var(--accent) 60%, var(--line));
  stroke-linejoin: round;
  stroke-width: 0.12;
}

.room-shape-card span {
  font-size: 12px;
  font-weight: 800;
}

.room-shape-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.room-sketch-workspace {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.45fr) minmax(420px, 0.55fr);
  min-width: 0;
}

.room-sketch-svg {
  background: color-mix(in srgb, var(--surface-solid) 90%, var(--surface-muted));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  height: clamp(300px, 44vh, 500px);
  touch-action: none;
  width: 100%;
}

.room-sketch-grid-line {
  stroke: color-mix(in srgb, var(--line) 70%, transparent);
  stroke-width: 0.01;
}

.room-sketch-polygon {
  fill: color-mix(in srgb, var(--accent) 12%, var(--surface-solid));
  stroke: color-mix(in srgb, var(--accent) 58%, var(--line));
  stroke-linejoin: round;
  stroke-width: 0.06;
}

.room-opening-edge-target {
  cursor: crosshair;
  opacity: 0;
  pointer-events: stroke;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 0.42;
}

.room-opening-edge-target:hover,
.room-opening-edge-target:focus {
  opacity: 0.26;
}

.room-wall-opening .room-opening-gap {
  stroke: var(--surface-solid);
  stroke-linecap: round;
  stroke-width: 0.3;
}

.room-wall-opening[data-room-opening-move] {
  cursor: move;
}

.room-wall-opening[data-room-opening-move].is-dragging > line:not(.room-opening-gap),
.room-wall-opening[data-room-opening-move]:hover > line:not(.room-opening-gap) {
  stroke-width: 0.26;
}

.room-wall-opening > line:not(.room-opening-gap) {
  stroke: var(--room-opening-color, var(--accent));
  stroke-linecap: round;
  stroke-width: 0.2;
}

.room-opening-resize-handle {
  cursor: ew-resize;
  fill: var(--surface-solid);
  stroke: var(--text);
  stroke-width: 0.05;
}

.room-opening-resize-handle:hover,
.room-opening-resize-handle.is-dragging {
  fill: var(--room-opening-color, var(--accent));
  stroke: var(--room-opening-color-dark, var(--accent-dark));
  stroke-width: 0.07;
}

.room-wall-opening text {
  fill: var(--text);
  font-size: 0.3px;
  font-weight: 850;
  paint-order: stroke;
  stroke: var(--surface-solid);
  stroke-width: 0.06px;
  text-anchor: middle;
}

.room-sketch-point circle {
  cursor: grab;
  fill: var(--surface-solid);
  stroke: var(--accent-dark);
  stroke-width: 0.04;
}

.room-sketch-point circle:hover,
.room-sketch-point circle.is-dragging {
  fill: color-mix(in srgb, var(--accent) 18%, var(--surface-solid));
  stroke-width: 0.07;
}

.room-sketch-point circle.is-dragging {
  cursor: grabbing;
}

.room-sketch-point text,
.room-edge-label {
  fill: var(--muted);
  font-size: 0.22px;
  font-weight: 800;
  paint-order: stroke;
  stroke: var(--surface-solid);
  stroke-width: 0.04px;
}

.room-edge-label {
  text-anchor: middle;
}

.room-sketch-meta {
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  padding: 7px 9px;
}

.room-data-fields {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0;
  margin-bottom: 8px;
  padding-bottom: 10px;
}

.room-data-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 0 6px;
}

.room-grid-field {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 34px;
  padding: 4px 0;
}

.room-grid-field span {
  color: var(--muted);
  font-size: 13px;
}

.room-grid-field input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  min-height: 30px;
  padding: 4px 8px;
  text-align: right;
  width: 82px;
}

.room-display-options {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
  padding: 8px 0;
}

.room-display-options label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.room-display-options input {
  accent-color: var(--accent);
}

.room-openings-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-top: 10px;
  min-width: 0;
  padding-top: 10px;
}

.room-openings-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.room-openings-head > div:first-child {
  display: grid;
  gap: 2px;
}

.room-openings-head strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.room-openings-head span {
  color: var(--muted);
  font-size: 11px;
}

.room-openings-actions {
  display: flex;
  gap: 6px;
  min-width: max-content;
}

.room-openings-actions .button {
  min-height: 30px;
  padding: 4px 9px;
}

.room-opening-list {
  display: grid;
  gap: 6px;
  max-height: min(34vh, 360px);
  min-width: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.room-opening-row {
  align-items: end;
  background: color-mix(in srgb, var(--surface-muted) 50%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(66px, 0.62fr) minmax(120px, 1fr) minmax(160px, 1.35fr) minmax(84px, 0.7fr) minmax(128px, 0.95fr) 34px;
  padding: 7px;
}

.room-opening-row-compact {
  grid-template-columns: minmax(62px, 0.56fr) minmax(140px, 1.25fr) minmax(170px, 1.35fr) 34px;
}

.room-opening-index {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-bottom: 3px;
}

.room-opening-index span {
  align-items: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 999px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.room-opening-index strong {
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.esd-bonding-filter-index {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  transition: background-color 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.esd-bonding-filter-index:hover,
.esd-bonding-filter-index:focus-visible {
  background: color-mix(in srgb, var(--accent-soft) 30%, var(--surface-muted));
}

.esd-bonding-filter-index:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus);
}

.esd-bonding-filter-index.is-active {
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
}

.room-opening-row label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.room-opening-row label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.room-opening-row input,
.room-opening-row select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  min-height: 30px;
  min-width: 0;
  padding: 4px 7px;
  width: 100%;
}

.room-opening-colors {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(6, 18px);
  min-height: 30px;
}

.room-opening-color {
  background: var(--room-opening-swatch);
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  height: 18px;
  padding: 0;
  width: 18px;
}

.room-opening-color.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 3px color-mix(in srgb, var(--text) 18%, transparent);
}

.room-opening-delete {
  align-self: end;
  background: var(--surface-solid);
}

.form-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.form-hint.is-warning {
  color: var(--warning);
  font-weight: 800;
}

.form-hint:empty {
  display: none;
}

.modal-actions {
  align-items: center;
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  justify-content: center;
  margin: 2px -16px -16px;
  padding: 10px 16px 12px;
  position: static;
  z-index: 4;
}

.modal-actions .button {
  min-width: 132px;
}

.compact-assignment-modal .modal-actions {
  gap: 8px;
  margin: 2px -14px -12px;
  padding: 10px 14px 12px;
}

.compact-assignment-modal .modal-actions .button {
  min-height: 38px;
  min-width: 116px;
  padding: 8px 14px;
}

.modal-delete-action {
  margin-right: auto;
}

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

.room-modal-actions {
  margin: 0;
  position: static;
}

.room-save-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-left: auto;
}

.room-save-actions .button {
  min-width: 136px;
}

.empty-state {
  border-style: dashed;
  color: var(--muted);
  display: grid;
  min-height: 160px;
  padding: 24px;
  place-items: center;
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

@media (max-width: 1180px) {
  .app-header {
    padding-left: 18px;
    padding-right: 18px;
  }

  .main-nav {
    gap: 4px;
    justify-content: flex-start;
    left: auto;
    max-width: none;
    overflow-x: auto;
    position: static;
    transform: none;
  }

  .brand {
    flex-basis: 240px;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .assignment-select-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-sketch-workspace,
  .room-inline-form .room-sketch-workspace {
    grid-template-columns: 1fr;
  }

  .room-opening-list {
    max-height: none;
  }

  .room-opening-row {
    grid-template-columns: minmax(66px, 0.7fr) minmax(120px, 1fr) minmax(180px, 1.45fr) minmax(84px, 0.8fr) minmax(128px, 0.95fr) 34px;
  }

  .room-opening-row-compact {
    grid-template-columns: minmax(58px, 0.55fr) minmax(120px, 1.25fr) minmax(150px, 1.25fr) 34px;
  }

  .esd-measurement-workspace .room-opening-row-compact {
    grid-template-columns: minmax(56px, 0.5fr) minmax(0, 1fr) minmax(126px, auto) 34px;
  }

  .workspace-bar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .auth-shell {
    max-width: 380px;
  }

  .auth-card {
    padding: 24px;
  }

  .tab-button,
  .tab {
    font-size: 12px;
    min-height: 28px;
    padding: 4px 9px;
  }
}

@media (max-width: 760px) {
  :root {
    --dashboard-content-padding-vertical: 32px;
  }

  .theme-mode-panel,
  .system-toggle-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .theme-mode-switch,
  .system-select-control,
  .system-option-switch {
    flex-basis: auto;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .system-toggle-panel {
    gap: 12px;
  }

  .qr-code-layout {
    grid-template-columns: 1fr;
  }

  .qr-logo-settings {
    grid-template-columns: 1fr;
  }

  .qr-logo-preview {
    min-height: 86px;
  }

  .qr-use-grid {
    grid-template-columns: 1fr;
  }

  .qr-link-output {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal,
  .room-modal {
    height: min(96vh, 960px);
    max-height: min(96vh, 960px);
    width: min(100%, 1000px);
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions .button {
    flex: 1 1 140px;
  }

  .app-header {
    align-items: center;
    flex-wrap: nowrap;
    padding: 8px 12px;
  }

  .auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 14px;
  }

  .auth-shell {
    border-radius: 20px;
    min-height: auto;
  }

  .auth-card {
    padding: 22px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .main-nav {
    min-width: 0;
    order: initial;
    width: auto;
  }

  .header-actions {
    margin-left: 0;
    min-width: max-content;
  }

  .topbar-inprogress-protocols {
    gap: 4px;
    max-width: min(100vw - 150px, 320px);
  }

  .topbar-protocol-pill {
    max-width: 120px;
    padding: 0 8px;
  }

  .context-pill {
    max-width: 190px;
  }

  .workspace-bar {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 14px 12px;
  }

  .module-tabs {
    grid-column: 1;
    justify-self: center;
  }

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

  .entity-link-button {
    grid-template-columns: 1fr;
  }

  .protocol-context-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .protocol-flow-grid,
  .protocol-modal-grid,
  .protocol-measurement-workspace,
  .esd-measurement-workspace,
  .protocol-range-grid,
  .company-settings-layout,
  .vde-setup-grid,
  .vde-inspection-grid,
  .assignment-select-grid,
  .vde-measure-layout,
  .vde-measure-grid,
  .compact-form-grid,
  .compact-choice-list {
    grid-template-columns: 1fr;
  }

  .measurement-plan-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .protocol-stepper-control {
    grid-template-columns: 34px minmax(80px, 1fr) 34px;
  }

  .protocol-stepper-control > span {
    grid-column: 1 / -1;
  }

  .protocol-point-entry {
    grid-template-columns: 1fr;
  }

  .protocol-next-point-button {
    width: 100%;
  }

  .company-logo-card {
    position: static;
  }

  .vde-setup-grid .wide-field {
    grid-column: auto;
  }

  .protocol-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .esd-measurement-workspace {
    grid-template-areas: none;
  }

  .esd-measurement-workspace .esd-values-list-wrap {
    max-width: none;
  }

  .protocol-review-grid span:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .protocol-review-grid span:nth-child(2n) {
    border-right: 0;
  }

  .room-shape-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-sketch-workspace {
    grid-template-columns: 1fr;
  }

  .room-sketch-svg {
    height: 320px;
  }

  .room-openings-head {
    align-items: stretch;
    flex-direction: column;
  }

  .room-openings-actions {
    min-width: 0;
  }

  .room-openings-actions .button {
    flex: 1;
  }

  .room-opening-row {
    grid-template-columns: 42px minmax(0, 1fr) 34px;
  }

  .room-opening-row-compact {
    grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) 34px;
  }

  .esd-measurement-workspace .room-opening-row-compact {
    grid-template-columns: 40px minmax(0, 1fr) 34px;
  }

  .esd-measurement-workspace .room-opening-row-compact .esd-bonding-color-swatches {
    grid-column: 2 / 4;
  }

  .room-opening-row-compact .room-opening-wall {
    grid-column: auto;
  }

  .room-opening-index {
    grid-row: 1 / span 3;
  }

  .room-opening-wall {
    grid-column: 2 / 4;
  }

  .room-opening-row label:last-of-type {
    grid-column: 2 / 4;
  }

  .room-opening-row-compact label:last-of-type {
    grid-column: auto;
  }

  .room-opening-colors {
    grid-column: 2 / 4;
  }

  .room-opening-delete {
    grid-column: 3;
    grid-row: 1;
  }

  .content {
    padding: 16px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .summary-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-card:last-child {
    border-bottom: 0;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

}
