:root {
  --red: #c8102e;
  --red-dark: #9f0b24;
  --red-soft: #fff0f2;
  --ink: #202126;
  --muted: #666a73;
  --line: #e4e5e8;
  --surface: #ffffff;
  --background: #f6f6f7;
  --green: #137a4d;
  --green-soft: #e9f7f0;
  --amber: #a45c00;
  --amber-soft: #fff6df;
  --shadow: 0 12px 32px rgba(31, 32, 37, .08);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--red); }

h1, h2, h3, .brand-title {
  margin-top: 0;
  font-family: "Manrope", sans-serif;
  letter-spacing: -.025em;
}

p { line-height: 1.6; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-weight: 700;
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.app-loading { min-height: 100vh; display: grid; place-items: center; }
.loader {
  width: 38px;
  aspect-ratio: 1;
  border: 3px solid #e4e4e6;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Authentication */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.1fr);
  background: var(--surface);
}
.auth-panel {
  display: grid;
  align-content: center;
  padding: clamp(38px, 7vw, 100px);
}
.auth-box { width: 100%; max-width: 430px; margin-inline: auto; }
.auth-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 52px; }
.auth-brand img { width: 62px; height: 62px; object-fit: contain; }
.auth-brand strong { display: block; font-family: "Manrope"; font-size: 1.25rem; }
.auth-brand span { display: block; margin-top: 3px; color: var(--muted); font-size: .9rem; }
.auth-box h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.auth-box > p { margin: 0 0 30px; color: var(--muted); }
.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin: 18px;
  padding: clamp(42px, 6vw, 88px);
  border-radius: 24px;
  color: white;
  background: #8e0d23;
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image: linear-gradient(90deg, transparent 49%, rgba(255,255,255,.22) 50%), linear-gradient(transparent 49%, rgba(255,255,255,.18) 50%);
  background-size: 72px 72px;
  mask-image: linear-gradient(135deg, transparent 5%, black 85%);
}
.auth-visual::after {
  content: "∿";
  position: absolute;
  right: -8%;
  top: 4%;
  color: rgba(255,255,255,.09);
  font: 700 34rem/1 "Manrope";
  transform: rotate(-10deg);
}
.auth-visual-content { position: relative; z-index: 1; max-width: 620px; }
.auth-visual h2 { max-width: 560px; margin: 0 0 18px; font-size: clamp(2.2rem, 4.4vw, 4.7rem); line-height: 1.05; }
.auth-visual p { max-width: 500px; color: rgba(255,255,255,.78); font-size: 1.06rem; }

/* Inputs and buttons */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label, .field-label { color: #3d3f45; font-size: .9rem; font-weight: 600; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid #d8d9dd;
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s;
}
.input, .select { height: 48px; padding: 0 14px; }
.textarea { min-height: 112px; resize: vertical; padding: 13px 14px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.11); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.span-2 { grid-column: span 2; }
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 17px;
  cursor: pointer;
  color: var(--ink);
  background: white;
  font-weight: 700;
  text-decoration: none;
  transition: transform .1s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { color: white; background: var(--red); }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { border-color: var(--line); background: white; }
.btn-secondary:hover { border-color: #babcc1; background: #fafafa; }
.btn-danger { color: var(--red); border-color: #f1c8cf; background: var(--red-soft); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
.icon-button {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border: 0; border-radius: 9px;
  background: transparent; cursor: pointer; color: var(--ink); font-size: 1.25rem;
}
.icon-button:hover { background: #f1f1f3; }
.form-error { min-height: 20px; margin: -7px 0 12px; color: var(--red); font-size: .88rem; }
.auth-inline-link { margin: -8px 0 18px; text-align: right; font-size: .88rem; }
.auth-switch { margin: 22px 0 0 !important; color: var(--muted); font-size: .92rem; text-align: center; }
.auth-switch a, .auth-inline-link a { color: var(--red); font-weight: 700; text-decoration: none; }
.auth-switch a:hover, .auth-inline-link a:hover { text-decoration: underline; }
.auth-success { margin: 0 0 20px; border-left: 4px solid var(--green); border-radius: 7px; padding: 16px 18px; background: var(--green-soft); }
.auth-success strong { display: block; color: var(--green); }
.auth-success p { margin: 5px 0 0; color: #4d5551; }
.auth-success .btn { margin-top: 14px; }
.auth-invalid { width: min(500px, calc(100% - 32px)); }

/* Main shell */
.topbar {
  position: fixed;
  z-index: 20;
  top: 0; left: 0; right: 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}
.topbar-brand { display: flex; align-items: center; gap: 13px; }
.topbar-brand img { width: 45px; height: 45px; object-fit: contain; }
.topbar-brand strong { display: block; font-family: "Manrope"; font-size: .95rem; }
.topbar-brand span { display: block; color: var(--muted); font-size: .76rem; }
.user-menu { display: flex; align-items: center; gap: 14px; }
.user-meta { text-align: right; }
.user-meta strong { display: block; font-size: .9rem; }
.user-meta span { color: var(--muted); font-size: .76rem; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red); font-weight: 700; }
.mobile-menu { display: none; }
.sidebar {
  position: fixed;
  z-index: 15;
  top: 76px; bottom: 0; left: 0;
  width: 245px;
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: white;
}
.sidebar-label { padding: 0 12px 10px; color: #92949a; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nav-link {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  color: #555861;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}
.nav-link:hover { color: var(--ink); background: #f7f7f8; }
.nav-link.active { color: var(--red); background: var(--red-soft); }
.nav-icon { width: 22px; font-size: 1.05rem; text-align: center; }
.main-content { min-height: 100vh; margin-left: 245px; padding: 116px clamp(24px, 4vw, 64px) 60px; }
.content-wrap { max-width: 1180px; margin-inline: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.page-head h1 { margin-bottom: 6px; font-size: clamp(1.75rem, 3vw, 2.35rem); }
.page-head p { margin: 0; color: var(--muted); }

/* Home */
.welcome { margin-bottom: 34px; }
.welcome h1 { margin-bottom: 7px; font-size: clamp(2rem, 4vw, 3rem); }
.welcome p { margin: 0; color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 48px; }
.action-card {
  position: relative;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  color: var(--ink);
  background: white;
  text-align: left;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.action-card:hover { border-color: #c7c8cc; transform: translateY(-2px); box-shadow: var(--shadow); }
.action-card:first-child { border-color: var(--red); color: white; background: var(--red); }
.action-icon { font-size: 1.7rem; }
.action-card strong { font: 700 1.12rem "Manrope"; }
.action-card span:last-child { opacity: .72; font-size: .86rem; }
.section-title { margin-bottom: 18px; font-size: 1.25rem; }
.material-list { display: grid; gap: 10px; }
.material-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 16px 4px; }
.material-item:first-child { border-top: 1px solid var(--line); }
.material-item strong { display: block; margin-bottom: 3px; }
.material-item p { margin: 0; color: var(--muted); font-size: .88rem; }

/* Cards, stats and tables */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.panel-pad { padding: clamp(20px, 3vw, 32px); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: white; }
.stat span { display: block; margin-bottom: 13px; color: var(--muted); font-size: .83rem; }
.stat strong { font: 800 clamp(1.65rem, 3vw, 2.2rem) "Manrope"; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; color: #73767e; background: #f7f7f8; font-size: .75rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 15px 16px; border-top: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
tbody tr:hover { background: #fcfcfc; }
.cell-main { max-width: 390px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; font-size: .74rem; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--green); background: var(--green-soft); }
.badge-warning { color: var(--amber); background: var(--amber-soft); }
.badge-neutral { color: #666; background: #efeff1; }
.badge-danger { color: var(--red); background: var(--red-soft); }
.empty { padding: 48px 22px; color: var(--muted); text-align: center; }
.filter-bar { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto; align-items: end; gap: 12px; margin-bottom: 24px; }
.filter-bar .field { margin: 0; }

/* Practice */
.practice-shell { max-width: 880px; margin-inline: auto; }
.question-card { border: 1px solid var(--line); border-radius: 16px; padding: clamp(24px, 5vw, 52px); background: white; box-shadow: 0 10px 35px rgba(30,31,35,.04); }
.question-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 30px; }
.question-number { color: var(--red); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.meta-pill { border-radius: 999px; padding: 5px 10px; color: #63666d; background: #f1f1f3; font-size: .76rem; }
.meta-pill.reconstructed { color: #71531a; background: var(--amber-soft); }
.question-statement { margin: 0 0 30px; font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.7; white-space: pre-wrap; }
.question-visuals { display: grid; gap: 14px; margin: -4px 0 30px; }
.question-visual { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; text-align: center; }
.question-visual a { display: block; padding: 12px; }
.question-visual img { display: block; width: 100%; max-height: 620px; margin: auto; object-fit: contain; }
.visual-note { margin: -3px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.options { display: grid; gap: 11px; }
.options.saving { opacity: .76; pointer-events: none; }
.option {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border: 1px solid #dedfe2;
  border-radius: 11px;
  padding: 10px 16px;
  cursor: pointer;
  background: white;
  line-height: 1.45;
  transition: border-color .13s, background .13s;
}
.option:hover { border-color: #aaaeb5; }
.option input { position: absolute; opacity: 0; }
.option-letter { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #d5d6da; border-radius: 50%; font-weight: 700; }
.option.selected { border-color: var(--red); background: var(--red-soft); }
.option.selected .option-letter { border-color: var(--red); color: white; background: var(--red); }
.option.correct { border-color: var(--green); background: var(--green-soft); }
.option.correct .option-letter { border-color: var(--green); color: white; background: var(--green); }
.option.incorrect { border-color: var(--red); background: var(--red-soft); }
.question-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.feedback { margin-top: 24px; border-left: 4px solid var(--green); border-radius: 6px; padding: 16px 18px; background: var(--green-soft); }
.feedback.error { border-color: var(--red); background: var(--red-soft); }
.feedback strong { display: block; margin-bottom: 5px; }
.feedback p { margin: 0; color: #50535a; }

/* Simulations */
.simulation-section { margin-bottom: 42px; }
.secondary-collection { padding-top: 4px; }
.collection-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.collection-head h2 { margin: 0; font-size: 1.35rem; }
.collection-head > span { color: var(--muted); font-size: .86rem; }
.content-note { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; border: 1px solid #ead7a5; border-radius: 11px; padding: 13px 16px; color: #634b19; background: #fffbec; font-size: .83rem; line-height: 1.45; }
.content-note strong { flex: 0 0 auto; }
.simulation-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.simulation-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: white; }
.simulation-card.official { border-top: 3px solid var(--red); padding-top: 22px; }
.simulation-card-top { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.source-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; color: var(--red); background: var(--red-soft); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.simulation-card h3 { margin-bottom: 8px; }
.simulation-card .simulation-description { min-height: 48px; margin: 0 0 20px; color: var(--muted); }
.simulation-info { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 20px; color: #4e5158; font-size: .84rem; }
.simulation-card > .btn { align-self: flex-start; margin-top: auto; }
.card-progress { margin: -2px 0 20px; }
.card-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: .78rem; }
.card-progress strong { color: var(--ink); }
.exam-intro > p { margin: 17px 0 22px; color: var(--muted); }
.exam-intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 12px; }
.exam-intro-grid > div { padding: 18px; border-right: 1px solid var(--line); }
.exam-intro-grid > div:last-child { border: 0; }
.exam-intro-grid strong, .exam-intro-grid span { display: block; }
.exam-intro-grid strong { margin-bottom: 4px; font: 800 1.55rem "Manrope"; }
.exam-intro-grid span { color: var(--muted); font-size: .78rem; }
.exam-rules { margin: 0; padding-left: 21px; color: #4d5057; font-size: .9rem; line-height: 1.7; }
.resume-note { display: grid; gap: 4px; border-left: 4px solid var(--amber); border-radius: 7px; padding: 14px 16px; color: #5c4a26; background: var(--amber-soft); font-size: .88rem; }
.intro-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.attempt-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.attempt-head h2 { margin-bottom: 4px; }
.attempt-tools { display: flex; align-items: center; gap: 14px; }
.timer { display: flex; align-items: center; gap: 8px; color: var(--red); font-weight: 700; }
.attempt-progress { height: 5px; margin-bottom: 11px; }
.map-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 13px; color: var(--muted); font-size: .74rem; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend span:last-child { margin-left: auto; }
.map-legend i { width: 9px; height: 9px; display: inline-block; border-radius: 3px; }
.legend-current { background: var(--red); }
.legend-answered { border: 1px solid #9bd1b7; background: var(--green-soft); }
.question-map { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.map-item { width: 34px; height: 34px; border: 1px solid #d7d8dc; border-radius: 7px; cursor: pointer; background: white; font-weight: 600; }
.map-item.answered { border-color: #9bd1b7; color: var(--green); background: var(--green-soft); }
.map-item.current { border-color: var(--red); color: white; background: var(--red); }
.attempt-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.result-hero { padding: 38px; color: white; background: var(--red); border-radius: var(--radius); }
.result-hero h2 { margin-bottom: 5px; }
.score { margin-top: 24px; font: 800 clamp(2.6rem, 6vw, 4.5rem) "Manrope"; }
.score small { font-size: 1.1rem; opacity: .75; }
.area-results { display: grid; gap: 16px; margin-top: 28px; }
.area-row-head { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: .9rem; }
.bar { height: 8px; overflow: hidden; border-radius: 999px; background: #e9e9eb; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--red); }

/* Modal */
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(22,23,27,.58); }
.modal { width: min(780px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; border-radius: 16px; background: white; box-shadow: 0 22px 70px rgba(0,0,0,.24); }
.modal-lg { width: min(980px, 100%); }
.modal-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); background: white; }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 24px; }
.modal-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: white; }
.option-editor { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; margin-bottom: 9px; }
.option-editor > span { font-weight: 800; text-align: center; }
.option-textarea { min-height: 74px; }
.statement-editor { min-height: 180px; }
.question-metadata { margin: 0 0 22px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 0; }
.question-metadata summary { margin-bottom: 14px; cursor: pointer; color: #3d3f45; font-weight: 700; }
.question-images-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.question-images-empty { grid-column: 1 / -1; margin: 0; }
.question-image-editor { display: grid; align-content: start; gap: 8px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px; background: #fafafa; }
.question-image-editor img { width: 100%; height: 120px; border-radius: 6px; background: white; object-fit: contain; }
.question-image-editor span { overflow: hidden; color: var(--muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.image-upload-button { justify-self: start; cursor: pointer; }
.image-upload-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.check-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.check-item { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.check-item:last-child { border: 0; }
.check-item input { accent-color: var(--red); }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 380px; transform: translateY(20px); border-radius: 10px; padding: 13px 17px; opacity: 0; pointer-events: none; color: white; background: #292a2f; box-shadow: var(--shadow); transition: .2s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--red-dark); }

@media (max-width: 980px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .sidebar { width: 215px; }
  .main-content { margin-left: 215px; }
  .action-grid, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .action-card:last-child { grid-column: span 2; min-height: 130px; }
}

@media (max-width: 720px) {
  .auth-panel { padding: 30px 22px; }
  .auth-brand { margin-bottom: 38px; }
  .topbar { height: 68px; padding: 0 14px; }
  .topbar-brand img { width: 39px; height: 39px; }
  .topbar-brand strong { font-size: .84rem; }
  .topbar-brand span { font-size: .68rem; }
  .user-meta, .avatar { display: none; }
  .mobile-menu { display: inline-grid; }
  .sidebar { top: 68px; width: min(280px, 82vw); transform: translateX(-105%); box-shadow: var(--shadow); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 96px 16px 42px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .action-grid, .simulation-list, .stats-grid { grid-template-columns: 1fr; }
  .action-card, .action-card:last-child { grid-column: auto; min-height: 138px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .filter-bar { grid-template-columns: 1fr; }
  .question-card { border-radius: 12px; padding: 21px 16px; }
  .question-visual a { padding: 7px; }
  .option { min-height: 66px; padding: 9px 11px; }
  .question-actions .btn { flex: 1; }
  .attempt-head { align-items: flex-start; flex-direction: column; }
  .attempt-tools { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .map-legend span:last-child { width: 100%; margin-left: 0; }
  .attempt-nav .btn { flex: 1; padding-inline: 10px; }
  .collection-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .content-note { align-items: flex-start; flex-direction: column; gap: 4px; }
  .exam-intro-grid { grid-template-columns: 1fr; }
  .exam-intro-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .intro-actions { flex-direction: column-reverse; }
  .intro-actions .btn { width: 100%; }
  .material-item { align-items: flex-start; flex-direction: column; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: white; }
  table.responsive td { display: grid; grid-template-columns: 105px 1fr; gap: 10px; border: 0; padding: 8px 4px; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
  table.responsive .actions { justify-content: flex-start; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 16px 16px 0 0; }
  .modal-body { padding: 20px 16px; }
  .modal-head, .modal-actions { padding-inline: 16px; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}
