html {
  font-size: 16px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.required-indicator {
  color: #dc3545;
  font-weight: 600;
  margin-left: 0.25rem;
}

.required-helper {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.55;
}

.card-panel {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: 0 34px 55px -30px rgba(15, 23, 42, 0.3);
  padding: clamp(1.75rem, 2vw + 1rem, 2.75rem);
}

.card-panel--form {
  padding: clamp(1.75rem, 2vw + 1rem, 2.5rem);
}

.card-panel--soft {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(148, 163, 184, 0.35);
}

.card-panel--muted {
  background: radial-gradient(120% 120% at 45% 0%, #f1f5f9 0%, #ffffff 60%, #f8fafc 100%);
}

.card-panel__title {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.card-panel__subtitle {
  color: #64748b;
  margin-bottom: 1.5rem;
}

.card-elevated {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 45px -26px rgba(15, 23, 42, 0.28);
}

.card-elevated--success {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.08) 0%, rgba(34, 197, 94, 0.02) 100%);
}

.text-subtle {
  color: #64748b !important;
}

.audit-doc-name {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.badge-soft {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
}

.btn-ghost {
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #0f172a;
  background: rgba(241, 245, 249, 0.6);
  transition: all 0.2s ease;
}

.btn-ghost:hover,
.btn-ghost:focus {
  border-color: rgba(59, 130, 246, 0.55);
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.8);
}

.page-hero--compact {
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
}

.page-hero--compact .page-hero__title {
  font-size: clamp(1.75rem, 2.5vw, 2.35rem);
}

.page-hero--compact .page-hero__subtitle {
  font-size: 1rem;
}

.theme-toggle-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.theme-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-weight: 600;
  color: var(--color-text, #1f2933);
  min-height: 96px;
  text-align: center;
}

.theme-pill .material-symbols-outlined {
  font-size: 1.5rem;
}

.theme-pill:hover,
.theme-pill:focus-within {
  border-color: var(--color-primary, #1f6feb);
  box-shadow: 0 0 0 3px rgba(37, 140, 251, 0.2);
}

.btn-check:checked + .theme-pill {
  border-color: var(--color-primary, #1f6feb);
  background: rgba(37, 140, 251, 0.08);
  color: var(--color-primary, #1f6feb);
}

.btn-check:focus-visible + .theme-pill {
  outline: 3px solid var(--color-primary, #1f6feb);
  outline-offset: 4px;
}

.option-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
}

.option-card-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.theme-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.option-card__body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  height: 100%;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.option-card__swatch {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: linear-gradient(135deg, var(--theme-surface, #f8fafc) 0%, rgba(255, 255, 255, 0.92) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.option-card__swatch-accent {
  width: 70%;
  height: 70%;
  border-radius: 10px;
  display: block;
  background: linear-gradient(135deg, var(--theme-accent, #1f6feb), var(--theme-accent, #1f6feb));
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.18);
}

.option-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.4;
}

.option-card__title {
  font-weight: 600;
  color: var(--color-text, #0f172a);
}

.option-card__meta {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9rem;
}

.option-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-primary, #1f6feb);
}

.option-card__body:hover,
.option-card__body:focus-within {
  border-color: var(--color-primary, #1f6feb);
  box-shadow: 0 8px 22px rgba(37, 140, 251, 0.12);
  transform: translateY(-1px);
}

.btn-check:checked + .option-card__body {
  border-color: var(--color-primary, #1f6feb);
  box-shadow: 0 10px 26px rgba(37, 140, 251, 0.14);
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.06), rgba(31, 111, 235, 0.02));
}

.btn-check:focus-visible + .option-card__body {
  outline: 3px solid var(--color-primary, #1f6feb);
  outline-offset: 2px;
}

.theme-card--compact .option-card__meta {
  font-size: 0.95rem;
}

.theme-switcher-panel {
  padding: 1rem;
  border-radius: 1rem;
}

.theme-switcher-panel__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.theme-switcher-panel__header .material-symbols-outlined {
  background: rgba(37, 140, 251, 0.08);
  border-radius: 12px;
  padding: 0.35rem;
  color: var(--color-primary, #1f6feb);
}

/* === DARK THEME — WCAG 2.1 AA compliant ===
   Text contrast ratios verified:
   #f9fafb on #111827 (body bg):  14.4:1  ✓ AAA
   #9ca3af on #111827 (body bg):   6.3:1  ✓ AA
   #9ca3af on #1f2937 (surface):   5.1:1  ✓ AA
   #60a5fa on #111827 (primary):   6.2:1  ✓ AA
*/

html[data-theme='dark'] {
  color-scheme: dark;
}

html[data-theme='dark'] body {
  background-color: #111827;
  color: #f9fafb;
}

/* Text utilities */
html[data-theme='dark'] .text-muted,
html[data-theme='dark'] small.text-muted {
  color: #9ca3af !important;
}
html[data-theme='dark'] .text-dark { color: #f9fafb !important; }
html[data-theme='dark'] .text-secondary { color: #9ca3af !important; }
html[data-theme='dark'] .text-body { color: #f9fafb !important; }

/* Backgrounds */
html[data-theme='dark'] .bg-white { background-color: #1f2937 !important; }
html[data-theme='dark'] .bg-light { background-color: #1f2937 !important; }
html[data-theme='dark'] .bg-body  { background-color: #111827 !important; }

/* Links */
html[data-theme='dark'] a:not(.btn):not(.nav-link):not(.dropdown-item) {
  color: #60a5fa;
}
html[data-theme='dark'] a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
  color: #93c5fd;
}

/* Borders / dividers */
html[data-theme='dark'] .border          { border-color: #374151 !important; }
html[data-theme='dark'] .border-top      { border-top-color:    #374151 !important; }
html[data-theme='dark'] .border-bottom   { border-bottom-color: #374151 !important; }
html[data-theme='dark'] .border-start    { border-left-color:   #374151 !important; }
html[data-theme='dark'] .border-end      { border-right-color:  #374151 !important; }
html[data-theme='dark'] hr { border-color: #374151; opacity: 1; }

/* Shadows */
html[data-theme='dark'] .shadow-sm { box-shadow: 0 2px 8px  rgba(0,0,0,.5) !important; }
html[data-theme='dark'] .shadow    { box-shadow: 0 4px 16px rgba(0,0,0,.6) !important; }
html[data-theme='dark'] .shadow-lg { box-shadow: 0 8px 32px rgba(0,0,0,.7) !important; }

/* ---- Navbar ---- */
html[data-theme='dark'] .modern-header,
html[data-theme='dark'] .modern-header .navbar {
  background-color: #1f2937 !important;
  border-bottom: 1px solid #374151 !important;
  box-shadow: 0 1px 8px rgba(0,0,0,.4) !important;
}
html[data-theme='dark'] .navbar-toggler         { border-color: #374151; }
html[data-theme='dark'] .navbar-toggler-icon    { filter: invert(1); }
html[data-theme='dark'] .nav-link,
html[data-theme='dark'] .navbar-brand           { color: #d1d5db !important; }
html[data-theme='dark'] .nav-link:hover,
html[data-theme='dark'] .nav-link:focus         { color: #f9fafb !important; }
html[data-theme='dark'] .nav-link.active        { color: #60a5fa !important; }
html[data-theme='dark'] .nav-link.btn-primary,
html[data-theme='dark'] .nav-link.btn-primary:hover { color: #ffffff !important; }

/* ---- Cards ---- */
html[data-theme='dark'] .card,
html[data-theme='dark'] .card-panel {
  background-color: #1f2937 !important;
  border-color: #374151 !important;
  color: #f9fafb;
  box-shadow: 0 4px 24px rgba(0,0,0,.45);
}
html[data-theme='dark'] .card-header {
  background-color: rgba(255,255,255,.04) !important;
  border-color: #374151 !important;
  color: #f9fafb;
}
html[data-theme='dark'] .card-footer {
  background-color: rgba(255,255,255,.04) !important;
  border-color: #374151 !important;
  color: #f9fafb;
}
html[data-theme='dark'] .card-body  { color: inherit; }
html[data-theme='dark'] .card-title { color: #f9fafb; }
html[data-theme='dark'] .card-subtitle { color: #9ca3af; }
html[data-theme='dark'] .card-text  { color: #d1d5db; }
html[data-theme='dark'] .card-elevated {
  background-color: #1f2937 !important;
  border-color: #374151 !important;
}

/* ---- Modals ---- */
html[data-theme='dark'] .modal-content {
  background-color: #1f2937 !important;
  border-color: #374151 !important;
  color: #f9fafb;
}
html[data-theme='dark'] .modal-header { border-color: #374151 !important; color: #f9fafb; }
html[data-theme='dark'] .modal-body   { color: #d1d5db; }
html[data-theme='dark'] .modal-footer { border-color: #374151 !important; }
html[data-theme='dark'] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: .7;
}
html[data-theme='dark'] .btn-close:hover { opacity: 1; }

/* ---- Forms ---- */
html[data-theme='dark'] .form-control,
html[data-theme='dark'] .form-select {
  background-color: #111827 !important;
  color: #f9fafb !important;
  border-color: #374151 !important;
}
html[data-theme='dark'] .form-control:focus,
html[data-theme='dark'] .form-select:focus {
  background-color: #111827 !important;
  color: #f9fafb !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 .2rem rgba(96,165,250,.25) !important;
}
html[data-theme='dark'] .form-control::placeholder { color: #6b7280; }
html[data-theme='dark'] .form-control:disabled,
html[data-theme='dark'] .form-control[readonly] {
  background-color: #1f2937 !important;
  color: #9ca3af !important;
}
html[data-theme='dark'] .form-check-input {
  background-color: #374151;
  border-color: #4b5563;
}
html[data-theme='dark'] .form-check-input:checked {
  background-color: #60a5fa !important;
  border-color: #60a5fa !important;
}
html[data-theme='dark'] .form-check-label { color: #d1d5db; }
html[data-theme='dark'] .form-switch .form-check-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%236b7280'/%3e%3c/svg%3e");
}
html[data-theme='dark'] .form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
}
html[data-theme='dark'] label,
html[data-theme='dark'] .form-label { color: #d1d5db; }
html[data-theme='dark'] .form-text  { color: #9ca3af; }
html[data-theme='dark'] .input-group-text {
  background-color: #374151;
  border-color: #4b5563;
  color: #d1d5db;
}
html[data-theme='dark'] .form-control.is-invalid,
html[data-theme='dark'] .form-select.is-invalid  { border-color: #f87171 !important; }
html[data-theme='dark'] .invalid-feedback { color: #f87171; }
html[data-theme='dark'] .valid-feedback   { color: #34d399; }

/* ---- Dropdowns ---- */
html[data-theme='dark'] .dropdown-menu {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
html[data-theme='dark'] .dropdown-item              { color: #d1d5db; }
html[data-theme='dark'] .dropdown-item:hover,
html[data-theme='dark'] .dropdown-item:focus        { background-color: #374151; color: #f9fafb; }
html[data-theme='dark'] .dropdown-item.active,
html[data-theme='dark'] .dropdown-item:active       { background-color: #60a5fa; color: #111827; }
html[data-theme='dark'] .dropdown-item.disabled,
html[data-theme='dark'] .dropdown-item:disabled     { color: #6b7280; }
html[data-theme='dark'] .dropdown-divider           { border-color: #374151; }
html[data-theme='dark'] .dropdown-header            { color: #9ca3af; }

/* ---- Tables ---- */
html[data-theme='dark'] .table {
  color: #f9fafb;
  border-color: #374151;
}
html[data-theme='dark'] .table > :not(caption) > * > * {
  background-color: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}
html[data-theme='dark'] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255,255,255,.04);
  color: #f9fafb;
}
html[data-theme='dark'] .table-hover > tbody > tr:hover > * {
  background-color: rgba(96,165,250,.1);
  color: #f9fafb;
}
html[data-theme='dark'] thead th,
html[data-theme='dark'] .table > thead > tr > th {
  background-color: #111827 !important;
  color: #9ca3af !important;
  border-color: #374151 !important;
}
html[data-theme='dark'] .table-bordered > :not(caption) > * > * { border-color: #374151; }
html[data-theme='dark'] .table-light,
html[data-theme='dark'] .table-light > * > * {
  background-color: #111827 !important;
  color: #9ca3af !important;
  border-color: #374151 !important;
}

/* ---- Alerts ---- */
html[data-theme='dark'] .alert-primary   { background-color: rgba(96,165,250,.15);  border-color: rgba(96,165,250,.4);  color: #93c5fd; }
html[data-theme='dark'] .alert-success   { background-color: rgba(52,211,153,.15);  border-color: rgba(52,211,153,.4);  color: #6ee7b7; }
html[data-theme='dark'] .alert-danger    { background-color: rgba(248,113,113,.15); border-color: rgba(248,113,113,.4); color: #fca5a5; }
html[data-theme='dark'] .alert-warning   { background-color: rgba(251,191,36,.15);  border-color: rgba(251,191,36,.4);  color: #fde68a; }
html[data-theme='dark'] .alert-info      { background-color: rgba(96,165,250,.15);  border-color: rgba(96,165,250,.4);  color: #93c5fd; }
html[data-theme='dark'] .alert-secondary { background-color: rgba(156,163,175,.15); border-color: rgba(156,163,175,.4); color: #d1d5db; }
html[data-theme='dark'] .alert-light     { background-color: rgba(255,255,255,.08); border-color: #374151; color: #d1d5db; }
html[data-theme='dark'] .alert-dark      { background-color: rgba(156,163,175,.15); border-color: rgba(156,163,175,.3); color: #f9fafb; }

/* ---- Badges ---- */
html[data-theme='dark'] .badge.bg-light,
html[data-theme='dark'] .badge.text-bg-light  { background-color: #374151 !important; color: #d1d5db !important; }
html[data-theme='dark'] .badge.bg-secondary,
html[data-theme='dark'] .badge.text-bg-secondary { background-color: #4b5563 !important; color: #f9fafb !important; }
html[data-theme='dark'] .badge.bg-dark,
html[data-theme='dark'] .badge.text-bg-dark   { background-color: #374151 !important; color: #f9fafb !important; }
html[data-theme='dark'] .badge.bg-primary,
html[data-theme='dark'] .badge.text-bg-primary { background-color: #1e40af !important; color: #bfdbfe !important; }
html[data-theme='dark'] .badge.bg-success     { background-color: rgba(52,211,153,.2) !important; color: #6ee7b7 !important; }
html[data-theme='dark'] .badge.bg-danger      { background-color: rgba(248,113,113,.2) !important; color: #fca5a5 !important; }
html[data-theme='dark'] .badge.bg-warning     { background-color: rgba(251,191,36,.2) !important; color: #fde68a !important; }
html[data-theme='dark'] .badge.bg-info        { background-color: rgba(96,165,250,.2) !important; color: #93c5fd !important; }

/* ---- Buttons ---- */
html[data-theme='dark'] .btn-primary               { background-color: #2563eb; border-color: #2563eb; color: #fff; }
html[data-theme='dark'] .btn-primary:hover,
html[data-theme='dark'] .btn-primary:focus         { background-color: #1d4ed8; border-color: #1d4ed8; color: #fff; }
html[data-theme='dark'] .btn-secondary             { background-color: #374151; border-color: #374151; color: #f9fafb; }
html[data-theme='dark'] .btn-secondary:hover       { background-color: #4b5563; border-color: #4b5563; color: #fff; }
html[data-theme='dark'] .btn-light                 { background-color: #374151; border-color: #374151; color: #f9fafb; }
html[data-theme='dark'] .btn-light:hover           { background-color: #4b5563; border-color: #4b5563; color: #fff; }
html[data-theme='dark'] .btn-outline-primary       { color: #60a5fa; border-color: #60a5fa; }
html[data-theme='dark'] .btn-outline-primary:hover,
html[data-theme='dark'] .btn-outline-primary:focus { background-color: #60a5fa; border-color: #60a5fa; color: #111827; }
html[data-theme='dark'] .btn-outline-secondary     { color: #9ca3af; border-color: #4b5563; }
html[data-theme='dark'] .btn-outline-secondary:hover { background-color: #374151; border-color: #374151; color: #f9fafb; }
html[data-theme='dark'] .btn-outline-danger        { color: #fca5a5; border-color: #f87171; }
html[data-theme='dark'] .btn-outline-danger:hover  { background-color: #f87171; color: #111827; }
html[data-theme='dark'] .btn-outline-success       { color: #6ee7b7; border-color: #34d399; }
html[data-theme='dark'] .btn-outline-success:hover { background-color: #34d399; color: #111827; }
html[data-theme='dark'] .btn-outline-warning       { color: #fde68a; border-color: #fbbf24; }
html[data-theme='dark'] .btn-outline-warning:hover { background-color: #fbbf24; color: #111827; }
html[data-theme='dark'] .btn-link                  { color: #60a5fa; }
html[data-theme='dark'] .btn-link:hover            { color: #93c5fd; }

/* ---- Focus rings (dark background) ---- */
html[data-theme='dark'] .btn:focus,
html[data-theme='dark'] .btn:active:focus,
html[data-theme='dark'] .btn-link.nav-link:focus,
html[data-theme='dark'] .form-control:focus,
html[data-theme='dark'] .form-check-input:focus {
  box-shadow: 0 0 0 .1rem #111827, 0 0 0 .25rem #60a5fa;
}

/* ---- Nav Tabs / Pills ---- */
html[data-theme='dark'] .nav-tabs                  { border-color: #374151; }
html[data-theme='dark'] .nav-tabs .nav-link        { color: #9ca3af; }
html[data-theme='dark'] .nav-tabs .nav-link:hover  { color: #f9fafb; border-color: #374151 #374151 transparent; }
html[data-theme='dark'] .nav-tabs .nav-link.active,
html[data-theme='dark'] .nav-tabs .nav-item.show .nav-link {
  background-color: #1f2937;
  border-color: #374151 #374151 #1f2937;
  color: #f9fafb;
}
html[data-theme='dark'] .nav-pills .nav-link        { color: #9ca3af; }
html[data-theme='dark'] .nav-pills .nav-link.active { background-color: #2563eb; color: #fff; }

/* ---- List Groups ---- */
html[data-theme='dark'] .list-group-item        { background-color: #1f2937; border-color: #374151; color: #d1d5db; }
html[data-theme='dark'] .list-group-item:hover  { background-color: #374151; color: #f9fafb; }
html[data-theme='dark'] .list-group-item.active { background-color: #2563eb; border-color: #2563eb; color: #fff; }
html[data-theme='dark'] .list-group-item.disabled { color: #6b7280; background-color: transparent; }

/* ---- Breadcrumbs ---- */
html[data-theme='dark'] .breadcrumb-item a                  { color: #60a5fa; }
html[data-theme='dark'] .breadcrumb-item.active             { color: #9ca3af; }
html[data-theme='dark'] .breadcrumb-item + .breadcrumb-item::before { color: #6b7280; }

/* ---- Pagination ---- */
html[data-theme='dark'] .page-link               { background-color: #1f2937; border-color: #374151; color: #60a5fa; }
html[data-theme='dark'] .page-link:hover         { background-color: #374151; border-color: #4b5563; color: #93c5fd; }
html[data-theme='dark'] .page-item.active .page-link   { background-color: #2563eb; border-color: #2563eb; color: #fff; }
html[data-theme='dark'] .page-item.disabled .page-link { background-color: #1f2937; border-color: #374151; color: #6b7280; }

/* ---- Toasts ---- */
html[data-theme='dark'] .toast        { background-color: rgba(31,41,55,.96); border-color: #374151; color: #f9fafb; }
html[data-theme='dark'] .toast-header { background-color: rgba(31,41,55,.9);  border-color: #374151; color: #d1d5db; }

/* ---- Accordions ---- */
html[data-theme='dark'] .accordion-item    { background-color: #1f2937; border-color: #374151; }
html[data-theme='dark'] .accordion-button { background-color: #1f2937; color: #f9fafb; }
html[data-theme='dark'] .accordion-button:not(.collapsed) { background-color: rgba(96,165,250,.1); color: #60a5fa; }
html[data-theme='dark'] .accordion-button::after { filter: invert(1); }
html[data-theme='dark'] .accordion-body           { color: #d1d5db; }

/* ---- Progress ---- */
html[data-theme='dark'] .progress { background-color: #374151; }

/* ---- Page Hero ---- */
html[data-theme='dark'] .page-hero {
  background: linear-gradient(135deg, rgba(31,41,55,.9) 0%, rgba(17,24,39,.95) 100%);
  border-color: #374151;
  color: #f9fafb;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.6);
}
html[data-theme='dark'] .page-hero::after    { opacity: .3; }
html[data-theme='dark'] .page-hero__eyebrow  { background: rgba(96,165,250,.15); color: #93c5fd; }
/* Base subtitle — beats specificity (0,1,0) of .page-hero__subtitle */
html[data-theme='dark'] .page-hero__subtitle { color: #d1d5db; }
/* Variant overrides — must match the 3-class specificity of the light-mode rules so dark wins */
html[data-theme='dark'] .page-hero.page-hero--accent .page-hero__subtitle,
html[data-theme='dark'] .page-hero.page-hero--light  .page-hero__subtitle,
html[data-theme='dark'] .page-hero.page-hero--subtle .page-hero__subtitle { color: #d1d5db; }
html[data-theme='dark'] .page-hero.page-hero--slate {
  background: linear-gradient(135deg, rgba(17,24,39,.95), rgba(30,58,138,.85));
}

/* ---- Option Cards ---- */
html[data-theme='dark'] .option-card__body {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}
html[data-theme='dark'] .option-card__title  { color: #f9fafb; }
html[data-theme='dark'] .option-card__meta   { color: #9ca3af; }
html[data-theme='dark'] .option-card__swatch {
  border-color: #374151;
  background: linear-gradient(135deg, #1f2937 0%, rgba(31,41,55,.9) 100%);
}
html[data-theme='dark'] .option-card__swatch-accent { box-shadow: 0 8px 18px rgba(96,165,250,.22); }
html[data-theme='dark'] .option-card__icon   { background: rgba(96,165,250,.1); border-color: #374151; color: #60a5fa; }

/* ---- Misc Custom ---- */
html[data-theme='dark'] code       { background-color: #374151; color: #f97316; border-radius: 4px; padding: .1em .3em; }
html[data-theme='dark'] pre        { background-color: #1f2937 !important; border-color: #374151; color: #e2e8f0 !important; }
html[data-theme='dark'] blockquote { border-left-color: #4b5563; color: #9ca3af; }
html[data-theme='dark'] .card-panel__title    { color: #f9fafb; }
html[data-theme='dark'] .card-panel__subtitle { color: #9ca3af; }
html[data-theme='dark'] .btn-ghost {
  border-color: #374151; color: #d1d5db;
  background: rgba(55,65,81,.4);
}
html[data-theme='dark'] .btn-ghost:hover,
html[data-theme='dark'] .btn-ghost:focus {
  border-color: #60a5fa; color: #f9fafb;
  background: rgba(96,165,250,.1);
}
html[data-theme='dark'] .badge-soft { background: rgba(96,165,250,.15); color: #93c5fd; }

/* ---- Nav / run loading overlays ---- */
html[data-theme='dark'] .nav-loading-overlay          { background: rgba(17,24,39,.96); }
html[data-theme='dark'] .nav-loading-overlay__card    { background: #1f2937; box-shadow: 0 1.5rem 3.5rem rgba(0,0,0,.5); }
html[data-theme='dark'] .nav-loading-overlay__title   { color: #f9fafb; }
html[data-theme='dark'] .nav-loading-overlay__text    { color: #9ca3af; }
html[data-theme='dark'] .run-details-loading-overlay  { background: rgba(17,24,39,.96); }
html[data-theme='dark'] .run-details-loading-card     { background: #1f2937; box-shadow: 0 1.5rem 3.5rem rgba(0,0,0,.5); }
html[data-theme='dark'] .run-details-loading-title    { color: #f9fafb; }
html[data-theme='dark'] .run-details-loading-text     { color: #9ca3af; }

/* ---- Shared upload components (.hint / .subtle / .uploader / .file-chip / .cloud-tile) ---- */
html[data-theme='dark'] .hint   { color: #9ca3af !important; }
html[data-theme='dark'] .subtle { color: #9ca3af !important; }
html[data-theme='dark'] .uploader {
  background: #1f2937 !important;
  border-color: #374151 !important;
}
html[data-theme='dark'] .uploader:hover  { background: #374151 !important; }
html[data-theme='dark'] .uploader.ring   {
  background: rgba(96,165,250,.08) !important;
  border-color: #60a5fa !important;
}
html[data-theme='dark'] .file-chip {
  background: #374151 !important;
  border-color: #4b5563 !important;
  color: #f9fafb !important;
}
html[data-theme='dark'] .cloud-tile {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #f9fafb !important;
}
html[data-theme='dark'] .cloud-tile:hover:not(.disabled) {
  border-color: #60a5fa !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.4) !important;
}

html[data-theme='dark'] .scheduled-card   { border-left-color: #60a5fa; }
html[data-theme='dark'] .scheduled-empty {
  background: linear-gradient(135deg, rgba(96,165,250,.05), rgba(52,211,153,.05));
}
html[data-theme='dark'] .theme-switcher-panel__header .material-symbols-outlined {
  background: rgba(96,165,250,.1);
  color: #60a5fa;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  background-color: var(--color-background, #f7f9fc);
  color: var(--color-text, #1f2933);
}

.page-hero {
  position: relative;
  border-radius: 18px;
  padding: 2.5rem 1.75rem;
  margin-bottom: 2.5rem;
  color: var(--color-text, #061120);
  background: linear-gradient(135deg, rgba(80, 115, 255, 0.16), rgba(94, 234, 212, 0.18));
  border: 1px solid rgba(99, 102, 241, 0.12);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: -60% 45% auto -15%;
  height: 260%;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.35), rgba(59, 130, 246, 0));
  pointer-events: none;
  opacity: 0.8;
}

.page-hero__content {
  position: relative;
  max-width: 720px;
  z-index: 1;
}

.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563eb;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  margin-bottom: 1rem;
}

.page-hero__title {
  font-family: var(--font-heading, "Poppins", "Segoe UI", sans-serif);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.85rem);
  margin-bottom: 1rem;
  color: inherit;
}

.page-hero__subtitle {
  font-size: 1.08rem;
  line-height: 1.75;
  color: rgba(6, 17, 32, 0.9);
  margin: 0;
}

.page-hero.manage-page-hero {
  margin-bottom: 2rem;
}

.page-hero.page-hero--accent {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(59, 130, 246, 0.15));
  border-color: rgba(99, 102, 241, 0.2);
}

.page-hero.page-hero--slate {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 64, 175, 0.75));
  color: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.5);
}

.page-hero.page-hero--slate .page-hero__subtitle {
  color: rgba(248, 250, 252, 0.92);
}

.page-hero.page-hero--center {
  text-align: center;
  padding-block: 2.75rem;
}

.page-hero.page-hero--center .page-hero__content {
  margin: 0 auto;
  text-align: center;
}

.page-hero.page-hero--center .page-hero__eyebrow {
  margin-left: auto;
  margin-right: auto;
}

.export-options[aria-disabled="true"],
.export-options.is-disabled {
  position: relative;
  opacity: 0.55;
  pointer-events: none;
}

.export-options[aria-disabled="true"]::after,
.export-options.is-disabled::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.35);
}

.scheduled-section {
  margin-top: 3rem;
}

.scheduled-section__header {
  margin-bottom: 1.5rem;
}

.scheduled-section__header p {
  max-width: 560px;
}

.scheduled-empty {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(14, 116, 144, 0.08));
}

.scheduled-card {
  border-left: 4px solid #4f46e5;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scheduled-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 35px -12px rgba(15, 23, 42, 0.2);
}

@media (max-width: 768px) {
  .page-hero {
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
  }

  .page-hero__title {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
  }

  .page-hero__subtitle {
    font-size: 1.02rem;
  }
}

@media (max-width: 480px) {
  .page-hero {
    padding: 1.8rem 1.25rem;
    margin-bottom: 1.75rem;
  }

  .page-hero__eyebrow {
    font-size: 0.85rem;
  }
}

.layout-main {
  padding: 2rem 1.5rem;
}

@media (min-width: 992px) {
  .layout-main {
    padding: 3rem 2rem;
  }
}

@media (min-width: 1400px) {
  .layout-main {
    padding: 3rem 4rem;
  }
}

@media (min-width: 1920px) {
  .layout-main {
    padding: 4rem 6rem;
  }
}

@media (max-width: 768px) {
  .layout-main {
    align-items: flex-start !important;
    padding: 1.5rem 1rem;
  }
}

.content-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 1920px) {
  .content-wrapper {
    max-width: 1600px;
  }
}

@media (min-width: 2560px) {
  .content-wrapper {
    max-width: 1920px;
  }
}

.modern-header .navbar-nav .nav-link.btn {
  border-radius: 999px;
}

.cookie-consent-footer {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  padding: 0 1rem;
  z-index: 1080;
  display: none;
  pointer-events: none;
}

.cookie-consent-footer[aria-hidden="false"] {
  display: flex;
  justify-content: center;
}

.cookie-consent-panel {
  width: min(960px, 100%);
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 16px 45px -18px rgba(15, 23, 42, 0.25);
  padding: 0.85rem 1rem;
  pointer-events: auto;
}

.cookie-consent-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.cookie-consent-text {
  flex-grow: 1;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .cookie-consent-panel {
    padding: 1rem;
  }
  .cookie-consent-content {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  .cookie-consent-actions {
    flex-direction: column;
  }
  .cookie-consent-actions .btn {
    width: 100%;
  }
}


button.is-loading {
  cursor: wait;
}

.btn-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

button.is-loading .btn-label {
  opacity: 0.85;
}

.recaptcha-error {
  margin-bottom: 1rem;
}

.btn-spinner {
  display: inline-flex;
  align-items: center;
}

.scan-form .input-group-text {
  font-size: 1.25rem;
  background-color: #ffffff;
  border-right: 0;
}

.scan-form .input-group .form-control-lg {
  font-size: 1rem;
  border-left: 0;
}

.export-options {
  background-color: #f8fbff;
  border-color: rgba(37, 140, 251, 0.25);
}

.scan-history-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background-color: #ffffff;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scan-history-actions .btn.disabled,
.scan-history-actions .btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.65;
}

@media (max-width: 576px) {
  .scan-history-actions .btn {
    flex: 1 1 100%;
  }
}

.profile-controls {
  flex-wrap: nowrap;
}

.profile-controls .nav-profile-link {
  display: inline-flex;
  align-items: center;
  max-width: clamp(140px, 22vw, 240px);
  white-space: nowrap;
  overflow: hidden;
}

.profile-controls .nav-profile-text {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (max-width: 767.98px) {
  .profile-controls {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .profile-controls .nav-link {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #a11yWidgetWrapper {
    display: none !important;
  }

  .profile-controls .d-flex {
    gap: 0.5rem;
  }
}

/* Accessibility styles */

body.grayscale {
    filter: grayscale(100%);
}

body.high-contrast {
    background-color: #000;
    color: #fff;
}

body.high-contrast a {
    color: #ffff00;
}

body.negative-contrast {
    filter: invert(100%);
}

/* Oversize file highlight - used by doc Upload page */
.file-chip.oversize {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220,53,69,.15);
    animation: pulseRed 1.6s ease-in-out 1;
}

@keyframes pulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(220,53,69,.35);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(220,53,69,0);
    }
}


/* FAQ layout refinements */
.faq-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.faq-card {
    display: flex;
    flex-direction: column;
}

.faq-card__title {
    margin-bottom: 0.5rem;
}

.faq-card .faq-item:first-of-type {
    margin-top: 1.5rem;
}

.faq-item {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 0.9rem;
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover,
.faq-item:focus-within {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 12px 30px -18px rgba(37, 99, 235, 0.35);
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-weight: 700;
    font-size: 1.25rem;
    color: #2563eb;
}

.faq-card details[open] > summary::after {
    content: '-';
}

.faq-item summary:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 3px;
    border-radius: 0.75rem;
}

.faq-item > *:not(summary) {
    margin-top: 0.75rem;
    color: #475569;
}

.faq-item p {
    margin-bottom: 0;
    line-height: 1.65;
}

.faq-item code {
    background: rgba(15, 23, 42, 0.08);
    border-radius: 0.35rem;
    padding: 0.05rem 0.4rem;
}

@media (max-width: 767.98px) {
    .faq-card-grid {
        gap: 1.75rem;
    }

    .faq-item {
        padding: 0.85rem 0.95rem;
    }

    .faq-item summary {
        font-size: 1rem;
    }
}

/* Manage header card tweaks */
.manage-card-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.manage-card-header__eyebrow {
    align-self: flex-start;
    margin-bottom: 0.5rem;
}

.manage-card-header__title {
    margin-bottom: 0.25rem;
}

.manage-card-header__subtitle {
    color: #475569;
    margin: 0;
    line-height: 1.65;
}

/* History start time column */
.history-start-time {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 7ch;
}

.history-start-time-line {
    display: block;
    line-height: 1.2;
}

.status-table {
    table-layout: fixed;
    width: 100%;
}

.status-table .file-cell {
    max-width: 260px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.status-table .error-hint {
    display: inline-block;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-table .action-buttons {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 767.98px) {
    .status-table .file-cell {
        max-width: 200px;
    }
}
.settings-icon {
    color: #0ea5e9;
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease-in-out;
}

.nav-link:hover .settings-icon,
.nav-link:focus-visible .settings-icon {
    color: #0284c7;
}

.header-run-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.header-run-search__toggle {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: #0f172a;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.header-run-search__toggle:hover,
.header-run-search__toggle:focus-visible,
.header-run-search[data-open="true"] .header-run-search__toggle {
    color: #2563eb;
    transform: scale(1.03);
}

.header-run-search__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: min(24rem, 86vw);
    transform: translateX(var(--header-run-search-shift-x, 0px));
    z-index: 1100;
    background:
        linear-gradient(180deg, #f8fbff 0%, #ffffff 52%),
        #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 0.8rem;
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.22);
    padding: 0.7rem 0.7rem 0.55rem;
}

.header-run-search__input {
    font-size: 0.95rem;
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.05);
}

.header-run-search__status {
    margin-top: 0.55rem;
    font-size: 0.95rem;
    color: #475569;
}

.header-run-search__results {
    margin-top: 0.55rem;
    max-height: 16rem;
    overflow-y: auto;
}

.header-run-search__results li + li {
    margin-top: 0.4rem;
}

.header-run-search__result-link {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 0.65rem;
    padding: 0.52rem 0.58rem;
    text-decoration: none;
    background: #ffffff;
    color: #0f172a;
    overflow: hidden;
}

.header-run-search__result-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0.26rem;
    border-radius: 0.65rem 0 0 0.65rem;
    background: var(--run-accent, #64748b);
}

.header-run-search__result-link--web {
    --run-accent: #0ea5e9;
}

.header-run-search__result-link--document {
    --run-accent: #f59e0b;
}

.header-run-search__result-link--mobile {
    --run-accent: #22c55e;
}

.header-run-search__result-link--other {
    --run-accent: #8b5cf6;
}

.header-run-search__result-link:hover,
.header-run-search__result-link:focus-visible {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #0f172a;
    text-decoration: none;
}

.header-run-search__result-link--web:hover,
.header-run-search__result-link--web:focus-visible {
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(14, 165, 233, 0.08);
}

.header-run-search__result-link--document:hover,
.header-run-search__result-link--document:focus-visible {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.09);
}

.header-run-search__result-link--mobile:hover,
.header-run-search__result-link--mobile:focus-visible {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.09);
}

.header-run-search__result-link--other:hover,
.header-run-search__result-link--other:focus-visible {
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.09);
}

.header-run-search__result-icon {
    width: 1.95rem;
    height: 1.95rem;
    flex: 0 0 1.95rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.04rem;
    background: #f1f5f9;
    color: #334155;
}

.header-run-search__result-icon--web {
    background: rgba(14, 165, 233, 0.14);
    color: #0c4a6e;
}

.header-run-search__result-icon--document {
    background: rgba(245, 158, 11, 0.14);
    color: #78350f;
}

.header-run-search__result-icon--mobile {
    background: rgba(34, 197, 94, 0.14);
    color: #14532d;
}

.header-run-search__result-icon--other {
    background: rgba(139, 92, 246, 0.13);
    color: #4c1d95;
}

.header-run-search__result-icon-glyph {
    font-size: 1.05rem;
    line-height: 1;
}

.header-run-search__result-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.header-run-search__result-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.header-run-search__mark {
    background: #fff4a3;
    color: inherit;
    padding: 0 0.08rem;
    border-radius: 0.2rem;
}

.header-run-search__result-chips {
    margin-top: 0.3rem;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.header-run-search__chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.23rem 0.46rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.header-run-search__chip--source {
    color: #0f172a;
    background: #f8fafc;
}

.header-run-search__chip--web {
    border-color: rgba(14, 165, 233, 0.42);
    background: rgba(14, 165, 233, 0.1);
}

.header-run-search__chip--document {
    border-color: rgba(245, 158, 11, 0.42);
    background: rgba(245, 158, 11, 0.12);
}

.header-run-search__chip--mobile {
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(34, 197, 94, 0.12);
}

.header-run-search__chip--other {
    border-color: rgba(139, 92, 246, 0.42);
    background: rgba(139, 92, 246, 0.1);
}

.header-run-search__chip--status {
    font-weight: 600;
    text-transform: none;
}

.header-run-search__chip--success {
    color: #14532d;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
}

.header-run-search__chip--failed {
    color: #7f1d1d;
    border-color: rgba(239, 68, 68, 0.36);
    background: rgba(239, 68, 68, 0.1);
}

.header-run-search__chip--partial {
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.36);
    background: rgba(245, 158, 11, 0.12);
}

.header-run-search__chip--cancelled {
    color: #374151;
    border-color: rgba(107, 114, 128, 0.36);
    background: rgba(107, 114, 128, 0.12);
}

.header-run-search__chip--active {
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.36);
    background: rgba(59, 130, 246, 0.1);
}

.header-run-search__chip--neutral {
    color: #334155;
    border-color: rgba(100, 116, 139, 0.32);
    background: rgba(148, 163, 184, 0.12);
}

.header-run-search__result-meta {
    display: block;
    margin-top: 0.28rem;
    font-size: 0.95rem;
    color: #475569;
}

.header-run-search__help {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    color: #475569;
}

.header-run-search__pager {
    margin-top: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.header-run-search__pager-btn {
    width: 2.1rem;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.header-run-search__pager-btn .material-symbols-outlined {
    font-size: 1.05rem;
    line-height: 1;
}

.header-run-search__pager-btn:hover:not(:disabled),
.header-run-search__pager-btn:focus-visible:not(:disabled) {
    background: rgba(30, 64, 175, 0.08);
    border-color: rgba(30, 64, 175, 0.45);
    color: #1e40af;
}

.header-run-search__pager-summary {
    font-size: 0.95rem;
    color: #475569;
    text-align: center;
    flex: 1 1 auto;
    min-width: 0;
}

.header-run-search__help a {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: underline;
}

.header-run-search__help a:hover,
.header-run-search__help a:focus-visible {
    color: #1e40af;
}

@media (max-width: 767.98px) {
    .header-run-search__panel {
        right: 0;
        width: min(22rem, calc(100vw - 1rem));
    }
}

.upload-status-icon {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: #16a34a;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.upload-status-icon__glyph {
    position: relative;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
}

.upload-status-icon__glyph-idle {
    display: inline-flex;
    color: #16a34a;
    transition: transform 0.2s ease-in-out;
}

.upload-status-icon__glyph-active {
    display: none;
    color: #f97316;
    font-size: 1.45rem;
}
.upload-status-icon__indicator {
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    right: -0.05rem;
    top: -0.05rem;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.35);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.upload-status-icon[data-has-jobs="true"] {
    color: #f97316;
    transform: scale(1.05);
}

.upload-status-icon[data-has-jobs="true"] .upload-status-icon__indicator {
    background: #f97316;
    opacity: 1;
    transform: scale(1);
    animation: upload-indicator-pulse 1.2s ease-in-out infinite;
}

.upload-status-icon[data-has-jobs="true"] .upload-status-icon__glyph-idle {
    display: none;
}

.upload-status-icon[data-has-jobs="true"] .upload-status-icon__glyph-active {
    display: block;
}

@keyframes upload-indicator-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.45);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    }
}

/* Run logs run-picker dropdown */
[data-run-picker] .form-select[data-run-input] {
    cursor: text;
}

[data-run-picker] .dropdown-menu[data-run-menu] {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    width: 100%;
    max-height: 16rem;
    overflow-y: auto;
    margin-top: 0.125rem;
    padding: 0;
    border-radius: 0.375rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background-color: #ffffff;
    box-shadow: 0 12px 30px -18px rgba(15, 23, 42, 0.45);
}

    [data-run-picker] .dropdown-menu[data-run-menu] .dropdown-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

/* WCAG contrast and readable text hardening for user-facing pages */
:root {
    --bs-body-color: #1f2937;
    --bs-secondary-color: #475569;
    --bs-link-color: #0b5ed7;
    --bs-link-hover-color: #084298;
    --bs-info-text-emphasis: #0f3d64;
    --bs-info-bg-subtle: #e8f3ff;
    --bs-info-border-subtle: #7db7f0;
    --bs-warning-text-emphasis: #6a3d00;
    --bs-warning-bg-subtle: #fff4d6;
    --bs-warning-border-subtle: #d4a72c;
}

body {
    line-height: 1.6;
}

small,
.small,
.form-text,
.text-muted,
.text-secondary,
.text-body-secondary,
.option-card__meta {
    font-size: 0.95rem !important;
    line-height: 1.55;
}

.text-muted,
.text-secondary,
.text-body-secondary,
.form-text,
.option-card__meta {
    color: #475569 !important;
}

.dropdown-item.text-muted,
.dropdown-item.text-secondary,
.dropdown-item.text-body-secondary {
    color: #334155 !important;
}

.btn-sm,
.form-control-sm,
.form-select-sm {
    font-size: 0.95rem;
}

.btn-outline-secondary {
    color: #334155;
    border-color: #64748b;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-secondary.active {
    color: #ffffff;
    background-color: #334155;
    border-color: #334155;
}

.btn-outline-primary {
    color: #0b5ed7;
    border-color: #0b5ed7;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
    color: #ffffff;
    background-color: #0b5ed7;
    border-color: #0b5ed7;
}

.btn-outline-success {
    color: #146c43;
    border-color: #146c43;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active,
.btn-outline-success.active {
    color: #ffffff;
    background-color: #146c43;
    border-color: #146c43;
}

.btn-outline-danger {
    color: #b02a37;
    border-color: #b02a37;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active,
.btn-outline-danger.active {
    color: #ffffff;
    background-color: #b02a37;
    border-color: #b02a37;
}

.btn-outline-warning {
    color: #8a4b00;
    border-color: #8a4b00;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active,
.btn-outline-warning.active {
    color: #ffffff;
    background-color: #8a4b00;
    border-color: #8a4b00;
}

.alert-info {
    color: #0f3d64;
    background-color: #e8f3ff;
    border-color: #7db7f0;
}

.alert-warning {
    color: #6a3d00;
    background-color: #fff4d6;
    border-color: #d4a72c;
}

.page-hero.page-hero--accent,
.page-hero.page-hero--light,
.page-hero.page-hero--subtle {
    color: #061120;
}

.page-hero.page-hero--accent .page-hero__subtitle,
.page-hero.page-hero--light .page-hero__subtitle,
.page-hero.page-hero--subtle .page-hero__subtitle {
    color: rgba(6, 17, 32, 0.9);
}

html[data-theme='dark'] .page-hero.page-hero--accent,
html[data-theme='dark'] .page-hero.page-hero--light,
html[data-theme='dark'] .page-hero.page-hero--subtle {
    color: #f9fafb;
}
