:root {
  color-scheme: dark;
  --surface: #121414;
  --surface-lowest: #0d0f0f;
  --surface-panel: #1a1d1d;
  --surface-container: #1e2020;
  --surface-container-high: #282a2a;
  --surface-variant: #333535;
  --border-subtle: #404848;
  --on-surface: #e2e2e2;
  --on-surface-variant: #c0c8c7;
  --primary: #b9ece9;
  --primary-fixed-dim: #9dd0cd;
  --secondary-container: #1d514f;
  --attention: #f6b99e;
  --error: #ffb4ab;
  --row-hover: #1e2020;
  --processing-row-bg: color-mix(in srgb, var(--primary) 5%, var(--surface-lowest));
  --processing-line-soft: color-mix(in srgb, var(--primary) 24%, transparent);
  --processing-line-strong: color-mix(in srgb, var(--primary) 72%, transparent);
  --processing-sweep-track: color-mix(in srgb, var(--primary) 36%, var(--border-subtle));
  --processing-sweep-head: color-mix(in srgb, var(--primary) 88%, white);
  --processing-line-glow: color-mix(in srgb, var(--primary) 22%, transparent);
}

:root[data-theme="light"] {
  color-scheme: light;
  --surface: #fbf8fa;
  --surface-lowest: #ffffff;
  --surface-panel: #ffffff;
  --surface-container: #f0edef;
  --surface-container-high: #e4e2e3;
  --surface-variant: #f6f3f5;
  --border-subtle: #c5c6cd;
  --on-surface: #1b1b1d;
  --on-surface-variant: #45474c;
  --primary: #2a5c5a;
  --primary-fixed-dim: #2a5c5a;
  --secondary-container: #f0edef;
  --attention: #b45309;
  --error: #ba1a1a;
  --row-hover: #f6f3f5;
  --processing-row-bg: color-mix(in srgb, var(--primary) 8%, var(--surface-lowest));
  --processing-line-soft: color-mix(in srgb, var(--primary) 30%, transparent);
  --processing-line-strong: color-mix(in srgb, var(--primary) 76%, transparent);
  --processing-sweep-track: color-mix(in srgb, var(--primary) 42%, var(--border-subtle));
  --processing-sweep-head: var(--primary);
  --processing-line-glow: color-mix(in srgb, var(--primary) 26%, transparent);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background: var(--surface-lowest);
  color: var(--on-surface);
  font-family: "Hanken Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  border-radius: 2px;
}

.material-symbols-outlined {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 20px;
  font-family: "Material Symbols Outlined";
  font-size: 20px;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
  vertical-align: middle;
}

.global-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  padding: 0 16px;
  min-width: 0;
}

.global-header::before,
.global-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.global-header::before {
  z-index: 1;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--accent, var(--primary)) 26%, transparent) 34%, var(--accent, var(--primary)) 50%, color-mix(in srgb, var(--accent, var(--primary)) 26%, transparent) 66%, transparent 100%);
  transform: translateX(-78%);
}

.global-header::after {
  background: color-mix(in srgb, var(--accent, var(--primary)) 14%, transparent);
}

body[data-page-loading="true"] .global-header::before {
  animation: header-loader-sweep 2.8s cubic-bezier(0.45, 0, 0.2, 1) infinite;
  opacity: 0.95;
}

body[data-page-loading="true"] .global-header::after {
  animation: header-loader-track 2.8s ease-in-out infinite;
}

@keyframes header-loader-sweep {
  0% {
    transform: translateX(-78%);
  }

  100% {
    transform: translateX(78%);
  }
}

@keyframes header-loader-track {
  0%,
  100% {
    opacity: 0;
  }

  45%,
  55% {
    opacity: 0.35;
  }
}


.brand-lockup,
.header-actions,
.button-row,
.local-toolbar,
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-panel));
  color: var(--primary);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.brand-lockup strong {
  color: var(--on-surface);
  font-size: 20px;
  font-weight: 800;
  line-height: 28px;
  white-space: nowrap;
}

.version-badge,
.jow-badge,
.user-chip,
.pill,
.status-pill {
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  color: var(--on-surface-variant);
  min-height: 24px;
  padding: 3px 8px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.version-badge {
  background: var(--surface-panel);
  font-size: 11px;
}

.jow-badge {
  --jow-badge-color: var(--on-surface-variant);
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--jow-badge-color) 58%, transparent);
  background: color-mix(in srgb, var(--jow-badge-color) 12%, transparent);
  padding: 2px 8px 2px 2px;
  color: var(--jow-badge-color);
  cursor: pointer;
}

.jow-badge-mini,
.jow-badge-status {
  display: inline-flex;
  align-items: center;
}

.jow-badge-mini {
  min-height: 20px;
  border-radius: 999px;
  background: var(--jow-badge-color);
  color: var(--surface-lowest);
  padding: 2px 8px;
  font-weight: 900;
}

.jow-badge-status {
  color: var(--jow-badge-color);
  padding: 2px 0;
}

.jow-disabled {
  --jow-badge-color: var(--on-surface-variant);
  opacity: 0.7;
}

.jow-online {
  --jow-badge-color: var(--primary);
}

.jow-offline {
  --jow-badge-color: color-mix(in srgb, var(--attention) 54%, var(--on-surface-variant));
}

.jow-expired {
  --jow-badge-color: var(--attention);
}

.jow-login-required {
  --jow-badge-color: color-mix(in srgb, var(--error) 78%, var(--on-surface-variant));
}

.jow-badge.is-pulsing {
  animation: jow-border-pulse 1.8s ease-in-out infinite;
}

@keyframes jow-border-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--jow-badge-color) 0%, transparent);
  }

  50% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--jow-badge-color) 28%, transparent);
  }
}
.header-actions {
  gap: 14px;
  min-width: 0;
}

.symbol-button {
  overflow: hidden;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 0;
}

.symbol-button:hover,
.symbol-button:focus-visible {
  color: var(--primary);
}

.symbol-button.logout-button {
  color: var(--on-surface-variant);
}

.symbol-button.logout-button:hover,
.symbol-button.logout-button:focus-visible,
.danger {
  color: var(--error);
}

.user-chip {
  display: flex;
  min-width: 0;
  max-width: 260px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 0;
  border-left: 1px solid var(--border-subtle);
  background: transparent;
  padding: 0 0 0 14px;
  color: var(--on-surface);
  cursor: pointer;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  text-align: right;
}

.user-chip:disabled {
  cursor: default;
}

.user-chip > div {
  display: grid;
  min-width: 0;
  justify-items: end;
  gap: 2px;
}

.user-chip span:not(.avatar-chip),
.user-chip small {
  max-width: 172px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 12px;
}

.avatar-chip {
  flex: 0 0 32px;
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.user-chip .avatar-preview {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.app-shell {
  min-height: 100vh;
  padding-top: 48px;
}

body[data-route="login"] .global-header,
body[data-route="setup"] .global-header,
body[data-route="2fa"] .global-header {
  display: none;
}

body[data-route="login"] .app-shell,
body[data-route="setup"] .app-shell,
body[data-route="2fa"] .app-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding-top: 0;
}

.auth-layout {
  display: grid;
  width: min(420px, calc(100vw - 32px));
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
  padding: 0;
}

.auth-layout--wide {
  width: min(560px, calc(100vw - 32px));
}

.auth-layout-wide {
  width: min(560px, calc(100vw - 32px));
}

.panel {
  border: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  padding: 16px;
}

.setup-preview,
.otp-row {
  display: flex;
  align-items: center;
}

.setup-preview {
  gap: 12px;
  margin-top: 16px;
}

.avatar-preview {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
}

.team-cell {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.team-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 30px;
  min-width: 0;
  gap: 8px;
}

.team-manager-avatar {
  display: inline-flex;
  flex: 0 0 auto;
}

.team-avatar-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.team-avatar-group:empty {
  display: none;
}

.team-avatar {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
}

.team-avatar + .team-avatar {
  margin-left: -5px;
}

.team-avatar:hover {
  z-index: 2;
}

.team-avatar .avatar-chip,
.team-avatar .avatar-preview {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--on-surface) 18%, var(--border-subtle));
  background: var(--surface-container);
  color: var(--on-surface);
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 0 0 1px var(--surface-lowest), 0 1px 4px color-mix(in srgb, black 20%, transparent);
}

.team-avatar .avatar-preview {
  display: block;
  object-position: center 22%;
}

.team-avatar--owner .avatar-chip,
.team-avatar--owner .avatar-preview {
  border-color: color-mix(in srgb, var(--on-surface) 28%, var(--border-subtle));
}

.team-avatar--overflow {
  border: 1px solid color-mix(in srgb, var(--on-surface-variant) 62%, var(--border-subtle));
  border-radius: 999px;
  background: var(--surface-container);
  color: var(--on-surface);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  box-shadow: 0 0 0 1px var(--surface-lowest), 0 1px 4px color-mix(in srgb, black 20%, transparent);
}

.team-avatar:hover .avatar-chip,
.team-avatar:hover .avatar-preview,
.team-avatar--overflow:hover {
  border-color: color-mix(in srgb, var(--on-surface) 70%, var(--border-subtle));
}

.team-owner-name,
.team-current-role {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-owner-name {
  color: var(--on-surface);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.team-cell--hovering .team-owner-name {
  color: var(--on-surface);
}

.team-current-role {
  color: color-mix(in srgb, var(--on-surface-variant) 76%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.2;
  text-align: left;
}

.team-current-role:empty {
  display: none;
}

.team-meta {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  align-items: end;
  gap: 6px;
}

.panel h1,
.panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.muted {
  color: var(--on-surface-variant);
}

.form-stack {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--on-surface-variant);
  font-size: 13px;
}

fieldset {
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  color: var(--on-surface-variant);
  font-size: 13px;
  margin-bottom: 8px;
  padding: 0;
}

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  background: var(--surface-lowest);
  color: var(--on-surface);
  padding: 7px 9px;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 2px solid color-mix(in srgb, var(--primary) 28%, transparent);
}

input[readonly] {
  color: var(--on-surface-variant);
  cursor: default;
}

.digit-inputs {
  display: grid;
  grid-template-columns: repeat(6, 42px);
  gap: 8px;
}

.digit-input {
  height: 44px;
  padding: 0;
  text-align: center;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
}


.button-row {
  flex-wrap: wrap;
  gap: 8px;
}

.otp-group {
  margin: 0;
  border: 0;
  padding: 0;
}

.otp-group legend {
  margin-bottom: 6px;
  color: var(--on-surface-variant);
  font-size: 13px;
}

.otp-row {
  gap: 8px;
}

.otp-input {
  width: 44px;
  min-height: 48px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
}

.primary,
.secondary {
  min-height: 34px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  padding: 7px 12px;
}

.primary {
  background: var(--primary);
  color: var(--surface-lowest);
  font-weight: 700;
}

.secondary {
  background: var(--surface-container);
  color: var(--on-surface);
}

.secondary.is-active {
  border-color: var(--primary);
  color: var(--primary);
}

.secondary .material-symbols-outlined {
  margin-right: 6px;
  font-size: 18px;
}

.dossier-download-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.danger-action {
  background: var(--error);
  color: var(--surface-lowest);
}

.local-toolbar {
  height: 56px;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  padding: 0 16px;
}

.jow-preview-popover {
  position: fixed;
  z-index: 35;
  top: 52px;
  left: 112px;
  display: grid;
  width: min(680px, calc(100vw - 32px));
  min-height: 108px;
  gap: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  padding: 12px 16px;
}

.jow-preview-popover h2,
.jow-preview-popover p {
  margin: 0;
}

.jow-preview-popover--auth {
  width: min(860px, calc(100vw - 32px));
  gap: 8px;
  padding: 8px;
}

.provenance-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.provenance-badge--jow {
  --jow-badge-color: var(--primary);
  border: 0;
}

.provenance-badge.jow-badge-mini {
  min-height: 20px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--jow-badge-color);
  color: var(--surface-lowest);
  font-size: 12px;
  font-weight: 900;
  line-height: 16px;
  flex: 0 0 auto;
  margin-top: -4px;
  vertical-align: top;
}

.provenance-badge--local {
  color: var(--on-surface-variant);
}

.panel-eyebrow,
.jow-preview-status,
.jow-login-flow {
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 16px;
}

.jow-preview-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jow-system-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 16px;
}

.jow-preview-status span {
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  padding: 4px 8px;
}

.jow-system-summary span {
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-container));
  padding: 4px 8px;
}

.jow-popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jow-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.jow-action-group > span {
  color: var(--on-surface-variant);
  flex: 0 0 64px;
  font-size: 12px;
  line-height: 16px;
}

.jow-action-group--demo {
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.jow-login-flow {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.jow-login-flow span {
  color: color-mix(in srgb, var(--on-surface-variant) 68%, transparent);
}

.jow-auth-view {
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #101112;
}

.jow-auth-frame {
  display: block;
  width: 100%;
  height: min(620px, calc(100vh - 124px));
  border: 0;
}

.jow-auth-fallback {
  border-top: 1px solid var(--border-subtle);
  padding: 8px 10px;
}

.jow-auth-fallback a {
  color: var(--primary);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.jow-auth-starting {
  display: grid;
  gap: 10px;
  padding: 10px 8px 6px;
}

.jow-auth-actions {
  display: flex;
  justify-content: flex-end;
}

.jow-native-session {
  border: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  padding: 14px;
}

.jow-native-session h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.toolbar-left,
.toolbar-right {
  gap: 16px;
  min-width: 0;
}

.toolbar-title {
  margin: 0;
  color: var(--on-surface);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.toolbar-subtitle {
  color: var(--on-surface-variant);
  margin: 2px 0 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 16px;
}

.toolbar-filter {
  position: relative;
  display: flex;
  width: 228px;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  background: var(--surface-container);
  color: var(--on-surface-variant);
  padding: 0 32px 0 10px;
  font-size: 13px;
  cursor: pointer;
}

.toolbar-filter select {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  width: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.toolbar-filter .material-symbols-outlined {
  position: absolute;
  right: 9px;
  font-size: 18px;
  pointer-events: none;
}

.toolbar-search-wrap {
  position: relative;
  display: block;
  flex: 0 1 432px;
  width: clamp(240px, 28vw, 432px);
}

.admin-search {
  width: 100%;
  margin: 0 0 12px;
}

.toolbar-search-wrap .material-symbols-outlined {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--on-surface-variant);
  transform: translateY(-50%);
}

.toolbar-search {
  padding-left: 40px;
}

.dossier-controls {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  padding: 0 16px;
}

.new-dossier {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 144px;
  justify-content: center;
}

.toolbar-icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  color: var(--on-surface-variant);
  cursor: pointer;
}

.toolbar-icon-button:hover,
.toolbar-icon-button:focus-visible,
.toolbar-icon-button.is-active {
  border-color: var(--primary);
  color: var(--primary);
}

.toolbar-icon-button.primary-icon {
  background: var(--primary-fixed-dim);
  color: var(--surface-lowest);
}

.table-wrap {
  height: calc(100vh - 104px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface-lowest);
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 52px;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sort-header {
  display: inline-flex;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  padding: 0;
  text-align: inherit;
  text-transform: inherit;
}

.sort-header span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-icon {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 16px;
  opacity: 0;
  transition: opacity 140ms ease;
}

th:hover .sort-icon,
.sort-header:focus-visible .sort-icon,
.sort-header.is-sorted .sort-icon {
  opacity: 1;
}

.sort-header.is-sorted {
  color: var(--on-surface);
  font-weight: 800;
}

td {
  height: 60px;
}

.dossier-table th:nth-child(1),
.dossier-table td:nth-child(1) {
  width: 23%;
  padding-left: 16px;
}

.dossier-table th:nth-child(2),
.dossier-table td:nth-child(2) {
  width: 18%;
}

.dossier-table th:nth-child(3),
.dossier-table td:nth-child(3) {
  width: 35%;
}

.dossier-table th:nth-child(4),
.dossier-table td:nth-child(4) {
  width: 13%;
  text-align: left;
}

.dossier-table th:nth-child(5),
.dossier-table td:nth-child(5) {
  width: 11%;
  padding-right: 16px;
}

.dossier-table--admin th:nth-child(1),
.dossier-table--admin td:nth-child(1) {
  width: 23%;
}

.dossier-table--admin th:nth-child(2),
.dossier-table--admin td:nth-child(2) {
  width: 18%;
}

.dossier-table--admin th:nth-child(3),
.dossier-table--admin td:nth-child(3) {
  width: 35%;
}

.dossier-table--admin th:nth-child(4),
.dossier-table--admin td:nth-child(4) {
  width: 13%;
  text-align: left;
}

.dossier-table--admin th:nth-child(5),
.dossier-table--admin td:nth-child(5) {
  width: 11%;
  padding-right: 16px;
}

tbody tr {
  background: var(--surface-lowest);
}

tbody tr:hover td {
  background: var(--row-hover);
}

.dossier-row--openable {
  cursor: pointer;
}

.dossier-row--openable:hover .dossier-name,
.dossier-row--openable:focus-visible .dossier-name {
  color: var(--primary);
}

.dossier-row--skeleton td {
  color: color-mix(in srgb, var(--on-surface) 72%, transparent);
}

.dossier-row--structure-ready td {
  color: var(--on-surface);
}

.dossier-row--attention td {
  color: color-mix(in srgb, var(--attention) 78%, var(--on-surface));
}

.dossier-row--skeleton .dossier-ref {
  opacity: 0.72;
}

.dossier-name,
.dossier-summary,
.dossier-ref {
  display: block;
}

.dossier-name {
  color: var(--on-surface);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
}

.dossier-title {
  display: flex;
  max-width: 100%;
  align-items: flex-start;
  gap: 6px;
}

.dossier-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dossier-name--skeleton {
  color: color-mix(in srgb, var(--on-surface) 72%, transparent);
  font-size: 15px;
  font-weight: 600;
}

.dossier-name--structure-ready {
  font-weight: 700;
}

.dossier-name--ai-ready {
  font-weight: 800;
}

.dossier-ref,
.meta-cell {
  color: color-mix(in srgb, var(--on-surface-variant) 72%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 16px;
}

.dossier-table td[data-cell="status"] {
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 14px;
}

.status-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.status-text {
  display: inline-block;
  color: var(--on-surface);
  font-weight: 700;
  line-height: 18px;
}

.status-detail,
.status-next {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-detail {
  color: var(--on-surface);
  font-family: "Source Serif Four", Georgia, serif;
  font-size: 14px;
  line-height: 18px;
}

.status-next {
  color: color-mix(in srgb, var(--on-surface-variant) 78%, transparent);
  font-size: 12px;
  line-height: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-color: var(--surface-variant);
  background: var(--surface-container);
  letter-spacing: 0;
  text-transform: none;
}

.status-ok {
  color: var(--on-surface);
}

.status-warn {
  border-color: color-mix(in srgb, var(--attention) 75%, var(--border-subtle));
  color: var(--attention);
}

.status-danger {
  border-color: color-mix(in srgb, var(--error) 75%, var(--border-subtle));
  color: var(--error);
}

.loader-strip {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-container-high) 88%, var(--surface-variant));
}

.loader-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.loader-type-1 .loader-activity {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0 22%, color-mix(in srgb, var(--on-surface-variant) 26%, transparent) 50%, transparent 78%),
    color-mix(in srgb, var(--on-surface-variant) 12%, var(--surface-container-high));
  background-size: 220% 100%, 100% 100%;
  animation: loader-type-1 2.4s ease-in-out infinite;
}

.loader-type-1 {
  height: 3px;
  opacity: 0.82;
}

.loader-type-2 .loader-fill {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 35%, rgba(255, 255, 255, 0.1) 55%, transparent 70%),
    linear-gradient(90deg, color-mix(in srgb, var(--primary-fixed-dim) 42%, var(--surface-container-high)), color-mix(in srgb, var(--primary) 54%, var(--surface-container-high)));
  animation: loader-type-2 1.8s linear infinite;
}

.loader-type-static .loader-fill {
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary-fixed-dim) 42%, var(--surface-container-high)), color-mix(in srgb, var(--primary) 54%, var(--surface-container-high)));
}

.loader-type-3 .loader-activity {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 32%, rgba(255, 255, 255, 0.1) 58%, transparent 76%),
    linear-gradient(90deg, var(--primary-fixed-dim), var(--primary));
  box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 42%, transparent);
  animation: loader-type-3 1.6s linear infinite;
}

@keyframes loader-type-1 {
  from {
    background-position: 180% 0, 0 0;
  }

  to {
    background-position: -80% 0, 0 0;
  }
}

@keyframes loader-type-2 {
  from {
    background-position: -24px 0, 0 0;
  }

  to {
    background-position: 80px 0, 0 0;
  }
}

@keyframes loader-type-3 {
  from {
    transform: translateX(-120%);
    background-position: -30px 0, 0 0;
  }

  to {
    transform: translateX(260%);
    background-position: 100px 0, 0 0;
  }
}

.action-cell {
  position: relative;
  overflow: visible;
  text-align: right;
}

.row-actions {
  position: relative;
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.row-action-primary,
.row-menu-trigger,
.row-menu-item {
  border-radius: 2px;
}

.row-action-primary:hover,
.row-action-primary:focus-visible,
.row-menu-trigger:hover,
.row-menu-trigger:focus-visible,
.row-menu-item:hover,
.row-menu-item:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.row-action-primary {
  display: inline-flex;
  min-width: 150px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-container-low);
  color: var(--on-surface);
  cursor: pointer;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.row-action-primary .material-symbols-outlined,
.row-menu-item .material-symbols-outlined {
  font-size: 18px;
}

.row-action-primary--disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.row-menu {
  position: relative;
  overflow: visible;
}

.row-menu[open] {
  z-index: 30;
}

.row-menu summary {
  list-style: none;
}

.row-menu summary::-webkit-details-marker {
  display: none;
}

.row-menu-trigger {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  color: var(--on-surface);
  cursor: pointer;
}

.row-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  display: grid;
  min-width: 226px;
  gap: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  padding: 6px;
}

.row-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--on-surface);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

tr:hover .row-actions,
tr:focus-within .row-actions {
  opacity: 1;
}

.shell-notice {
  margin: 16px 16px 0;
}

.breadcrumb-row {
  display: flex;
  height: 28px;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--on-surface-variant);
  padding: 0 16px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.breadcrumb-link {
  border: 0;
  background: transparent;
  color: var(--on-surface);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-transform: inherit;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus-visible {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-row .material-symbols-outlined {
  color: color-mix(in srgb, var(--on-surface-variant) 45%, transparent);
  font-size: 16px;
}

.dossier-identity {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  padding: 16px;
}

.identity-left,
.identity-summary {
  display: grid;
  gap: 6px;
}

.identity-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity-title-row h1 {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
}

.identity-meta,
.identity-preview {
  margin: 0;
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.identity-preview {
  color: color-mix(in srgb, var(--attention) 82%, var(--on-surface-variant));
  text-transform: none;
}

.identity-summary {
  justify-items: end;
  text-align: right;
}

.identity-summary p {
  margin: 0;
}

.identity-summary p:last-child {
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
}

@keyframes processing-line-sweep-left-to-right {
  from {
    background-position: 140% 0, 0 0;
  }

  to {
    background-position: -140% 0, 0 0;
  }
}

@keyframes processing-row-lines-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 var(--processing-line-soft),
      inset 0 -1px 0 var(--processing-line-soft);
  }

  50% {
    box-shadow:
      inset 0 1px 0 var(--processing-line-strong),
      inset 0 -1px 0 var(--processing-line-strong);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dossier-row--processing-active,
  .structure-row--processing-active,
  .dossier-row--processing-active td,
  .structure-row--processing-active td {
    animation: none;
  }
}

.structure-toolbar {
  height: 48px;
  border-top: 0;
  background: var(--surface-container);
}

.structure-toolbar .toolbar-search-wrap {
  flex-basis: 420px;
}

.structure-toolbar .primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dossier-workbench {
  background: var(--surface-lowest);
}

.processing-panel {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-container) 78%, var(--surface-lowest));
  padding: 12px 16px;
}

.processing-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.processing-panel-header .material-symbols-outlined {
  color: var(--primary);
  font-size: 22px;
}

.processing-panel-header div {
  display: grid;
  gap: 2px;
}

.processing-panel-header strong {
  color: var(--on-surface);
  font-size: 14px;
  font-weight: 700;
}

.processing-panel-header span:not(.material-symbols-outlined),
.processing-panel-meta {
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.processing-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-container-high) 88%, var(--surface-variant));
}

.processing-progress span {
  display: block;
  height: 100%;
  min-width: 5%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 64%, var(--attention)));
}

.processing-panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.processing-panel--failed .processing-panel-header .material-symbols-outlined,
.processing-panel--failed .processing-panel-header strong {
  color: var(--error);
}

.processing-panel--completed .processing-panel-header .material-symbols-outlined,
.processing-panel--completed .processing-panel-header strong {
  color: var(--primary);
}

.processing-panel--interrupted {
  border-bottom-color: color-mix(in srgb, var(--attention) 42%, var(--border-subtle));
}

.processing-panel--interrupted .processing-panel-header .material-symbols-outlined,
.processing-panel--interrupted .processing-panel-header strong {
  color: color-mix(in srgb, var(--attention) 74%, var(--on-surface));
}

.structure-table-wrap {
  position: relative;
  height: calc(100vh - 152px);
}

.structure-table {
  margin-bottom: 56px;
}

.structure-large-note {
  display: flex;
  min-height: 36px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  color: var(--on-surface-variant);
  font-size: 13px;
  padding: 0 16px;
}

.structure-table th {
  height: 40px;
  letter-spacing: 0;
  text-transform: none;
}

.structure-table-wrap--processing::after {
  --processing-sweep-duration: 5s;
  content: "";
  position: absolute;
  z-index: 4;
  top: 39px;
  left: 0;
  right: 0;
  height: 2px;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 42%, var(--processing-sweep-head) 50%, transparent 58%),
    var(--processing-sweep-track);
  background-repeat: no-repeat, repeat;
  background-size: 240% 100%, 100% 100%;
  box-shadow: 0 0 4px var(--processing-line-glow);
  animation: processing-line-sweep-left-to-right var(--processing-sweep-duration) linear infinite;
  will-change: background-position;
}

.structure-table th:nth-child(1),
.structure-table td:nth-child(1) {
  width: 30%;
  padding-left: 16px;
}

.structure-table th:nth-child(2),
.structure-table td:nth-child(2) {
  width: 9%;
}

.structure-table th:nth-child(3),
.structure-table td:nth-child(3),
.structure-table th:nth-child(4),
.structure-table td:nth-child(4),
.structure-table th:nth-child(5),
.structure-table td:nth-child(5),
.structure-table th:nth-child(6),
.structure-table td:nth-child(6) {
  width: 11%;
}

.structure-table th:nth-child(7),
.structure-table td:nth-child(7) {
  width: 12%;
}

.structure-table th:nth-child(8),
.structure-table td:nth-child(8) {
  width: 5%;
  padding-right: 16px;
  text-align: right;
}

.structure-row td {
  height: 40px;
  color: var(--on-surface-variant);
  font-size: 13px;
}

.dossier-row--processing-active,
.structure-row--processing-active {
  background: var(--processing-row-bg);
}

.dossier-row--processing-active td,
.structure-row--processing-active td {
  background: var(--processing-row-bg);
  animation: processing-row-lines-pulse 3.2s ease-in-out infinite;
}

.structure-name-cell {
  overflow: visible;
}

.tree-cell {
  --tree-depth: 0;
  position: relative;
  display: flex;
  min-width: 0;
  height: 40px;
  align-items: center;
  gap: 8px;
  padding-left: calc(var(--tree-depth) * 24px);
}

.tree-kind-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.tree-kind-button:hover .tree-kind,
.tree-kind-button:focus-visible .tree-kind {
  color: var(--primary);
}

.tree-kind-button:focus-visible {
  outline: 1px solid var(--primary);
  outline-offset: 2px;
}

.tree-kind {
  flex: 0 0 auto;
  color: var(--on-surface-variant);
  font-size: 18px;
}

.tree-kind--folder {
  color: var(--on-surface);
}

.tree-kind--document {
  color: color-mix(in srgb, var(--on-surface-variant) 84%, transparent);
}

.tree-kind--page {
  color: color-mix(in srgb, var(--on-surface-variant) 56%, transparent);
  font-size: 16px;
}

.tree-kind--attention {
  color: var(--attention);
}

.tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-count {
  color: color-mix(in srgb, var(--on-surface-variant) 62%, transparent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.structure-row--folder .tree-label {
  color: var(--on-surface);
  font-size: 15px;
  font-weight: 800;
}

.structure-row--document .tree-label {
  color: var(--on-surface);
  font-family: "Source Serif Four", Georgia, serif;
  font-size: 14px;
}

.structure-row--page .tree-label {
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.structure-row--attention {
  background: color-mix(in srgb, var(--attention) 8%, var(--surface-lowest));
  box-shadow: inset 2px 0 0 var(--attention);
}

.structure-row--jow-blocker,
.structure-row--jow-delta {
  background: color-mix(in srgb, var(--attention) 8%, var(--surface-lowest));
  box-shadow: inset 2px 0 0 var(--attention);
}

.structure-row--attention td,
.structure-row--attention .tree-label,
.structure-row--jow-blocker td,
.structure-row--jow-blocker .tree-label,
.structure-row--jow-delta td,
.structure-row--jow-delta .tree-label {
  color: var(--attention);
}

.structure-action-cell {
  overflow: visible;
}

.structure-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.structure-row:hover .structure-actions,
.structure-row:focus-within .structure-actions {
  opacity: 1;
}

.structure-action {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.structure-action:hover,
.structure-action:focus-visible {
  color: var(--primary);
}

.structure-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.structure-action .material-symbols-outlined {
  font-size: 18px;
}

.upload-progress {
  display: grid;
  gap: 8px;
}

.upload-progress-label {
  color: var(--on-surface-variant);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.empty-row {
  color: var(--on-surface-variant);
  font-style: italic;
  text-align: center;
}

.notice {
  border-left: 3px solid var(--primary);
  background: var(--surface-container);
  color: var(--on-surface-variant);
  margin-top: 12px;
  padding: 9px 11px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(320px, 1fr);
  gap: 16px;
  padding: 16px;
}

.settings-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.settings-detail-list div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.settings-detail-list dt {
  color: var(--on-surface-variant);
  font-size: 13px;
}

.settings-detail-list dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-section {
  display: grid;
  gap: 11px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.settings-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.settings-section h2 {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
}

.admin-toolbar {
  border-bottom-color: color-mix(in srgb, var(--attention) 55%, var(--border-subtle));
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: calc(100vh - 104px);
  gap: 16px;
  overflow: hidden;
  padding: 16px;
}

.panel-header,
.admin-stats,
.event-head {
  display: flex;
  gap: 8px;
}

.panel-header,
.event-head {
  align-items: flex-start;
  justify-content: space-between;
}

.panel-header {
  margin-bottom: 16px;
}

.admin-stats {
  align-items: center;
  flex-wrap: wrap;
}

.stacked-panels {
  display: grid;
  gap: 16px;
  align-content: start;
}

.admin-zone {
  border-color: color-mix(in srgb, var(--attention) 45%, var(--border-subtle));
}

.admin-list-panel,
.admin-side-panel {
  min-height: 0;
}

.admin-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-side-panel {
  max-height: calc(100vh - 136px);
  overflow-y: auto;
}

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

body[data-route="setup"] .setup-password-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-route="setup"] .setup-password-hint {
  margin: -3px 0 0;
  font-size: 12px;
}

body[data-route="setup"] .setup-button-row {
  justify-content: center;
}

.compact-table table {
  min-width: 760px;
}

.admin-table-wrap {
  border-top: 1px solid var(--border-subtle);
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

.admin-table-wrap table {
  min-width: 0;
}

.evidence-table-wrap {
  max-height: 220px;
}

.evidence-table-wrap table,
.admin-log-table-wrap table {
  min-width: 0;
}

.admin-log-panel {
  margin: 16px;
  min-height: 0;
}

.admin-log-table-wrap {
  height: calc(100vh - 168px);
}

.admin-detail-panel {
  max-height: 100%;
  overflow-y: auto;
}

.profile-preview {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
}

.selected-row td {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-panel));
}

.page-notice {
  margin-bottom: 0;
}

.subpanel {
  margin-top: 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.subpanel h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.subpanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subpanel-head h3 {
  margin: 0;
}

.whatsapp-delivery-card {
  border-top-color: color-mix(in srgb, var(--primary) 45%, var(--border-subtle));
}

.delivery-detail {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.delivery-detail p {
  margin: 0;
}

.delivery-status {
  border: 1px solid var(--border-subtle);
  color: var(--on-surface);
  background: color-mix(in srgb, var(--surface-panel) 78%, var(--primary) 22%);
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
}

.pairing-code {
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 0;
  padding: 12px 14px;
}

.pairing-code strong {
  display: inline-flex;
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.event-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  padding: 10px 12px;
}

.event-list li span {
  display: block;
  margin-top: 4px;
}

.event-list time {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-content: center;
  text-align: center;
  margin-top: 12px;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 16px;
  bottom: 16px;
  width: min(520px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--primary);
  background: var(--surface-panel);
  color: var(--on-surface);
  margin: 0;
  padding: 10px 8px 10px 12px;
  pointer-events: auto;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.toast-message {
  min-width: 0;
}

.toast-close {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
}

.toast-close:hover,
.toast-close:focus-visible {
  border-color: var(--border-subtle);
  background: var(--surface-low);
  color: var(--on-surface);
}

.toast-close .material-symbols-outlined {
  font-size: 18px;
}

.modal-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.46);
  padding: 16px;
}

.modal-panel {
  width: min(460px, 100%);
  border: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  padding: 16px;
}

.modal-panel--wide {
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.new-dossier-form {
  gap: 12px;
}

.new-dossier-manager-field {
  display: grid;
  gap: 6px;
  color: var(--on-surface-variant);
  font-size: 13px;
}

.owner-picker,
.team-picker {
  position: relative;
}

.owner-picker-selected,
.owner-picker-option,
.team-picker-selected {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-lowest);
  color: var(--on-surface);
  padding: 7px 9px;
  text-align: left;
}

.owner-picker-selected {
  min-height: 38px;
  cursor: pointer;
  list-style: none;
}

.team-picker-selected {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 38px;
  cursor: pointer;
  list-style: none;
}

.owner-picker-selected::-webkit-details-marker,
.team-picker-selected::-webkit-details-marker {
  display: none;
}

.owner-picker-selected > span:not(.material-symbols-outlined),
.owner-picker-option span,
.team-picker-selected > span:not(.material-symbols-outlined) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.owner-picker-selected strong,
.owner-picker-option strong,
.team-picker-selected strong {
  overflow: hidden;
  color: var(--on-surface);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-picker-selected small,
.owner-picker-option small,
.team-picker-selected small {
  overflow: hidden;
  color: var(--on-surface-variant);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-picker-menu,
.team-picker-menu {
  position: absolute;
  z-index: 4;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.team-picker-menu {
  position: static;
  max-height: 178px;
  margin-top: 4px;
  padding: 6px;
  box-shadow: none;
}

.owner-picker-option {
  grid-template-columns: auto minmax(0, 1fr);
  border-width: 0 0 1px;
  cursor: pointer;
}

.owner-picker-option:last-child {
  border-bottom: 0;
}

.owner-picker-option:hover,
.owner-picker-option.is-selected {
  background: var(--surface-container);
}

.owner-picker .avatar-chip,
.owner-picker .avatar-preview {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 999px;
  font-size: 10px;
}

.team-picker .user-check-list {
  gap: 4px;
}

.team-picker .user-check {
  grid-template-columns: 18px auto minmax(0, 1fr);
  min-height: 46px;
  background: var(--surface-lowest);
  padding: 6px 8px;
}

.team-picker .user-check input[type="checkbox"] {
  margin: 0;
}

.team-picker .user-check .avatar-chip,
.team-picker .user-check .avatar-preview {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}

.toggle-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  padding: 10px;
}

.toggle-row input[type="checkbox"],
.user-check input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  padding: 0;
}

.toggle-row span,
.user-check span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.toggle-row strong,
.user-check strong {
  color: var(--on-surface);
  font-size: 13px;
  line-height: 1.2;
}

.toggle-row small,
.user-check small {
  color: var(--on-surface-variant);
  font-size: 12px;
  line-height: 1.25;
}

.new-dossier-team {
  display: grid;
  gap: 8px;
}

.user-check-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.user-check {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  padding: 8px;
}

.user-check.is-disabled {
  opacity: 0.58;
}

.user-check .avatar-chip,
.user-check .avatar-preview {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 999px;
  font-size: 10px;
}

.event-item {
  border: 1px solid var(--border-subtle);
  background: var(--surface-container);
  padding: 10px 12px;
}

.event-item p {
  margin: 8px 0 0;
}

@media (max-width: 820px) {
  .global-header {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    min-height: 76px;
    padding: 8px 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .app-shell {
    padding-top: 76px;
  }

  .user-check-list {
    grid-template-columns: 1fr;
  }

  .auth-layout,
  .settings-grid,
  .admin-grid,
  .split-fields {
    grid-template-columns: 1fr;
  }

  .local-toolbar {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    padding: 10px 12px;
  }

  .dossier-controls {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    padding: 12px;
  }

  .toolbar-left,
  .toolbar-right {
    justify-content: space-between;
    width: 100%;
  }

  .toolbar-search-wrap {
    width: min(100%, 320px);
  }
}
