:root {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --paper: #ffffff;
  --paper-soft: #f1f5f9;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --soft: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-hover: #ef4444;
  --red-soft: #fef2f2;
  --yellow: #f59e0b;
  --yellow-amber: #facc15;
  --yellow-soft: #fefce8;
  --yellow-dark: #d97706;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --green-dark: #15803d;
  --purple: #9333ea;
  --purple-soft: #faf5ff;
  --radius: 18px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(220, 38, 38, 0.15);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

html.dark, body.dark {
  color-scheme: dark;
  --bg: #0b1120;
  --bg-elevated: #1e293b;
  --paper: #1e293b;
  --paper-soft: #0f172a;
  --ink: #f8fafc;
  --ink-secondary: #e2e8f0;
  --muted: #94a3b8;
  --soft: #243247;
  --line: #334155;
  --line-strong: #475569;
  --red: #ef4444;
  --red-dark: #dc2626;
  --red-hover: #f87171;
  --red-soft: rgba(220, 38, 38, 0.22);
  --yellow: #fbbf24;
  --yellow-amber: #fde047;
  --yellow-soft: rgba(245, 158, 11, 0.22);
  --yellow-dark: #f59e0b;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.22);
  --green-dark: #16a34a;
  --purple: #c084fc;
  --purple-soft: rgba(168, 85, 247, 0.22);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  transition: background-color 0.25s ease, color 0.25s ease;
  position: relative;
  overflow-x: hidden;
}

[hidden] { display: none !important; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-hover); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
img { max-width: 100%; }
svg { vertical-align: middle; flex: none; }

/* Ambient Glow Floating Lights */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(65px);
  will-change: transform;
}
.glow-red {
  top: -100px;
  left: -80px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.16) 0%, rgba(220, 38, 38, 0) 70%);
  animation: float-red 14s ease-in-out infinite alternate;
}
.glow-gold {
  bottom: -90px;
  right: -70px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0) 70%);
  animation: float-gold 16s ease-in-out infinite alternate;
}
@keyframes float-red {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(35px, 30px) scale(1.08); }
  100% { transform: translate(-25px, 45px) scale(0.94); }
}
@keyframes float-gold {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -35px) scale(1.1); }
  100% { transform: translate(25px, -20px) scale(0.95); }
}

/* Header & Navigation */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.top-inner, .footer-inner {
  max-width: 1200px;
  margin: auto;
  padding-inline: 24px;
}
.top-inner {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  min-height: 52px;
  border: 0;
  background: none;
  flex: none;
  text-align: left;
}
.brand img {
  object-fit: contain;
  height: 42px;
  width: auto;
}
.brand span {
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
}
.theme-toggle:hover {
  transform: translateY(-2px);
  background: var(--line);
}
.theme-toggle:active {
  transform: scale(0.94);
}
html:not(.dark) .icon-sun,
html.dark .icon-moon {
  display: inline-block;
}
html:not(.dark) .icon-moon,
html.dark .icon-sun {
  display: none;
}

#app {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: 30px 24px 45px;
  position: relative;
  z-index: 1;
}
#app:focus { outline: none; }

footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  position: relative;
  z-index: 2;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.footer-inner {
  min-height: 60px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: .84rem;
}

.offline {
  padding: 10px 16px;
  background: var(--yellow-soft);
  color: var(--yellow-dark);
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid var(--yellow);
  position: relative;
  z-index: 20;
}
.toast {
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 100;
  width: max-content;
  max-width: calc(100% - 32px);
  font-size: .94rem;
  font-weight: 600;
  border: 1px solid var(--line);
}

.wrap { max-width: 620px; margin: 0 auto; }
.entrance { max-width: 520px; margin: 0 auto; }

/* Single-Door Unified Login UI */
.login-card {
  position: relative;
  border-radius: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 4vw, 36px);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--red) 0%, var(--yellow) 100%);
}
.login-header {
  text-align: center;
  margin-bottom: 24px;
}
.login-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}
.login-header p {
  color: var(--muted);
  font-size: .92rem;
  margin: 0;
}
.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow-dark);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 15px;
}
.hero-content {
  min-height: 400px;
  border-radius: 24px;
  padding: clamp(28px, 4.3vw, 52px);
  color: #fff;
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #d97706 100%);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 20px 40px rgba(185, 28, 28, 0.25);
}
.hero-content::before, .hero-content::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(254, 240, 138, 0.4);
  right: -170px;
  bottom: -150px;
  box-shadow: 0 0 0 25px rgba(250, 204, 21, 0.15), 0 0 0 60px rgba(250, 204, 21, 0.08);
}
.hero-content::after {
  width: 22px;
  height: 22px;
  right: 15%;
  bottom: 28%;
  background: var(--yellow-amber);
  border: none;
  box-shadow: 0 0 16px var(--yellow-amber);
}
.hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(2.1rem, 4.8vw, 3.8rem);
  max-width: 600px;
  margin: .2em 0 .28em;
  line-height: 1.05;
  letter-spacing: -.05em;
  color: #ffffff;
}
.hero .lead {
  max-width: 35ch;
  color: #fee2e2;
  font-size: 1.05rem;
}
.hero .buttons { margin-top: 24px; }
.hero-aside {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(22px, 3.2vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}
.hero-steps {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.hero-steps li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 0;
}
.hero-steps li + li { border-top: 1px solid var(--line); }
.hero-steps strong, .hero-steps small { display: block; }
.hero-steps strong { color: var(--ink); font-size: .96rem; }
.hero-steps small { color: var(--muted); margin-top: 2px; font-size: .86rem; }

.glyph {
  height: 44px;
  width: 44px;
  display: grid;
  place-items: center;
  background: var(--yellow-soft);
  border-radius: 12px;
  color: var(--yellow-dark);
  flex: none;
}
.glyph.red { background: var(--red-soft); color: var(--red); }
.eyebrow {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  color: var(--red);
  margin: 0 0 8px;
}
.hero .eyebrow { color: var(--yellow-amber); }

h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -.03em;
  color: var(--ink);
}
h1 { font-size: clamp(1.85rem, 4.5vw, 2.75rem); margin-bottom: 9px; }
h2 { font-size: clamp(1.15rem, 2.8vw, 1.48rem); }
h3 { font-size: 1.05rem; }
p { margin: 8px 0; }
.lead, .muted, .small { color: var(--muted); }
.lead { margin: 8px 0 0; font-size: 1rem; }
.small { font-size: .88rem; }
.section-head { margin-bottom: 22px; }

/* Cards & Surfaces */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 26px);
  box-shadow: var(--shadow);
  min-width: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card + .card { margin-top: 16px; }
.card.accent {
  position: relative;
  overflow: hidden;
}
.card.accent::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red) 0%, var(--yellow) 100%);
}
.card-main { display: grid; gap: 19px; }
.card-main .glyph { width: 50px; height: 50px; }
.warm, .notice {
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--soft);
  color: var(--ink);
  font-size: .92rem;
  border: 1px solid var(--line);
}
.notice.error {
  background: var(--red-soft);
  color: var(--red-dark);
  border-color: rgba(220, 38, 38, 0.25);
}
.notice.success {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: rgba(22, 163, 74, 0.25);
}

/* Buttons with GPU-Accelerated Micro-Interactions */
.linkbtn, .btn {
  font-family: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-decoration: none;
  text-align: center;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.25;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s, background-color 0.18s, border-color 0.18s;
  will-change: transform;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  background: var(--soft);
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  border-color: var(--red);
  min-height: 48px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--red-hover) 0%, var(--red) 100%);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}
.btn.gold {
  color: #3b2003;
  background: linear-gradient(135deg, var(--yellow-amber) 0%, var(--yellow) 100%);
  border-color: var(--yellow);
  min-height: 48px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
.btn.gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #fef08a 0%, var(--yellow-amber) 100%);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}
.btn.danger { color: var(--red); border-color: rgba(220, 38, 38, 0.3); }
.btn.danger:hover:not(:disabled) { background: var(--red-soft); }
.btn.subtle {
  background: transparent;
  border-color: transparent;
  color: var(--red);
  padding-inline: 8px;
}
.btn.subtle:hover:not(:disabled) {
  background: var(--red-soft);
  box-shadow: none;
}
.btn.slim {
  min-height: 44px;
  padding: 8px 14px;
  font-size: .88rem;
}
.btn.square {
  min-width: 44px;
  padding: 10px;
}
.btn.full { width: 100%; }

.buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.buttons > * { min-width: 0; }
.buttons.stretch > * { flex: 1; }
.gap { margin-top: 16px; }
.back { margin: -4px 0 14px; }
.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stack { display: grid; gap: 14px; min-width: 0; }
.flow { display: grid; gap: 19px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* Status Badges / Pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink-secondary);
  padding: 5px 12px;
  font-weight: 700;
  font-size: .8rem;
  white-space: normal;
  width: fit-content;
  display: inline-block;
  border: 1px solid var(--line);
}
.pill.green {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: rgba(22, 163, 74, 0.25);
}
.pill.gold {
  background: var(--yellow-soft);
  color: var(--yellow-dark);
  border-color: rgba(245, 158, 11, 0.25);
}
.pill.red {
  background: var(--red-soft);
  color: var(--red-dark);
  border-color: rgba(220, 38, 38, 0.25);
}
.pill.purple {
  background: var(--purple-soft);
  color: var(--purple);
  border-color: rgba(147, 51, 234, 0.25);
}

.pick-list { display: grid; gap: 10px; }
.pick {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 12px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.18s, background-color 0.18s, transform 0.18s;
}
.pick:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-soft);
  transform: translateY(-2px);
}
.pick:disabled {
  background: var(--soft);
  opacity: 1;
  color: var(--muted);
}
.pick strong, .pick small { display: block; }
.pick small { margin-top: 3px; color: var(--muted); }
.info-list { display: grid; gap: 10px; margin: 0; }
.info-list div {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.info-list dt { font-size: .86rem; color: var(--muted); }
.info-list dd { margin: 0; font-weight: 700; color: var(--ink); }
.help {
  font-size: .9rem;
  color: var(--muted);
  padding: 11px 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.loading, .empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  font-size: .94rem;
}
.loading { margin-top: 50px; }
.score {
  display: block;
  color: var(--red);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(2.5rem, 11vw, 4.5rem);
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.score small { font-size: .33em; letter-spacing: 0; color: var(--muted); }

/* Forms & Inputs */
label.field {
  display: grid;
  min-width: 0;
  gap: 6px;
  font-size: .88rem;
  font-weight: 650;
  color: var(--ink-secondary);
}
input:not([type=checkbox]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: .96rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:not([type=checkbox]):focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
  outline: none;
}
input[type=checkbox] {
  width: 22px;
  height: 22px;
  accent-color: var(--red);
  flex: none;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink);
}
input[type=file] { height: auto; padding: 10px; font-size: .88rem; }
input.code {
  font-size: 1.5rem;
  letter-spacing: .2em;
  font-weight: 850;
  text-transform: uppercase;
  max-width: 320px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px 14px 14px;
  background: var(--paper);
}
fieldset legend {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  padding: 0 6px;
}

/* Console Layout & Menu */
.console {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 20px;
}
.menu {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  align-self: start;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.menu button {
  background: transparent;
  color: var(--ink);
  border: 0;
  text-align: left;
  border-radius: 10px;
  width: 100%;
  padding: 11px 13px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  font-weight: 650;
  transition: background-color 0.18s, color 0.18s;
}
.menu button:hover { background: var(--soft); }
.menu button[aria-current] {
  background: var(--red-soft);
  color: var(--red-dark);
  font-weight: 750;
}
.admin-heading { align-items: flex-start; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.stat strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: .86rem; color: var(--muted); }

/* Records */
.record-grid { display: grid; gap: 10px; }
.record {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.record .info { flex: 1; min-width: min(190px, 100%); }
.record .info h3 { color: var(--ink); }
.record .info p { margin: 3px 0 0; }
.record .buttons { flex-shrink: 0; }
.toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr));
  gap: 8px;
}
.information { min-width: 0; }

.super-layout {
  display: grid;
  grid-template-columns: minmax(250px, .75fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}
.key-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.8rem, 6.5vw, 2.6rem);
  font-weight: 850;
  letter-spacing: .18em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  padding: 6px 14px;
  background: var(--red-soft);
  border-radius: 14px;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Exam UI */
.exam-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.exam-head h1 { font-size: 1.45rem; margin: 0; }
.timer {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--red-dark);
  background: var(--red-soft);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 12px;
  padding: 8px 14px;
  min-height: 42px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
progress {
  appearance: none;
  width: 100%;
  height: 9px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--soft);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
progress::-webkit-progress-bar { background: var(--soft); }
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--red) 0%, var(--yellow) 100%);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--red) 0%, var(--yellow) 100%);
  border-radius: 999px;
}
.question {
  font-size: clamp(1.15rem, 4vw, 1.44rem);
  letter-spacing: -.01em;
  white-space: pre-wrap;
  color: var(--ink);
  line-height: 1.6;
}
.option {
  display: flex;
  text-align: left;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  overflow-wrap: anywhere;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.15s, background-color 0.15s;
}
.option:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-soft);
  transform: translateX(4px);
}
.option[aria-pressed=true] {
  background: var(--red-soft);
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}
.option.correct {
  background: var(--green-soft);
  border-color: var(--green);
}
.option b {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--soft);
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 750;
  color: var(--ink);
}
.option[aria-pressed=true] b {
  background: var(--red);
  color: #ffffff;
}
.option img {
  width: min(120px, 30%);
  height: auto;
  max-height: 100px;
  object-fit: contain;
}
.question-image {
  display: block;
  max-height: 320px;
  width: auto;
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.indexpick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  gap: 6px;
  max-height: 46vh;
  overflow: auto;
  padding: 4px;
}
.indexpick .done {
  background: var(--green-soft);
  border-color: rgba(22, 163, 74, 0.35);
  color: var(--green-dark);
}
.exam-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.exam-actions button { flex: 1; }
.error-list { max-height: 230px; overflow: auto; padding-left: 24px; }
.error-list li { margin: 5px 0; }

/* Dialog Modal */
dialog {
  width: min(550px, calc(100% - 24px));
  max-height: calc(100dvh - 28px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.25);
}
dialog::backdrop {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
}
dialog header { margin-bottom: 16px; }
details.panel > summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

/* Animations & Micro-Interactions */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.pulse-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--green);
}
.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulse-green 2s infinite;
}

/* Vue.js Transition classes */
.fade-slide-enter-active, .fade-slide-leave-active {
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-slide-enter-from {
  opacity: 0;
  transform: translateY(8px);
}
.fade-slide-leave-to {
  opacity: 0;
  transform: translateY(-8px);
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.credential {
  word-break: break-word;
  font-family: ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--ink);
}

/* Responsive Media Queries */
@media (max-width: 800px) {
  .console { grid-template-columns: 1fr; }
  .menu { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; gap: 14px; }
  .hero-content { min-height: 290px; }
  .hero-aside { padding: 20px; }
  .super-layout { grid-template-columns: 1fr; }
}

@media (max-width: 510px) {
  .top-inner, .footer-inner, #app { padding-inline: 14px; }
  .top-inner { min-height: 66px; }
  #app { padding-top: 20px; padding-bottom: 24px; }
  .brand { gap: 8px; }
  .brand img { width: 88px; height: auto; }
  .brand span {
    font-size: .78rem;
    padding-left: 8px;
    max-width: 65px;
    line-height: 1.15;
    text-align: left;
  }
  .footer-inner { flex-wrap: wrap; padding-block: 12px; gap: 4px 10px; }
  .hero { margin-top: 0; }
  .hero-content { min-height: 270px; padding: 22px; border-radius: 18px; }
  .hero .btn { width: 100%; }
  .hero-aside { border-radius: 18px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu button { padding: 8px 6px; font-size: .8rem; gap: 5px; }
  .menu button svg { width: 16px; }
  .section-head { margin-bottom: 16px; }
  .question-image { max-height: 200px; }
  .account-bar { gap: 5px; }
  .account-bar .pill { font-size: .72rem; padding: 4px 8px; }
  .account-bar .btn { padding-inline: 8px; font-size: .82rem; }
}

@media (max-width: 355px) {
  .split { gap: 8px; }
  .card { padding: 14px; }
  .buttons.stretch { gap: 6px; }
  .exam-actions .btn { padding-inline: 8px; font-size: .86rem; }
  .record { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .glow-red, .glow-gold, .pulse-dot {
    animation: none !important;
  }
}

@media print {
  .topbar, footer, .buttons, .back, .menu, .toolbar, .help, .toast, .offline, .ambient-glow, .theme-toggle {
    display: none !important;
  }
  body, #app, .card {
    color: black;
    background: white;
    box-shadow: none;
  }
  #app { padding: 0; }
}
