@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@500;700;800;900&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --paper: #f3ecdf;
  --surface: #fffaf0;
  --surface-soft: #f6efe2;
  --ink: #14110f;
  --ink-soft: #4f463d;
  --gold: #c5a028;
  --gold-strong: #a88411;
  --wine: #8f2d1f;
  --green: #157347;
  --red: #b42318;
  --gray: #8e877d;
  --shadow: 0 24px 60px rgba(20, 17, 15, 0.1);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: "Archivo", sans-serif;
  --font-body: "Manrope", sans-serif;
}

body[data-theme="dark"] {
  --paper: #121212;
  --surface: #1b1b1b;
  --surface-soft: #242424;
  --ink: #f4ede2;
  --ink-soft: #c0b6a7;
  --gold: #d7b34a;
  --gold-strong: #f0ca63;
  --wine: #cf6a54;
  --green: #46c37b;
  --red: #ef7f73;
  --gray: #9b948a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color-scheme: light;
  background:
    radial-gradient(circle at top left, rgba(197, 160, 40, 0.18), transparent 28%),
    linear-gradient(180deg, var(--paper), #efe6d7 60%, #eadfcd);
  color: var(--ink);
  font-family: var(--font-body);
  transition: background 0.25s ease, color 0.25s ease;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body[data-theme="dark"] {
  color-scheme: dark;
  background:
    radial-gradient(circle at top left, rgba(215, 179, 74, 0.14), transparent 28%),
    linear-gradient(180deg, #111111, #161616 56%, #1c1c1c);
}

body[data-theme="dark"] .portal-loader-card,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .report-card,
body[data-theme="dark"] .admin-card,
body[data-theme="dark"] .instructions-card,
body[data-theme="dark"] .dashboard-hero,
body[data-theme="dark"] .page-heading,
body[data-theme="dark"] .report-heading,
body[data-theme="dark"] .admin-heading,
body[data-theme="dark"] .hero-panel,
body[data-theme="dark"] .auth-panel,
body[data-theme="dark"] .attempt-item,
body[data-theme="dark"] .bank-item,
body[data-theme="dark"] .summary-card,
body[data-theme="dark"] .analysis-mini-card,
body[data-theme="dark"] .analysis-spotlight,
body[data-theme="dark"] .analysis-topic-row,
body[data-theme="dark"] .analysis-review-card,
body[data-theme="dark"] .analysis-time-card,
body[data-theme="dark"] .analysis-visual-card,
body[data-theme="dark"] .analysis-plan-row,
body[data-theme="dark"] .analysis-section-row,
body[data-theme="dark"] .table-row,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .option-card,
body[data-theme="dark"] .passage,
body[data-theme="dark"] .section-strip,
body[data-theme="dark"] .legend-card,
body[data-theme="dark"] .checkbox-row,
body[data-theme="dark"] .attempt-item,
body[data-theme="dark"] .bank-item,
body[data-theme="dark"] .summary-card,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .analysis-mini-card,
body[data-theme="dark"] .latex-preview-toolbar,
body[data-theme="dark"] .latex-preview,
body[data-theme="dark"] .latex-preview-block {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .report-layout,
body[data-theme="dark"] .admin-layout,
body[data-theme="dark"] .dashboard-grid,
body[data-theme="dark"] .dashboard-hero,
body[data-theme="dark"] .editorial-shell,
body[data-theme="dark"] .instructions-layout {
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .report-card,
body[data-theme="dark"] .admin-card,
body[data-theme="dark"] .instructions-card,
body[data-theme="dark"] .dashboard-card,
body[data-theme="dark"] .dashboard-highlight-banner,
body[data-theme="dark"] .dashboard-notice-card,
body[data-theme="dark"] .planner-countdown-card,
body[data-theme="dark"] .planner-goal-card,
body[data-theme="dark"] .planner-analytics-card,
body[data-theme="dark"] .planner-event-card,
body[data-theme="dark"] .planner-insight-card,
body[data-theme="dark"] .planner-selected-date-card,
body[data-theme="dark"] .planner-bucket,
body[data-theme="dark"] .planner-modal-card,
body[data-theme="dark"] .report-history-card,
body[data-theme="dark"] .question-card,
body[data-theme="dark"] .solution-card,
body[data-theme="dark"] .admin-modal-card {
  background:
    radial-gradient(circle at top right, rgba(216, 177, 61, 0.07), transparent 32%),
    linear-gradient(180deg, rgba(31, 31, 31, 0.96), rgba(24, 24, 24, 0.98));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .admin-modal-head {
  background: linear-gradient(180deg, rgba(58, 52, 43, 0.92), rgba(33, 33, 33, 0.98));
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .admin-modal-overlay,
body[data-theme="dark"] .transition-modal {
  background: rgba(5, 5, 5, 0.62);
}

body[data-theme="dark"] .meta-chip {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 240, 233, 0.82);
}

body[data-theme="dark"] .planner-inline-alert {
  background: rgba(46, 113, 201, 0.16);
  color: #a9c8ff;
}

body[data-theme="dark"] .question-editor-intro {
  background: rgba(255, 255, 255, 0.05);
}

body[data-theme="dark"] .active-paper-panel {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .planner-tag-option span,
body[data-theme="dark"] .planner-history-item,
body[data-theme="dark"] .planner-status-chip.planned,
body[data-theme="dark"] .planner-status-chip.completed,
body[data-theme="dark"] .planner-status-chip.missed,
body[data-theme="dark"] .planner-status-chip.live {
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .calendar-tooltip {
  background: rgba(255, 250, 240, 0.96);
  color: #15110f;
}

body[data-theme="dark"] .planner-tab-button {
  border-color: rgba(255, 249, 239, 0.08);
  background: rgba(255, 249, 239, 0.04);
  color: rgba(255, 249, 239, 0.72);
}

body[data-theme="dark"] .planner-tab-button:hover,
body[data-theme="dark"] .planner-tab-button.is-active {
  color: #fff9ef;
  border-color: rgba(216, 177, 61, 0.34);
  background: rgba(216, 177, 61, 0.12);
}

body[data-theme="dark"] .dashboard-hero::before {
  background:
    linear-gradient(115deg, transparent 0 44%, rgba(216, 177, 61, 0.13) 50%, transparent 56%),
    radial-gradient(circle at 12% 18%, rgba(216, 177, 61, 0.11), transparent 30%);
  opacity: 0.9;
}

body[data-theme="dark"] .dashboard-card::before {
  background:
    radial-gradient(circle at top right, rgba(216, 177, 61, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(34, 34, 34, 0.96), rgba(24, 24, 24, 0.98));
}

body[data-theme="dark"] .dashboard-card:hover,
body[data-theme="dark"] .dashboard-highlight-banner:hover,
body[data-theme="dark"] .dashboard-stats .summary-card:hover {
  border-color: rgba(216, 177, 61, 0.28);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] .dashboard-grid > .panel::before {
  background: linear-gradient(90deg, rgba(216, 177, 61, 0.82), transparent 72%);
}

body[data-theme="dark"] .dashboard-notice-card {
  background:
    radial-gradient(circle at top left, rgba(190, 140, 57, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(78, 51, 26, 0.96), rgba(52, 34, 16, 0.98));
  border-color: rgba(216, 177, 61, 0.16);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 240, 217, 0.04);
}

body[data-theme="dark"] .notice-board-paper {
  background:
    linear-gradient(180deg, rgba(71, 56, 38, 0.98), rgba(54, 42, 29, 0.98)),
    repeating-linear-gradient(
      180deg,
      transparent,
      transparent 30px,
      rgba(255, 232, 194, 0.06) 30px,
      rgba(255, 232, 194, 0.06) 31px
    );
  border-color: rgba(255, 231, 192, 0.08);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .notice-board-paper::after {
  background: linear-gradient(135deg, rgba(96, 74, 44, 0.96), rgba(71, 56, 38, 0.98));
}

body[data-theme="dark"] .dashboard-notice-card .section-label {
  color: #f0ca63;
}

body[data-theme="dark"] .dashboard-notice-card .empty-state {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .meta-chip.is-draft {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(245, 240, 233, 0.72);
}

body[data-theme="dark"] .divider {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: rgba(244, 237, 226, 0.44);
}

body[data-theme="dark"] select option,
body[data-theme="dark"] select optgroup {
  background: #232323;
  color: #f4ede2;
}

body[data-theme="dark"] .button-secondary,
body[data-theme="dark"] .button-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.14);
}

body[data-theme="dark"] .calendar-cell {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .bar-track,
body[data-theme="dark"] .analysis-meter,
body[data-theme="dark"] .analysis-bar-track {
  background: rgba(255, 255, 255, 0.08);
}

body.is-syncing #app {
  filter: blur(10px) saturate(0.9);
  transform: scale(0.995);
  transition: filter 0.18s ease, transform 0.18s ease;
}

.portal-loader {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.portal-loader-card {
  width: min(440px, 100%);
  padding: 30px 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(197, 160, 40, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(246, 239, 226, 0.96));
  border: 1px solid rgba(20, 17, 15, 0.08);
  box-shadow: var(--shadow);
  text-align: center;
}

.portal-loader-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.2em;
}

.portal-loader-line {
  width: min(220px, 100%);
  height: 6px;
  margin: 0 auto 20px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  overflow: hidden;
}

.portal-loader-line span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--wine));
  animation: portalSlide 1.2s ease-in-out infinite;
}

.portal-loader-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.portal-loader-card p:last-child {
  margin: 14px auto 0;
  max-width: 26rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 236, 223, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sync-overlay-card {
  width: auto;
  padding: 18px 22px;
  border-radius: 999px;
  border: 1px solid rgba(20, 17, 15, 0.06);
  background: rgba(255, 250, 240, 0.46);
  box-shadow: 0 14px 40px rgba(20, 17, 15, 0.08);
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.sync-ring-loader {
  position: relative;
  width: 34px;
  height: 34px;
}

.sync-ring-loader span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.sync-ring-loader span:first-child {
  border-top-color: var(--gold);
  border-right-color: rgba(197, 160, 40, 0.35);
  animation: syncSpin 0.9s linear infinite;
}

.sync-ring-loader span:last-child {
  inset: 6px;
  border-bottom-color: var(--ink);
  border-left-color: rgba(20, 17, 15, 0.22);
  animation: syncSpinReverse 1.2s linear infinite;
}

.sync-overlay-text {
  margin: 0;
  display: inline-flex;
  gap: 0.08em;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
}

.sync-overlay-text span {
  display: inline-block;
  animation: syncTextPulse 1.2s ease-in-out infinite;
}

.sync-overlay-text span:nth-child(2) { animation-delay: 0.06s; }
.sync-overlay-text span:nth-child(3) { animation-delay: 0.12s; }
.sync-overlay-text span:nth-child(4) { animation-delay: 0.18s; }
.sync-overlay-text span:nth-child(5) { animation-delay: 0.24s; }
.sync-overlay-text span:nth-child(6) { animation-delay: 0.30s; }
.sync-overlay-text span:nth-child(7) { animation-delay: 0.36s; }

@keyframes syncSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes syncSpinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes syncTextPulse {
  0%, 100% {
    opacity: 0.32;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@keyframes dashboardReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashboardLift {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashboardCardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashboardSheen {
  from {
    transform: translateX(-34%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 0.55;
  }
}

@keyframes noticePinSettle {
  0% {
    transform: translateY(-8px) scale(0.85);
    opacity: 0;
  }
  70% {
    transform: translateY(1px) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes portalSlide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(340%);
  }
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  color-scheme: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(197, 160, 40, 0.45);
  outline-offset: 2px;
}

.no-js-shell,
.page-shell {
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
}

.page-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 0 0;
}

.page-shell.is-fluid {
  width: calc(100% - 28px);
  max-width: none;
}

.section-label {
  margin: 0 0 12px;
  color: var(--gold-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.editorial-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.hero-panel,
.auth-panel,
.panel,
.exam-layout,
.report-layout,
.admin-layout {
  border: 1px solid rgba(20, 17, 15, 0.08);
  box-shadow: var(--shadow);
}

.hero-panel,
.panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.95), rgba(246, 239, 226, 0.95));
}

.hero-panel {
  min-height: 720px;
  padding: 42px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: calc(var(--radius-lg) - 8px);
  border: 1px solid rgba(20, 17, 15, 0.08);
  pointer-events: none;
}

.brand-row,
.dashboard-bar,
.report-bar,
.instructions-bar,
.exam-topbar,
.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(197, 160, 40, 0.18);
}

.status-note,
.helper-text,
.list-note {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.headline-block {
  align-self: center;
  max-width: 620px;
}

.headline-block h1,
.dashboard-hero h1,
.page-heading h1,
.report-heading h1,
.admin-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6.4vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.headline-block p,
.dashboard-hero p,
.page-heading p,
.report-heading p,
.admin-heading p {
  max-width: 48rem;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}

.strike {
  position: relative;
  display: inline-block;
}

.strike::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  top: 52%;
  height: 10px;
  background: var(--wine);
  transform: rotate(-3deg);
}

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

.stat-card,
.summary-card,
.metric-card {
  padding: 18px;
  border-radius: var(--radius-md);
}

.stat-card {
  background: rgba(20, 17, 15, 0.94);
  color: #f8f2e8;
}

.stat-card strong,
.metric-card strong,
.summary-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card span,
.metric-card span,
.summary-card span {
  display: block;
  margin-top: 10px;
  color: rgba(248, 242, 232, 0.78);
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 17, 15, 0.98), rgba(26, 22, 19, 0.96));
  color: #f7f0e4;
  padding: 34px;
  display: grid;
  gap: 26px;
  align-content: start;
}

.auth-panel h2,
.panel h2,
.report-card h2,
.admin-card h2,
.instructions-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.auth-copy {
  color: rgba(247, 240, 228, 0.78);
  line-height: 1.7;
}

.grid-two,
.dashboard-grid,
.report-grid,
.admin-grid,
.instructions-grid,
.exam-grid {
  display: grid;
  gap: 20px;
}

.admin-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(20, 17, 15, 0.12);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: rgba(255, 250, 240, 0.96);
  color: var(--ink);
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(79, 70, 61, 0.58);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 46px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 2px), calc(100% - 14px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field select option,
.field select optgroup {
  background: rgba(255, 250, 240, 0.98);
  color: var(--ink);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.72;
  cursor: pointer;
}

body[data-theme="dark"] .field input[type="date"]::-webkit-calendar-picker-indicator,
body[data-theme="dark"] .field input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.15);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  transition: background-color 5000s ease-in-out 0s;
  box-shadow: 0 0 0 1000px rgba(255, 250, 240, 0.96) inset;
}

body[data-theme="dark"] input:-webkit-autofill,
body[data-theme="dark"] input:-webkit-autofill:hover,
body[data-theme="dark"] input:-webkit-autofill:focus,
body[data-theme="dark"] textarea:-webkit-autofill,
body[data-theme="dark"] textarea:-webkit-autofill:hover,
body[data-theme="dark"] textarea:-webkit-autofill:focus,
body[data-theme="dark"] select:-webkit-autofill,
body[data-theme="dark"] select:-webkit-autofill:hover,
body[data-theme="dark"] select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.05) inset;
}

.auth-panel .field input,
.auth-panel .field textarea,
.auth-panel .field select {
  border-color: rgba(255, 250, 240, 0.12);
  background: rgba(255, 250, 240, 0.08);
  color: #f7f0e4;
}

.auth-panel .field label,
.auth-panel .helper-text {
  color: rgba(247, 240, 228, 0.72);
}

.button-row,
.meta-row,
.solution-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.palette-button,
.tab-button {
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.palette-button:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 0.83rem;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(20, 17, 15, 0.06);
}

.button-primary {
  background: var(--gold);
  color: var(--ink);
}

.button-secondary {
  background: transparent;
  color: inherit;
  border-color: rgba(20, 17, 15, 0.16);
}

.button-ghost {
  background: rgba(20, 17, 15, 0.06);
  color: var(--ink);
}

.button-danger {
  background: rgba(180, 35, 24, 0.1);
  color: var(--wine);
  border-color: rgba(180, 35, 24, 0.18);
}

.button-compact {
  min-height: 30px;
  padding: 0 11px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.auth-panel .button-secondary {
  border-color: rgba(255, 250, 240, 0.16);
}

.banner {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 250, 240, 0.08);
  color: #f7f0e4;
  font-size: 0.94rem;
  font-weight: 700;
}

.dashboard-hero,
.page-heading,
.report-heading,
.admin-heading {
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.94), rgba(246, 239, 226, 0.94));
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  animation: dashboardReveal 420ms ease both;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 44%, rgba(255, 255, 255, 0.38) 50%, transparent 56%),
    radial-gradient(circle at 12% 18%, rgba(216, 177, 61, 0.18), transparent 30%);
  opacity: 0.55;
  transform: translateX(-18%);
  animation: dashboardSheen 900ms ease 180ms both;
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero h1 {
  max-width: 980px;
}

.dashboard-grid,
.report-grid,
.admin-grid,
.instructions-grid {
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  margin-top: 20px;
}

.dashboard-grid {
  align-items: start;
  animation: dashboardLift 460ms ease 80ms both;
}

.dashboard-grid > .panel {
  position: relative;
  overflow: hidden;
}

.dashboard-grid > .panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(216, 177, 61, 0.9), transparent 72%);
  opacity: 0.75;
}

.dashboard-top-notes {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  margin-top: 24px;
}

.dashboard-top-notes > * {
  animation: dashboardCardIn 420ms ease both;
}

.dashboard-top-notes > *:nth-child(2) {
  animation-delay: 70ms;
}

.dashboard-highlight-banner,
.dashboard-notice-card {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.08);
}

.dashboard-highlight-banner {
  background:
    radial-gradient(circle at top right, rgba(216, 177, 61, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(255, 247, 224, 0.98), rgba(247, 238, 219, 0.98));
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-highlight-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 159, 41, 0.32);
  box-shadow: 0 18px 36px rgba(80, 58, 17, 0.1);
}

.dashboard-notice-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(163, 106, 44, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(126, 79, 35, 0.94), rgba(95, 58, 24, 0.96));
  border-color: rgba(92, 54, 23, 0.3);
  box-shadow:
    0 18px 38px rgba(62, 39, 18, 0.18),
    inset 0 0 0 1px rgba(255, 245, 223, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.dashboard-notice-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 46px rgba(62, 39, 18, 0.22),
    inset 0 0 0 1px rgba(255, 245, 223, 0.1);
}

.notice-board-frame {
  position: relative;
  padding: 18px 16px 14px;
}

.notice-board-paper {
  position: relative;
  padding: 20px 18px 18px;
  border-radius: 16px 16px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.98), rgba(247, 237, 213, 0.98)),
    repeating-linear-gradient(
      180deg,
      transparent,
      transparent 30px,
      rgba(122, 92, 49, 0.08) 30px,
      rgba(122, 92, 49, 0.08) 31px
    );
  border: 1px solid rgba(148, 111, 59, 0.16);
  box-shadow:
    0 8px 18px rgba(55, 35, 17, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: rotate(-0.4deg);
}

.notice-board-paper::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: -1px;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, rgba(215, 197, 163, 0.95), rgba(241, 231, 205, 0.98));
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  box-shadow: -8px -8px 16px rgba(112, 85, 42, 0.12);
}

.notice-pin {
  position: absolute;
  top: 12px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fff7e4, #c89d34 55%, #8f6712 100%);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.65);
  z-index: 2;
  animation: noticePinSettle 520ms cubic-bezier(0.2, 0.9, 0.2, 1.1) both;
}

.notice-pin-left {
  left: 24px;
}

.notice-pin-right {
  right: 24px;
}

.dashboard-highlight-banner strong,
.dashboard-notice-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.dashboard-highlight-banner span,
.dashboard-notice-card p {
  color: var(--ink-soft);
  line-height: 1.7;
}

.dashboard-notice-card .section-label {
  color: #8b5a16;
}

.dashboard-notice-card .empty-state {
  margin: 0;
  background: rgba(255, 251, 241, 0.64);
  border-color: rgba(148, 111, 59, 0.14);
}

.panel,
.report-card,
.admin-card,
.instructions-card {
  padding: 26px;
}

.report-card,
.admin-card,
.instructions-card,
.dashboard-card,
.question-card,
.legend-card,
.summary-card,
.metric-card,
.solution-card {
  border: 1px solid rgba(20, 17, 15, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 240, 0.96);
}

.admin-grid > .admin-card,
.admin-grid > .panel {
  flex: 1 1 360px;
  min-width: min(100%, 360px);
  align-self: flex-start;
  height: auto;
}

.dashboard-card,
.solution-card,
.question-card {
  padding: 22px;
}

.dashboard-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
  animation: dashboardCardIn 420ms ease both;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background:
    radial-gradient(circle at top right, rgba(216, 177, 61, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(246, 239, 226, 0.98));
  transition: opacity 180ms ease;
}

.dashboard-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(216, 177, 61, 0.95), rgba(143, 45, 31, 0.7));
  opacity: 0;
  transition: opacity 180ms ease;
}

.dashboard-card:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 159, 41, 0.32);
  box-shadow: 0 22px 46px rgba(20, 17, 15, 0.12);
}

.dashboard-card:hover::before,
.dashboard-card:hover::after {
  opacity: 1;
}

.dashboard-card:nth-child(2) { animation-delay: 55ms; }
.dashboard-card:nth-child(3) { animation-delay: 110ms; }
.dashboard-card:nth-child(4) { animation-delay: 165ms; }
.dashboard-card:nth-child(5) { animation-delay: 220ms; }
.dashboard-card:nth-child(6) { animation-delay: 275ms; }

.planner-inline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 2px;
}

.dashboard-card .button-row {
  align-items: center;
  gap: 10px;
}

.dashboard-card h3,
.question-card h3,
.solution-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.dashboard-card p,
.solution-card p,
.report-card p,
.admin-card p,
.instructions-card p,
.question-copy {
  color: var(--ink-soft);
  line-height: 1.7;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.06);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.meta-chip.is-live {
  background: #239442;
  border-color: #1d7635;
  color: #fff;
}

.meta-chip.is-draft {
  background: #efe7d8;
  border-color: #d8c7ab;
  color: #6e6359;
}

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

.metric-card span,
.summary-card span {
  color: var(--ink-soft);
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: rgba(20, 17, 15, 0.08);
}

.dashboard-list,
.attempt-list,
.solution-list,
.question-bank {
  display: grid;
  gap: 16px;
}

.dashboard-list {
  gap: 18px;
}

.dashboard-stats .summary-card {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dashboard-stats .summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 159, 41, 0.24);
  box-shadow: 0 16px 32px rgba(20, 17, 15, 0.08);
}

.list-scroll-card {
  max-height: min(360px, 52vh);
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}

.attempt-item,
.bank-item {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(20, 17, 15, 0.04);
}

.presence-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(20, 17, 15, 0.06);
}

.presence-dot.is-online {
  background: #31b56a;
}

.presence-dot.is-offline {
  background: #d55a5a;
}

.analysis-bar-stack {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.analysis-bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
}

.analysis-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  overflow: hidden;
}

.analysis-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9a227 0%, #8f6a0d 100%);
}

.trend-sparkline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 140px;
  margin-top: 12px;
}

.trend-bar {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.trend-bar span {
  display: block;
  width: 100%;
  min-height: 12px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #1a7f64 0%, #0e3d33 100%);
}

.trend-bar small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.instructions-layout,
.exam-layout,
.report-layout,
.admin-layout {
  border-radius: 32px;
  overflow: hidden;
  background: rgba(255, 250, 240, 0.75);
}

.admin-layout-inline-footer {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 28px);
}

.instructions-bar,
.report-bar,
.admin-bar,
.exam-topbar {
  min-height: 76px;
  padding: 18px 26px;
  background: rgba(20, 17, 15, 0.98);
  color: #f7f0e4;
}

.instructions-tabs,
.exam-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-button {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 250, 240, 0.12);
  background: rgba(255, 250, 240, 0.08);
  color: #f7f0e4;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tab-button.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.tab-button:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.timer-stack {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.timer-stack span {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 240, 228, 0.66);
}

.timer-stack strong {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.timer-stack strong.is-warning {
  color: #ffcf66;
}

.timer-stack strong.is-danger {
  color: #ff8467;
}

.instructions-body,
.report-body,
.admin-body {
  padding: 24px;
}

.admin-layout-inline-footer .admin-body {
  flex: 1 1 auto;
}

.instructions-card ul,
.instructions-card ol,
.report-card ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--ink-soft);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(20, 17, 15, 0.05);
}

.legend-grid {
  display: grid;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(20, 17, 15, 0.12);
}

.legend-dot.answered {
  background: rgba(21, 115, 71, 0.2);
  border-color: rgba(21, 115, 71, 0.45);
}

.legend-dot.not-answered {
  background: rgba(180, 35, 24, 0.15);
  border-color: rgba(180, 35, 24, 0.38);
}

.legend-dot.not-visited {
  background: rgba(141, 135, 125, 0.18);
  border-color: rgba(141, 135, 125, 0.42);
}

.legend-dot.marked {
  background: rgba(108, 67, 229, 0.18);
  border-color: rgba(108, 67, 229, 0.42);
}

.legend-dot.answered-marked {
  background: linear-gradient(135deg, rgba(21, 115, 71, 0.2), rgba(148, 106, 255, 0.2));
  border-color: rgba(108, 67, 229, 0.42);
}

.profile-shell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(197, 160, 40, 0.18);
  color: var(--gold-strong);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
}

.exam-grid {
  grid-template-columns: minmax(0, 2fr) 320px;
  padding: 24px;
}

.question-panel,
.question-sidebar {
  display: grid;
  gap: 16px;
}

.section-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(20, 17, 15, 0.06);
}

.section-strip strong {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.question-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.question-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(197, 160, 40, 0.12);
  color: var(--gold-strong);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.passage {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(20, 17, 15, 0.04);
  color: var(--ink-soft);
  line-height: 1.8;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.1);
  background: #fffdf8;
}

.option-card.is-selected {
  border-color: rgba(197, 160, 40, 0.55);
  background: rgba(197, 160, 40, 0.09);
}

.option-card input {
  margin-top: 4px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend-card {
  padding: 18px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.palette-button {
  min-height: 44px;
  border: 1px solid rgba(20, 17, 15, 0.12);
  border-radius: 12px;
  background: rgba(20, 17, 15, 0.05);
  color: var(--ink);
  font-weight: 800;
}

.palette-button.is-current {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.palette-button.status-answered {
  background: #3f9a45;
  border-color: #2f7d35;
  color: #fff;
}

.palette-button.status-not-answered {
  background: #d64d3f;
  border-color: #b2392d;
  color: #fff;
}

.palette-button.status-not-visited {
  background: #d4cab8;
  border-color: #b8aa92;
  color: #534a41;
}

.palette-button.status-marked {
  background: #8353c7;
  border-color: #693db0;
  color: #fff;
}

.palette-button.status-answered-marked {
  background: linear-gradient(135deg, #3f9a45, #8353c7);
  border-color: #693db0;
  color: #fff;
}

.submit-card {
  display: grid;
  gap: 14px;
}

.progress-line {
  height: 10px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #e6c45d);
}

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

.analysis-showcase {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.analysis-stage {
  opacity: 0;
  transform: translateY(10px);
  animation: analysisFadeIn 0.5s ease forwards;
}

.analysis-spotlight {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.5), transparent 32%),
    linear-gradient(135deg, rgba(216, 177, 61, 0.16), rgba(255, 250, 240, 0.98));
}

.analysis-spotlight strong {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.analysis-spotlight span:last-child {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

.analysis-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.analysis-spotlight.is-strong {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.58), transparent 34%),
    linear-gradient(135deg, rgba(35, 148, 66, 0.18), rgba(255, 250, 240, 0.98));
}

.analysis-spotlight.is-good {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(135deg, rgba(216, 177, 61, 0.18), rgba(255, 250, 240, 0.98));
}

.analysis-spotlight.is-watch {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(135deg, rgba(218, 136, 57, 0.18), rgba(255, 250, 240, 0.98));
}

.analysis-spotlight.is-focus {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(135deg, rgba(157, 48, 40, 0.15), rgba(255, 250, 240, 0.98));
}

.analysis-mini-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.analysis-mini-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(20, 17, 15, 0.03);
}

.analysis-mini-card strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.analysis-mini-card small {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.analysis-grid {
  align-items: start;
}

.analysis-panel {
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(255, 250, 240, 0.94));
}

.analysis-section-list,
.analysis-plan-list {
  display: grid;
  gap: 14px;
}

.analysis-section-row,
.analysis-plan-row {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(20, 17, 15, 0.04);
}

.analysis-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.analysis-section-head strong,
.analysis-plan-row strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.analysis-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(216, 177, 61, 0.18);
  color: #6c5210;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.analysis-meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  overflow: hidden;
}

.analysis-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8b13d, #239442);
  width: 0;
  transition: width 1s ease;
}

.analysis-meter-soft span {
  background: linear-gradient(90deg, rgba(143, 45, 31, 0.88), rgba(216, 177, 61, 0.92));
}

.analysis-section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.analysis-plan-row.is-benchmark {
  background:
    linear-gradient(135deg, rgba(216, 177, 61, 0.16), rgba(20, 17, 15, 0.02));
}

.analysis-topic-list,
.analysis-review-list {
  display: grid;
  gap: 14px;
}

.analysis-topic-row,
.analysis-review-card,
.analysis-time-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(255, 252, 245, 0.92);
  box-shadow: 0 14px 34px rgba(20, 17, 15, 0.06);
}

.analysis-topic-row {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.analysis-topic-head,
.analysis-review-head,
.analysis-review-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.analysis-topic-head strong,
.analysis-review-meta h4,
.analysis-review-head h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.analysis-topic-head span:last-child,
.analysis-review-meta .section-label {
  color: var(--ink-soft);
}

.analysis-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.analysis-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.analysis-time-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.analysis-time-card strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}

.analysis-time-meter {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

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

.analysis-visual-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(255, 252, 245, 0.92);
  box-shadow: 0 14px 34px rgba(20, 17, 15, 0.06);
}

.analysis-donut {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
}

.analysis-donut svg {
  width: 168px;
  height: 168px;
  transform: rotate(-90deg);
}

.analysis-donut-base,
.analysis-donut-segment {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
}

.analysis-donut-base {
  stroke: rgba(20, 17, 15, 0.08);
}

.analysis-donut-center {
  position: absolute;
  display: grid;
  gap: 6px;
  text-align: center;
}

.analysis-donut-center span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analysis-donut-center strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1;
}

.analysis-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.analysis-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.analysis-legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.analysis-history-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 180px;
}

.analysis-history-bar {
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 8px;
  min-height: 180px;
}

.analysis-history-bar span {
  display: block;
  width: 100%;
  min-height: 12px;
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(180deg, rgba(143, 45, 31, 0.9), rgba(216, 177, 61, 0.95));
}

.analysis-history-bar.is-current span {
  background: linear-gradient(180deg, rgba(35, 148, 66, 0.92), rgba(216, 177, 61, 0.95));
}

.analysis-history-bar strong {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1;
}

.analysis-history-bar small {
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

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

.report-history-section {
  display: grid;
  gap: 14px;
}

.report-history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.report-history-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.2;
}

.report-history-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.report-history-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(255, 252, 245, 0.92);
  box-shadow: 0 14px 30px rgba(20, 17, 15, 0.06);
}

.report-history-card.is-current {
  border-color: rgba(200, 159, 41, 0.4);
  box-shadow: 0 16px 34px rgba(200, 159, 41, 0.14);
}

.report-history-kicker {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-history-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.1;
}

.report-history-meta {
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.analysis-review-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analysis-review-card:hover,
.analysis-topic-row:hover,
.analysis-time-card:hover,
.analysis-mini-card:hover,
.analysis-spotlight:hover {
  transform: translateY(-3px);
  transition: 0.2s ease;
}

.analysis-review-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.analysis-review-block {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(20, 17, 15, 0.04);
}

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

.analysis-option {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(20, 17, 15, 0.04);
  border: 1px solid transparent;
}

.analysis-option.is-correct {
  border-color: rgba(21, 115, 71, 0.2);
  background: rgba(21, 115, 71, 0.08);
}

.analysis-option.is-selected-wrong {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.08);
}

.analysis-option.is-selected-correct {
  border-color: rgba(21, 115, 71, 0.28);
}

.analysis-option-index {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  font-weight: 800;
}

.analysis-review-images {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.analysis-inline-image {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.analysis-inline-image img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(20, 17, 15, 0.08);
}

.analysis-explanation {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(216, 177, 61, 0.14), rgba(255, 250, 240, 0.96));
}

.bar-item {
  display: grid;
  gap: 8px;
}

.bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #ddbe56);
}

.answer-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.answer-chip.correct {
  background: rgba(21, 115, 71, 0.14);
  color: var(--green);
}

.answer-chip.incorrect {
  background: rgba(180, 35, 24, 0.12);
  color: var(--red);
}

.answer-chip.neutral {
  background: rgba(141, 135, 125, 0.18);
  color: var(--gray);
}

.search-highlight {
  padding: 0 2px;
  border-radius: 4px;
  background: #e3c04f;
  color: #15110f;
}

.rich-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}

.empty-state {
  padding: 26px;
  border-radius: var(--radius-md);
  background: rgba(20, 17, 15, 0.05);
  color: var(--ink-soft);
  line-height: 1.8;
}

@keyframes analysisFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.table-like {
  display: grid;
  gap: 12px;
}

.table-scroll-card {
  max-height: min(460px, 62vh);
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}

.table-scroll-card .table-row.header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr 0.7fr;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(20, 17, 15, 0.04);
}

.leaderboard-table .table-row {
  grid-template-columns: 0.55fr 1.35fr 0.75fr 0.8fr 1fr 1fr;
}

.table-row.header {
  background: rgba(20, 17, 15, 0.08);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tests-table .table-row {
  grid-template-columns: 1.2fr 0.5fr 0.7fr 0.85fr 0.95fr 0.9fr;
}

.tests-table .table-row span:last-child {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.tests-table .table-row .button {
  min-height: 34px;
  padding: 0 12px;
}

.tests-table .table-row {
  align-items: start;
}

.tests-table {
  overflow-x: auto;
  padding-bottom: 6px;
}

.tests-table .table-row {
  min-width: 860px;
}

.test-title-live {
  color: #239442;
  font-weight: 800;
}

.question-bank {
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-calendar-card {
  display: grid;
  gap: 14px;
}

.planner-section-shell {
  gap: 16px;
}

.planner-top-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.planner-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(20, 17, 15, 0.04);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.planner-tab-button:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 177, 61, 0.28);
  color: var(--ink);
}

.planner-tab-button.is-active {
  border-color: rgba(216, 177, 61, 0.48);
  background: rgba(216, 177, 61, 0.14);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(216, 177, 61, 0.2);
}

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

.planner-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.planner-panel-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.planner-summary-strip,
.planner-analytics-grid,
.planner-insights-grid {
  display: grid;
  gap: 14px;
}

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

.planner-countdown-card,
.planner-goal-card,
.planner-analytics-card,
.planner-insight-card,
.planner-selected-date-card,
.planner-bucket,
.planner-modal-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: 0 14px 32px rgba(20, 17, 15, 0.08);
}

.planner-countdown-card,
.planner-goal-card,
.planner-insight-card,
.planner-selected-date-card,
.planner-bucket {
  padding: 16px;
}

.planner-countdown-card strong,
.planner-goal-head span,
.planner-analytics-card strong,
.planner-insight-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.planner-countdown-card span,
.planner-insight-card span,
.planner-goal-card .helper-text {
  color: var(--ink-soft);
  line-height: 1.6;
}

.planner-goal-head,
.planner-bucket-head,
.planner-event-head,
.planner-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.planner-goal-head span,
.planner-bucket-head span {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.planner-progress {
  height: 10px;
  margin: 12px 0 10px;
  border-radius: 999px;
  background: rgba(20, 17, 15, 0.08);
  overflow: hidden;
}

.planner-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8b13d, #239442);
  transition: width 280ms ease;
}

.calendar-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.calendar-head .button-row {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

.calendar-head h3 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays span {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-cell {
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(20, 17, 15, 0.04);
  color: var(--ink);
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  font-weight: 800;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

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

.calendar-cell.has-live {
  box-shadow: inset 0 0 0 1px rgba(46, 113, 201, 0.24);
}

.calendar-cell.is-muted {
  opacity: 0.32;
}

.calendar-cell.is-selected {
  border-color: rgba(216, 177, 61, 0.55);
  background: rgba(216, 177, 61, 0.14);
  box-shadow: inset 0 0 0 1px rgba(216, 177, 61, 0.25);
}

.calendar-cell.is-today {
  box-shadow: inset 0 0 0 2px rgba(20, 17, 15, 0.18);
  animation: todayGlow 1.8s ease-in-out infinite;
}

.calendar-cell.is-exam-day {
  border-color: rgba(183, 58, 40, 0.66);
  background: rgba(183, 58, 40, 0.14);
  animation: examBlink 1.1s ease-in-out infinite;
}

.calendar-date-number {
  position: relative;
  z-index: 1;
}

.calendar-dot-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 10px;
}

.calendar-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.calendar-dot.is-planned {
  background: #d8b13d;
}

.calendar-dot.is-completed {
  background: #239442;
}

.calendar-dot.is-missed {
  background: #b73828;
}

.calendar-dot.is-live {
  background: #2e71c9;
}

.calendar-dot-more {
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 800;
}

.calendar-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(6px);
  min-width: 90px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(20, 17, 15, 0.94);
  color: #fff9ef;
  font-size: 0.72rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 4;
}

.calendar-cell:hover .calendar-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.calendar-helper {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.6;
}

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

.planner-analytics-grid-compact {
  gap: 10px;
}

.planner-analytics-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.planner-analytics-card span {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.planner-selected-date-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.planner-main-grid,
.planner-right-rail {
  display: grid;
  gap: 14px;
  align-content: start;
}

.planner-sidebar-stack {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.planner-event-list,
.planner-history-list,
.modal-scroll,
.compact-scroll {
  display: grid;
  gap: 12px;
}

.planner-list-scroll,
.compact-scroll,
.modal-scroll {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.planner-bucket {
  display: grid;
  gap: 12px;
  align-content: start;
}

.planner-list-scroll {
  max-height: min(320px, 52vh);
}

.planner-event-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.planner-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planner-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.planner-status-chip.planned {
  background: rgba(216, 177, 61, 0.18);
  color: #8f6804;
}

.planner-status-chip.completed {
  background: rgba(35, 148, 66, 0.16);
  color: #1d7635;
}

.planner-status-chip.missed {
  background: rgba(183, 56, 40, 0.14);
  color: #8f2d1f;
}

.planner-status-chip.live {
  background: rgba(46, 113, 201, 0.14);
  color: #255caa;
}

.planner-inline-alert {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(46, 113, 201, 0.12);
  color: #255caa;
  font-weight: 700;
}

.planner-history-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(20, 17, 15, 0.04);
}

.planner-history-item span {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.planner-history-list-large {
  max-height: 420px;
}

.planner-empty {
  padding: 18px;
}

.planner-modal-overlay {
  align-items: center;
  justify-content: center;
}

.planner-modal-card {
  width: min(1080px, calc(100vw - 28px));
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.planner-modal-head {
  padding: 20px 22px;
  border-bottom: 1px solid rgba(20, 17, 15, 0.08);
}

.planner-modal-head h3 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.planner-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  padding: 20px 22px 22px;
  overflow: auto;
}

.planner-modal-column {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.planner-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.planner-tag-option {
  position: relative;
}

.planner-tag-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.planner-tag-option span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(20, 17, 15, 0.04);
  font-weight: 700;
}

.planner-tag-option input:checked + span {
  border-color: rgba(46, 113, 201, 0.28);
  background: rgba(46, 113, 201, 0.12);
  color: #255caa;
}

.planner-arrow-button {
  min-width: 42px;
  padding-inline: 0;
  font-size: 1rem;
}

@keyframes examBlink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(183, 58, 40, 0.08); }
  50% { box-shadow: 0 0 0 8px rgba(183, 58, 40, 0.22); }
}

@keyframes todayGlow {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(20, 17, 15, 0.18); }
  50% { box-shadow: inset 0 0 0 2px rgba(46, 113, 201, 0.3), 0 0 0 6px rgba(46, 113, 201, 0.08); }
}

.admin-bank-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.75fr);
  gap: 14px;
  margin-bottom: 14px;
}

.bank-item label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.app-footer {
  margin-top: auto;
  flex: 0 0 auto;
  padding: 22px 0 18px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-align: center;
}

.app-footer-inline {
  width: 100%;
  margin: 0;
  padding: 18px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(20, 17, 15, 0.98);
  color: #f7f0e4;
}

.auth-panel .field input::placeholder,
.auth-panel .field textarea::placeholder {
  color: rgba(247, 240, 228, 0.44);
}

.auth-panel .field select option,
.auth-panel .field select optgroup {
  background: #1f1b18;
  color: #f7f0e4;
}

.theme-nav-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(255, 250, 240, 0.92);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(20, 17, 15, 0.12);
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.theme-nav-button:hover {
  transform: translateY(-1px);
}

.theme-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.support-chat-button {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 32;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  border: 1px solid rgba(197, 160, 40, 0.28);
  background:
    radial-gradient(circle at top left, rgba(230, 196, 93, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(29, 24, 21, 0.98), rgba(48, 37, 28, 0.98));
  color: #fff9ef;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(20, 17, 15, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.support-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 46px rgba(20, 17, 15, 0.28);
  filter: brightness(1.03);
}

.support-chat-icon {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #d8b13d, #c69f2a);
  color: #15110f;
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 239, 0.36),
    0 8px 18px rgba(20, 17, 15, 0.18);
}

.support-chat-icon img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.92);
}

.support-chat-copy {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}

.support-chat-copy strong {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.support-chat-copy small {
  font-size: 0.74rem;
  color: rgba(255, 249, 239, 0.74);
}

body[data-theme="dark"] .theme-nav-button {
  background: rgba(24, 24, 24, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f5e3a2;
}

body[data-theme="dark"] .theme-nav-button:hover {
  background: rgba(32, 32, 32, 0.98);
}

body[data-theme="dark"] .support-chat-button {
  border-color: rgba(216, 177, 61, 0.24);
  background:
    radial-gradient(circle at top left, rgba(216, 177, 61, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(28, 28, 28, 0.98), rgba(20, 20, 20, 0.98));
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.34);
}

@media (max-width: 1120px) {
  .editorial-shell,
  .dashboard-grid,
  .instructions-grid,
  .exam-grid,
  .report-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: unset;
  }

  .planner-modal-body {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-hero,
  .dashboard-hero::before,
  .dashboard-grid,
  .dashboard-top-notes > *,
  .dashboard-card,
  .notice-pin {
    animation: none;
  }

  .dashboard-card,
  .dashboard-highlight-banner,
  .dashboard-notice-card,
  .dashboard-stats .summary-card {
    transition: none;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100%, calc(100% - 18px));
    padding-top: 18px;
  }

  .hero-panel,
  .auth-panel,
  .dashboard-hero,
  .page-heading,
  .report-heading,
  .admin-heading,
  .panel,
  .report-card,
  .admin-card,
  .instructions-card {
    padding: 20px;
  }

  .hero-grid,
  .dashboard-top-notes,
  .planner-summary-strip,
  .planner-analytics-grid,
  .planner-insights-grid,
  .dashboard-stats,
  .summary-grid,
  .analysis-showcase,
  .analysis-visual-grid,
  .analysis-mini-grid,
  .analysis-time-grid,
  .metric-grid,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .exam-topbar,
  .instructions-bar,
  .report-bar,
  .admin-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .report-history-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .theme-nav-button {
    width: 38px;
    height: 38px;
  }

  .support-chat-button {
    right: 14px;
    bottom: 16px;
    min-height: 52px;
    padding: 8px 12px 8px 8px;
    gap: 10px;
  }

  .support-chat-icon {
    width: 36px;
    height: 36px;
  }

  .support-chat-copy strong {
    font-size: 0.86rem;
  }

  .support-chat-copy small {
    font-size: 0.7rem;
  }

  .planner-top-tabs {
    grid-template-columns: 1fr;
  }

  .planner-panel-head,
  .calendar-head {
    align-items: start;
    flex-direction: column;
  }

  .calendar-head .button-row {
    width: 100%;
    justify-content: flex-start;
  }

  .planner-sidebar-stack {
    position: static;
  }

  .planner-modal-card {
    width: min(100vw, calc(100vw - 16px));
    max-height: min(92vh, 900px);
    border-radius: 20px 20px 0 0;
    align-self: end;
  }

  .calendar-cell {
    min-height: 62px;
  }
}

/* UGEE-style utility overrides with AceIIIT brand colors */

.page-shell {
  width: 100%;
  padding: 0 0 32px;
}

.editorial-shell,
.dashboard-hero,
.dashboard-grid,
.report-layout,
.admin-layout {
  width: min(1200px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}

.editorial-shell,
.dashboard-hero,
.dashboard-grid,
.report-layout,
.admin-layout {
  margin-top: 28px;
}

.app-footer {
  width: min(1200px, calc(100% - 28px));
  margin: auto auto 0;
}

.app-footer-inline {
  width: 100%;
  margin: 0;
}

.admin-layout-inline-footer .app-footer-inline {
  margin-top: auto;
}

.utility-layout {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fbf7ef;
}

.utility-layout .button {
  min-height: 38px;
  border-radius: 2px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
}

.utility-layout .button-primary {
  background: linear-gradient(180deg, #d8b13d, #c69f2a);
  border-color: #b88e12;
  color: #15110f;
}

.utility-layout .button-secondary {
  background: #fffdf7;
  border-color: #c8bfae;
  color: #15110f;
}

.utility-layout .button-ghost {
  background: #f3eadb;
  border-color: #d7c7ad;
  color: #15110f;
}

.utility-layout .button-danger {
  background: #b73a28;
  border-color: #912717;
  color: #fff5ef;
}

.utility-layout .tab-button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 2px;
  border: 1px solid rgba(255, 250, 240, 0.14);
  background: rgba(255, 250, 240, 0.08);
  color: #f7f0e4;
  letter-spacing: 0;
  text-transform: none;
}

.utility-layout .tab-button.is-active {
  background: #c89f29;
  border-color: #b98f16;
  color: #15110f;
}

.utility-layout .tab-button:disabled {
  background: rgba(255, 250, 240, 0.08);
  color: rgba(255, 250, 240, 0.56);
  border-color: rgba(255, 250, 240, 0.08);
}

.utility-titlebar,
.exam-paperbar,
.exam-sectionheader,
.exam-sectionbar,
.exam-footerbar {
  border-top: 1px solid #1a1410;
}

.instructions-layout .instructions-bar,
.exam-layout .exam-topbar {
  min-height: 48px;
  padding: 10px 14px;
  background: #15110f;
  color: #fbf6ea;
}

.instructions-layout .brand-mark,
.exam-layout .brand-mark {
  font-size: 0.92rem;
}

.utility-titlebar {
  padding: 10px 12px;
  background: #dbc65b;
  color: #15110f;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.instructions-utility-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 275px;
  min-height: 640px;
  border-top: 1px solid #1a1410;
}

.instructions-mainpane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  border-right: 1px solid #1a1410;
  background: #fffdf9;
}

.instructions-scrollpane {
  min-height: 0;
  max-height: 560px;
  overflow: auto;
}

.instructions-copy {
  padding: 28px 20px 20px;
  color: #1f1a16;
  line-height: 1.8;
}

.instructions-copy p {
  margin: 0 0 22px;
  max-width: 92ch;
}

.instructions-centerhead {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.checkbox-row-utility {
  margin: 0 16px 12px;
  border: 1px solid #d8c7ab;
  border-radius: 2px;
  background: #f8f2e6;
  color: #1f1a16;
  font-weight: 700;
}

.checkbox-row-utility span {
  color: #1f1a16;
}

.checkbox-row-utility input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.utility-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 16px;
}

.instructions-sidepane {
  padding: 22px 18px;
  background: #f6efe0;
  display: grid;
  align-content: start;
  gap: 24px;
}

.instructions-profilecard {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px 12px 20px;
  border: 1px solid #dac9ab;
  background: #fffdf9;
}

.avatar-large {
  width: 94px;
  height: 94px;
  font-size: 1.6rem;
}

.instructions-sideinfo {
  display: grid;
  gap: 12px;
  padding: 16px 14px;
  border: 1px solid #dac9ab;
  background: #fffdf9;
  color: #5b4f43;
}

.instructions-sideinfo p {
  margin: 0;
}

.exam-layout {
  margin-top: 0;
}

.exam-paperbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: #f2ead9;
}

.exam-paper-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.paper-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #c8bfae;
  background: #fffdf7;
  color: #15110f;
  font-weight: 700;
}

.paper-tab.is-active {
  background: #c89f29;
  border-color: #b98f16;
}

.exam-timerline {
  color: #1f1a16;
  font-size: 1.05rem;
  font-weight: 700;
}

.exam-timerline strong {
  color: #15110f;
}

.exam-timerline strong.is-warning {
  color: #996200;
}

.exam-timerline strong.is-danger {
  color: #b42318;
}

.exam-sectionheader {
  padding: 8px 14px;
  background: #fffdf9;
  color: #1f1a16;
  font-weight: 700;
}

.exam-sectionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  background: #f6efe0;
}

.exam-submeta {
  color: #5b4f43;
  font-size: 0.92rem;
  font-weight: 700;
}

.exam-layout .exam-grid {
  gap: 0;
  padding: 0;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
}

.exam-mainpanel {
  gap: 0;
  background: #fffdf9;
  min-width: 0;
}

.exam-questioncard {
  min-height: 520px;
  border: 0;
  border-right: 1px solid #1a1410;
  border-radius: 0;
  background: #fffdf9;
  box-shadow: none;
  padding: 0;
}

.question-titlebar {
  padding: 10px 12px;
  border-bottom: 1px solid #d8c7ab;
  background: #fff7e8;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.exam-questionbody {
  position: relative;
  padding: 16px 18px 26px;
  min-height: calc(520px - 46px);
  background:
    radial-gradient(circle at 10% 14%, rgba(200, 159, 41, 0.06), transparent 18%),
    repeating-linear-gradient(
      -55deg,
      rgba(26, 20, 16, 0.02) 0,
      rgba(26, 20, 16, 0.02) 10px,
      transparent 10px,
      transparent 150px
    ),
    #fffdf9;
}

.exam-questiontext {
  margin: 0;
  color: #201b17;
  font-size: 1.12rem;
  line-height: 1.75;
}

.exam-passage {
  border: 1px solid #dfcfb5;
  border-radius: 0;
  background: #f8f2e6;
}

.exam-options {
  margin-top: 18px;
  gap: 14px;
}

.exam-option {
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #211c18;
}

.exam-option.is-selected {
  background: transparent;
  border: 0;
  color: #15110f;
}

.question-figure {
  display: block;
  max-width: min(100%, 560px);
  border: 1px solid #dfcfb5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 30px rgba(20, 17, 15, 0.08);
}

.question-figure-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.question-figure-stack .question-figure {
  margin-top: 0;
}

.question-figure-button {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 10px;
}

.question-figure-button:hover {
  transform: translateY(-1px);
}

.question-figure-button .question-figure {
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 8, 7, 0.78);
  backdrop-filter: blur(4px);
}

.image-lightbox-card {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  padding: 18px;
  border-radius: 22px;
  background: #fff9ef;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.image-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.image-lightbox-image {
  display: block;
  width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
}

.exam-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 10px 12px;
  border-top: 1px solid #1a1410;
  border-right: 1px solid #1a1410;
  background: #f8f2e6;
  box-shadow: 0 -12px 24px rgba(20, 17, 15, 0.08);
}

.exam-actionbar .button {
  flex: 0 0 auto;
  min-width: 132px;
  white-space: nowrap;
}

.exam-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0;
  background: #eef0ea;
  border-left: 1px solid #1a1410;
}

.exam-candidatecard {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 14px 12px 16px;
  border-bottom: 1px solid #1a1410;
  background: #fffdf9;
}

.exam-guardrail-card {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid rgba(200, 159, 41, 0.22);
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.98);
}

.exam-guardrail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 0;
}

.exam-warning-banner {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(157, 44, 22, 0.12);
  color: #7d2717;
  font-size: 0.9rem;
  font-weight: 700;
}


.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 14px 12px;
  border-bottom: 1px solid #1a1410;
  background: #fffdf9;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #211c18;
  font-size: 0.86rem;
  font-weight: 700;
}

.status-count {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.status-count.answered {
  background: #2f9d44;
}

.status-count.not-answered {
  background: #d74a32;
}

.status-count.not-visited {
  background: #7d7469;
}

.status-count.marked {
  background: #7b4dd0;
}

.status-count.answered-marked {
  background: linear-gradient(135deg, #2f9d44, #7b4dd0);
}

.exam-palettecard {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 0 14px;
  border-bottom: 1px solid #1a1410;
  background: #eee3cf;
}

.palette-head {
  padding: 10px 14px;
  background: #15110f;
  color: #d8b13d;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.palette-caption {
  margin: 0;
  padding: 12px 14px 8px;
  color: #1f1a16;
  font-size: 0.92rem;
  font-weight: 700;
}

.exam-sidebar .palette-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 14px;
}

.exam-sidebar .palette-button {
  min-height: 42px;
  border-radius: 2px;
  background: #f4efe7;
  font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.exam-sidebar .palette-button.status-answered {
  background: #239442;
  border-color: #1d7635;
  color: #fff;
}

.exam-sidebar .palette-button.status-not-answered {
  background: #d84536;
  border-color: #af3024;
  color: #fff;
}

.exam-sidebar .palette-button.status-marked {
  background: #7a44cc;
  border-color: #6032ab;
  color: #fff;
}

.exam-sidebar .palette-button.status-answered-marked {
  background: linear-gradient(135deg, #239442, #7a44cc);
  border-color: #6032ab;
  color: #fff;
}

.exam-sidebar .palette-button.status-not-visited {
  background: #cfc5b3;
  border-color: #ab9c82;
  color: #4d4439;
}

.exam-sidebar .palette-button.is-current {
  box-shadow: inset 0 0 0 2px #c89f29;
}

.exam-submitcard {
  flex: 0 0 auto;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: #eef0ea;
  box-shadow: none;
}

.exam-submitcard .button {
  width: 100%;
}


.exam-footerbar {
  padding: 3px 0;
  background: #15110f;
  color: #f8f2e8;
  text-align: center;
  font-size: 0.76rem;
  line-height: 1.2;
}

.calculator-popout {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 6;
}

.calculator-modal {
  width: min(360px, calc(100% - 24px));
  padding: 18px;
  border: 1px solid #d7c7ad;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9ee, #f3eadc);
  box-shadow: 0 28px 70px rgba(20, 17, 15, 0.2);
  animation: slide-up 220ms ease;
}

.calculator-modal-inline {
  width: 320px;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(20, 17, 15, 0.18);
}

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

.calculator-close {
  border: 0;
  background: transparent;
  color: #8f2d1f;
  font-weight: 800;
}

.calculator-display {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 14px;
  padding: 0 14px;
  border-radius: 12px;
  background: #15110f;
  color: #f8f2e8;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

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

.calculator-key {
  min-height: 48px;
  border: 1px solid #d5c4a8;
  border-radius: 12px;
  background: #fffdf8;
  color: #15110f;
  font-weight: 800;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.calculator-key-wide {
  grid-column: span 4;
  background: linear-gradient(180deg, #d8b13d, #c69f2a);
}

.compact-bank {
  max-height: 360px;
  overflow: auto;
}

.transition-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(20, 17, 15, 0.28);
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 17, 15, 0.42);
}

.admin-modal-card {
  width: min(860px, calc(100% - 24px));
  max-height: min(84vh, 920px);
  overflow: hidden;
  border: 1px solid #d8c7ab;
  border-radius: 18px;
  background: #fff9ef;
  box-shadow: 0 26px 70px rgba(20, 17, 15, 0.22);
  animation: slide-up 220ms ease both;
}

.admin-modal-card.is-large {
  width: calc(100% - 24px);
  max-height: calc(100vh - 24px);
}

.question-editor-modal {
  width: min(1280px, calc(100vw - 28px));
}

.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  background: linear-gradient(180deg, rgba(241, 231, 214, 0.85), rgba(255, 249, 239, 0.98));
  border-bottom: 1px solid rgba(216, 199, 171, 0.7);
}

.admin-modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.admin-modal-body {
  padding: 18px;
  overflow: auto;
  max-height: calc(84vh - 70px);
}

.question-editor-body {
  display: grid;
  gap: 18px;
}

.question-editor-intro {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(20, 17, 15, 0.04);
}

.active-paper-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(20, 17, 15, 0.08);
  background: rgba(255, 252, 245, 0.88);
}

.active-paper-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.active-paper-title-row strong {
  font-family: var(--font-display);
  font-size: 1.06rem;
  line-height: 1.2;
}

.active-paper-chips {
  margin-top: 0;
}

.latex-preview-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.latex-preview {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  max-height: 360px;
  overflow: auto;
}

.latex-preview-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.latex-preview-block {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(250, 250, 250, 0.9);
}

.latex-preview-content {
  line-height: 1.5;
}

.latex-preview-options {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.latex-preview-modal {
  max-height: none;
  overflow: visible;
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.transition-card {
  width: min(460px, calc(100% - 24px));
  padding: 28px;
  border: 1px solid #d8c7ab;
  border-radius: 18px;
  background: #fff9ef;
  box-shadow: 0 24px 54px rgba(20, 17, 15, 0.18);
}

.transition-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.transition-card p {
  margin: 0 0 18px;
}

.instructions-modal-overlay {
  z-index: 24;
}

.instructions-popup-card {
  width: min(760px, calc(100% - 24px));
}

.instructions-popup-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.hero-panel,
.auth-panel,
.dashboard-card,
.question-card,
.exam-palettecard,
.instructions-profilecard,
.instructions-sideinfo,
.calculator-modal {
  animation: float-in 320ms ease both;
}

.palette-button.is-current,
.option-card.is-selected {
  animation: pulse-soft 240ms ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-soft {
  0% {
    transform: scale(0.98);
  }

  100% {
    transform: scale(1);
  }
}

.instructions-layout .legend-dot,
.exam-layout .legend-dot {
  border-radius: 2px;
}

@media (max-width: 900px) {
  .instructions-utility-shell,
  .exam-layout .exam-grid {
    grid-template-columns: 1fr;
  }

  .instructions-mainpane,
  .exam-questioncard,
  .exam-actionbar {
    border-right: 0;
  }

  .exam-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    border-left: 0;
  }

  .exam-palettecard {
    overflow: visible;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: 100%;
    padding-bottom: 24px;
  }

  .editorial-shell,
  .dashboard-hero,
  .dashboard-grid,
  .report-layout,
  .admin-layout,
  .app-footer {
    width: min(100%, calc(100% - 18px));
  }

  .admin-layout-inline-footer {
    min-height: calc(100dvh - 18px);
  }

  .instructions-utility-shell,
  .exam-layout .exam-grid {
    grid-template-columns: 1fr;
  }

  .instructions-mainpane {
    border-right: 0;
  }

  .utility-bottom-actions,
  .exam-actionbar,
  .exam-paperbar,
  .exam-sectionbar {
    flex-direction: column;
    align-items: stretch;
  }

  .exam-actionbar {
    position: sticky;
    bottom: 0;
    overflow-x: visible;
  }

  .exam-actionbar .button {
    min-width: 0;
    width: 100%;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}
