/*
الملف: site.css
الغرض: الألوان والخطوط والتخطيط.
يرتبط بـ: _Layout.cshtml، وbootstrap.rtl.min.css، وfonts.css.
السبب: كل شكل الموقع في ملف واحد بالمتغيرات، فيُغيَّر اللون أو الخط من مكان واحد.
File: site.css
Purpose: Colors, fonts and layout.
Related to: _Layout.cshtml, bootstrap.rtl.min.css, fonts.css.
Why: The whole look of the site is in one file built on variables, so a color or font changes in one place.
*/
:root {
  --c-bg-0: #05080D; --c-bg-1: #0A131C; --c-bg-2: #0F1C27; --c-bg-3: #152634;
  --c-line: #22313F; --c-line-strong: #33465A;
  --c-ink: #F3EFE6; --c-muted: #A7B3BF; --c-dim: #7D8B99;
  --c-gold: #E2B866; --c-gold-soft: rgba(226, 184, 102, .14);
  --c-teal: #3FD0C9; --c-teal-soft: rgba(63, 208, 201, .12);
  --c-red: #E7877F; --c-red-soft: rgba(231, 135, 127, .14);
  --glow-gold: 0 0 28px rgba(226, 184, 102, .45);
  --glow-teal: 0 0 18px rgba(63, 208, 201, .35);
  --c-seat: #0B1621; --c-core: #0D1E28;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font-display: "Cairo Variable", "Noto Sans Arabic Variable", system-ui, sans-serif;
  --font-body: "Noto Sans Arabic Variable", "Cairo Variable", system-ui, sans-serif;
}
[data-bs-theme="dark"] {
  --bs-body-bg: var(--c-bg-0); --bs-body-color: var(--c-ink);
  --bs-secondary-color: var(--c-muted); --bs-border-color: var(--c-line);
  --bs-primary: var(--c-gold); --bs-primary-rgb: 226, 184, 102;
  --bs-link-color: var(--c-teal); --bs-link-hover-color: var(--c-ink);
  --bs-body-font-family: var(--font-body); --bs-body-line-height: 1.85;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 800; letter-spacing: 0; }
h1 { font-size: clamp(2.25rem, 4.5vw, 3.75rem); line-height: 1.25; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.35; }
html { scroll-behavior: auto; }
:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

:root {
  --hall: radial-gradient(120% 90% at 50% 70%, #143440 0%, #0A1520 50%, #04070C 100%);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
  scroll-margin-top: calc(72px + env(safe-area-inset-top));
}

main:focus {
  outline: 0;
}

:root {
  scroll-behavior: auto;
  scroll-padding-top: calc(88px + env(safe-area-inset-top));
}

/* Keeps a focused field near the bottom edge clear of the fixed chat button. */
:root:has(.chat-widget) { scroll-padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }

img { max-width: 100%; height: auto; }

a { color: var(--c-teal); }
a:where(:hover, :focus-visible) { color: var(--c-ink); }

/* A text link inside a line: vertical padding grows its hit box to 44px without changing the line spacing. */
:where(a:not([class])) { padding-block: max(5px, calc((44px - 2em) / 2)); }

input,
select,
textarea,
.form-control,
.form-control-sm,
.form-select,
.form-select-sm {
  font-size: max(16px, 1rem);
}

.container-xxl { --bs-gutter-x: 3rem; }

a.visually-hidden-focusable:focus {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  inset-inline-start: calc(8px + max(env(safe-area-inset-left), env(safe-area-inset-right)));
  z-index: 1100;
  padding: 12px 24px;
  border-radius: 10px;
  background: var(--c-gold);
  color: var(--c-bg-0);
  font-weight: 600;
  text-decoration: none;
}

.hall { background: var(--hall); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding-top: env(safe-area-inset-top);
  background: rgba(5, 8, 13, .72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-line);
}

.site-header .navbar {
  --bs-navbar-padding-y: 12px;
  --bs-navbar-color: var(--c-muted);
  --bs-navbar-hover-color: var(--c-ink);
  --bs-navbar-active-color: var(--c-gold);
  --bs-navbar-brand-color: var(--c-ink);
  --bs-navbar-brand-hover-color: var(--c-ink);
  --bs-navbar-toggler-border-color: var(--c-line-strong);
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23F3EFE6' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-brand,
.site-brand:hover,
.site-brand:focus-visible {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-inline-end: 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--c-ink);
  text-decoration: none;
}

.site-brand img {
  width: 28px;
  height: 28px;
  flex: none;
}

.site-header .navbar-toggler {
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
}

.site-header .navbar-collapse { padding-block: 8px; }

@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    max-height: calc(100dvh - 72px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.site-header .nav-link {
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding-block: 10px;
  color: var(--c-muted);
  text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.site-header .nav-link:hover,
.site-header .nav-link:focus-visible {
  color: var(--c-ink);
}

.site-header .nav-link.active,
.site-header .nav-link[aria-current="page"] {
  color: var(--c-gold);
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.btn:focus-visible,
.btn-check:focus-visible + .btn,
.nav-link:focus-visible,
.navbar-toggler:focus-visible,
.form-check-input:focus-visible,
.btn-close:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 2px;
  box-shadow: none;
}

.site-alerts {
  display: grid;
  gap: 12px;
  padding-block-start: 16px;
}

.site-alerts .alert { margin-bottom: 0; }

.page-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 56px 72px;
  background: var(--hall);
  border-bottom: 1px solid var(--c-line);
}

.page-band h1 { margin: 0; }

.page-band .crumbs {
  flex-basis: 100%;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--c-muted);
}

/* Breadcrumb links are navigation targets, not text inside a sentence, so they get the full 44px box. */
.page-band .crumbs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: inherit;
}

.page-band.page-band-admin {
  background: var(--c-bg-1);
}

.page-band-admin .crumbs { color: var(--c-dim); }

.auth-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70dvh;
  padding: 56px 16px;
  background: var(--hall);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}

.auth-card.auth-card-wide { max-width: 560px; }

/* Two classes, so it wins over the general .form-control size and height below. */
.form-control.otp-input {
  height: auto;
  min-height: 60px;
  padding-block: 8px;
  font-size: 28px;
  line-height: 1.4;
  letter-spacing: 8px;
  text-indent: 8px; /* balances the space letter-spacing leaves after the last digit */
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.otp-countdown { font-variant-numeric: tabular-nums; }

.auth-card h1 {
  margin-bottom: 24px;
  font-size: 30px;
  line-height: 1.4;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block: 20px;
  font-size: 13px;
  color: var(--c-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-line);
}

.btn {
  --bs-btn-padding-x: 24px;
  --bs-btn-padding-y: 12px;
  --bs-btn-border-radius: 10px;
  --bs-btn-font-weight: 600;
  --bs-btn-active-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.btn-sm {
  --bs-btn-padding-x: 16px;
  --bs-btn-padding-y: 6px;
  --bs-btn-font-size: .875rem;
  min-height: 44px;
}

.btn-primary {
  --bs-btn-color: var(--c-bg-0);
  --bs-btn-bg: var(--c-gold);
  --bs-btn-border-color: var(--c-gold);
  --bs-btn-hover-color: var(--c-bg-0);
  --bs-btn-hover-bg: var(--c-gold);
  --bs-btn-hover-border-color: var(--c-gold);
  --bs-btn-active-color: var(--c-bg-0);
  --bs-btn-active-bg: var(--c-gold);
  --bs-btn-active-border-color: var(--c-gold);
  --bs-btn-disabled-color: var(--c-bg-0);
  --bs-btn-disabled-bg: var(--c-gold);
  --bs-btn-disabled-border-color: var(--c-gold);
}

.btn-primary:hover:not(:disabled):not(.disabled) { box-shadow: var(--glow-gold); }

.btn-outline-primary {
  --bs-btn-color: var(--c-gold);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--c-gold);
  --bs-btn-hover-color: var(--c-gold);
  --bs-btn-hover-bg: var(--c-gold-soft);
  --bs-btn-hover-border-color: var(--c-gold);
  --bs-btn-active-color: var(--c-gold);
  --bs-btn-active-bg: var(--c-gold-soft);
  --bs-btn-active-border-color: var(--c-gold);
  --bs-btn-disabled-color: var(--c-gold);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--c-gold);
}

.btn-secondary {
  --bs-btn-color: var(--c-ink);
  --bs-btn-bg: var(--c-bg-3);
  --bs-btn-border-color: var(--c-line-strong);
  --bs-btn-hover-color: var(--c-ink);
  --bs-btn-hover-bg: var(--c-bg-3);
  --bs-btn-hover-border-color: var(--c-muted);
  --bs-btn-active-color: var(--c-ink);
  --bs-btn-active-bg: var(--c-bg-3);
  --bs-btn-active-border-color: var(--c-muted);
  --bs-btn-disabled-color: var(--c-ink);
  --bs-btn-disabled-bg: var(--c-bg-3);
  --bs-btn-disabled-border-color: var(--c-line-strong);
}

.btn-danger {
  --bs-btn-color: var(--c-red);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--c-red);
  --bs-btn-hover-color: var(--c-red);
  --bs-btn-hover-bg: var(--c-red-soft);
  --bs-btn-hover-border-color: var(--c-red);
  --bs-btn-active-color: var(--c-red);
  --bs-btn-active-bg: var(--c-red-soft);
  --bs-btn-active-border-color: var(--c-red);
  --bs-btn-disabled-color: var(--c-red);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--c-red);
}

.btn-outline-secondary {
  --bs-btn-color: var(--c-muted);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--c-line-strong);
  --bs-btn-hover-color: var(--c-gold);
  --bs-btn-hover-bg: var(--c-gold-soft);
  --bs-btn-hover-border-color: var(--c-gold);
  --bs-btn-active-color: var(--c-gold);
  --bs-btn-active-bg: var(--c-gold-soft);
  --bs-btn-active-border-color: var(--c-gold);
  --bs-btn-disabled-color: var(--c-muted);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--c-line-strong);
}

.btn-check:checked + .btn-outline-secondary {
  color: var(--c-gold);
  background-color: var(--c-gold-soft);
  border-color: var(--c-gold);
}

.card {
  --bs-card-bg: var(--c-bg-2);
  --bs-card-color: var(--c-ink);
  --bs-card-border-color: var(--c-line);
  --bs-card-border-radius: 16px;
  --bs-card-inner-border-radius: 15px;
  --bs-card-spacer-x: 24px;
  --bs-card-spacer-y: 24px;
  --bs-card-cap-padding-x: 24px;
  --bs-card-cap-padding-y: 16px;
  --bs-card-cap-bg: var(--c-bg-3);
}

a.card {
  text-decoration: none;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}

a.card:hover,
a.card:focus-visible {
  --bs-card-bg: var(--c-bg-3);
  background-color: var(--c-bg-3);
  color: var(--c-ink);
}

.card h2 { font-size: 1.5rem; }
.card h3 { font-size: 1.25rem; }

.form-label {
  margin-bottom: 8px;
  font-weight: 500;
}

.form-control,
.form-select {
  height: 46px;
  min-height: 46px;
  padding: 10px 16px;
  background-color: var(--c-bg-1);
  color: var(--c-ink);
  border: 1px solid var(--c-muted);
  border-radius: 10px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

textarea.form-control {
  height: auto;
  min-height: 46px;
}

.form-control::placeholder { color: var(--c-dim); opacity: 1; }

.form-control::file-selector-button {
  background-color: var(--c-bg-3);
  color: var(--c-ink);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--c-bg-1);
  color: var(--c-ink);
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(226, 184, 102, .25);
  outline: 2px solid transparent;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background-color: var(--c-bg-0);
  color: var(--c-muted);
  border-color: var(--c-line-strong);
}

.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border-color: var(--c-red);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
.was-validated .form-control:invalid:focus,
.was-validated .form-select:invalid:focus {
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px var(--c-red-soft);
}

.form-check { padding-inline-start: 1.75em; }

.form-check .form-check-input { margin-inline-start: -1.75em; }

.form-check-label { padding-block: 8px; }

.form-check-input {
  width: 1.25em;
  height: 1.25em;
  margin-top: calc(.3em + 8px);
  background-color: var(--c-bg-1);
  border: 1px solid var(--c-muted);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.form-check-input:focus {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(226, 184, 102, .25);
}

.form-check-input:checked {
  background-color: var(--c-gold);
  border-color: var(--c-gold);
}

.form-check-input:checked[type=checkbox] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2305080D' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type=radio] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%2305080D'/%3e%3c/svg%3e");
}

.form-check-input.is-invalid,
.was-validated .form-check-input:invalid {
  border-color: var(--c-red);
}

.form-check-input.is-invalid ~ .form-check-label,
.was-validated .form-check-input:invalid ~ .form-check-label {
  color: var(--c-ink);
}

.form-text { color: var(--c-muted); }

.invalid-feedback {
  --bs-form-invalid-color: var(--c-red);
  color: var(--c-red);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.status-draft,
.status-cancelled {
  background: var(--c-bg-3);
  color: var(--c-muted);
}

.status-queued,
.status-extracting,
.status-answering,
.status-round1,
.status-round2,
.status-aggregating,
.status-awaiting_approval {
  background: var(--c-gold-soft);
  color: var(--c-gold);
}

.status-done {
  background: var(--c-teal-soft);
  color: var(--c-teal);
}

.status-failed,
.status-failed_quorum,
.status-rejected_size {
  background: var(--c-red-soft);
  color: var(--c-red);
}

:is(.status-queued, .status-extracting, .status-answering, .status-round1, .status-round2, .status-aggregating)::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-gold);
  animation: status-pulse 1.6s var(--ease) infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.alert {
  --bs-alert-color: var(--c-ink);
  --bs-alert-bg: var(--c-teal-soft);
  --bs-alert-border-color: transparent;
  --bs-alert-padding-x: 20px;
  --bs-alert-padding-y: 16px;
  border: 0;
  border-radius: 10px;
}

.alert-info {
  --bs-alert-bg: var(--c-teal-soft);
  border-inline-start: 3px solid var(--c-teal);
}

.alert-warning {
  --bs-alert-bg: var(--c-gold-soft);
  border-inline-start: 3px solid var(--c-gold);
}

.alert-danger {
  --bs-alert-bg: var(--c-red-soft);
  border-inline-start: 3px solid var(--c-red);
}

.alert-link { color: inherit; }

.table {
  --bs-table-color: var(--c-ink);
  --bs-table-bg: var(--c-bg-2);
  --bs-table-border-color: var(--c-line);
  --bs-table-hover-color: var(--c-ink);
  --bs-table-hover-bg: var(--c-bg-3);
  --bs-table-striped-color: var(--c-ink);
  --bs-table-striped-bg: var(--c-bg-1);
  --bs-table-active-color: var(--c-ink);
  --bs-table-active-bg: var(--c-bg-3);
}

.table > thead {
  --bs-table-bg: var(--c-bg-3);
  font-weight: 600;
}

.table > :not(caption) > * > * {
  padding: 12px 16px;
}

.table > :not(:first-child) { border-top: 0; }

.table > :not(:last-child) > :last-child > * { border-bottom-color: var(--c-line); }

.table > tbody > tr:hover > * {
  --bs-table-bg-state: var(--c-bg-3);
  --bs-table-color-state: var(--c-ink);
}

details {
  background: var(--c-bg-2);
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

details.card { padding: 0; }

details.details-danger { border-color: var(--c-red); }

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 16px 24px;
  border-radius: 16px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker { display: none; }

summary::marker { content: ""; }

summary::after {
  content: "+";
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--c-gold);
}

details[open] > summary::after { content: "\2212"; }

details > :not(summary) { margin-inline: 24px; }

details > :last-child { margin-bottom: 24px; }

.site-footer {
  padding-block: 48px calc(32px + env(safe-area-inset-bottom));
  background: var(--c-bg-0);
  color: var(--c-muted);
  border-top: 1px solid var(--c-line);
}

.site-footer .company {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--c-ink);
}

.site-footer h2,
.site-footer h3 {
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-ink);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer:has(~ .chat-widget) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.site-footer ul a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 0;
  color: var(--c-muted);
  text-decoration: none;
}

.site-footer ul a:hover,
.site-footer ul a:focus-visible {
  color: var(--c-ink);
  text-decoration: underline;
}

.site-footer hr {
  margin-block: 32px 24px;
  border-color: var(--c-line);
  opacity: 1;
}

.footer-disclaimer {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--c-dim);
}

.error-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60dvh;
  padding: 56px 16px;
  text-align: center;
  background: var(--hall);
}

.error-stage h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.error-stage p { color: var(--c-muted); }

.error-code {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(5rem, 12vw, 8rem);
  line-height: 1.1;
  color: var(--c-gold);
  text-shadow: var(--glow-gold);
}

.report {
  max-width: 52rem;
  margin: 2rem auto;
  padding: 48px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  line-height: 2;
  overflow-wrap: anywhere;
}

.report h1 {
  margin-bottom: 24px;
  padding-bottom: 16px;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.5;
  border-bottom: 2px solid var(--c-gold);
}

.report h2 {
  margin-block: 32px 12px;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.6;
  color: var(--c-gold);
}

.report h3 {
  margin-block: 24px 8px;
  font-size: 18px;
  line-height: 1.7;
}

.report a {
  color: var(--c-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report a:hover,
.report a:focus-visible { color: var(--c-ink); }

.report blockquote {
  margin-inline: 0;
  padding-inline-start: 16px;
  border-inline-start: 3px solid var(--c-teal);
  color: var(--c-muted);
}

.report pre {
  max-width: 100%;
  overflow-x: auto;
}

.report table {
  width: 100%;
  margin-block: 16px;
  border-collapse: collapse;
  background: var(--c-bg-2);
  color: var(--c-ink);
}

.report th,
.report td {
  padding: 12px 16px;
  border: 1px solid var(--c-line);
  text-align: start;
  vertical-align: top;
}

.report thead th {
  background: var(--c-bg-3);
  font-weight: 600;
}

.report tbody tr:hover > * { background: var(--c-bg-3); }

@media (max-width: 767.98px) {
  .page-band { padding: 32px 16px; }

  .auth-stage { padding: 32px 16px; }

  .auth-card { padding: 24px; }

  .report {
    margin-block: 1rem;
    padding: 20px;
  }

  .site-footer { padding-block: 32px calc(24px + env(safe-area-inset-bottom)); }

  .site-footer:has(~ .chat-widget) { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* Home page */
.bg-0 { background: var(--c-bg-0); }
.bg-1 { background: var(--c-bg-1); }

.hero {
  display: flex;
  align-items: center;
  min-height: min(88dvh, 820px);
  padding-block: 48px;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.hero-scene {
  order: -1;
  min-width: 0;
  margin-inline: -1.5rem;
}

.hero-text { min-width: 0; }

.hero-kicker {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-gold);
}

.hero-text h1 { margin-bottom: 20px; }

.hero-lead {
  max-width: 38rem;
  margin-bottom: 28px;
  font-size: 1.125rem;
  color: var(--c-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-actions .btn { flex: 1 1 100%; }

.hero-chamber {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70dvh;
  overflow: visible;
}

.hero-arc {
  stroke: var(--c-line);
  stroke-width: 2;
  opacity: .6;
}

.hero-chamber .seat {
  stroke: var(--c-teal);
  filter: drop-shadow(var(--glow-teal));
  animation: hero-light 400ms var(--ease) calc(var(--i) * 120ms) 1 backwards;
}

.hero-chamber .seat[data-alias="1"] { --i: 0; }
.hero-chamber .seat[data-alias="2"] { --i: 1; }
.hero-chamber .seat[data-alias="3"] { --i: 2; }
.hero-chamber .seat[data-alias="4"] { --i: 3; }
.hero-chamber .seat[data-alias="5"] { --i: 4; }
.hero-chamber .seat[data-alias="6"] { --i: 5; }
.hero-chamber .seat[data-alias="7"] { --i: 6; }
.hero-chamber .seat[data-alias="8"] { --i: 7; }

.seat-disc {
  fill: var(--c-seat);
  stroke: inherit;
  stroke-width: 2;
}

.seat-num {
  fill: var(--c-ink);
  stroke: none;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.hero-chamber .core {
  animation: hero-core 360ms var(--ease) 1240ms 1 backwards;
}

.core-ring { stroke-width: 1.5; }

.core-ring-outer { stroke: var(--c-teal); opacity: .5; }

.core-ring-middle { stroke: var(--c-gold); opacity: .6; }

.core-ring-inner {
  fill: var(--c-core);
  stroke: var(--c-teal);
  stroke-width: 2;
  filter: drop-shadow(var(--glow-teal));
}

.core-title,
.core-sub {
  font-family: var(--font-display);
  text-anchor: middle;
}

.core-title {
  fill: var(--c-ink);
  font-size: 22px;
  font-weight: 800;
}

.core-sub {
  fill: var(--c-gold);
  font-size: 15px;
  font-weight: 600;
}

@keyframes hero-light {
  from {
    stroke: var(--c-dim);
    filter: drop-shadow(0 0 0 rgba(63, 208, 201, 0));
  }
  to {
    stroke: var(--c-teal);
    filter: drop-shadow(var(--glow-teal));
  }
}

@keyframes hero-core {
  from { opacity: .25; }
  to { opacity: 1; }
}

.home-section {
  padding-block: 64px;
  border-top: 1px solid var(--c-line);
}

.home-section h2 { margin-bottom: 32px; }

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-card {
  position: relative;
  min-width: 0;
  padding: 20px 24px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  counter-increment: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card::before {
  content: counter(step);
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--c-gold);
  border-radius: 50%;
  background: var(--c-gold-soft);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--c-gold);
}

.deliverables,
.why-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.why-list { grid-template-columns: minmax(0, 1fr); }

.deliverable,
.why-item {
  min-width: 0;
  padding: 20px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

.deliverable::before {
  content: "";
  display: block;
  width: 24px;
  height: 3px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: var(--c-gold);
}

.deliverable:nth-child(even)::before { background: var(--c-teal); }

.deliverable h3,
.why-item h3 {
  margin-bottom: 8px;
  font-size: 1.125rem;
}

.deliverable p,
.why-item p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--c-muted);
}

.why-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  font-weight: 600;
}

.why-link::after {
  content: "\2190" / "";
  margin-inline-start: 8px;
}

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 48rem;
  margin-inline: auto;
}

.faq-list details > p { margin-top: 0; color: var(--c-muted); }

.faq-list details[open] { border-color: var(--c-gold); }

.home-closing {
  padding-block: 80px;
  text-align: center;
}

.home-closing h2 { margin-bottom: 24px; }

@media (min-width: 576px) {
  .hero-actions .btn { flex: 0 0 auto; }
}

@media (min-width: 768px) {
  .hero-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }

  .hero-scene { order: 0; margin-inline: 0; }

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

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

  .why-item:last-child { grid-column: 1 / -1; }

  .deliverable,
  .why-item { padding: 24px; }
}

@media (min-width: 992px) {
  .hero-inner { gap: 48px; }

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

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

  .home-section { padding-block: 88px; }
}

/* Knowledge base */
.kb-category {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 40px 20px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}

.kb-category::before {
  content: "";
  flex: none;
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: var(--c-gold);
}

.kb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.kb-title {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--c-teal);
}

@media (min-width: 768px) {
  .kb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.report-meta {
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-muted);
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.contact-layout > * { min-width: 0; }

.contact-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--c-dim);
}

@media (min-width: 768px) {
  .contact-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

@media (min-width: 992px) {
  .contact-layout { grid-template-columns: 400px minmax(0, 1fr); }
}

.consent-box {
  background: var(--c-bg-1);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 16px;
}

/* Account */
.account-stack {
  display: grid;
  gap: 24px;
  max-width: 860px;
  margin-inline: auto;
}

.account-name-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-name-row .form-control { flex: 1 1 auto; min-width: 0; }

.account-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block: 24px;
}

.account-email-value {
  text-align: end;
  overflow-wrap: anywhere;
}

.export-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--c-teal);
  text-decoration: none;
}

.export-link::before {
  content: "\2193" / "";
  margin-inline-end: 8px;
}

.export-link:hover,
.export-link:focus-visible { text-decoration: underline; }

details.details-danger > summary { color: var(--c-red); }

details.details-inline {
  background: none;
  border: 0;
  border-radius: 0;
}

details.details-inline > summary {
  display: inline-flex;
  min-height: 44px;
  padding: 4px 12px;
  border: 1px solid var(--c-red);
  border-radius: 10px;
  color: var(--c-red);
  font-weight: 600;
}

details.details-inline > summary::after { content: none; }

details.details-inline > :not(summary) { margin: 8px 0 0; }

.form-control[aria-invalid="true"],
.form-select[aria-invalid="true"],
.form-check-input[aria-invalid="true"] {
  border-color: var(--c-red);
}

/* Cases: list, new, shared blocks */
.page-band > * { min-width: 0; }

.table-responsive { position: relative; }

.pagination .page-link {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.table-responsive:has(> .cases-table) {
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

.cases-table { margin-bottom: 0; }

.cases-table > thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
}

.cases-table > tbody > tr > * {
  vertical-align: middle;
  padding-block: 16px;
}

.cases-table > tbody > tr:last-child > * { border-bottom: 0; }

.cases-table td:first-child { min-width: 14rem; }

.cases-table td a {
  color: var(--c-teal);
  text-decoration: none;
}

.cases-table td a:hover,
.cases-table td a:focus-visible {
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cases-table td:not(:first-child) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.download-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.case-new-card {
  width: 100%;
  max-width: 960px;
  margin: 40px auto;
  padding: 36px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 20px;
}

.case-new-card textarea.form-control {
  min-height: 168px;
  resize: vertical;
}

.case-new-card input[type="file"].form-control { padding: 6px 12px; }

.case-new-card .btn[type="submit"] { min-width: 200px; }

.example-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.example-buttons .btn { border-radius: 999px; }

.legal-refs,
.case-files {
  margin-block: 24px;
  padding: 24px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

.legal-refs > :is(h2, h3, h4, p:first-child),
.case-files > :is(h2, h3, h4) {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--c-ink);
}

.legal-refs ul,
.case-files ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-refs li { overflow-wrap: anywhere; }

.legal-refs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: 0;
  color: var(--c-teal);
}

.legal-refs a[target="_blank"]::after {
  content: "\2197" / "";
  margin-inline-start: 6px;
}

.legal-refs a:hover,
.legal-refs a:focus-visible { color: var(--c-ink); }

.case-files li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  overflow-wrap: anywhere;
}

.case-files small,
.case-files .file-size {
  font-size: 13px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.delete-case { margin-block: 24px; }

.delete-case > p { color: var(--c-muted); }

.delete-case form { margin-block-end: 0; }

/* Draft conversation */
.draft-column {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
}

.draft-column .case-files {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

.conversation {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 960px;
  margin: 24px auto;
}

.msg-user,
.msg-enhancer {
  min-width: 0;
  overflow-wrap: anywhere;
}

.msg-user {
  align-self: flex-end;
  max-width: 80%;
  padding: 16px 20px;
  background: var(--c-gold-soft);
  color: var(--c-ink);
  border-radius: 16px;
  white-space: pre-line;
}

.msg-enhancer {
  width: 100%;
  padding: 24px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

.msg-enhancer > :last-child { margin-bottom: 0; }

.msg-enhancer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--c-teal);
}

.msg-enhancer-label::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-teal);
}

.scope-card { margin-block: 16px; }

.scope-card :is(h2, h3, h4, h5) {
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--c-teal);
}

.scope-card p { margin-bottom: 4px; }

.scope-card > :last-child { margin-bottom: 0; }

.scope-card .btn { margin-top: 12px; }

.answer-form,
.brief-card {
  width: 100%;
  max-width: 960px;
  margin: 16px auto;
  padding: 24px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

.answer-form fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.answer-form legend {
  float: none;
  width: 100%;
  margin-bottom: 4px;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.8;
}

.answer-form .btn-check + .btn {
  min-height: 46px;
  text-align: start;
}

.question-why {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-muted);
}

.brief-card > :is(h2, h3) {
  margin-bottom: 8px;
  font-size: 1.375rem;
  line-height: 1.5;
}

.brief-card textarea.form-control { min-height: 120px; }

.brief-lists {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-block: 16px;
}

.brief-lists > * {
  min-width: 0;
  padding: 16px 20px;
  background: var(--c-bg-1);
  border: 1px solid var(--c-line);
  border-radius: 12px;
}

.brief-lists :is(h3, h4) {
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--c-gold);
}

.brief-lists ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.brief-lists li::marker { color: var(--c-gold); }

.quick-note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-muted);
}

/* Chamber hall */
.chamber-root {
  --chamber-gutter: clamp(16px, 3.4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100dvh - 72px - env(safe-area-inset-top));
  padding: 24px var(--chamber-gutter) 0;
  background: var(--hall);
  color: var(--c-ink);
  overflow-x: clip;
}

.chamber-root > * { min-width: 0; }

.chamber-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}

.chamber-top > * { min-width: 0; }

.chamber-title {
  flex: 1 1 18rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.chamber-elapsed {
  display: flex;
  flex-direction: column;
  flex: none;
  text-align: end;
}

.elapsed-label {
  font-size: 11px;
  line-height: 1.6;
  color: var(--c-muted);
}

.elapsed-value {
  display: block;
  direction: ltr;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.stages {
  display: flex;
  flex: 1 0 100%;
  gap: 12px;
  max-width: 100%;
  margin-block: -10px;
  padding-block: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--c-line-strong) transparent;
}

.stage {
  display: inline-flex;
  flex: 0 0 150px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 150px;
  height: 34px;
  padding-inline: 6px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: transparent;
  color: var(--c-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: color 400ms var(--ease), border-color 400ms var(--ease), background-color 400ms var(--ease), box-shadow 400ms var(--ease);
}

.stage:first-child { margin-inline-start: auto; }

.stage:last-child { margin-inline-end: auto; }

.stage.is-done {
  border-color: var(--c-teal);
  color: var(--c-teal);
}

.stage.is-done::before {
  content: "\2713";
  flex: none;
}

.stage.is-current {
  background: var(--c-gold-soft);
  border-color: var(--c-gold);
  color: var(--c-gold);
  box-shadow: var(--glow-gold);
}

.stage.is-current::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.stage.is-upcoming {
  border-color: var(--c-line);
  color: var(--c-muted);
}

.chamber-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--c-muted);
}

.chamber-legend > * { margin: 0; }

.chamber-legend ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 0;
  list-style: none;
}

.legend-dot {
  display: inline-block;
  margin-inline-end: 6px;
}

.dir-yes { fill: var(--c-gold); color: var(--c-gold); }

.dir-no { fill: var(--c-red); color: var(--c-red); }

.dir-other { fill: var(--c-dim); color: var(--c-dim); }

svg.chamber {
  display: block;
  width: 100%;
  max-width: 1200px;
  height: auto;
  margin-inline: auto;
  overflow: visible;
}

svg.chamber text { text-anchor: middle; }

svg.chamber path.arc {
  fill: none;
  stroke: var(--c-line);
  stroke-width: 2;
  opacity: .6;
}

svg.chamber .edges path {
  fill: none;
  stroke-linecap: round;
  pointer-events: none;
  transition: stroke-dashoffset 900ms var(--ease);
}

svg.chamber .edges path.edge-agree { stroke: var(--c-gold); }

svg.chamber .edges path.edge-disagree {
  stroke: var(--c-red);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
  opacity: .6;
}

svg.chamber .seat-disc {
  fill: var(--c-seat);
  stroke: var(--c-dim);
  stroke-width: 2;
  filter: none;
  transition: stroke 400ms var(--ease), stroke-width 400ms var(--ease), filter 400ms var(--ease);
}

svg.chamber .seat-pulse {
  fill: none;
  stroke: var(--c-gold);
  stroke-width: 2;
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
}

svg.chamber .seat-number {
  fill: var(--c-ink);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  transition: opacity 400ms var(--ease), fill 400ms var(--ease);
}

svg.chamber .seat-name {
  fill: var(--c-ink);
  font-size: 14px;
  font-weight: 600;
}

svg.chamber .seat-status {
  fill: var(--c-muted);
  font-size: 12px;
  transition: fill 400ms var(--ease);
}

svg.chamber .seat-direction {
  fill: var(--c-ink);
  font-size: 12px;
}

svg.chamber .dir-dot {
  stroke: var(--c-bg-0);
  stroke-width: 2;
}

svg.chamber .seat.is-waiting .seat-disc { stroke: var(--c-dim); }

svg.chamber .seat.is-running .seat-disc {
  stroke: var(--c-gold);
  stroke-width: 3;
  filter: drop-shadow(var(--glow-gold));
}

svg.chamber .seat.is-running .seat-status { fill: var(--c-gold); }

svg.chamber .seat.is-running .seat-pulse {
  opacity: .35;
  animation: seat-pulse 2.4s var(--ease) infinite;
}

svg.chamber .seat.is-done .seat-disc {
  stroke: var(--c-teal);
  filter: drop-shadow(var(--glow-teal));
}

svg.chamber .seat.is-done .seat-status { fill: var(--c-teal); }

svg.chamber .seat.is-failed .seat-disc { stroke: var(--c-red); }

svg.chamber .seat.is-failed .seat-number { opacity: .5; }

svg.chamber .seat.is-failed .seat-status { fill: var(--c-red); }

@keyframes seat-pulse {
  from { transform: scale(1); opacity: .5; }
  to { transform: scale(1.12); opacity: 0; }
}

svg.chamber .core-ring-outer,
svg.chamber .core-ring-mid,
svg.chamber .core-ring-inner {
  transition: stroke 400ms var(--ease), opacity 400ms var(--ease), filter 400ms var(--ease);
}

svg.chamber .core-ring-outer {
  fill: none;
  stroke: var(--c-teal);
  stroke-width: 1;
  opacity: .5;
}

svg.chamber .core-ring-mid {
  fill: none;
  stroke: var(--c-gold);
  stroke-width: 1;
  opacity: .6;
}

svg.chamber .core-ring-inner {
  fill: var(--c-core);
  stroke: var(--c-teal);
  stroke-width: 2;
  filter: drop-shadow(var(--glow-teal));
}

svg.chamber .core-line1 {
  fill: var(--c-ink);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
}

svg.chamber .core-line2 {
  fill: var(--c-gold);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  transition: fill 400ms var(--ease);
}

svg.chamber .core-under {
  fill: var(--c-muted);
  font-size: 14px;
}

svg.chamber .core.is-complete .core-ring-outer { stroke: var(--c-teal); opacity: 1; }

svg.chamber .core.is-complete .core-ring-mid { stroke: var(--c-teal); opacity: .8; }

svg.chamber .core.is-complete .core-ring-inner { filter: drop-shadow(var(--glow-teal)) drop-shadow(var(--glow-teal)); }

svg.chamber .core.is-complete .core-line2 { fill: var(--c-teal); }

svg.chamber .core-line1.core-count-out,
svg.chamber .core-line1.core-count-in {
  transform-box: fill-box;
  transform-origin: center;
}

svg.chamber .core-line1.core-count-out { animation: core-count-out 350ms var(--ease) forwards; }

svg.chamber .core-line1.core-count-in { animation: core-count-in 350ms var(--ease) backwards; }

@keyframes core-count-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-14px); opacity: 0; }
}

@keyframes core-count-in {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Event caption */
.caption {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  max-width: 880px;
  min-height: 96px;
  margin: 8px auto 0;
  padding: 14px 20px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.caption-line {
  transition: opacity 300ms var(--ease);
}

.caption-line.is-new { animation: caption-in 300ms var(--ease) backwards; }

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

.caption-text {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
  color: var(--c-ink);
}

.caption-quote {
  display: block;
  font-size: 15px;
  line-height: 1.8;
  color: var(--c-ink);
}

.caption .kind-answer .caption-text,
.caption .kind-review .caption-text,
.caption .kind-tally .caption-text { color: var(--c-gold); }

.caption .kind-legal .caption-text,
.caption .kind-stage .caption-text { color: var(--c-teal); }

.caption .kind-failed .caption-text { color: var(--c-red); }

.caption-line.caption-old { opacity: .6; }

.caption-old .caption-text,
.caption-old .caption-quote { font-size: 12px; }

.caption .btn { margin-top: 8px; }

/* Bottom bar and progress */
.chamber-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: auto;
  padding-block: 12px;
  padding-inline-end: max(0px, calc(7.5rem + max(env(safe-area-inset-left), env(safe-area-inset-right)) - var(--chamber-gutter)));
  font-size: 13px;
  line-height: 1.8;
}

.bottom-stage {
  font-weight: 600;
  color: var(--c-ink);
}

.bottom-counts { color: var(--c-teal); }

.chamber-progress {
  display: block;
  flex: none;
  width: calc(100% + 2 * var(--chamber-gutter));
  max-width: none;
  height: 4px;
  margin-inline: calc(-1 * var(--chamber-gutter));
  border: 0;
  border-radius: 0;
  background: var(--c-line);
  overflow: visible;
  -webkit-appearance: none;
  appearance: none;
}

.chamber-progress::-webkit-progress-bar {
  background: var(--c-line);
  border-radius: 0;
}

.chamber-progress::-webkit-progress-value {
  background: var(--c-gold);
  border-radius: 0;
  box-shadow: var(--glow-gold);
  transition: width 400ms var(--ease);
}

.chamber-progress::-moz-progress-bar {
  background: var(--c-gold);
  border-radius: 0;
}

/* Mobile chamber (hidden from 768) */
.chamber-mobile { display: none; }

.mobile-core {
  padding: 20px 16px;
  background: var(--c-core);
  border: 1px solid var(--c-teal);
  border-radius: 16px;
  box-shadow: var(--glow-teal);
  text-align: center;
  transition: border-color 400ms var(--ease), box-shadow 400ms var(--ease);
}

.mobile-core .mobile-line1 {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  line-height: 1.4;
}

.mobile-core .mobile-line2 {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--c-gold);
}

.mobile-core .mobile-under {
  display: block;
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-muted);
}

.mobile-core.is-complete {
  border-color: var(--c-teal);
  box-shadow: var(--glow-teal), var(--glow-teal);
}

.mobile-core.is-complete .mobile-line2 { color: var(--c-teal); }

.mobile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.mobile-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.mobile-disc {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--c-seat);
  border: 2px solid var(--c-dim);
  border-radius: 50%;
  color: var(--c-ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  transition: border-color 400ms var(--ease), border-width 400ms var(--ease), box-shadow 400ms var(--ease);
}

.mobile-disc > .dir-dot {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  width: 14px;
  height: 14px;
  background: currentColor;
  border: 2px solid var(--c-bg-0);
  border-radius: 50%;
}

.mobile-status,
.mobile-direction {
  max-width: 100%;
  font-size: 11px;
  line-height: 1.5;
}

.mobile-status { color: var(--c-muted); transition: color 400ms var(--ease); }

.mobile-direction { color: var(--c-ink); }

.mobile-seat.is-running .mobile-disc {
  border-color: var(--c-gold);
  border-width: 3px;
  box-shadow: var(--glow-gold);
}

.mobile-seat.is-running .mobile-disc::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid var(--c-gold);
  border-radius: 50%;
  opacity: .35;
  pointer-events: none;
  animation: seat-pulse 2.4s var(--ease) infinite;
}

.mobile-seat.is-running .mobile-status { color: var(--c-gold); }

.mobile-seat.is-done .mobile-disc {
  border-color: var(--c-teal);
  box-shadow: var(--glow-teal);
}

.mobile-seat.is-done .mobile-status { color: var(--c-teal); }

.mobile-seat.is-failed .mobile-disc { border-color: var(--c-red); }

.mobile-seat.is-failed .mobile-disc > :not(.dir-dot) { opacity: .5; }

.mobile-seat.is-failed .mobile-status { color: var(--c-red); }

/* Below the hall */
.chamber-below {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding: 32px 24px;
}

.chamber-log { margin: 0; }

.chamber-log ol,
.chamber-log ul {
  margin-block: 0 24px;
  padding: 0;
  list-style: none;
}

.chamber-log li {
  display: flex;
  gap: 16px;
  padding-block: 12px;
  border-top: 1px solid var(--c-line);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.chamber-log li > time {
  flex: none;
  direction: ltr;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.chamber-log li > :not(time) { flex: 1 1 0; min-width: 0; }

.chamber-log .caption-quote {
  font-size: 14px;
  color: var(--c-muted);
}

.chamber-log .kind-legal,
.chamber-log .kind-stage { color: var(--c-teal); }

.chamber-log .kind-failed { color: var(--c-red); }

@media (min-width: 768px) {
  .chamber-mobile { display: none; }
}

@media (max-width: 767.98px) {
  svg.chamber,
  .chamber-legend { display: none; }

  .chamber-mobile { display: block; }

  .case-new-card {
    margin-block: 20px;
    padding: 20px;
  }

  .answer-form,
  .brief-card,
  .legal-refs,
  .case-files,
  .msg-enhancer { padding: 20px; }

  .draft-column .case-files { padding: 0; }

  .chamber-below { padding: 24px 16px; }

  .chamber-log li { flex-direction: column; gap: 2px; }

  .caption { padding: 12px 16px; }

  .stages { margin-inline: calc(-1 * var(--chamber-gutter)); padding-inline: var(--chamber-gutter); }
}

/* Chat window (plan 8, 9.4) */
.chat-toggle {
  position: fixed;
  inset-inline-end: calc(1rem + max(env(safe-area-inset-left), env(safe-area-inset-right)));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 1040;
  min-height: 44px;
  border-radius: 999px;
  box-shadow: var(--glow-gold);
}

.chat-panel {
  position: fixed;
  inset-inline-end: calc(1rem + max(env(safe-area-inset-left), env(safe-area-inset-right)));
  bottom: calc(4.75rem + env(safe-area-inset-bottom));
  z-index: 1040;
  display: flex;
  flex-direction: column;
  width: min(23rem, calc(100% - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100dvh - 6.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--c-line);
  border-radius: 16px;
  background: var(--c-bg-2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}

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

.chat-close {
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-bg-0);
}

.chat-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: min(12rem, 30dvh);
  padding: 16px;
  overflow-y: auto;
}

.chat-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 10px;
  overflow-wrap: anywhere;
}

.chat-msg p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-msg a { display: inline-block; margin-top: 4px; }

.chat-msg-visitor {
  align-self: flex-end;
  background: var(--c-gold-soft);
}

.chat-msg-assistant {
  align-self: flex-start;
  background: var(--c-bg-3);
}

.chat-msg-error {
  align-self: flex-start;
  background: var(--c-red-soft);
  color: var(--c-red);
}

.chat-waiting { color: var(--c-muted); }

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px 0;
  border-top: 1px solid var(--c-line);
}

.chat-input {
  flex: 1 1 auto;
  min-height: 46px;
  resize: none;
}

.chat-send { flex: 0 0 auto; }

.chat-note {
  margin: 0;
  padding: 8px 16px 12px;
  color: var(--c-dim);
  font-size: 12px;
  line-height: 1.7;
}

/* Lawyers page */
.lawyers-hero {
  padding-block: 64px;
}

.lawyers-kicker {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-gold);
}

.lawyers-hero h1 {
  max-width: 48rem;
  margin-bottom: 20px;
}

.lawyers-lead {
  max-width: 42rem;
  margin-bottom: 28px;
  font-size: 1.125rem;
  color: var(--c-muted);
}

.lawyers-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.lawyers-actions .btn { flex: 1 1 100%; }

.lawyers-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--c-muted);
}

.lawyers-trust li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lawyers-trust li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-teal);
}

.lawyers-section {
  padding-block: 56px;
  border-top: 1px solid var(--c-line);
}

.lawyers-section h2 { margin-bottom: 20px; }

.lawyers-intro {
  max-width: 48rem;
  margin-bottom: 32px;
  color: var(--c-muted);
}

.lawyers-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lawyers-card {
  min-width: 0;
  padding: 24px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
}

.lawyers-card h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.lawyers-card p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--c-muted);
}

.lawyers-number {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--c-gold);
}

.lawyers-card-mark::before {
  content: "";
  display: block;
  width: 24px;
  height: 3px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: var(--c-gold);
}

.lawyers-card .lawyers-eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-gold);
}

.lawyers-card-featured { border-color: var(--c-gold); }

.lawyers-checks {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--c-ink);
}

.lawyers-checks li {
  display: flex;
  gap: 8px;
  padding-block: 2px;
}

.lawyers-checks li::before {
  content: "\2713" / "";
  flex: none;
  color: var(--c-teal);
}

.lawyers-citation {
  margin-top: 16px;
  border-color: var(--c-teal);
  background: var(--c-teal-soft);
}

.lawyers-card .lawyers-citation-line {
  font-size: 13px;
  color: var(--c-muted);
}

.law-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.law-tools[hidden] { display: none; }

.law-search {
  flex: 1 1 280px;
  max-width: 28rem;
}

.law-count {
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--c-teal);
  border-radius: 999px;
  background: var(--c-teal-soft);
  font-size: 13px;
  color: var(--c-teal);
}

.law-groups {
  display: grid;
  gap: 12px;
}

.law-group[hidden] { display: none; }

.law-list {
  display: grid;
  gap: 2px 24px;
  margin-block: 0;
  padding: 0;
  list-style: none;
}

.law-item[hidden] { display: none; }

.law-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
}

.law-item a::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--c-teal);
}

.law-note {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--c-dim);
}

.lawyers-faq { margin-inline: 0; }

.lawyers-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: lawyers-step;
}

.lawyers-step {
  min-width: 0;
  padding: 20px 24px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  counter-increment: lawyers-step;
}

.lawyers-step::before {
  content: counter(lawyers-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border: 1.5px solid var(--c-gold);
  border-radius: 50%;
  background: var(--c-gold-soft);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--c-gold);
}

.lawyers-step h3 {
  margin-bottom: 8px;
  font-size: 1.125rem;
}

.lawyers-step p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--c-muted);
}

.lawyers-closing {
  text-align: center;
}

.lawyers-closing .lawyers-intro { margin-inline: auto; }

.lawyers-closing .lawyers-actions { justify-content: center; }

.lawyers-disclaimer {
  padding-block: 24px;
  border-top: 1px solid var(--c-line);
}

.lawyers-disclaimer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--c-dim);
}

@media (min-width: 576px) {
  .lawyers-actions .btn { flex: 0 0 auto; }
}

@media (min-width: 768px) {
  .lawyers-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

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

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

@media (min-width: 992px) {
  .lawyers-hero { padding-block: 96px; }

  .lawyers-section { padding-block: 80px; }

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

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

/* Admin pages */
.page-band-admin + .container-xxl pre {
  max-height: 480px;
  margin: 0;
  padding: 12px 16px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--c-muted);
  background: var(--c-bg-1);
  border: 1px solid var(--c-line);
  border-radius: 8px;
}

.pre-wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.page-band-admin + .container-xxl pre.pre-prose {
  font-family: inherit;
}

.text-break-all {
  overflow-wrap: anywhere;
}

.member-status-ok {
  color: var(--c-teal);
}

.member-status-running {
  color: var(--c-gold);
}

.member-status-error {
  color: var(--c-red);
}

.admin-figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0;
}

.card.card-awaiting {
  border-color: var(--c-gold);
}
