@font-face {
  font-family: "Vazir";
  src: url("/static/fonts/Vazir.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazir";
  src: url("/static/fonts/Vazir-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fbfc;
  --ink: #172033;
  --muted: #64748b;
  --brand: #0f766e;
  --brand-deep: #115e59;
  --brand-soft: #d9f4ef;
  --accent: #d97706;
  --accent-soft: #fff3d6;
  --line: #dbe4ec;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(22, 50, 74, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% -10%, rgba(15, 118, 110, 0.13), transparent 36rem),
    radial-gradient(circle at 8% 0%, rgba(217, 119, 6, 0.08), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: "Vazir", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.8;
}

a {
  color: var(--brand-deep);
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.page {
  padding-block: 28px 64px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(219, 228, 236, 0.9);
  backdrop-filter: blur(16px);
}

.header-row {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  transition: 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.nav-badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 11px;
  line-height: 1;
}

.hero,
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.hero h1,
.page-heading h1 {
  margin: 4px 0 8px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.35;
  letter-spacing: -1px;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero-copy {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-stat {
  min-width: 145px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.hero-stat strong {
  display: block;
  color: var(--brand-deep);
  font-size: 30px;
  line-height: 1.2;
}

.hero-stat span {
  color: var(--muted);
  font-size: 12px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 18px;
}

.filter-card {
  padding: 18px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  align-items: end;
}

.filter-grid label,
.prompt-form label,
.export-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-grid .search-field {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  background: white;
}

textarea {
  resize: vertical;
}

.check-field {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  padding-block: 10px;
  cursor: pointer;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.btn-primary:hover {
  background: var(--brand-deep);
  color: white;
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.btn-ghost {
  border-color: var(--line);
  background: white;
  color: var(--muted);
}

.btn-large {
  min-height: 46px;
  padding-inline: 24px;
  font-size: 14px;
}

.quick-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.quick-note {
  color: var(--muted);
  font-size: 11px;
}

.results-section {
  margin-top: 20px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

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

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

.question-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 45, 65, 0.05);
}

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

.question-number {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.badge.badge-brand {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.badge.badge-accent {
  background: var(--accent-soft);
  color: #92400e;
}

.question-stem {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 2;
}

.q-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.q-images img {
  max-width: min(100%, 260px);
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.options-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.option-item {
  display: flex;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: #334155;
  font-size: 13px;
  line-height: 1.8;
}

.option-index {
  color: var(--brand);
  font-weight: 800;
}

.answer-box {
  margin-top: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 8px 11px;
}

.answer-box summary {
  cursor: pointer;
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 800;
}

.answer-box p {
  margin: 7px 0 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.9;
}

.card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.card-actions .btn {
  min-height: 34px;
  font-size: 12px;
}

.basket-toggle.is-selected {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.empty-state {
  padding: 34px 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding-inline: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.page-btn.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.basket-list {
  display: grid;
  gap: 10px;
}

.basket-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.basket-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 800;
}

.basket-main {
  min-width: 0;
}

.basket-stem {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.9;
}

.basket-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.basket-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.basket-controls {
  display: flex;
  gap: 4px;
}

.icon-btn {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.export-card {
  margin-top: 18px;
}

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

.export-form .wide {
  grid-column: 1 / -1;
}

.export-form small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prompt-source-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.prompt-params-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.prompt-page-range,
.prompt-meta-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 859px) {
  .prompt-params-row {
    grid-template-columns: 1fr;
  }
}

.prompt-result-card {
  margin-top: 18px;
}

.warning-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.warning {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.9;
}

.warning-amber {
  border: 1px solid #f4d58d;
  background: var(--accent-soft);
  color: #92400e;
}

.warning-red {
  border: 1px solid #f3b6ae;
  background: var(--danger-soft);
  color: var(--danger);
}

#prompt-output {
  min-height: 360px;
  margin-bottom: 12px;
  background: #0f172a;
  color: #dbeafe;
  font-family: "Vazir", "Vazirmatn", sans-serif;
  font-size: 13px;
  line-height: 1.9;
  text-align: left;
}

.toast {
  position: fixed;
  inset-inline-start: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100% - 40px));
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: var(--danger);
}

.modal {
  width: min(440px, calc(100% - 28px));
  padding: 0;
  border: none;
  border-radius: 18px;
  background: white;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.modal-card h2 {
  margin: 0;
  font-size: 18px;
}

.modal-card p {
  margin: 0;
}

.modal-card select,
.modal-card textarea {
  background: var(--surface-soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

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

.skeleton-card {
  min-height: 220px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #eef3f8 25%, #f8fbfd 45%, #eef3f8 65%);
  background-size: 220% 100%;
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  to { background-position: -220% 0; }
}

@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-grid .search-field {
    grid-column: 1 / -1;
  }
  .question-list {
    grid-template-columns: 1fr;
  }
  .export-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 22px, 1180px);
  }
  .header-row {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 12px;
  }
  .main-nav {
    width: 100%;
    gap: 3px;
  }
  .nav-link {
    padding: 7px 9px;
    font-size: 12px;
  }
  .hero,
  .page-heading {
    flex-direction: column;
  }
  .hero-stat {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: right;
  }
  .filter-grid,
  .export-form {
    grid-template-columns: 1fr;
  }
  .filter-grid .search-field,
  .export-form .wide {
    grid-column: auto;
  }
  .basket-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }
  .basket-thumb {
    display: none;
  }
  .basket-controls {
    grid-column: 2 / -1;
    justify-content: flex-end;
  }
}
/* Auth and admin surfaces */
.login-wrap {
  display: grid;
  min-height: 58vh;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
}

.login-card h1 {
  margin: 4px 0 6px;
  font-size: 27px;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-dev-banner {
  margin-bottom: 16px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(15, 45, 65, 0.05);
  text-align: center;
}

.stat-card strong {
  display: block;
  color: var(--brand-deep);
  font-size: 25px;
  line-height: 1.3;
}

.stat-card span {
  color: var(--muted);
  font-size: 11px;
}

.admin-section {
  margin-top: 16px;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

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

.table-snippet {
  color: var(--ink);
  line-height: 1.8;
}

.table-note {
  max-width: 230px;
  color: var(--muted);
}

.table-date {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}

.uuid-note {
  color: var(--brand);
  font-family: "Vazir", "Vazirmatn", sans-serif;
  font-size: 10px;
}

.btn-small {
  min-height: 29px;
  margin: 2px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
}

.empty-cell {
  padding: 25px !important;
  color: var(--muted) !important;
  text-align: center !important;
}

@media (max-width: 900px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
}
/* Public landing page */
.public-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 25, 35, 0.94);
  color: #f8fafc;
  backdrop-filter: blur(16px);
}

.public-header-row {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.public-brand {
  color: #f8fafc;
}

.public-brand:hover {
  color: #ffffff;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.landing-nav a {
  padding: 8px 13px;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  transition: 160ms ease;
}

.landing-nav a:hover {
  background: rgba(45, 212, 191, 0.1);
  color: #ffffff;
}

.landing-header-cta {
  background: #2dd4bf;
  color: #062e2b;
  box-shadow: 0 10px 24px rgba(45, 212, 191, 0.18);
}

.landing-header-cta:hover {
  background: #5eead4;
  color: #062e2b;
}

.landing-main {
  padding-bottom: 0;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 100px;
  background:
    radial-gradient(circle at 14% 22%, rgba(217, 119, 6, 0.12), transparent 30rem),
    linear-gradient(145deg, #081923 0%, #0c2a2d 50%, #12433f 100%);
  color: #f8fafc;
}

.landing-hero::before {
  position: absolute;
  inset: auto -12rem -18rem auto;
  width: 34rem;
  height: 34rem;
  border: 1px solid rgba(94, 234, 212, 0.16);
  border-radius: 50%;
  content: "";
}

.landing-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
}

.landing-eyebrow {
  display: inline-flex;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.1);
  color: #99f6e4;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.9;
}

.landing-hero h1 {
  max-width: 760px;
  margin: 18px 0 16px;
  color: #ffffff;
  font-size: clamp(32px, 4.7vw, 58px);
  line-height: 1.3;
  letter-spacing: -1.5px;
}

.landing-lead {
  max-width: 650px;
  margin: 0;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 2;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.landing-hero .btn-primary {
  background: #2dd4bf;
  color: #062e2b;
  box-shadow: 0 12px 28px rgba(45, 212, 191, 0.22);
}

.landing-hero .btn-primary:hover {
  background: #5eead4;
  color: #062e2b;
}

.landing-btn-secondary {
  border-color: rgba(203, 213, 225, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

.landing-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.landing-hero-note {
  margin: 18px 0 0;
  color: #94a3b8;
  font-size: 11px;
}

.workspace-preview {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  background: #f8fafc;
  color: var(--ink);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.34);
}

.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.workspace-dots {
  display: inline-flex;
  gap: 5px;
}

.workspace-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}

.workspace-flow {
  display: grid;
  gap: 9px;
}

.workspace-step {
  padding: 13px;
  border: 1px solid #dbe4ec;
  border-radius: 15px;
  background: #ffffff;
}

.workspace-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 12px;
}

.workspace-index {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 800;
}

.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.preview-chips span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 9px;
  font-weight: 700;
}

.preview-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: #f8fbfc;
  color: #94a3b8;
  font-size: 9px;
}

.preview-search i {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1.5px solid #94a3b8;
  border-radius: 50%;
}

.preview-search i::after {
  position: absolute;
  inset: auto -3px -2px auto;
  width: 5px;
  height: 1.5px;
  border-radius: 999px;
  background: #94a3b8;
  content: "";
  transform: rotate(45deg);
}

.preview-question {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
}

.preview-question span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 8px;
  font-weight: 800;
}

.preview-question i {
  width: 78%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0, #f1f5f9);
}

.workspace-export {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.preview-export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-export-buttons span {
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
}

.preview-export-buttons span + span {
  border: 1px solid #99f6e4;
  background: #ffffff;
  color: var(--brand-deep);
}

.landing-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-top: -44px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 25px 55px rgba(15, 45, 65, 0.12);
}

.landing-stat {
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: var(--surface-soft);
  text-align: center;
}

.landing-stat strong {
  display: block;
  color: var(--brand-deep);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.3;
}

.landing-stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.landing-section {
  padding-block: 76px;
  scroll-margin-top: 92px;
}

.landing-section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.landing-section h2 {
  margin: 6px 0 0;
  font-size: clamp(25px, 3.2vw, 38px);
  line-height: 1.45;
  letter-spacing: -0.7px;
}

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

.feature-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(15, 45, 65, 0.05);
  transition: 180ms ease;
}

.feature-card:hover {
  border-color: #b7ded8;
  transform: translateY(-2px);
}

.feature-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.feature-icon svg {
  width: 23px;
  height: 23px;
}

.feature-card h3 {
  margin: 15px 0 7px;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.95;
}

.workflow-section {
  border-block: 1px solid #e2eeea;
  background: linear-gradient(180deg, #f8fbfc, #eef7f5);
}

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

.workflow-step {
  padding: 24px;
  border: 1px solid #dce8e4;
  border-radius: 20px;
  background: #ffffff;
}

.workflow-num {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 12px;
  background: var(--brand);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 9px 20px rgba(15, 118, 110, 0.2);
}

.workflow-step h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.school-section {
  padding-top: 0;
}

.school-access-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  padding: 32px;
  border: 1px solid #c6e7df;
  border-radius: 26px;
  background: linear-gradient(135deg, #f0fdfa, #ffffff);
  box-shadow: 0 20px 50px rgba(15, 118, 110, 0.08);
}

.school-access-copy h2 {
  margin-top: 8px;
}

.school-access-copy > p {
  max-width: 680px;
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.contact-card {
  align-self: stretch;
  padding: 22px;
  border-radius: 18px;
  background: #0f172a;
  color: #e2e8f0;
}

.contact-card h3 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 15px;
}

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

.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 11px;
}

.contact-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.contact-list span {
  color: #94a3b8;
}

.contact-list strong {
  color: #99f6e4;
  font-weight: 700;
}

.contact-fallback {
  margin: 0;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.95;
}

.landing-footer {
  padding-block: 30px;
  background: #081923;
  color: #94a3b8;
}

.landing-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand .public-brand {
  font-size: 14px;
}

.footer-brand .public-brand img {
  width: 32px;
  height: 32px;
}

.footer-brand p {
  margin: 7px 0 0;
  color: #64748b;
  font-size: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
}

.footer-links a {
  color: #cbd5e1;
}

.footer-links a:hover {
  color: #5eead4;
}

.login-home-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.login-home-link:hover {
  color: var(--brand);
}

@media (max-width: 1000px) {
  .landing-hero-grid {
    grid-template-columns: 1fr;
  }
  .workspace-preview {
    width: min(640px, 100%);
  }
  .landing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: -32px;
  }
  .workflow-grid {
    grid-template-columns: 1fr;
  }
  .school-access-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .public-header-row {
    min-height: auto;
    flex-wrap: wrap;
    padding-block: 10px;
  }
  .landing-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-bottom: 4px;
  }
  .landing-hero {
    padding: 52px 0 88px;
  }
  .landing-hero h1 {
    letter-spacing: -0.8px;
  }
  .landing-section {
    padding-block: 56px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .school-access-card {
    padding: 22px;
  }
}

@media (max-width: 420px) {
  .landing-stats {
    grid-template-columns: 1fr;
  }
  .landing-actions .btn {
    width: 100%;
  }
}

/* Workspace session controls */
.header-session {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.user-chip {
  display: inline-flex;
  max-width: 160px;
  align-items: center;
  padding: 5px 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-form {
  display: inline-flex;
  margin: 0;
}

.nav-logout {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-logout:hover {
  border-color: #f3b6ae;
  background: var(--danger-soft);
  color: var(--danger);
}

.login-public-header .public-header-row {
  min-height: 68px;
}

@media (max-width: 900px) {
  .site-header .header-row {
    flex-wrap: wrap;
    padding-block: 10px;
  }
  .site-header .main-nav {
    order: 3;
    width: 100%;
  }
  .site-header .header-session {
    order: 2;
    margin-inline-start: auto;
  }
}

@media (max-width: 620px) {
  .site-header .header-session {
    width: 100%;
    justify-content: flex-end;
  }
}

.answer-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.9;
}

.answer-images img {
  max-width: min(100%, 240px);
  max-height: 180px;
}

.security-section .section-heading {
  align-items: flex-start;
}

.security-flag-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.security-flag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #f3b6ae;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
}

.security-flag-pill small {
  color: #7f1d1d;
  font-size: 9px;
  font-weight: 600;
}

.security-table tr.security-flagged td {
  background: #fff8f6;
}

.security-number {
  color: var(--brand-deep);
  font-size: 16px;
}

.security-reasons {
  margin-top: 6px;
}

.badge.security-badge {
  background: var(--danger-soft);
  color: var(--danger);
}

.role-note {
  color: var(--muted);
  font-size: 10px;
}

.session-details {
  margin-bottom: 8px;
}

.session-details summary {
  cursor: pointer;
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 800;
}

.session-table {
  width: 100%;
  min-width: 640px;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 10px;
}

.session-table th,
.session-table td {
  padding: 6px 5px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.session-table th {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.session-state {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.session-state.is-active {
  color: var(--brand-deep);
}[hidden] {
  display: none !important;
}

.header-session {
  position: relative;
}

.notif-bell {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  transition: 160ms ease;
}

.notif-bell > svg,
.notif-badge {
  position: relative;
  z-index: 2;
}

.notif-bell svg {
  width: 18px;
  height: 18px;
}

.notif-bell:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.notif-badge {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding-inline: 4px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.notif-bell-high {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.08);
}

.notif-bell-high::before {
  position: absolute;
  inset: -12px;
  z-index: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(220, 38, 38, 0.62) 0deg 2deg,
    transparent 2deg 24deg
  );
  content: "";
  pointer-events: none;
  -webkit-mask: radial-gradient(circle, transparent 0 53%, #000 58% 100%);
  mask: radial-gradient(circle, transparent 0 53%, #000 58% 100%);
  animation: notif-rays 9s linear infinite;
}

.notif-bell-high::after {
  position: absolute;
  inset: -5px;
  z-index: 1;
  border: 1.5px solid rgba(185, 28, 28, 0.55);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  animation: notif-halo 2.2s ease-in-out infinite;
}

.notif-bell-high .notif-badge {
  background: #b91c1c;
}

@keyframes notif-rays {
  to { transform: rotate(360deg); }
}

@keyframes notif-halo {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 0.28; transform: scale(1.14); }
}

.notif-popover {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 60;
  width: min(370px, calc(100vw - 26px));
  max-height: min(72vh, 540px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

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

.notif-popover-head strong {
  font-size: 13px;
}

.notif-read-all {
  padding: 4px 8px;
  border: 0;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.notif-read-all:disabled {
  opacity: 0.45;
  cursor: default;
}

.notif-list {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.notif-empty {
  margin: 0;
  padding: 16px 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.notif-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  outline: none;
}

.notif-item[data-notif-mark-read] {
  cursor: pointer;
}

.notif-item[data-notif-mark-read]:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.notif-item.is-high {
  border-color: #fecaca;
  border-inline-start: 3px solid #b91c1c;
  background: #fff8f7;
}

.notif-item.is-read {
  opacity: 0.72;
}

.notif-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notif-item-meta time {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.notif-priority {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 8px;
  font-weight: 800;
}

.notif-priority.is-high {
  background: var(--danger-soft);
  color: var(--danger);
}

.notif-item > strong {
  display: block;
  font-size: 12px;
  line-height: 1.7;
}

.notif-item > p {
  margin: 3px 0 0;
  color: #475569;
  font-size: 10px;
  line-height: 1.9;
  white-space: pre-line;
}

.notif-item-state {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
}

.high-priority-banner {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px auto 0;
  padding: 14px 18px;
  border: 1px solid #fecaca;
  border-inline-start: 5px solid #b91c1c;
  border-radius: 16px;
  background: linear-gradient(100deg, #fff1f2, #fff7ed);
  box-shadow: 0 12px 30px rgba(185, 28, 28, 0.09);
}

.high-priority-copy {
  min-width: 0;
}

.high-priority-kicker {
  display: inline-block;
  margin-bottom: 3px;
  color: #b91c1c;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.high-priority-copy strong {
  display: block;
  color: #7f1d1d;
  font-size: 14px;
  line-height: 1.7;
}

.high-priority-copy p {
  margin: 2px 0 0;
  color: #7c2d12;
  font-size: 11px;
  line-height: 1.9;
  white-space: pre-line;
}

.high-priority-ack {
  flex: 0 0 auto;
  border-color: #b91c1c;
  background: #b91c1c;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.2);
}

.high-priority-ack:hover {
  background: #991b1b;
  color: #ffffff;
}

.btn-danger {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #ffffff;
}

.btn-danger:hover {
  background: #991b1b;
  color: #ffffff;
}

.security-suspended td {
  background: #fff5f5;
}

.suspended-badge {
  background: #b91c1c;
  color: #ffffff;
}

.suspended-reason-note {
  margin-top: 5px;
  color: #991b1b;
  font-size: 10px;
  line-height: 1.8;
}

.security-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

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

.notification-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.notification-form .wide {
  grid-column: 1 / -1;
}

.notification-form textarea {
  min-height: 100px;
}

.notification-recent-heading {
  margin-top: 24px;
}

.notification-recent-heading h3 {
  margin: 0;
  font-size: 16px;
}

.notification-priority.normal {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.notification-priority.high {
  background: var(--danger-soft);
  color: var(--danger);
}

.suspended-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -20%, rgba(185, 28, 28, 0.2), transparent 48rem),
    #f7eded;
}

.suspended-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
}

.suspended-card {
  width: min(660px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid #fecaca;
  border-top: 7px solid #b91c1c;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(127, 29, 29, 0.15);
}

.suspended-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid #fecaca;
  border-radius: 18px;
  background: #fff1f2;
  color: #b91c1c;
}

.suspended-mark svg {
  width: 34px;
  height: 34px;
}

.suspended-eyebrow {
  margin: 0;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.suspended-card h1 {
  margin: 6px 0 12px;
  color: #7f1d1d;
  font-size: clamp(25px, 4vw, 36px);
  line-height: 1.4;
}

.suspended-copy {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 2;
}

.suspended-reason {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fff7f7;
}

.suspended-reason span {
  display: block;
  margin-bottom: 4px;
  color: #991b1b;
  font-size: 10px;
  font-weight: 800;
}

.suspended-reason p {
  margin: 0;
  color: #7f1d1d;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.9;
}

.suspended-support {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.suspended-support h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.suspended-support p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.suspended-support ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.suspended-support li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.suspended-support strong {
  color: var(--ink);
}

.suspended-logout {
  margin-top: 24px;
}

@media (max-width: 720px) {
  .high-priority-banner {
    align-items: stretch;
    flex-direction: column;
  }
  .high-priority-ack {
    width: 100%;
  }
  .notification-form {
    grid-template-columns: 1fr;
  }
  .notification-form .wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notif-bell-high::before,
  .notif-bell-high::after {
    animation: none;
  }
}.balance-card {
  margin-top: 18px;
}

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

.balance-panel {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.balance-panel h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 13px;
}

.balance-segment-bar {
  display: flex;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef3;
  box-shadow: inset 0 1px 2px rgba(15, 45, 65, 0.08);
}

.meter-segment {
  display: block;
  height: 100%;
  min-width: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.7);
  transition: width 220ms ease;
}

.balance-segment-bar .difficulty-easy,
.balance-legend-pill.difficulty-easy i {
  background: #0f766e;
}

.balance-segment-bar .difficulty-medium,
.balance-legend-pill.difficulty-medium i {
  background: #d97706;
}

.balance-segment-bar .difficulty-hard,
.balance-legend-pill.difficulty-hard i {
  background: #334155;
}

.balance-segment-bar .difficulty-unknown,
.balance-legend-pill.difficulty-unknown i {
  background: #94a3b8;
}

.balance-segment-bar .image-segment,
.balance-legend-pill.image-segment i {
  background: #0f766e;
}

.balance-segment-bar .text-segment,
.balance-legend-pill.text-segment i {
  background: #cbd5e1;
}

.balance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.balance-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.balance-legend-pill i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.balance-legend-pill b {
  color: var(--ink);
  font-size: 10px;
}

.balance-legend-pill small {
  color: var(--muted);
  font-size: 8px;
}

.source-bars {
  display: grid;
  gap: 10px;
}

.source-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.source-row-head > span:first-child {
  color: var(--ink);
  font-size: 10px;
}

.source-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef3;
}

.source-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #2dd4bf);
  transition: width 220ms ease;
}

.image-ratio-bar {
  margin-top: 2px;
}

.active-saved-exam {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 13px;
  border: 1px solid #c6e7df;
  border-radius: 13px;
  background: #f0fdfa;
}

.active-saved-pill {
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 700;
}

.active-saved-pill strong {
  font-weight: 900;
}

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

.saved-exams-card {
  margin-top: 18px;
}

.saved-exams-list {
  display: grid;
  gap: 10px;
}

.saved-exams-note {
  margin: 0;
  padding: 18px 13px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.saved-exam-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.saved-exam-main {
  min-width: 0;
}

.saved-exam-main strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 13px;
}

.saved-exam-main small {
  color: var(--muted);
  font-size: 9px;
}

.saved-exam-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}

.saved-exam-badges span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 9px;
  font-weight: 700;
}

.saved-exam-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

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

@media (max-width: 980px) {
  .balance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .saved-exam-row {
    align-items: stretch;
    flex-direction: column;
  }
  .saved-exam-actions .btn {
    flex: 1 1 auto;
  }
  .active-saved-exam {
    align-items: flex-start;
    flex-direction: column;
  }
}.student-page {
  padding-bottom: 52px;
}

.student-header {
  position: static;
}

.student-header-row {
  flex-wrap: wrap;
}

.student-tabs .nav-link {
  background: transparent;
  cursor: pointer;
}

.student-tabs a.is-active {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.student-dev-note {
  width: min(760px, 100%);
  margin: 24px auto;
  padding: 24px;
  border: 1px solid #c6e7df;
  border-radius: 20px;
  background: #f0fdfa;
  text-align: center;
}

.student-dev-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-deep);
  font-size: 18px;
}

.student-dev-note p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.student-resume-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid #99f6e4;
  border-inline-start: 5px solid var(--brand);
  border-radius: 18px;
  background: linear-gradient(100deg, #ecfdf5, #ffffff);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.09);
}

.student-resume-card h2 {
  margin: 2px 0 3px;
  font-size: 18px;
}

.student-card {
  margin-top: 18px;
}

.student-card h1 {
  margin: 3px 0 0;
  font-size: clamp(24px, 3.2vw, 34px);
}

.student-setup-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.student-setup-form > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.student-setup-form .wide {
  grid-column: 1 / -1;
}

.student-choice-group {
  grid-column: span 2;
  margin: 0;
  padding: 0;
  border: 0;
}

.student-choice-group legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.student-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.student-pills label {
  position: relative;
  cursor: pointer;
}

.student-pills input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.student-pills span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.student-pills input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.student-mode-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.student-mode-pills label {
  position: relative;
  cursor: pointer;
}

.student-mode-pills input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.student-mode-pills label > span {
  display: block;
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.student-mode-pills strong,
.student-mode-pills small {
  display: block;
}

.student-mode-pills strong {
  color: var(--ink);
  font-size: 12px;
}

.student-mode-pills small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.student-mode-pills input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.student-history-list {
  display: grid;
  gap: 9px;
}

.student-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.student-history-row > div:first-child {
  min-width: 0;
}

.student-history-row strong {
  color: var(--ink);
  font-size: 13px;
}

.student-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.student-history-score {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.student-history-score > strong {
  color: var(--brand-deep);
  font-size: 18px;
}

.student-history-score small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.student-live-label {
  color: #b45309 !important;
  font-size: 12px !important;
}

.student-empty-note {
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.student-runner {
  padding-top: 2px;
}

.student-runner-bar {
  position: sticky;
  top: 10px;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: 18px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}

.student-runner-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.student-runner-stat span {
  color: #94a3b8;
  font-size: 9px;
}

.student-runner-stat strong {
  color: #99f6e4;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0.03em;
}

.student-runner-stat strong.is-low {
  color: #fbbf24;
}

.student-save-status {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 700;
}

.student-save-status.is-saving {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}

.student-save-status.is-error {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

.student-runner-bar .btn-primary {
  background: #2dd4bf;
  color: #062e2b;
}

.student-runner-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 12px;
}

.student-runner-heading h1 {
  margin: 0;
  font-size: clamp(21px, 3vw, 30px);
}

.student-question-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.student-strip-pill {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.student-strip-pill.is-answered {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.student-questions {
  display: grid;
  gap: 14px;
}

.student-question-card,
.student-review-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 45, 65, 0.05);
  scroll-margin-top: 220px;
}

.student-question-head,
.student-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.student-question-number {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.student-question-text {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 2;
}

.student-question-images,
.student-answer-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.student-question-images img,
.student-answer-images img {
  max-width: min(100%, 260px);
  max-height: 210px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  object-fit: contain;
}

.student-options {
  display: grid;
  gap: 8px;
}

.student-option {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: #334155;
  font: inherit;
  font-size: 13px;
  line-height: 1.8;
  text-align: right;
  cursor: pointer;
  transition: 140ms ease;
}

.student-option:hover {
  border-color: #99f6e4;
}

.student-option.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.student-option-index {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: #ffffff;
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 800;
}

.student-option.is-selected .student-option-index {
  background: var(--brand);
  color: #ffffff;
}

.student-scorecard {
  padding-top: 6px;
}

.student-scorecard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.student-scorecard-heading h1 {
  margin: 3px 0;
  font-size: clamp(24px, 3.5vw, 38px);
}

.student-score-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.student-kpi {
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 45, 65, 0.05);
  text-align: center;
}

.student-kpi strong {
  display: block;
  color: var(--brand-deep);
  font-size: 25px;
  line-height: 1.25;
}

.student-kpi span {
  color: var(--muted);
  font-size: 10px;
}

.student-kpi-primary {
  border-color: #99f6e4;
  background: linear-gradient(145deg, #ecfdf5, #ffffff);
}

.student-kpi.is-correct strong {
  color: var(--brand);
}

.student-kpi.is-wrong strong {
  color: var(--danger);
}

.student-breakdown {
  display: grid;
  gap: 13px;
}

.student-weak-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.student-weak-head strong {
  color: var(--brand-deep);
}

.student-weak-row.is-negative .student-weak-head strong {
  color: var(--danger);
}

.student-weak-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef3;
}

.student-weak-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #991b1b, #d97706, #0f766e);
}

.student-weak-row.is-negative .student-weak-track span {
  background: var(--danger);
}

.student-weak-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.student-review {
  display: grid;
  gap: 14px;
}

.student-status-badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.student-status-badge.is-correct {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.student-status-badge.is-wrong {
  background: var(--danger-soft);
  color: var(--danger);
}

.student-status-badge.is-blank {
  background: #f1f5f9;
  color: var(--muted);
}

.student-review-options {
  display: grid;
  gap: 7px;
}

.student-review-option {
  display: flex;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.8;
}

.student-review-option.is-correct {
  border-color: #99f6e4;
  background: #ecfdf5;
}

.student-review-option.is-selected {
  border-color: #93c5fd;
  background: #eff6ff;
}

.student-review-option.is-wrong-selected {
  border-color: #fca5a5;
  background: #fff1f2;
}

.student-solution {
  margin-top: 13px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfdff;
}

.student-solution p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}

.student-solution p:last-child {
  margin-bottom: 0;
}

.student-solution-text {
  color: var(--ink) !important;
  white-space: pre-line;
}

@media (max-width: 900px) {
  .student-setup-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .student-score-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .student-kpi-primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .student-header-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .student-tabs {
    order: 3;
    width: 100%;
  }
  .student-page {
    padding-top: 14px;
  }
  .student-card {
    padding: 15px;
  }
  .student-setup-form {
    grid-template-columns: 1fr;
  }
  .student-setup-form .wide,
  .student-choice-group {
    grid-column: auto;
  }
  .student-mode-pills {
    grid-template-columns: 1fr;
  }
  .student-resume-card {
    align-items: stretch;
    flex-direction: column;
  }
  .student-resume-card .btn {
    width: 100%;
  }
  .student-history-row {
    align-items: stretch;
    flex-direction: column;
  }
  .student-history-score {
    justify-content: space-between;
  }
  .student-runner-bar {
    top: 8px;
    gap: 8px;
    border-radius: 15px;
    padding: 11px 12px;
  }
  .student-runner-stat strong {
    font-size: 20px;
  }
  .student-runner-bar .btn {
    width: 100%;
  }
  .student-question-card,
  .student-review-card {
    padding: 14px;
    scroll-margin-top: 195px;
  }
  .student-option {
    min-height: 56px;
    font-size: 13px;
  }
  .student-scorecard-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .student-score-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.subscription-renewal-strip {
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 10px 16px;
  border: 1px solid #f4d58d;
  border-inline-start: 4px solid #d97706;
  border-radius: 13px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.9;
  text-align: center;
}

.admin-user-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.admin-user-create-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.admin-user-create-form .form-actions {
  grid-column: 1 / -1;
}

.admin-user-table-wrap {
  max-height: 560px;
  overflow: auto;
}

.admin-user-table {
  min-width: 900px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.admin-user-state {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-user-state.is-active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.admin-user-state.is-expiring {
  background: var(--accent-soft);
  color: #92400e;
}

.admin-user-state.is-expired {
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-user-state.is-suspended {
  background: #fef2f2;
  color: #991b1b;
}

.admin-user-state.is-inactive {
  background: #f1f5f9;
  color: var(--muted);
}

.expired-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 0%, rgba(217, 119, 6, 0.13), transparent 32rem),
    #f4f7fa;
}

.expired-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
}

.expired-card {
  width: min(660px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid #f4d58d;
  border-top: 7px solid #d97706;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(120, 53, 15, 0.14);
}

.expired-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid #f4d58d;
  border-radius: 18px;
  background: var(--accent-soft);
  color: #b45309;
}

.expired-mark svg {
  width: 34px;
  height: 34px;
}

.expired-eyebrow {
  margin: 0;
  color: #b45309;
  font-size: 11px;
  font-weight: 900;
}

.expired-card h1 {
  margin: 6px 0 12px;
  color: #78350f;
  font-size: clamp(25px, 4vw, 36px);
  line-height: 1.45;
}

.expired-copy {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 2;
}

.expired-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 16px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid #f4d58d;
  border-radius: 14px;
  background: #fffbeb;
}

.expired-meta span {
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
}

.expired-meta strong {
  color: #78350f;
  font-size: 12px;
}

.expired-support {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.expired-support h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.expired-support p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.expired-support ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.expired-support li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.expired-support strong {
  color: var(--ink);
}

.expired-logout {
  margin-top: 24px;
}

.billing-result-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(15, 118, 110, 0.1), transparent 28rem),
    var(--bg);
}

.billing-result-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
}

.billing-result-card {
  width: min(600px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-top: 6px solid var(--brand);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.billing-result-card.is-failure {
  border-top-color: var(--danger);
}

.billing-result-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 17px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.billing-result-card.is-failure .billing-result-mark {
  background: var(--danger-soft);
  color: var(--danger);
}

.billing-result-mark svg {
  width: 31px;
  height: 31px;
}

.billing-result-card h1 {
  margin: 4px 0 10px;
  font-size: clamp(23px, 3.5vw, 32px);
}

.billing-result-message {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.95;
}

.billing-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.billing-result-support {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.billing-result-support strong {
  color: var(--ink);
}

@media (max-width: 980px) {
  .admin-user-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .admin-user-create-form {
    grid-template-columns: 1fr;
  }
  .admin-user-create-form .form-actions {
    grid-column: auto;
  }
  .subscription-renewal-strip {
    width: calc(100% - 22px);
  }
  .expired-meta {
    grid-template-columns: 1fr;
  }
}

/* Theme controls */
.theme-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.32);
  outline-offset: 2px;
}

.theme-toggle svg {
  display: none;
  width: 17px;
  height: 17px;
}

.theme-toggle .theme-icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .theme-icon-sun {
  display: block;
}

.public-header .theme-toggle {
  border-color: rgba(203, 213, 225, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.public-header .theme-toggle:hover {
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(45, 212, 191, 0.14);
  color: #f8fafc;
}

.student-guest-actions,
.landing-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1116;
  --surface: #121b22;
  --surface-soft: #17232c;
  --ink: #edf3f7;
  --muted: #9fb1bf;
  --brand: #14b8a6;
  --brand-deep: #5eead4;
  --brand-soft: rgba(20, 184, 166, 0.16);
  --accent: #fcd34d;
  --accent-soft: rgba(245, 158, 11, 0.16);
  --line: #243340;
  --line-strong: #2f4252;
  --danger: #fca5a5;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --danger-line: #ef4444;
  --correct: #86efac;
  --correct-soft: rgba(34, 197, 94, 0.16);
  --correct-line: #22c55e;
  --info: #93c5fd;
  --info-soft: rgba(59, 130, 246, 0.16);
  --info-line: #3b82f6;
  --on-brand: #042f2e;
  --image-mat: #f3f6f8;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  scrollbar-color: #2f4252 #0b1116;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 90% -10%, rgba(20, 184, 166, 0.09), transparent 36rem),
    radial-gradient(circle at 8% 0%, rgba(245, 158, 11, 0.045), transparent 28rem),
    var(--bg);
  color: var(--ink);
}

:root[data-theme="dark"] a {
  color: var(--brand-deep);
}

:root[data-theme="dark"] a:hover {
  color: #99f6e4;
}

:root[data-theme="dark"] ::selection {
  background: rgba(20, 184, 166, 0.35);
  color: #ffffff;
}

:root[data-theme="dark"] .site-header {
  background: rgba(11, 17, 22, 0.9);
  border-bottom-color: rgba(47, 66, 82, 0.9);
}

:root[data-theme="dark"] .public-header {
  background: rgba(7, 15, 20, 0.95);
  border-bottom-color: rgba(47, 66, 82, 0.8);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

:root[data-theme="dark"] select option {
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #7f93a2;
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
  border-color: var(--brand);
  background: var(--surface-soft);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

:root[data-theme="dark"] input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-soft) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

:root[data-theme="dark"] .btn-primary {
  color: var(--on-brand);
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.2);
}

:root[data-theme="dark"] .btn-primary:hover {
  background: #2dd4bf;
  color: var(--on-brand);
}

:root[data-theme="dark"] .btn-ghost,
:root[data-theme="dark"] .nav-logout,
:root[data-theme="dark"] .page-btn,
:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] .notif-bell,
:root[data-theme="dark"] .balance-legend-pill {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

:root[data-theme="dark"] .btn-ghost:hover,
:root[data-theme="dark"] .nav-logout:hover,
:root[data-theme="dark"] .page-btn:hover,
:root[data-theme="dark"] .icon-btn:hover,
:root[data-theme="dark"] .notif-bell:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

:root[data-theme="dark"] .btn-danger,
:root[data-theme="dark"] .high-priority-ack,
:root[data-theme="dark"] .suspended-badge {
  border-color: var(--danger-line);
  background: #b91c1c;
  color: #ffffff;
}

:root[data-theme="dark"] .btn-danger:hover,
:root[data-theme="dark"] .high-priority-ack:hover {
  border-color: #dc2626;
  background: #991b1b;
  color: #ffffff;
}

:root[data-theme="dark"] .nav-badge,
:root[data-theme="dark"] .notif-badge,
:root[data-theme="dark"] .page-btn.is-active,
:root[data-theme="dark"] .student-strip-pill.is-answered,
:root[data-theme="dark"] .student-option.is-selected .student-option-index,
:root[data-theme="dark"] .workflow-num,
:root[data-theme="dark"] .preview-export-buttons span {
  color: var(--on-brand);
}

:root[data-theme="dark"] .notif-badge {
  border-color: var(--surface);
}

:root[data-theme="dark"] .notif-bell-high {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: #fca5a5;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

:root[data-theme="dark"] .notif-bell-high .notif-badge {
  background: #b91c1c;
  color: #ffffff;
}

:root[data-theme="dark"] .notif-popover {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .notif-item.is-high {
  border-color: rgba(239, 68, 68, 0.55);
  border-inline-start-color: var(--danger-line);
  background: var(--danger-soft);
}

:root[data-theme="dark"] .notif-item > p {
  color: var(--muted);
}

:root[data-theme="dark"] .toast {
  border-color: var(--line-strong);
  background: #17232c;
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .toast.is-error {
  background: #991b1b;
  color: #fee2e2;
}

:root[data-theme="dark"] .modal {
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

:root[data-theme="dark"] .modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

:root[data-theme="dark"] .modal-card select,
:root[data-theme="dark"] .modal-card textarea {
  background: var(--surface-soft);
}

:root[data-theme="dark"] #prompt-output {
  border-color: var(--line-strong);
  background: #0b1116;
  color: #dbeafe;
}

:root[data-theme="dark"] .option-item {
  color: var(--ink);
}

:root[data-theme="dark"] .answer-box {
  background: var(--surface-soft);
}

:root[data-theme="dark"] .answer-box p {
  color: var(--muted);
}

:root[data-theme="dark"] .badge.badge-accent,
:root[data-theme="dark"] .admin-user-state.is-expiring {
  background: var(--accent-soft);
  color: #fcd34d;
}

:root[data-theme="dark"] .warning-amber {
  border-color: #d97706;
  background: var(--accent-soft);
  color: #fcd34d;
}

:root[data-theme="dark"] .warning-red {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: #fca5a5;
}

:root[data-theme="dark"] .skeleton-card {
  background: linear-gradient(100deg, #18252e 25%, #22313b 45%, #18252e 65%);
  background-size: 220% 100%;
}

:root[data-theme="dark"] .workspace-preview {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.48);
}

:root[data-theme="dark"] .workspace-topbar {
  color: var(--muted);
}

:root[data-theme="dark"] .workspace-dots i {
  background: #3b4d5a;
}

:root[data-theme="dark"] .workspace-step {
  border-color: var(--line);
  background: var(--surface-soft);
}

:root[data-theme="dark"] .preview-chips span {
  background: var(--surface);
  color: var(--muted);
}

:root[data-theme="dark"] .preview-search {
  background: var(--surface);
  color: var(--muted);
}

:root[data-theme="dark"] .preview-search i {
  border-color: var(--muted);
}

:root[data-theme="dark"] .preview-search i::after {
  background: var(--muted);
}

:root[data-theme="dark"] .preview-question span {
  background: var(--surface);
  color: var(--muted);
}

:root[data-theme="dark"] .preview-question i {
  background: linear-gradient(90deg, #263641, #1c2a33);
}

:root[data-theme="dark"] .workspace-export {
  border-color: rgba(94, 234, 212, 0.35);
  background: var(--brand-soft);
}

:root[data-theme="dark"] .preview-export-buttons span + span {
  border-color: var(--brand);
  background: var(--surface);
  color: var(--brand-deep);
}

:root[data-theme="dark"] .landing-stats {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .feature-card:hover {
  border-color: rgba(94, 234, 212, 0.45);
}

:root[data-theme="dark"] .workflow-section {
  border-block-color: var(--line);
  background: #0d151b;
}

:root[data-theme="dark"] .workflow-step {
  border-color: var(--line);
  background: var(--surface);
}

:root[data-theme="dark"] .school-access-card {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .contact-card {
  border: 1px solid var(--line);
  background: #0f1a21;
}

:root[data-theme="dark"] .footer-brand p {
  color: #8aa0b0;
}

:root[data-theme="dark"] .balance-segment-bar,
:root[data-theme="dark"] .source-track,
:root[data-theme="dark"] .student-weak-track {
  background: #263641;
}

:root[data-theme="dark"] .meter-segment {
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .balance-segment-bar .difficulty-easy,
:root[data-theme="dark"] .balance-legend-pill.difficulty-easy i,
:root[data-theme="dark"] .balance-segment-bar .image-segment,
:root[data-theme="dark"] .balance-legend-pill.image-segment i {
  background: #2dd4bf;
}

:root[data-theme="dark"] .balance-segment-bar .difficulty-medium,
:root[data-theme="dark"] .balance-legend-pill.difficulty-medium i {
  background: #f59e0b;
}

:root[data-theme="dark"] .balance-segment-bar .difficulty-hard,
:root[data-theme="dark"] .balance-legend-pill.difficulty-hard i {
  background: #94a3b8;
}

:root[data-theme="dark"] .balance-segment-bar .difficulty-unknown,
:root[data-theme="dark"] .balance-legend-pill.difficulty-unknown i {
  background: #64748b;
}

:root[data-theme="dark"] .balance-segment-bar .text-segment,
:root[data-theme="dark"] .balance-legend-pill.text-segment i {
  background: #64748b;
}

:root[data-theme="dark"] .source-fill {
  background: linear-gradient(90deg, #14b8a6, #5eead4);
}

:root[data-theme="dark"] .active-saved-exam {
  border-color: rgba(94, 234, 212, 0.35);
  background: var(--brand-soft);
}

:root[data-theme="dark"] .student-dev-note {
  border-color: rgba(94, 234, 212, 0.35);
  background: var(--brand-soft);
}

:root[data-theme="dark"] .student-resume-card {
  border-color: rgba(94, 234, 212, 0.38);
  background: linear-gradient(100deg, rgba(20, 184, 166, 0.14), var(--surface));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .student-runner-bar {
  border: 1px solid var(--line);
  background: #071117;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .student-question-strip {
  border-color: var(--line);
  background: rgba(18, 27, 34, 0.94);
}

:root[data-theme="dark"] .student-question-card,
:root[data-theme="dark"] .student-review-card,
:root[data-theme="dark"] .student-kpi {
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .student-question-images img,
:root[data-theme="dark"] .student-answer-images img,
:root[data-theme="dark"] .q-images img,
:root[data-theme="dark"] .answer-images img,
:root[data-theme="dark"] .basket-thumb {
  background: var(--image-mat);
  padding: 6px;
  border-color: var(--line-strong);
}

:root[data-theme="dark"] .student-option {
  color: var(--ink);
}

:root[data-theme="dark"] .student-option:hover {
  border-color: rgba(94, 234, 212, 0.55);
}

:root[data-theme="dark"] .student-option-index {
  background: var(--surface);
  color: var(--brand-deep);
}

:root[data-theme="dark"] .student-kpi-primary {
  border-color: rgba(94, 234, 212, 0.35);
  background: linear-gradient(145deg, var(--brand-soft), var(--surface));
}

:root[data-theme="dark"] .student-kpi.is-correct strong {
  color: var(--correct);
}

:root[data-theme="dark"] .student-live-label {
  color: #fcd34d !important;
}

:root[data-theme="dark"] .student-status-badge.is-correct {
  background: var(--correct-soft);
  color: var(--correct);
}

:root[data-theme="dark"] .student-status-badge.is-blank {
  background: var(--surface-soft);
  color: var(--muted);
}

:root[data-theme="dark"] .student-review-option.is-correct {
  border-color: var(--correct-line);
  background: var(--correct-soft);
  color: var(--correct);
}

:root[data-theme="dark"] .student-review-option.is-selected {
  border-color: var(--info-line);
  background: var(--info-soft);
  color: #bfdbfe;
}

:root[data-theme="dark"] .student-review-option.is-wrong-selected {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: #fca5a5;
}

:root[data-theme="dark"] .student-solution {
  background: var(--surface-soft);
}

:root[data-theme="dark"] .security-table tr.security-flagged td {
  background: rgba(239, 68, 68, 0.08);
}

:root[data-theme="dark"] .security-table tr.security-suspended td {
  background: rgba(239, 68, 68, 0.13);
}

:root[data-theme="dark"] .security-flag-pill {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: #fca5a5;
}

:root[data-theme="dark"] .security-flag-pill small,
:root[data-theme="dark"] .suspended-reason-note {
  color: #fca5a5;
}

:root[data-theme="dark"] .admin-user-state.is-suspended {
  background: var(--danger-soft);
  color: #fca5a5;
}

:root[data-theme="dark"] .admin-user-state.is-inactive {
  background: var(--surface-soft);
  color: var(--muted);
}

:root[data-theme="dark"] .high-priority-banner {
  border-color: rgba(239, 68, 68, 0.55);
  border-inline-start-color: var(--danger-line);
  background: linear-gradient(100deg, rgba(239, 68, 68, 0.16), rgba(245, 158, 11, 0.08));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .high-priority-kicker {
  color: #fca5a5;
}

:root[data-theme="dark"] .high-priority-copy strong {
  color: #fecaca;
}

:root[data-theme="dark"] .high-priority-copy p {
  color: #fca5a5;
}

:root[data-theme="dark"] .subscription-renewal-strip {
  border-color: #d97706;
  border-inline-start-color: #d97706;
  background: var(--accent-soft);
  color: #fcd34d;
}

:root[data-theme="dark"] .suspended-body {
  background:
    radial-gradient(circle at 50% -20%, rgba(239, 68, 68, 0.18), transparent 48rem),
    var(--bg);
}

:root[data-theme="dark"] .suspended-card {
  border-color: var(--danger-line);
  border-top-color: var(--danger-line);
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .suspended-card h1 {
  color: #fecaca;
}

:root[data-theme="dark"] .suspended-copy {
  color: var(--muted);
}

:root[data-theme="dark"] .suspended-mark {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: #fca5a5;
}

:root[data-theme="dark"] .suspended-eyebrow {
  color: #fca5a5;
}

:root[data-theme="dark"] .suspended-reason {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

:root[data-theme="dark"] .suspended-reason span {
  color: #fca5a5;
}

:root[data-theme="dark"] .suspended-reason p {
  color: #fecaca;
}

:root[data-theme="dark"] .expired-body {
  background:
    radial-gradient(circle at 75% 0%, rgba(245, 158, 11, 0.11), transparent 32rem),
    var(--bg);
}

:root[data-theme="dark"] .expired-card {
  border-color: #d97706;
  border-top-color: #d97706;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
}

:root[data-theme="dark"] .expired-mark {
  border-color: #d97706;
  background: var(--accent-soft);
  color: #fcd34d;
}

:root[data-theme="dark"] .expired-eyebrow,
:root[data-theme="dark"] .expired-meta span {
  color: #fcd34d;
}

:root[data-theme="dark"] .expired-card h1,
:root[data-theme="dark"] .expired-meta strong {
  color: #fde68a;
}

:root[data-theme="dark"] .expired-copy {
  color: var(--muted);
}

:root[data-theme="dark"] .expired-meta {
  border-color: #d97706;
  background: var(--accent-soft);
}

:root[data-theme="dark"] .billing-result-body {
  background:
    radial-gradient(circle at 80% 0%, rgba(20, 184, 166, 0.1), transparent 28rem),
    var(--bg);
}

:root[data-theme="dark"] .billing-result-card {
  background: var(--surface);
}

:root[data-theme="dark"] .billing-result-message,
:root[data-theme="dark"] .billing-result-support {
  color: var(--muted);
}

:root[data-theme="dark"] .billing-result-support strong {
  color: var(--ink);
}

/* Question bank layout switcher */
.results-heading {
  align-items: center;
  flex-wrap: wrap;
}

.results-heading-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-inline-start: auto;
}

.layout-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.layout-switcher button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: 150ms ease;
}

.layout-switcher button:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.layout-switcher button:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.3);
  outline-offset: 1px;
}

.layout-switcher button.is-active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(15, 118, 110, 0.16);
}

.layout-switcher button.is-active:hover {
  background: var(--brand);
  color: #ffffff;
}

.layout-switcher svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

#question-list[data-layout="single"] {
  grid-template-columns: 1fr;
}

#question-list[data-layout="single"] .q-images img {
  max-height: 240px;
}

#question-list[data-layout="double"] {
  grid-template-columns: 1fr;
}

#question-list[data-layout="double"] .options-list {
  grid-template-columns: 1fr;
}

#question-list[data-layout="compact"] {
  grid-template-columns: 1fr;
  gap: 8px;
}

#question-list[data-layout="compact"] .question-card {
  gap: 8px;
  padding: 11px 13px;
  border-radius: 14px;
}

#question-list[data-layout="compact"] .question-stem {
  font-size: 13px;
  line-height: 1.8;
}

#question-list[data-layout="compact"] .q-images img {
  max-height: 110px;
}

#question-list[data-layout="compact"] .options-list {
  grid-template-columns: 1fr;
  gap: 4px;
}

#question-list[data-layout="compact"] .option-item {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.7;
}

#question-list[data-layout="compact"] .badge {
  padding: 2px 6px;
  font-size: 8px;
}

#question-list[data-layout="compact"] .card-actions {
  gap: 5px;
  padding-top: 0;
}

#question-list[data-layout="compact"] .card-actions .btn {
  min-height: 28px;
  font-size: 10px;
}

@media (min-width: 720px) {
  #question-list[data-layout="single"] .options-list,
  #question-list[data-layout="compact"] .options-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #question-list[data-layout="single"] .options-list {
    gap: 8px;
  }
}

@media (min-width: 900px) {
  #question-list[data-layout="double"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .layout-switcher .layout-opt-double {
    display: none;
  }
}

@media (max-width: 620px) {
  .results-heading {
    align-items: flex-start;
  }

  .results-heading-tools {
    width: 100%;
    justify-content: space-between;
  }
}

:root[data-theme="dark"] .layout-switcher button.is-active,
:root[data-theme="dark"] .layout-switcher button.is-active:hover {
  background: #14b8a6;
  color: var(--on-brand);
  box-shadow: 0 5px 14px rgba(20, 184, 166, 0.22);
}

/* Conditional cascading filters */
.filter-grid [hidden],
.student-setup-form [hidden],
.prompt-form [hidden],
.export-form [hidden] {
  display: none !important;
}

@media (min-width: 621px) {
  .export-form[data-export-answer="hidden"] .export-paper-field {
    grid-column: span 2;
  }
}

@media (min-width: 901px) {
  .filter-grid[data-filter-depth="none"] .search-field {
    grid-column: span 3;
  }

  .filter-grid[data-filter-depth="both"] .search-field {
    grid-column: span 1;
  }

  .student-setup-form[data-cascade-fields="none"]
  > .student-choice-group:not(.wide) {
    grid-column: 1 / -1;
  }

  .student-setup-form[data-cascade-fields="both"]
  > .student-choice-group:not(.wide) {
    grid-column: span 1;
  }

  .student-setup-form > #student-duration-field {
    grid-column: span 1;
  }

  .student-setup-form > .form-actions {
    grid-column: span 2;
    align-self: end;
  }
}
/* ------------------------------ */
/* Usage quota widget, footer and admin quota controls */
.quota-widget {
  position: relative;
  display: inline-flex;
}

.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.quota-pill:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.quota-pill.is-warn {
  border-color: var(--accent);
  color: var(--accent);
}

.quota-pill.is-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.quota-pill-track {
  display: inline-block;
  width: 44px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.quota-pill-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 260ms ease, background-color 260ms ease;
}

.quota-pill-fill.is-warn,
.quota-bar > span.is-warn {
  background: var(--accent);
}

.quota-pill-fill.is-danger,
.quota-bar > span.is-danger {
  background: var(--danger);
}

.quota-pill-pct {
  min-width: 28px;
  direction: ltr;
  text-align: center;
}

.quota-popover {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 60;
  width: min(330px, calc(100vw - 26px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

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

.quota-popover-head strong {
  font-size: 13px;
}

.quota-state {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.quota-restricted {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  line-height: 1.8;
}

.quota-group {
  display: grid;
  gap: 5px;
  padding-top: 10px;
}

.quota-group h4 {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.quota-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.quota-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.quota-bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 260ms ease, background-color 260ms ease;
}

.quota-reset {
  font-size: 9.5px;
  color: var(--muted);
}

.site-footer {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.site-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 12px;
  color: var(--muted);
  font-size: 11px;
}

.app-version-label {
  font-size: 10px;
  letter-spacing: 0.2px;
}

.admin-quota-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.admin-quota-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.admin-quota-form input[type="number"] {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.admin-quota-form .form-actions {
  grid-column: 1 / -1;
}

.admin-quota-form.modal-form-grid {
  margin-top: 10px;
}

.checkbox-label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.checkbox-label input {
  width: auto;
}

.admin-user-state.is-restricted {
  background: var(--accent-soft);
  color: var(--accent);
}

.quota-restricted-badge {
  background: var(--accent-soft);
  color: var(--accent);
}

:root[data-theme="dark"] .quota-pill {
  background: var(--surface-soft);
}

/* ------------------------------ */
/* Role switcher, multi-role badges and notification filters */
.role-switcher {
  position: relative;
  display: inline-flex;
}

.role-switcher-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: 140ms ease;
}

.role-switcher-pill:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.role-switcher-pill > svg {
  width: 14px;
  height: 14px;
}

.role-switcher-chevron {
  width: 12px !important;
  height: 12px !important;
  color: var(--muted);
}

.role-switcher-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 70;
  width: 240px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.role-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  text-align: start;
  cursor: pointer;
}

.role-option:hover {
  background: var(--surface-soft);
}

.role-option.is-active {
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
}

.role-option svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.role-badge {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.role-badge-row {
  flex-wrap: wrap;
}

.role-badge-row .badge {
  padding: 2px 7px;
  font-size: 9.5px;
}

.notif-filters {
  display: flex;
  gap: 6px;
  padding-top: 10px;
}

.notif-filter {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.notif-filter.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

/* ------------------------------ */
/* Admin sidebar workspace */
.admin-workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-workspace.is-sidebar-collapsed {
  grid-template-columns: 70px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-sidebar-title .eyebrow {
  margin: 0;
}

.admin-sidebar-title strong {
  display: block;
  font-size: 13px;
}

.admin-sidebar-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
}

.admin-sidebar-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.admin-workspace.is-sidebar-collapsed .admin-sidebar-toggle svg {
  transform: rotate(180deg);
}

.admin-sidebar-nav {
  display: grid;
  gap: 5px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
  transition: 140ms ease;
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.admin-nav-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.admin-nav-item.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.admin-sidebar-foot {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
}

.admin-workspace.is-sidebar-collapsed .admin-sidebar-title,
.admin-workspace.is-sidebar-collapsed .admin-nav-item span,
.admin-workspace.is-sidebar-collapsed .admin-sidebar-foot {
  display: none;
}

.admin-workspace.is-sidebar-collapsed .admin-nav-item {
  justify-content: center;
  padding: 9px;
}

.admin-content {
  min-width: 0;
}

.admin-panel {
  display: grid;
  gap: 14px;
}

.admin-panel-head h1 {
  margin: 2px 0 4px;
}

.role-guide {
  margin: 12px 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.role-guide summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.role-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.role-guide-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.role-guide-card strong {
  font-size: 11.5px;
}

.role-guide-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.9;
}

.role-guide-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.role-check-group {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.role-check-group legend {
  padding-inline: 4px;
  color: var(--muted);
  font-size: 11px;
}

.role-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.role-check input {
  width: auto;
}

@media (max-width: 960px) {
  .admin-workspace,
  .admin-workspace.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-sidebar-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .admin-nav-item {
    white-space: nowrap;
  }

  .admin-sidebar-foot {
    display: none;
  }

  .admin-workspace.is-sidebar-collapsed .admin-sidebar-nav {
    display: none;
  }
}


/* ------------------------------ */
/* Unified inline icon system and question popularity */
.ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  vertical-align: -2px;
}

.btn .ui-icon,
.nav-link .ui-icon,
.label-icon .ui-icon,
.student-runner-stat .ui-icon {
  width: 16px;
  height: 16px;
}

.label-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.8;
  white-space: nowrap;
}

.usage-badge .ui-icon {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.usage-badge.is-compact {
  padding: 1px 6px;
  font-size: 9px;
}

.search-field {
  position: relative;
}

.filter-search-icon {
  position: absolute;
  inset-inline-start: 10px;
  bottom: 10px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  padding-inline-start: 31px;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-card {
    animation: none;
    background: var(--surface-soft);
  }
}


/* ------------------------------ */
/* AI badges, queues, report priority and question revisions */
.ai-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  font-weight: 700;
}

:root[data-theme="dark"] .ai-source-badge {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(124, 58, 237, 0.2);
  color: #c4b5fd;
}

.ai-source-badge .ui-icon {
  width: 12px;
  height: 12px;
}

.admin-nav-badge {
  margin-inline-start: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 9px;
  font-weight: 800;
}

.ai-queue-list {
  display: grid;
  gap: 14px;
}

.ai-queue-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.ai-queue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ai-queue-head strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.ai-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.ai-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.ai-queue-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-queue-actions input {
  flex: 1 1 220px;
}

.ai-queue-card textarea,
.ai-queue-card input,
.ai-queue-card select {
  width: 100%;
}

.ai-queue-empty {
  padding: 10px 0;
}

.ai-preview-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.ai-preview-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.ai-preview-card.is-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.ai-preview-stem {
  margin: 0;
  font-weight: 700;
}

.ai-preview-options {
  margin: 0;
  padding-inline-start: 18px;
  font-size: 12px;
}

.ai-preview-options li.is-correct {
  color: var(--brand-deep);
  font-weight: 700;
}

.ai-submission-history {
  display: grid;
  gap: 8px;
}

.ai-history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.ai-history-row p {
  margin: 0 0 4px;
  font-size: 12px;
}

.ai-status-approved {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.ai-status-rejected {
  border-color: var(--danger);
  color: var(--danger);
}

.report-priority-badge {
  display: inline-flex;
  margin-bottom: 4px;
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
}

.report-priority-row {
  background: rgba(180, 35, 24, 0.04);
}

:root[data-theme="dark"] .report-priority-row {
  background: rgba(239, 68, 68, 0.08);
}

.modal-card-wide {
  width: min(820px, calc(100vw - 26px));
}

.admin-question-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.admin-question-tabs button {
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.admin-question-tabs button.is-active {
  border-bottom-color: var(--brand);
  color: var(--brand-deep);
}

.admin-question-modal label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
}

.admin-question-modal input[type="text"],
.admin-question-modal input[type="number"],
.admin-question-modal select,
.admin-question-modal textarea {
  width: 100%;
}

.question-history {
  display: grid;
  gap: 10px;
}

.question-history-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.question-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.question-history-snippet {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

/* ------------------------------ */
/* Support tickets and admin analytics */
.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.support-form .wide {
  grid-column: 1 / -1;
}

.support-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.support-captcha {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.support-captcha-question {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.support-captcha-question strong {
  color: var(--brand-deep);
  font-size: 15px;
}

.support-tracking-result,
.support-lookup-result {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 12px;
}

.support-my-tickets {
  display: grid;
  gap: 10px;
}

.support-ticket-row {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.support-ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.support-admin-reply {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12px;
}

.support-status-open {
  border-color: var(--accent);
  color: var(--accent);
}

.support-status-in_progress {
  border-color: #2563eb;
  color: #2563eb;
}

.support-status-answered {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.support-status-closed {
  border-color: var(--line);
  color: var(--muted);
}

.analytics-range {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.analytics-range-btn,
.tickets-filter {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.analytics-range-btn.is-active,
.tickets-filter.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.analytics-kpi-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.analytics-kpi-card span {
  color: var(--muted);
  font-size: 10.5px;
}

.analytics-kpi-card strong {
  font-size: 20px;
  color: var(--ink);
}

.analytics-kpi-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
}

.analytics-chart {
  min-height: 180px;
}

.analytics-svg {
  width: 100%;
  height: auto;
}

.analytics-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.analytics-axis-text {
  fill: var(--muted);
  font-size: 10px;
  font-family: inherit;
}

.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 0 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.analytics-legend-column {
  flex-direction: column;
  gap: 6px;
}

.analytics-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.analytics-legend-item i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.analytics-split,
.analytics-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.analytics-bars {
  display: grid;
  gap: 8px;
}

.analytics-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 1.1fr) 2fr 44px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.analytics-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}

.analytics-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.analytics-bar-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.analytics-donut-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.analytics-donut-svg {
  width: 150px;
  height: 150px;
}

.analytics-donut-total {
  fill: var(--ink);
  font-size: 20px;
  font-weight: 800;
  font-family: inherit;
}

.analytics-pageviews {
  margin-top: 8px;
}

.analytics-empty {
  padding: 18px 0;
}

.tickets-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-ticket-list {
  display: grid;
  gap: 12px;
}

.admin-ticket-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.admin-ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-ticket-message {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 12px;
  white-space: pre-wrap;
}

.admin-ticket-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-ticket-actions select {
  min-height: 34px;
}

.ticket-registered-yes {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.ticket-registered-no {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 900px) {
  .support-layout,
  .support-form {
    grid-template-columns: 1fr;
  }

  .analytics-bar-row {
    grid-template-columns: minmax(70px, 1fr) 1.5fr 36px;
  }
}


/* ------------------------------ */
/* Theme view transition and click ripple */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  z-index: 9999;
}

.btn,
.nav-link,
.admin-nav-item,
.filter-chip,
.sort-pill,
.role-switcher-pill,
.role-option,
.template-pill,
.template-card,
.tab-btn,
.layout-opt,
[data-ripple] {
  position: relative;
  overflow: hidden;
}

.ui-ripple {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: ui-ripple-expand 520ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes ui-ripple-expand {
  0% {
    opacity: 0.24;
    transform: translate(-50%, -50%) scale(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-ripple {
    display: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ------------------------------ */
/* Digikala-style bank filters and phase 7 UI */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.bank-toolbar {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 78px;
  z-index: 15;
  background: var(--surface);
}

.bank-search {
  display: grid;
  width: 100%;
}

.bank-search input {
  width: 100%;
}

.search-clear {
  position: absolute;
  inset-inline-end: 8px;
  bottom: 7px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.bank-sort-bar,
.bank-mobile-pills,
.bank-active-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sort-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sort-pill,
.filter-chip {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.sort-pill.is-active,
.filter-chip.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.filter-count-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-inline-start: 4px;
  padding-inline: 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
}

.bank-mobile-pills {
  display: none;
}

.bank-workspace {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.bank-filter-sidebar {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 98px);
  overflow-y: auto;
  padding: 14px;
  scrollbar-width: thin;
}

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

.filter-sidebar-head h2 {
  margin: 0;
  font-size: 15px;
}

.filter-drawer-close {
  display: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.filter-switches {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.switch-input {
  appearance: none;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch-input::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
}

.switch-input:checked {
  background: var(--brand);
}

.switch-input:checked::after {
  transform: translateX(-16px);
}

.filter-group {
  border-top: 1px solid var(--line);
}

.filter-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}

.filter-group-head small {
  grid-column: 1 / 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.filter-group-head.is-collapsed .filter-chevron {
  transform: rotate(-90deg);
}

.filter-active-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline-start: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.filter-group-body {
  padding-bottom: 10px;
}

.filter-group-body label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.filter-group-body select {
  width: 100%;
}

.filter-apply-btn {
  width: 100%;
  margin-top: 8px;
}

.filter-drawer-footer {
  display: none;
}

.filter-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(10, 18, 24, 0.55);
  backdrop-filter: blur(2px);
}

.bank-active-chips:empty {
  display: none;
}

.bank-active-chips .filter-chip {
  font-size: 10px;
}

.bank-results {
  min-width: 0;
}

.message-templates {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.message-template-heading {
  align-items: flex-start;
  gap: 8px;
}

.message-template-heading h3 {
  margin: 0;
  font-size: 13px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.template-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: 140ms ease;
}

.template-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.template-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.template-card strong {
  font-size: 11.5px;
}

.template-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.template-priority-high {
  border-color: var(--danger);
  color: var(--danger);
}

.device-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--brand-deep);
}

.device-icon svg {
  width: 15px;
  height: 15px;
}

.session-device {
  min-width: 150px;
  font-size: 10.5px;
  line-height: 1.7;
}

@media (max-width: 959px) {
  .bank-toolbar {
    top: 0;
    margin-inline: -2px;
  }

  .bank-workspace {
    grid-template-columns: 1fr;
  }

  .bank-mobile-pills {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .bank-mobile-pills::-webkit-scrollbar {
    display: none;
  }

  .bank-sort-bar {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bank-filter-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    z-index: 80;
    width: min(370px, 92vw);
    max-height: none;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    overscroll-behavior: contain;
  }

  .bank-filter-sidebar.is-open {
    transform: translateX(0);
  }

  .filter-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .filter-drawer-footer {
    position: sticky;
    bottom: 0;
    display: grid;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  body.filter-drawer-open {
    overflow: hidden;
  }
}

@media (min-width: 960px) {
  .filter-drawer-backdrop {
    display: none !important;
  }
}
