:root {
  --admin-font-size: 16px;

  --admin-background: #2a2a2a;
  --admin-foreground: #fafafa;

  --admin-card: #323232;
  --admin-card-foreground: #fafafa;

  --admin-muted-foreground: #a1a1aa;

  --admin-border: #4f4f4f;
  --admin-input-background: #4f4f4f;
  --admin-ring: rgba(255, 255, 255, 0.18);

  --admin-sidebar-bg: oklch(0.135 0.007 188);
  --admin-sidebar-hover-bg: oklch(0.18 0.009 188);
  --admin-sidebar-active-bg: oklch(0.255 0.022 188);
  --admin-sidebar-border: oklch(0.21 0.007 188);
  --admin-sidebar-muted: oklch(0.56 0.012 188);
  --admin-sidebar-avatar-bg: oklch(0.22 0.028 188);
  --admin-sidebar-danger: oklch(0.66 0.17 25);

  --admin-hover: rgba(255, 255, 255, 0.06);
  --admin-active: rgba(255, 255, 255, 0.1);

  --admin-accent: #19e6c0;
  --admin-accent-hover: #14ccaa;
  --admin-accent-subtle: rgba(25, 230, 192, 0.08);
  --admin-accent-border: rgba(25, 230, 192, 0.25);
  --admin-accent-text: #19e6c0;
  --admin-on-accent: #0b0c0e;

  --admin-score-good: #34d399;
  --admin-score-good-subtle: rgba(52, 211, 153, 0.12);
  --admin-score-good-border: rgba(52, 211, 153, 0.3);

  --admin-score-mid: #fbbf24;
  --admin-score-mid-subtle: rgba(251, 191, 36, 0.12);
  --admin-score-mid-border: rgba(251, 191, 36, 0.3);

  --admin-score-low: #f87171;
  --admin-score-low-subtle: rgba(248, 113, 113, 0.12);
  --admin-score-low-border: rgba(248, 113, 113, 0.35);

  --admin-muted: rgba(255, 255, 255, 0.04);

  --admin-radius: 0.625rem;

  --admin-font-weight-normal: 400;
  --admin-font-weight-medium: 500;
  --admin-font-weight-semibold: 600;

  --dash-font-display: "Barlow Condensed", sans-serif;
  --dash-font-body: "Onest", ui-sans-serif, system-ui, sans-serif;
}

[data-theme="light"] {
  --admin-background: #f5f5f5;
  --admin-foreground: #111827;

  --admin-card: #ffffff;
  --admin-card-foreground: #111827;

  --admin-muted-foreground: #6b7280;

  --admin-border: #e5e7eb;
  --admin-input-background: #f3f4f6;
  --admin-ring: rgba(0, 0, 0, 0.1);

  --admin-sidebar-bg: oklch(0.985 0.003 188);
  --admin-sidebar-hover-bg: oklch(0.955 0.005 188);
  --admin-sidebar-active-bg: oklch(0.895 0.018 188);
  --admin-sidebar-border: oklch(0.885 0.006 188);
  --admin-sidebar-muted: oklch(0.52 0.016 188);
  --admin-sidebar-avatar-bg: oklch(0.92 0.02 188);
  --admin-sidebar-danger: oklch(0.56 0.19 25);

  --admin-hover: rgba(0, 0, 0, 0.04);
  --admin-active: rgba(0, 0, 0, 0.08);

  --admin-accent: #0fa892;
  --admin-accent-hover: #0d9680;
  --admin-accent-subtle: rgba(15, 168, 146, 0.08);
  --admin-accent-border: rgba(15, 168, 146, 0.25);
  --admin-accent-text: #0d9680;
  --admin-on-accent: #ffffff;

  --admin-score-good: #059669;
  --admin-score-good-subtle: rgba(5, 150, 105, 0.12);
  --admin-score-good-border: rgba(5, 150, 105, 0.3);

  --admin-score-mid: #d97706;
  --admin-score-mid-subtle: rgba(217, 119, 6, 0.12);
  --admin-score-mid-border: rgba(217, 119, 6, 0.3);

  --admin-score-low: #dc2626;
  --admin-score-low-subtle: rgba(220, 38, 38, 0.12);
  --admin-score-low-border: rgba(220, 38, 38, 0.35);
}

html {
  font-size: var(--admin-font-size);
}

body {
  margin: 0;
}

.admin-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--admin-background);
  color: var(--admin-foreground);
  font-family: var(--dash-font-body), ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
}

.admin-topbar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--admin-muted-foreground);
  font-weight: var(--admin-font-weight-medium);
}

.admin-table a,
.admin-breadcrumbs a {
  color: var(--admin-foreground);
  text-decoration: none;
}

.admin-table-action,
a.admin-table-action,
button.admin-table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  font-size: 0.8125rem;
  font-weight: var(--admin-font-weight-medium);
  font-family: inherit;
  line-height: 1.5;
  color: var(--admin-muted-foreground);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.admin-table-action:hover,
a.admin-table-action:hover,
button.admin-table-action:hover {
  color: var(--admin-foreground);
  border-color: var(--admin-foreground);
}

.admin-breadcrumb-link {
  cursor: pointer;
  color: var(--admin-muted-foreground);
  transition: color 0.15s ease;
}

.admin-breadcrumb-link:hover {
  color: var(--admin-foreground);
}

.admin-breadcrumb-sep {
  color: var(--admin-muted-foreground);
  opacity: 0.55;
  user-select: none;
}

.admin-breadcrumbs .current {
  color: var(--admin-foreground);
}

.breadcrumb-separator {
  color: var(--admin-muted-foreground);
  opacity: 0.7;
  font-size: 0.95rem;
  line-height: 1;
}

.admin-action-button {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 48px;
  padding: 0 18px;
  background: transparent;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  color: var(--admin-muted-foreground);
  font-size: 1rem;
  font-weight: var(--admin-font-weight-medium);
  line-height: 1.5;
  cursor: default;
}

.admin-action-icon {
  font-size: 0.95rem;
  opacity: 0.9;
}

.admin-divider {
  flex: 1;
  border-top: 1px solid var(--admin-border);
}

.admin-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 32px 80px;
}

.admin-header h1 {
  margin: 0;
  font-family: var(--dash-font-display);
  font-size: 2.25rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: var(--admin-foreground);
}

.admin-header h2 {
  font-family: var(--dash-font-display);
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: var(--admin-foreground);
}

.dash-page-header h2 {
  font-size: 2.5rem;
}

.admin-header {
  margin-bottom: 1.25rem;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-header p {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--admin-muted-foreground);
  font-weight: var(--admin-font-weight-normal);
}

.dash-masthead-date {
  font-size: 0.9375rem;
  color: var(--admin-muted-foreground);
  font-weight: var(--admin-font-weight-normal);
  white-space: nowrap;
}

.admin-meta-card {
  margin-top: 2rem;
}

.admin-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: var(--admin-font-weight-medium);
  color: var(--admin-muted-foreground);
}

.admin-page .form-group--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.admin-page .form-group--checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  padding: 0;
}

.required {
  color: var(--admin-score-low);
}

.form-group--error input,
.form-group--error input[type],
.form-group--error textarea,
.form-group--error .section-name-input {
  box-shadow: 0 0 0 1px var(--admin-score-low);
}

.form-group--error input:focus,
.form-group--error textarea:focus {
  box-shadow: 0 0 0 2px var(--admin-score-low);
}

.form-group-error-msg {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--admin-score-low);
}

.admin-page input,
.admin-page input[type],
.admin-page textarea,
.settings-modal input,
.settings-modal input[type],
.settings-modal textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  color: var(--admin-card-foreground);
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  line-height: 1.5;
  font-family: inherit;
  font-weight: var(--admin-font-weight-normal);
  outline: none;
}

.admin-page input::placeholder,
.settings-modal input::placeholder {
  color: var(--admin-muted-foreground);
  opacity: 1;
}

.admin-page textarea::placeholder,
.settings-modal textarea::placeholder {
  color: var(--admin-muted-foreground);
  opacity: 1;
}

.admin-page input[readonly],
.admin-page input:disabled,
.admin-page textarea:disabled,
.settings-modal input[readonly],
.settings-modal input:disabled,
.settings-modal textarea:disabled {
  background-color: var(--admin-input-background);
  opacity: 1;
  -webkit-text-fill-color: var(--admin-card-foreground);
}

.admin-page select,
.settings-modal select {
  width: 100%;
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  color: var(--admin-card-foreground);
  padding: 0.625rem 2.25rem 0.625rem 0.875rem;
  font-size: 1rem;
  line-height: 1.5;
  font-family: inherit;
  font-weight: var(--admin-font-weight-normal);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

/* Custom dropdown chevron — replaces the native select arrow so it sits
   inset from the right edge instead of flush against the border. */
.admin-select-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.admin-select-chevron {
  position: absolute;
  top: 50%;
  right: 0.875rem;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--admin-muted-foreground);
  pointer-events: none;
}

.input-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toggle switch */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
}

.settings-toggle-label {
  font-size: 1rem;
  color: var(--admin-card-foreground);
}

.settings-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--admin-muted-foreground);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s ease;
}

.settings-toggle-on {
  background: var(--admin-accent);
}

.settings-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--admin-foreground);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.settings-toggle-on .settings-toggle-knob {
  transform: translateX(20px);
  background: var(--admin-on-accent);
}
.admin-page textarea[readonly] {
  cursor: default;
}

.admin-page h2 {
  margin: 0;
}

/* Script name above panels */
.template-name-field {
  margin-bottom: 1.5rem;
}

.template-nav-no-top {
  margin-top: 0;
}

/* Two-panel layout */
.template-panels {
  display: flex;
  gap: 32px;
}

.template-panel-left {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

.template-panel-right {
  flex: 1;
  min-width: 0;
}

/* Section nav */
.section-nav {
  margin-top: 24px;
}

.admin-section-card {
  margin-top: 0;
  overflow: hidden;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) + 4px);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.admin-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--admin-muted-foreground);
  font-size: 0.8125rem;
  pointer-events: none;
  transition: color 0.15s ease;
}

.admin-search:focus-within .admin-search-icon {
  color: var(--admin-foreground);
}

.admin-page input.admin-search-input,
.admin-page input[type].admin-search-input {
  flex: 1;
  width: 100%;
  height: 2.25rem;
  padding: 0 2.25rem;
  font-size: 0.875rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.admin-page input.admin-search-input:focus,
.admin-page input[type].admin-search-input:focus {
  border-color: var(--admin-foreground);
  box-shadow: 0 0 0 3px var(--admin-ring);
}

.admin-search-clear {
  position: absolute;
  right: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--admin-muted-foreground);
  cursor: pointer;
  border-radius: 999px;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.admin-search-clear:hover {
  color: var(--admin-foreground);
  background-color: var(--admin-hover);
}

.admin-search-clear:focus-visible {
  outline: none;
  color: var(--admin-foreground);
  box-shadow: 0 0 0 2px var(--admin-ring);
}

.admin-section-body {
  padding: 18px;
}

.admin-section-card .dash-empty-state {
  padding: 32px 24px;
}

.admin-section-card .dash-empty-icon {
  font-size: 1.5rem;
  color: var(--admin-muted-foreground);
}

.admin-section-card .dash-empty-sub {
  margin-bottom: 14px;
}

.new-section-card {
  margin-top: 1rem;
  overflow: hidden;
  text-align: center;
  background: var(--admin-card);
  border: 1px dashed var(--admin-border);
  border-radius: calc(var(--admin-radius) + 4px);
  padding: 10px;
  border-color: var(--admin-accent-border);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.new-section-card:hover {
  color: #19e6c0b3;
  background-color: #19e6c024;
  border-color: #19e6c04d;
}

.section-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 4px;
}

.section-nav-title {
  font-family: var(--dash-font-display);
  font-size: 0.75rem;
  font-weight: var(--admin-font-weight-semibold);
  color: var(--admin-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-nav-item {
  display: flex;
  align-items: center;
  border-radius: calc(var(--admin-radius) - 2px);
  transition: background-color 0.15s ease;
}

.section-nav-item:hover {
  background: var(--admin-hover);
}

.section-nav-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: none;
  border: none;
  color: var(--admin-foreground);
  font-size: 0.875rem;
  font-weight: var(--admin-font-weight-medium);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.section-nav-item-btn:focus-visible {
  outline: 2px solid var(--admin-ring);
  outline-offset: -2px;
  border-radius: calc(var(--admin-radius) - 2px);
}

.section-nav-delete {
  padding: 8px;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease;
}

.section-nav-item:hover .section-nav-delete {
  opacity: 1;
}

.section-nav-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Section groups & dividers */
.section-group {
  margin-top: 1.5rem;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) + 4px);
  padding: 18px;
}

.section-group:first-child {
  margin-top: 0;
}

.section-divider {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

.section-number {
  font-family: var(--dash-font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--admin-muted-foreground);
  line-height: 1;
  padding-top: 0.125rem;
  flex-shrink: 0;
  user-select: none;
}

.section-divider .form-group {
  flex: 1;
  min-width: 0;
}

.section-name-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  color: var(--admin-foreground);
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  font-weight: var(--admin-font-weight-normal);
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  transition: box-shadow 0.15s ease;
}

.section-name-input::placeholder {
  color: var(--admin-muted-foreground);
}

.section-name-input:focus {
  box-shadow: 0 0 0 1px var(--admin-ring);
}

.admin-section-card--mt {
  margin-top: 2rem;
}

.input-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.text-muted-no-margin {
  color: var(--admin-muted-foreground);
  margin: 0;
}

.admin-section-body--min-height {
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.admin-section-body--table {
  padding: 0;
}

.admin-section-body--table .admin-pagination {
  padding: 12px 18px 16px;
}

.admin-section-body--min-height .admin-pagination {
  margin-top: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--dash-font-display);
  font-size: 0.8125rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.06em;
  color: var(--admin-muted-foreground);
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table th:last-child,
.admin-table td:last-child {
  text-align: right;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr {
  transition: background-color 0.12s ease;
}

.admin-table tbody tr:hover {
  background: var(--admin-hover);
}

.admin-table-row--clickable {
  cursor: pointer;
}

.question-count {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--admin-muted-foreground);
  font-weight: var(--admin-font-weight-normal);
  white-space: nowrap;
}

.icon-button {
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  color: var(--admin-muted-foreground);
  font-size: 1rem;
  line-height: 1;
  user-select: none;
  cursor: pointer;
  transition:
    color 0.15s ease,
    filter 0.15s ease;
}

.icon-button:hover {
  color: var(--admin-score-low);
}

.icon-button:focus-visible {
  outline: 2px solid var(--admin-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Question accordion */
.question-list {
  display: flex;
  flex-direction: column;
}

.question-accordion {
  border-bottom: 1px solid var(--admin-border);
}

.question-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.question-accordion-header:hover {
  background: rgba(255, 255, 255, 0.09);
}

.question-accordion-header:focus-visible {
  outline: 2px solid var(--admin-ring);
  outline-offset: -2px;
}

.question-accordion-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.question-chevron {
  font-size: 0.8rem;
  color: var(--admin-muted-foreground);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.question-chevron-open {
  transform: rotate(90deg);
}

.question-index {
  font-family: var(--dash-font-display);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--admin-muted-foreground);
  font-weight: var(--admin-font-weight-semibold);
  flex-shrink: 0;
}

.question-preview {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--admin-muted-foreground);
  font-weight: var(--admin-font-weight-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-preview--filled {
  color: var(--admin-foreground);
}

.question-preview--error {
  color: var(--admin-score-low);
}

.question-accordion-body {
  padding: 4px 8px 16px 26px;
  animation: accordion-open 0.18s ease-out both;
}

@keyframes accordion-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-accordion-body textarea {
  min-height: 96px;
  resize: none;
}

/* Script template show — document layout */
.dash-stats-row.script-show-stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 24px;
}

@media (max-width: 960px) {
  .dash-stats-row.script-show-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .dash-stats-row.script-show-stats {
    grid-template-columns: 1fr;
  }
}

.script-show-score-denominator {
  font-size: 0.75em;
  font-weight: var(--admin-font-weight-normal);
  color: var(--admin-muted-foreground);
  margin-left: 2px;
}

.script-show-doc {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.script-show-section {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 24px 28px;
}

.script-show-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--admin-border);
}

.script-show-section-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.script-show-section-eyebrow {
  font-family: var(--dash-font-display);
  font-size: 0.75rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-muted-foreground);
}

.script-show-section-title {
  margin: 0;
  font-family: var(--dash-font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--admin-foreground);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.script-show-metric-group {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}

.script-show-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.script-show-metric-label {
  font-size: 0.75rem;
  color: var(--admin-muted-foreground);
}

.script-show-metric-value {
  font-family: var(--dash-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-foreground);
  line-height: 1.2;
}

.script-show-question-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.script-show-question {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.script-show-question-lead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.script-show-question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.script-show-question--excluded .script-show-question-body,
.script-show-question--excluded .script-show-ideal {
  opacity: 0.55;
}

.script-show-exclude-btn {
  font-size: 0.75rem;
  font-weight: var(--admin-font-weight-medium);
  color: var(--admin-muted-foreground);
  background: transparent;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.script-show-exclude-btn:hover:not(:disabled) {
  color: var(--admin-foreground);
  border-color: var(--admin-foreground);
}

.script-show-exclude-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.script-show-question-number {
  color: var(--admin-muted-foreground);
  font-weight: var(--admin-font-weight-semibold);
  margin-right: 2px;
}

.script-show-chip {
  font-size: 0.75rem;
  font-weight: var(--admin-font-weight-medium);
  color: var(--admin-foreground);
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.script-show-chip--muted {
  color: var(--admin-muted-foreground);
}

.script-show-chip--high {
  color: var(--admin-score-good);
  background: var(--admin-score-good-subtle);
  border-color: var(--admin-score-good-border);
}

.script-show-chip--mid {
  color: var(--admin-score-mid);
  background: var(--admin-score-mid-subtle);
  border-color: var(--admin-score-mid-border);
}

.script-show-chip--low {
  color: var(--admin-score-low);
  background: var(--admin-score-low-subtle);
  border-color: var(--admin-score-low-border);
}

.script-show-score--high {
  color: var(--admin-score-good);
}

.script-show-score--mid {
  color: var(--admin-score-mid);
}

.script-show-score--low {
  color: var(--admin-score-low);
}

.script-show-score--muted {
  color: var(--admin-muted-foreground);
}

.script-show-score-popover-wrapper {
  position: relative;
  display: inline-flex;
}

.script-show-score-popover-wrapper--open {
  z-index: 30;
}

.script-show-score-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.3;
  transition:
    filter 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.12s ease;
}

.script-show-score-trigger:hover {
  filter: brightness(1.12);
  border-color: var(--admin-foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.script-show-score-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--admin-ring);
}

.script-show-score-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: 300px;
  max-width: 80vw;
  padding: 12px;
  background-color: var(--admin-card);
  color: var(--admin-card-foreground);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.script-show-score-pop-header {
  font-family: var(--dash-font-display);
  font-size: 0.6875rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--admin-muted-foreground);
  margin-bottom: 8px;
}

.script-show-metric-defn-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.script-show-metric-defn-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.script-show-metric-defn-label {
  font-size: 0.8125rem;
  font-weight: var(--admin-font-weight-semibold);
  color: var(--admin-foreground);
}

.script-show-metric-defn-value {
  font-size: 0.8125rem;
  font-weight: var(--admin-font-weight-semibold);
  color: var(--admin-foreground);
  white-space: nowrap;
}

.script-show-metric-defn-desc {
  margin: 2px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--admin-muted-foreground);
}

.script-show-excerpt-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.script-show-excerpt-item {
  position: relative;
  padding-left: 14px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--admin-card-foreground);
}

.script-show-excerpt-item::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--admin-accent-text);
  font-weight: 700;
}

.summary-stat-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--admin-foreground);
}

.summary-stat-text--placeholder {
  color: var(--admin-muted-foreground);
  font-style: italic;
}

.summary-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.summary-metrics {
  margin-bottom: 4px;
}

.dash-metrics-row.summary-metrics-row {
  grid-template-columns: repeat(2, 1fr);
  padding: 12px 0 20px;
}

.summary-prose-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.summary-prose-card {
  min-height: 140px;
}

.summary-prose-card--accent {
  background: var(--admin-accent-subtle);
  border-color: var(--admin-accent-border);
}

.summary-accent-label {
  color: var(--admin-accent-text);
}

@media (max-width: 720px) {
  .summary-prose-row {
    grid-template-columns: 1fr;
  }

  .dash-metrics-row.summary-metrics-row {
    grid-template-columns: 1fr;
  }
}

.summary-placeholder-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-family: var(--dash-font-body);
  font-size: 0.625rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-muted-foreground);
  background: var(--admin-muted);
  border: 1px dashed var(--admin-border);
  border-radius: 999px;
  vertical-align: middle;
}

.summary-placeholder-chip--accent {
  color: var(--admin-accent-text);
  background: var(--admin-accent-subtle);
  border-color: var(--admin-accent-border);
}

/* Skeleton state — match the loaded layout's vertical rhythm */
.summary-skeleton-header {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.summary-skeleton-title {
  height: 1.75rem;
  width: 40%;
  max-width: 18rem;
}

.summary-skeleton-sub {
  height: 1rem;
  width: 60%;
  max-width: 28rem;
}

.summary-skeleton-metric-label {
  display: block;
  height: 0.875rem;
  margin-bottom: 0.625rem;
}

.summary-skeleton-metric-value {
  display: block;
  height: 2.25rem;
  width: 60%;
}

.summary-skeleton-stat-label {
  display: block;
  height: 0.875rem;
  margin-bottom: 0.875rem;
  width: 35%;
}

.summary-skeleton-stat-line {
  display: block;
  height: 0.875rem;
  margin-top: 0.5rem;
}

.summary-skeleton-eyebrow {
  display: block;
  height: 0.75rem;
  width: 5rem;
  margin-bottom: 0.5rem;
}

.summary-skeleton-section-title {
  display: block;
  height: 1.375rem;
}

/* Error state — friendlier than a bare <p> */
.summary-error {
  padding: 5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  max-width: 32rem;
  margin: 0 auto;
}

.summary-error-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: var(--admin-font-weight-semibold);
  color: var(--admin-foreground);
}

.summary-error-body {
  margin: 0;
  color: var(--admin-muted-foreground);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.summary-error-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.summary-not-found {
  padding: 96px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.summary-not-found-eyebrow {
  font-family: var(--dash-font-display);
  font-size: 0.75rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--admin-muted-foreground);
}

.summary-not-found-title {
  margin: 0;
  font-family: var(--dash-font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--admin-foreground);
  letter-spacing: -0.01em;
}

.summary-not-found-sub {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--admin-muted-foreground);
  max-width: 42ch;
  line-height: 1.5;
}

.script-show-question-body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--admin-foreground);
  white-space: pre-wrap;
  flex: 1;
  min-width: 0;
}

.script-show-ideal {
  background: var(--admin-input-background);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.script-show-ideal-label {
  font-family: var(--dash-font-display);
  font-size: 0.6875rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-muted-foreground);
}

.script-show-ideal-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--admin-card-foreground);
  white-space: pre-wrap;
}

.script-show-analytics-row {
  display: flex;
  gap: 0;
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  overflow: hidden;
}

.script-show-analytics-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--admin-border);
}

.script-show-analytics-cell:last-child {
  border-right: none;
}

.script-show-analytics-label {
  font-family: var(--dash-font-display);
  font-size: 0.6875rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--admin-muted-foreground);
  white-space: nowrap;
}

.script-show-analytics-value {
  font-size: 0.9375rem;
  font-weight: var(--admin-font-weight-semibold);
  color: var(--admin-foreground);
  line-height: 1.3;
}

@media (max-width: 720px) {
  .script-show-analytics-row {
    flex-wrap: wrap;
  }

  .script-show-analytics-cell {
    flex: 1 1 40%;
    border-right: 1px solid var(--admin-border);
    border-bottom: 1px solid var(--admin-border);
  }

  .script-show-analytics-cell:last-child {
    border-right: none;
  }
}

@media (max-width: 720px) {
  .script-show-section-header {
    flex-direction: column;
    gap: 12px;
  }

  .script-show-metric-group {
    align-self: stretch;
    justify-content: flex-start;
  }

  .script-show-metric {
    align-items: flex-start;
  }
}

/* Add inline buttons */
.add-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 0;
  background: none;
  border: none;
  color: var(--admin-muted-foreground);
  font-size: 0.875rem;
  font-weight: var(--admin-font-weight-medium);
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}

.add-inline-btn:hover {
  color: var(--admin-accent-text);
}

.add-dashed-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
  padding: 20px;
  background: none;
  border: 2px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-muted-foreground);
  font-size: 0.9375rem;
  font-weight: var(--admin-font-weight-medium);
  font-family: inherit;
  cursor: pointer;
  gap: 8px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.add-dashed-btn:hover {
  background: rgba(25, 230, 192, 0.06);
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.add-dashed-btn:focus-visible {
  outline: 2px solid var(--admin-ring);
  outline-offset: 2px;
}

.add-dashed-btn--sm {
  padding: 10px;
  font-size: 0.8125rem;
  margin-top: 12px;
}

.field-help {
  margin: 0.5rem 2px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--admin-muted-foreground);
  font-weight: var(--admin-font-weight-normal);
}

.admin-page input:focus,
.admin-page textarea:focus,
.settings-modal input:focus,
.settings-modal textarea:focus,
.admin-action-button:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--admin-ring);
}

/* Table skeleton loading */
.admin-table-skeleton {
  display: inline-block;
  height: 12px;
  border-radius: 4px;
  background: var(--admin-border);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.admin-table-skeleton--wide {
  width: 160px;
}
.admin-table-skeleton--mid {
  width: 80px;
}
.admin-table-skeleton--narrow {
  width: 32px;
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--admin-border);
}

.admin-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  color: var(--admin-muted-foreground);
  font-size: 0.875rem;
  font-weight: var(--admin-font-weight-medium);
  font-family: inherit;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.admin-pagination-btn:hover:not(:disabled) {
  color: var(--admin-foreground);
  border-color: var(--admin-foreground);
}

.admin-pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-pagination-page {
  font-size: 0.875rem;
  font-weight: var(--admin-font-weight-medium);
  color: var(--admin-muted-foreground);
}

/* Footer */
.admin-footer {
  position: sticky;
  bottom: 0;
  background: var(--admin-card);
  border-top: 1px solid var(--admin-border);
  padding: 16px 32px;
  display: flex;
  justify-content: flex-end;
}

.admin-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0 16px;
  background: var(--admin-accent);
  border: 1px solid var(--admin-accent);
  border-radius: calc(var(--admin-radius) - 2px);
  color: var(--admin-on-accent);
  font-size: 0.875rem;
  font-weight: var(--admin-font-weight-semibold);
  font-family: inherit;
  line-height: 1.5;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

a.admin-footer-btn {
  text-decoration: none;
}

.admin-footer-btn:hover {
  background: var(--admin-accent-hover);
  border-color: var(--admin-accent-hover);
}

.admin-footer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-footer-btn:focus-visible {
  outline: 2px solid var(--admin-ring);
  outline-offset: 2px;
}

.admin-footer-error {
  margin: 0 auto 0 0;
  font-size: 0.875rem;
  color: var(--admin-score-low);
}

/* Undo toast */
.undo-toast {
  position: fixed;
  bottom: 80px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 10px 16px;
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.2s ease-out both;
  z-index: 200;
}

.undo-toast-msg {
  color: var(--admin-muted-foreground);
}

.undo-toast-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--dash-font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.undo-toast-btn:hover {
  color: var(--admin-accent-hover);
}

.undo-toast-btn:focus-visible {
  outline: 2px solid var(--admin-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading spinner */
.admin-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 0;
}
.admin-loading-icon {
  font-size: 2rem;
  color: var(--admin-muted-foreground);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Sidebar */
.admin-sidebar-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar-main {
  flex: 1;
  min-width: 0;
}

/* Cap and center page content on wide screens across all sidebar screens.
   Topbars/headers stay full width (see .admin-topbar rule below). */
.admin-sidebar-main .admin-container {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.admin-sidebar-main .admin-topbar {
  padding: 8px 24px;
  max-width: none;
  margin: 0;
}

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--admin-sidebar-border);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar-top {
  display: flex;
  flex-direction: column;
}

.admin-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 14px;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
}

.admin-sidebar-logo:focus-visible {
  outline: 2px solid var(--admin-ring);
  outline-offset: -2px;
}

.admin-sidebar-logo-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.admin-sidebar-logo-text {
  font-family: var(--dash-font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--admin-foreground);
}

.admin-sidebar-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 12px 10px;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--admin-accent-border);
  background: transparent;
  color: var(--admin-accent);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: var(--admin-font-weight-semibold);
  line-height: 1;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
  cursor: pointer;
}

.admin-sidebar-cta:hover {
  background: var(--admin-accent-subtle);
  border-color: var(--admin-accent);
}

.admin-sidebar-cta:focus-visible {
  outline: 2px solid var(--admin-accent);
  outline-offset: 2px;
}

.admin-sidebar-cta-icon {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.admin-sidebar-cta-label {
  white-space: nowrap;
}

.admin-sidebar-section-label {
  padding: 14px 14px 3px;
  font-family: var(--dash-font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--admin-sidebar-muted);
  user-select: none;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  gap: 2px;
}

.admin-sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--admin-sidebar-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: var(--admin-font-weight-medium);
  line-height: 1;
  transition:
    color 0.12s ease,
    background-color 0.12s ease;
  cursor: pointer;
}

button.admin-sidebar-nav-item {
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.admin-sidebar-nav-item:hover {
  color: var(--admin-foreground);
  background: var(--admin-sidebar-hover-bg);
}

.admin-sidebar-nav-item:focus-visible {
  outline: 2px solid var(--admin-ring);
  outline-offset: -2px;
}

.admin-sidebar-nav-item.active {
  color: var(--admin-foreground);
  background: var(--admin-sidebar-active-bg);
}

.admin-sidebar-nav-item.active .admin-sidebar-nav-icon {
  color: var(--admin-accent);
}

.admin-sidebar-nav-icon {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  width: 16px;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.admin-sidebar-nav-label {
  white-space: nowrap;
}

.admin-sidebar-bottom {
  display: flex;
  flex-direction: column;
  padding: 10px 10px;
  border-top: 1px solid var(--admin-sidebar-border);
  gap: 1px;
}

.admin-sidebar-logout {
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.admin-sidebar-logout.confirming {
  color: var(--admin-sidebar-danger);
  background: color-mix(in oklch, var(--admin-sidebar-danger) 10%, transparent);
}

.admin-sidebar-logout.confirming .admin-sidebar-nav-icon {
  color: var(--admin-sidebar-danger);
}

.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 10px;
  margin-bottom: 4px;
}

.admin-sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--admin-sidebar-avatar-bg);
  color: var(--admin-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--dash-font-body);
  font-size: 0.8125rem;
  font-weight: var(--admin-font-weight-semibold);
  flex-shrink: 0;
}

.admin-sidebar-user-email {
  font-size: 0.8125rem;
  color: var(--admin-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (max-width: 900px) {
  .admin-sidebar {
    width: 60px;
  }

  .admin-sidebar-logo {
    padding: 18px 0;
    justify-content: center;
  }

  .admin-sidebar-cta {
    margin: 4px 8px 8px;
    padding: 9px 0;
    justify-content: center;
  }

  .admin-sidebar-logo-text,
  .admin-sidebar-cta-label,
  .admin-sidebar-section-label,
  .admin-sidebar-nav-label,
  .admin-sidebar-user-email {
    display: none;
  }

  .admin-sidebar-nav-item {
    justify-content: center;
    padding: 10px;
  }

  .admin-sidebar-nav-icon {
    width: auto;
  }

  .admin-sidebar-user {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-sidebar-nav-item,
  .admin-sidebar-nav-icon,
  .admin-sidebar-cta {
    transition: none;
  }

  .question-accordion-body {
    animation: none;
  }

  .undo-toast {
    animation: none;
  }

  .question-chevron {
    transition: none;
  }
}

@media (max-width: 900px) {
  .admin-meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-topbar,
  .admin-container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .template-panels {
    flex-direction: column;
  }

  .template-panel-left {
    width: 100%;
    position: static;
  }

  .section-divider {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-name-input {
    width: 100%;
  }

  .admin-header h1 {
    font-size: 2rem;
  }
}

.admin-banner {
  padding: 8px;
  margin: 2px 24px;
}

.admin-banner a {
  color: inherit;
  text-decoration: underline;
}
.admin-banner--warning {
  background-color: var(--admin-sidebar-danger);
  border-radius: 5px;
}

/* ─── Conversation transcript view ─── */
.transcript-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0 0.75rem;
  margin-bottom: 1rem;
  background: linear-gradient(
    to bottom,
    var(--admin-background) 0%,
    var(--admin-background) calc(100% - 12px),
    transparent 100%
  );
}

.transcript-search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.transcript-search-icon {
  position: absolute;
  left: 0.875rem;
  color: var(--admin-muted-foreground);
  font-size: 0.875rem;
  pointer-events: none;
  transition: color 0.15s ease;
}

.transcript-search:focus-within .transcript-search-icon {
  color: var(--admin-foreground);
}

.admin-page input.transcript-search-input,
.admin-page input[type].transcript-search-input {
  padding-left: 2.4rem;
  padding-right: 2.4rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.admin-page input.transcript-search-input:focus,
.admin-page input[type].transcript-search-input:focus {
  border-color: var(--admin-foreground);
  box-shadow: 0 0 0 3px var(--admin-ring);
}

.transcript-search-clear {
  position: absolute;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--admin-muted-foreground);
  cursor: pointer;
  border-radius: 999px;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.transcript-search-clear:hover {
  color: var(--admin-foreground);
  background-color: var(--admin-hover);
}

.transcript-search-clear:focus-visible {
  outline: none;
  color: var(--admin-foreground);
  box-shadow: 0 0 0 2px var(--admin-ring);
}

.transcript-match-controls {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.transcript-match-count {
  font-size: 0.8125rem;
  color: var(--admin-muted-foreground);
  font-variant-numeric: tabular-nums;
  min-width: 4.25rem;
  text-align: right;
  padding-right: 0.25rem;
}

.transcript-match-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  background: transparent;
  color: var(--admin-muted-foreground);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.transcript-match-step:hover:not(:disabled) {
  color: var(--admin-foreground);
  border-color: var(--admin-foreground);
  background-color: var(--admin-hover);
}

.transcript-match-step:focus-visible {
  outline: none;
  color: var(--admin-foreground);
  border-color: var(--admin-foreground);
  box-shadow: 0 0 0 2px var(--admin-ring);
}

.transcript-match-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.transcript-empty {
  padding: 4rem 1rem;
  text-align: center;
  color: var(--admin-muted-foreground);
  font-size: 0.9375rem;
}

.transcript-empty strong {
  color: var(--admin-foreground);
  font-weight: var(--admin-font-weight-medium);
}

.transcript-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.transcript-line {
  position: relative;
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1.25rem;
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  border-radius: var(--admin-radius);
  transition: background-color 0.15s ease;
}

.transcript-line:hover {
  background-color: var(--admin-hover);
}

.transcript-line--match {
  background-color: var(--admin-accent-subtle);
}

.transcript-line--match:hover {
  background-color: var(--admin-accent-subtle);
}

.transcript-line--active {
  background-color: var(--admin-accent-subtle);
}

/* Soft accent bar on the active match — replaces the heavier full-border */
.transcript-line--active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 3px;
  border-radius: 2px;
  background: var(--admin-accent);
}

.transcript-line-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  align-items: flex-start;
}

.transcript-speaker {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: var(--admin-font-weight-medium);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--admin-border);
  color: var(--admin-muted-foreground);
  background: transparent;
}

/* Interviewer — neutral outline */
.transcript-speaker--0 {
  background-color: transparent;
  border-color: var(--admin-border);
  color: var(--admin-muted-foreground);
}

/* Candidate — accent-tinted, the "subject" of the interview */
.transcript-speaker--1 {
  background-color: var(--admin-accent-subtle);
  border-color: var(--admin-accent-border);
  color: var(--admin-accent-text);
}

.transcript-time {
  font-size: 0.75rem;
  color: var(--admin-muted-foreground);
  font-variant-numeric: tabular-nums;
}

.transcript-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--admin-foreground);
  /* Comfortable reading width on wide screens */
  max-width: 64ch;
}

.transcript-mark {
  background-color: var(--admin-score-mid-subtle);
  color: var(--admin-foreground);
  box-shadow: inset 0 -2px 0 0 var(--admin-score-mid-border);
  padding: 0 2px;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .transcript-line {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
  }
  .transcript-line--active::before {
    top: 0.625rem;
    bottom: 0.625rem;
  }
  .transcript-line-meta {
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
  }
  .transcript-text {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .transcript-line,
  .transcript-search-clear,
  .transcript-match-step,
  .transcript-search-icon,
  .admin-page input.transcript-search-input,
  .admin-page input[type].transcript-search-input {
    transition: none;
  }
}

/* ─── Transcript filters ─── */

.transcript-filters-wrapper {
  position: relative;
}

.transcript-filters-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  background-color: var(--admin-card);
  color: var(--admin-foreground);
  font-size: 0.875rem;
  font-weight: var(--admin-font-weight-medium);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.transcript-filters-button:hover {
  background-color: var(--admin-hover);
}

.transcript-filters-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--admin-ring);
}

.transcript-filters-button:has(.transcript-filters-badge) {
  border-color: var(--admin-accent-border);
  background-color: var(--admin-accent-subtle);
  color: var(--admin-accent);
}

.transcript-filters-button:has(.transcript-filters-badge):hover {
  border-color: var(--admin-accent);
}

.transcript-filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background-color: var(--admin-accent);
  color: var(--admin-on-accent);
  font-size: 0.6875rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.01em;
}

.transcript-filters-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 20;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 0.5rem 0;
}

.transcript-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 0.25rem;
}

.transcript-filters-clear-all {
  background: none;
  border: none;
  color: var(--admin-muted-foreground);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.transcript-filters-clear-all:hover {
  color: var(--admin-foreground);
  background-color: var(--admin-hover);
}

.transcript-filters-clear-all:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--admin-ring);
}

.transcript-filters-category {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--admin-border);
}

.transcript-filters-category:last-child {
  border-bottom: none;
}

.transcript-filters-category-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-muted-foreground);
  margin-bottom: 0.5rem;
}

.transcript-filters-section {
  margin-bottom: 0.25rem;
}

.transcript-filters-section-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.transcript-filters-disclosure {
  background: none;
  border: none;
  color: var(--admin-muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.transcript-filters-disclosure:hover {
  color: var(--admin-foreground);
  background-color: var(--admin-hover);
}

.transcript-filters-disclosure:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--admin-ring);
}

.transcript-filters-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem;
  font-size: 0.875rem;
  color: var(--admin-foreground);
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.transcript-filters-row input[type="checkbox"] {
  margin-top: 0.1875rem;
}

.admin-page input[type="checkbox"].transcript-filters-checkbox,
.transcript-filters-row input[type="checkbox"],
.transcript-filters-popover input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: none;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  appearance: auto;
}

.transcript-filters-row-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  word-break: break-word;
}

.transcript-filters-row-label--stack {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.transcript-filters-row-hint {
  font-size: 0.75rem;
  color: var(--admin-muted-foreground);
  font-weight: 400;
}

.transcript-filters-row-count {
  font-size: 0.75rem;
  color: var(--admin-muted-foreground);
}

.transcript-filters-question-list {
  list-style: none;
  padding: 0 0 0 1.5rem;
  margin: 0.25rem 0 0;
}

.transcript-filters-question-list li {
  margin: 0.125rem 0;
}

.transcript-filters-empty {
  font-size: 0.8125rem;
  color: var(--admin-muted-foreground);
  margin: 0.25rem 0;
}

/* Active-filter chips */

.transcript-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.transcript-filter-chip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--admin-border);
  background-color: var(--admin-card);
  border-radius: 999px;
  font-size: 0.75rem;
  overflow: hidden;
}

.transcript-filter-chip-body {
  background: none;
  border: none;
  padding: 0.25rem 0.625rem;
  color: var(--admin-foreground);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  transition: background-color 0.15s ease;
}

.transcript-filter-chip-body:hover {
  background-color: var(--admin-hover);
}

.transcript-filter-chip-body:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--admin-ring);
}

.transcript-filter-chip-clear {
  background: none;
  border: none;
  border-left: 1px solid var(--admin-border);
  color: var(--admin-muted-foreground);
  padding: 0 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.transcript-filter-chip-clear:hover {
  color: var(--admin-foreground);
  background-color: var(--admin-hover);
}

.transcript-filter-chip-clear:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--admin-ring);
}

.transcript-empty-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .transcript-filters-button,
  .transcript-filters-clear-all,
  .transcript-filters-disclosure,
  .transcript-filter-chip-body,
  .transcript-filter-chip-clear {
    transition: none;
  }
}

/* ── Wizard steps ── */

.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 24px 16px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--card-bg, #1e1e1e);
  color: var(--text-muted, #888);
  border: 1px solid var(--border, #333);
}

.wizard-step-label {
  font-size: 13px;
  color: var(--text-muted, #888);
}

.wizard-step--active .wizard-step-number {
  background: var(--accent, #4db88a);
  color: #fff;
  border-color: var(--accent, #4db88a);
}

.wizard-step--active .wizard-step-label {
  color: var(--text-primary, #eee);
  font-weight: 600;
}

.wizard-step--completed .wizard-step-number {
  background: transparent;
  color: var(--accent, #4db88a);
  border-color: var(--accent, #4db88a);
}

.wizard-step--completed .wizard-step-label {
  color: var(--text-muted, #888);
}

.wizard-step-connector {
  width: 40px;
  height: 1px;
  background: var(--border, #333);
  margin: 0 12px;
}

.admin-footer-btn--secondary {
  background: transparent;
  border: 1px solid var(--border, #333);
  color: var(--text-muted, #888);
}

.admin-footer-btn--secondary:hover {
  border-color: var(--text-muted, #888);
  color: var(--text-primary, #eee);
}

/* ── Drag and drop (nav sidebar) ── */

.section-nav-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--admin-muted-foreground);
  cursor: grab;
  background: none;
  border: none;
  padding: 0;
  flex-shrink: 0;
  border-radius: 3px;
  font-size: 0.75rem;
  opacity: 0;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}

.section-nav-item:hover > .section-nav-drag-handle,
.section-nav-question-item:hover > .section-nav-drag-handle {
  opacity: 1;
}

.section-nav-drag-handle:hover {
  color: var(--admin-foreground);
  background: var(--admin-hover);
}

.section-nav-drag-handle:active {
  cursor: grabbing;
}

.section-nav-questions {
  display: flex;
  flex-direction: column;
  padding-left: 4px;
  margin-bottom: 4px;
}

.section-nav-question-item {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: calc(var(--admin-radius) - 2px);
  transition: background-color 0.15s ease;
}

.section-nav-question-item:hover {
  background: var(--admin-hover);
}

.section-nav-question-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  background: none;
  border: none;
  color: var(--admin-muted-foreground);
  font-size: 0.8125rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease;
}

.section-nav-question-btn:hover {
  color: var(--admin-foreground);
}

.section-nav-question-btn:focus-visible {
  outline: 2px solid var(--admin-ring);
  outline-offset: -2px;
  border-radius: calc(var(--admin-radius) - 2px);
}

.section-nav-question-label {
  font-family: var(--dash-font-display);
  font-weight: var(--admin-font-weight-semibold);
  font-size: 0.75rem;
  flex-shrink: 0;
  color: var(--admin-muted-foreground);
}

.section-nav-question-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.section-nav-drag-icon {
  color: var(--admin-muted-foreground);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.section-nav-item--overlay,
.section-nav-question-item--overlay {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-card);
  border: 1px solid var(--admin-accent);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--admin-foreground);
}

/* -------------------------------------------------------------------------
   Regrade modal
   ------------------------------------------------------------------------- */

.regrade-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.regrade-modal {
  display: flex;
  flex-direction: column;
  width: 580px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.report-modal {
  display: flex;
  flex-direction: column;
  width: 720px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.report-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 28px;
  min-height: 0;
}

.report-modal-textarea {
  flex: 1;
  width: 100%;
  min-height: 420px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 16px;
  color: var(--admin-text-muted);
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: none;
  outline: none;
  box-sizing: border-box;
}

.report-modal-textarea:focus {
  border-color: var(--admin-accent);
}

.report-modal-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--admin-text-muted);
  min-height: 420px;
}

.regrade-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--admin-border);
}

.regrade-modal-header-text {
  flex: 1;
  min-width: 0;
}

.regrade-modal-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -8px 0 0;
  background: transparent;
  border: none;
  border-radius: calc(var(--admin-radius) - 2px);
  color: var(--admin-muted-foreground);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.regrade-modal-close:hover {
  background: var(--admin-hover);
  color: var(--admin-foreground);
}

.regrade-modal-close:disabled {
  opacity: 0.5;
  cursor: default;
}

.regrade-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--admin-border);
}

.regrade-modal-selectall {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: var(--admin-font-weight-medium);
  color: var(--admin-foreground);
  cursor: pointer;
}

.regrade-modal-count {
  font-size: 0.75rem;
  color: var(--admin-muted-foreground);
  font-variant-numeric: tabular-nums;
}

.regrade-modal-title {
  margin: 0 0 5px;
  font-size: 1rem;
  font-weight: var(--admin-font-weight-semibold);
  color: var(--admin-foreground);
}

.regrade-modal-subtitle {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--admin-muted-foreground);
  line-height: 1.5;
}

.regrade-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px;
}

.regrade-modal-section {
  flex-shrink: 0;
  background: var(--admin-background);
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  overflow: hidden;
}

.regrade-modal-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.regrade-modal-section-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.regrade-modal-section-name {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: var(--admin-font-weight-semibold);
  color: var(--admin-foreground);
}

.regrade-modal-section-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--admin-muted-foreground);
  font-variant-numeric: tabular-nums;
}

.regrade-modal-chevron {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--admin-muted-foreground);
  transition: transform 0.15s ease;
}

.regrade-modal-chevron.is-collapsed {
  transform: rotate(-90deg);
}

.regrade-modal-question-list {
  list-style: none;
  margin: 0;
  padding: 0 14px 8px;
}

.regrade-modal-question-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: calc(var(--admin-radius) - 2px);
  cursor: pointer;
  transition: background 0.1s ease;
}

.regrade-modal-question-row:hover {
  background: var(--admin-hover);
}

.admin-page input[type="checkbox"].regrade-modal-checkbox {
  flex: 0 0 auto;
  width: auto;
  padding: 0;
  margin-top: 2px;
  accent-color: var(--admin-accent);
  cursor: pointer;
  appearance: auto;
  background: none;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
}

.regrade-modal-question-body {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--admin-foreground);
  line-height: 1.5;
  word-break: break-word;
}

.regrade-modal-chip {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 1px;
}

.regrade-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px;
  border-top: 1px solid var(--admin-border);
}

/* -------------------------------------------------------------------------
   Settings modal (tabbed)
   ------------------------------------------------------------------------- */

.settings-modal {
  text-align: left;
}

.settings-modal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  border-bottom: 1px solid var(--admin-border);
}

.settings-modal-tab {
  position: relative;
  padding: 12px 4px;
  margin-bottom: -1px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--admin-muted-foreground);
  font-size: 0.875rem;
  font-weight: var(--admin-font-weight-medium);
  font-family: inherit;
  cursor: pointer;
  transition: color 0.1s ease, border-color 0.1s ease;
}

.settings-modal-tab + .settings-modal-tab {
  margin-left: 16px;
}

.settings-modal-tab:hover {
  color: var(--admin-foreground);
}

.settings-modal-tab.active {
  color: var(--admin-foreground);
  border-bottom-color: var(--admin-accent);
}

.settings-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px;
}

.form-group-stack {
  display: flex;
  flex-direction: column;
}

.summary-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.regrade-skipped-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  margin-bottom: 4px;
  background: var(--admin-accent-subtle);
  border: 1px solid var(--admin-accent-border);
  border-radius: calc(var(--admin-radius) - 2px);
  font-size: 0.875rem;
  color: var(--admin-accent-text);
}

.regrade-skipped-banner-dismiss {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: var(--admin-font-weight-medium);
  color: var(--admin-accent-text);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0.75;
  transition: opacity 0.1s ease;
}

.regrade-skipped-banner-dismiss:hover {
  opacity: 1;
}

/* ============================================================
   Conversation Chat — floating widget
   ============================================================ */

.conv-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ---- Launcher button (collapsed state) ---- */

.conv-chat-launcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--admin-card);
  color: var(--admin-foreground);
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: var(--admin-font-weight-semibold);
  font-family: var(--dash-font-body);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.conv-chat-launcher:hover {
  transform: translateY(-1px);
  border-color: var(--admin-accent-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.conv-chat-launcher-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
  color: var(--admin-accent);
}

/* ---- Expanded window ---- */

.conv-chat-window {
  width: 400px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  transform-origin: bottom right;
  animation: conv-chat-window-in 0.19s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes conv-chat-window-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.conv-chat-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--admin-background);
  color: var(--admin-foreground);
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.conv-chat-window-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--dash-font-display);
  font-size: 0.9375rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.01em;
}

.conv-chat-window-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-accent);
  flex-shrink: 0;
}

.conv-chat-window-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--admin-muted-foreground);
  cursor: pointer;
  transition: color 0.1s ease, background 0.1s ease;
  flex-shrink: 0;
}

.conv-chat-window-btn:hover {
  color: var(--admin-foreground);
  background: var(--admin-input-background);
}

/* ---- Message list ---- */

.conv-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 16px;
  min-height: 320px;
  max-height: min(440px, calc(100vh - 220px));
}

/* ---- Empty state / starter prompts ---- */

.conv-chat-intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.conv-chat-intro-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--admin-muted-foreground);
}

.conv-chat-starters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.conv-chat-starter {
  text-align: left;
  padding: 9px 13px;
  font-size: 0.8125rem;
  line-height: 1.4;
  font-family: var(--dash-font-body);
  color: var(--admin-foreground);
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.conv-chat-starter:hover {
  border-color: var(--admin-accent-border);
  background: var(--admin-accent-subtle);
  color: var(--admin-accent-text);
}

.conv-chat-message {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 88%;
  animation: conv-chat-msg-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes conv-chat-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.conv-chat-message--user {
  align-self: flex-end;
  align-items: flex-end;
}

.conv-chat-message--assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.conv-chat-message-label {
  font-family: var(--dash-font-display);
  font-size: 0.625rem;
  font-weight: var(--admin-font-weight-semibold);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--admin-muted-foreground);
}

.conv-chat-message--assistant .conv-chat-message-label {
  color: var(--admin-accent-text);
}

.conv-chat-message-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.conv-chat-message-text {
  margin: 0;
  padding: 9px 13px;
  font-size: 0.875rem;
  line-height: 1.6;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}

.conv-chat-message--user .conv-chat-message-text {
  background: var(--admin-input-background);
  color: var(--admin-foreground);
  border: 1px solid var(--admin-border);
  border-bottom-right-radius: 4px;
}

.conv-chat-message--assistant .conv-chat-message-text {
  background: var(--admin-background);
  border: 1px solid var(--admin-border);
  color: var(--admin-foreground);
  border-bottom-left-radius: 4px;
}

/* ---- Markdown rendering (assistant) ---- */

.conv-chat-md { white-space: normal; }
.conv-chat-md > :first-child { margin-top: 0; }
.conv-chat-md > :last-child { margin-bottom: 0; }
.conv-chat-md p { margin: 0 0 8px; }
.conv-chat-md ul,
.conv-chat-md ol { margin: 0 0 8px; padding-left: 20px; }
.conv-chat-md li { margin: 2px 0; }
.conv-chat-md li::marker { color: var(--admin-muted-foreground); }
.conv-chat-md h1,
.conv-chat-md h2,
.conv-chat-md h3 {
  font-family: var(--dash-font-display);
  font-size: 0.9375rem;
  font-weight: var(--admin-font-weight-semibold);
  margin: 10px 0 6px;
}
.conv-chat-md strong { font-weight: var(--admin-font-weight-semibold); }
.conv-chat-md a { color: var(--admin-accent-text); text-decoration: underline; }
.conv-chat-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
}
.conv-chat-md pre {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  overflow-x: auto;
}
.conv-chat-md pre code { padding: 0; border: none; background: none; }

/* ---- Copy action ---- */

.conv-chat-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 3px 7px;
  font-size: 0.6875rem;
  font-family: var(--dash-font-body);
  color: var(--admin-muted-foreground);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.conv-chat-message--assistant:hover .conv-chat-copy,
.conv-chat-copy:focus-visible {
  opacity: 1;
}

.conv-chat-copy:hover {
  color: var(--admin-foreground);
  background: var(--admin-input-background);
}

/* ---- Typing indicator ---- */

.conv-chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 13px;
  background: var(--admin-background);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.conv-chat-typing span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--admin-accent);
  animation: conv-chat-bounce 1.2s infinite ease-in-out;
}

.conv-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.conv-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes conv-chat-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Error ---- */

.conv-chat-error {
  margin: 0 16px 10px;
  padding: 9px 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--admin-score-low);
  background: var(--admin-score-low-subtle);
  border: 1px solid var(--admin-score-low-border);
  border-radius: 8px;
}

/* ---- Input area ---- */

.conv-chat-input-area {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.conv-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.conv-chat-textarea {
  flex: 1;
  resize: none;
  padding: 9px 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  font-family: var(--dash-font-body);
  color: var(--admin-foreground);
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  outline: none;
  box-sizing: border-box;
  max-height: 132px;
  overflow-y: auto;
  transition: border-color 0.15s ease;
}

.conv-chat-textarea:focus {
  border-color: var(--admin-accent-border);
}

.conv-chat-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.conv-chat-hint {
  font-size: 0.6875rem;
  color: var(--admin-muted-foreground);
}

.conv-chat-hint kbd {
  font-family: var(--dash-font-body);
  font-size: 0.6875rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--admin-input-background);
  border: 1px solid var(--admin-border);
  color: var(--admin-foreground);
}

.conv-chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--admin-on-accent);
  background: var(--admin-accent);
  border: none;
  border-radius: var(--admin-radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.12s ease;
}

.conv-chat-send-btn:hover:not(:disabled) {
  background: var(--admin-accent-hover);
}

.conv-chat-send-btn:disabled {
  background: var(--admin-input-background);
  color: var(--admin-muted-foreground);
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .conv-chat-widget {
    bottom: 16px;
    right: 16px;
    left: 16px;
    align-items: stretch;
  }

  .conv-chat-launcher {
    align-self: flex-end;
  }

  .conv-chat-window {
    width: auto;
    max-width: none;
  }

  .conv-chat-messages {
    max-height: min(60vh, 440px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .conv-chat-window,
  .conv-chat-message {
    animation: none;
  }

  .conv-chat-typing span {
    animation: none;
    opacity: 0.7;
  }
}
/* Error banner for forms */
.admin-error-banner {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  margin-bottom: 16px;
  background: var(--admin-score-low-subtle);
  border: 1px solid var(--admin-score-low-border);
  border-radius: calc(var(--admin-radius) - 2px);
  font-size: 0.875rem;
  color: var(--admin-score-low);
}

.admin-error-banner p {
  margin: 0;
}

/* Hint text for form fields */
.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--admin-muted-foreground);
  line-height: 1.4;
}
