:root {
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --surface-2: #f0faf8;
  --ink: #17202a;
  --muted: #64707d;
  --line: #ded7ca;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --gold: #f5b700;
  --coral: #e85d4f;
  --blue: #2563eb;
  --green: #1f9d64;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(23, 32, 42, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0.78rem 0.85rem;
  outline: none;
}

textarea {
  resize: vertical;
}

.choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.choice-fieldset legend,
.review-approve {
  font-weight: 800;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.subject-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0;
}

.review-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
}

.question-coverage .metric-grid {
  margin-bottom: 1rem;
}

.coverage-controls {
  display: flex;
  justify-content: flex-end;
  margin: 1rem 0;
}

.coverage-controls label {
  width: min(100%, 360px);
}

.session-timer {
  min-width: 170px;
  padding: 0.8rem 1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
}
.session-timer strong { display:block; font-size:2rem; font-variant-numeric:tabular-nums; }
.session-timer small { color:var(--muted); }
.session-timer.is-running { border-color:var(--teal); }
.session-timer.is-urgent { color:var(--danger); border-color:var(--danger); animation:pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow:0 0 0 5px rgba(180,35,24,.12); } }
.session-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; margin-bottom:1rem; }
.session-summary article { padding:1rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.session-summary strong { display:block; font-size:1.7rem; }
.session-summary span { color:var(--muted); }
.task-start-panel { max-width:760px; margin:1rem auto; text-align:center; }
.accuracy-cell { display:flex; align-items:center; gap:.7rem; min-width:180px; }
.accuracy-cell .progress-bar { flex:1; }
.answer-history { display:grid; gap:.8rem; }
.answer-review { padding:1rem; border:1px solid var(--line); border-left:4px solid var(--danger); border-radius:var(--radius); background:var(--surface); }
.answer-review.is-correct { border-left-color:var(--green); }
.answer-review h3 { margin:.65rem 0; }
.impersonation-banner { display:flex; align-items:center; justify-content:center; gap:1rem; padding:.8rem; margin-bottom:1rem; border:2px solid var(--ink); background:var(--gold); border-radius:var(--radius); }
.impersonation-banner form { margin:0; }

.exam-shell { display:grid; gap:1rem; }
.exam-header { display:flex; align-items:center; justify-content:space-between; gap:1.5rem; padding:1.25rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.exam-header h1 { margin:.15rem 0; font-size:clamp(1.8rem,4vw,3rem); }
.exam-header p { margin:0; color:var(--muted); }
.exam-header-stats { display:flex; align-items:stretch; gap:.7rem; }
.exam-header-stats>div { min-width:105px; padding:.7rem 1rem; border:1px solid var(--line); border-radius:var(--radius); text-align:center; background:#fff; }
.exam-header-stats small,.exam-header-stats strong { display:block; }
.exam-header-stats strong { font-size:1.35rem; }
.exam-clock strong { font-variant-numeric:tabular-nums; color:var(--teal); }
.exam-clock.is-urgent strong { color:var(--danger); }
.exam-progress-track { height:10px; overflow:hidden; border-radius:20px; background:#e7e1d6; }
.exam-progress-track span { display:block; height:100%; background:linear-gradient(90deg,var(--teal),var(--green)); transition:width .35s ease; }
.exam-welcome { max-width:760px; margin:2rem auto; padding:2rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow); text-align:center; }
.exam-welcome ul { display:inline-grid; gap:.5rem; max-width:600px; margin:1rem auto 1.5rem; text-align:left; }
.exam-icon { display:grid; place-items:center; width:64px; height:64px; margin:0 auto 1rem; border-radius:50%; background:var(--teal); color:#fff; font-size:2rem; font-weight:900; }
.exam-primary { min-width:220px; padding:1rem 1.4rem; }
.exam-layout { position:relative; display:grid; grid-template-columns:230px minmax(0,1fr); gap:1rem; min-height:560px; }
.exam-sidebar,.exam-question-area { border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.exam-sidebar { padding:1rem; }
.exam-sidebar h2 { margin-top:0; }
.question-navigator { display:grid; grid-template-columns:repeat(4,1fr); gap:.5rem; }
.question-navigator button { aspect-ratio:1; border:1px solid var(--line); border-radius:7px; background:#fff; cursor:pointer; font-weight:800; }
.question-navigator button.is-current { border:2px solid var(--teal); color:var(--teal); }
.question-navigator button.is-answered { background:var(--green); border-color:var(--green); color:#fff; }
.exam-legend { display:grid; gap:.6rem; margin-top:1.5rem; color:var(--muted); font-size:.85rem; }
.exam-legend span { display:flex; align-items:center; gap:.5rem; }
.exam-legend i { width:15px; height:15px; border:1px solid var(--line); border-radius:4px; background:#fff; }
.exam-legend i.current { border:2px solid var(--teal); }.exam-legend i.answered { background:var(--green);border-color:var(--green); }
.exam-question-area { padding:1.25rem; }
.exam-toolbar { display:flex; justify-content:flex-end; gap:.7rem; padding-bottom:1rem; border-bottom:1px solid var(--line); }
.exam-question { padding-top:1rem; }
.question-heading { display:flex; justify-content:space-between; gap:1rem; }
.question-heading span { color:var(--muted); font-weight:700; }
.question-heading h2 { max-width:760px; font-size:1.45rem; }
.question-value { min-width:75px; padding:.6rem; border-radius:var(--radius); background:#fff3c4; text-align:center; }
.question-value strong,.question-value small { display:block; }
.question-tags { display:flex; gap:.5rem; margin:.5rem 0 1.25rem; }.question-tags span { padding:.3rem .6rem; border-radius:20px; background:var(--surface-2); font-size:.85rem; }
.exam-options { display:grid; gap:.75rem; }
.exam-options button { display:flex; align-items:center; gap:1rem; width:100%; padding:.9rem; border:1px solid var(--line); border-radius:var(--radius); background:#fff; text-align:left; cursor:pointer; }
.exam-options button:hover,.exam-options button.is-selected { border-color:var(--teal); background:var(--surface-2); }
.exam-options button span { display:grid; place-items:center; flex:0 0 36px; height:36px; border-radius:50%; background:#edf0f2; }
.exam-question-nav { display:flex; justify-content:space-between; margin-top:1.25rem; }
.pause-overlay { position:absolute; inset:0; z-index:5; display:grid; place-items:center; border:2px solid var(--teal); border-radius:var(--radius); background:rgba(247,243,234,.98); text-align:center; }.pause-overlay[hidden]{display:none}.pause-overlay>div{max-width:480px;padding:2rem}.exam-layout.is-paused .exam-sidebar,.exam-layout.is-paused .exam-question-area{visibility:hidden}
.history-filter .form-row { align-items:end; }.history-summary { margin:1rem 0;color:var(--muted); }.history-list { display:grid; gap:.75rem; }
.history-item { border:1px solid var(--line); border-left:4px solid var(--danger); border-radius:var(--radius); background:var(--surface); }.history-item.is-correct{border-left-color:var(--green)}
.history-item summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem; cursor:pointer; list-style:none; }.history-item summary::-webkit-details-marker{display:none}.history-item summary>div:first-child{display:grid;gap:.3rem}.history-item summary small{color:var(--muted)}.history-coins{white-space:nowrap;font-weight:800}.history-detail{padding:0 1rem 1rem;border-top:1px solid var(--line)}.pagination{display:flex;justify-content:center;gap:.4rem;margin:1.25rem 0;}
.wallet-hero { display:grid; grid-template-columns:1.4fr .8fr; align-items:center; gap:1.5rem; padding:clamp(1.25rem,4vw,2.5rem); border-radius:var(--radius); color:#fff; background:linear-gradient(130deg,#0b4f4a,#0f766e 60%,#15967f); box-shadow:var(--shadow); }
.wallet-hero h1 { margin:.2rem 0; font-size:clamp(2rem,5vw,3.5rem); }.wallet-hero p{max-width:650px}.wallet-rate{display:inline-block;margin-top:.8rem;padding:.55rem .8rem;border-radius:6px;background:rgba(255,255,255,.12)}
.wallet-balance-card { padding:1.3rem; border:1px solid rgba(255,255,255,.3); border-radius:var(--radius); background:rgba(255,255,255,.12); text-align:center; }.wallet-balance-card small,.wallet-balance-card span{display:block}.wallet-balance-card>strong{display:block;font-size:3.5rem;line-height:1}.wallet-balance-card div{margin-top:.7rem;font-size:1.2rem;font-weight:800;color:#fff3c4}
.wallet-breakdown { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; margin:1rem 0; }.wallet-breakdown article{display:flex;align-items:center;gap:.8rem;padding:1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}.wallet-breakdown small,.wallet-breakdown strong,.wallet-breakdown span{display:block}.wallet-breakdown span{color:var(--muted)}
.wallet-stat-icon { display:grid;place-items:center;flex:0 0 44px;height:44px;border-radius:50%;font-size:1.4rem;font-weight:900}.wallet-stat-icon.earned{background:#d9f6e8;color:var(--green)}.wallet-stat-icon.purchased{background:#dce9ff;color:var(--blue)}.wallet-stat-icon.spent{background:#fee3df;color:var(--danger)}.wallet-stat-icon.remaining{background:#fff1bd;color:#856300}.transaction-type{display:inline-block;padding:.25rem .5rem;border-radius:20px;background:var(--surface-2);font-size:.82rem;font-weight:700}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem;
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0;
}

code {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem clamp(1rem, 4vw, 2rem);
  background: rgba(255, 253, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--gold);
  font-weight: 900;
  box-shadow: 6px 6px 0 var(--gold);
}

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand small {
  color: var(--muted);
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.site-nav a,
.user-chip a {
  border-radius: var(--radius);
  padding: 0.58rem 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.site-nav a:hover,
.site-nav .is-active,
.nav-cta {
  background: var(--ink);
  color: #fff !important;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.user-chip span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero,
.dashboard-hero,
.compact-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  align-items: center;
  gap: 1.5rem;
  min-height: 420px;
  padding: clamp(1.4rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 250, 248, 0.96)),
    var(--surface);
  box-shadow: var(--shadow);
}

.compact-hero {
  min-height: auto;
  grid-template-columns: 1fr;
}

.hero h1,
.dashboard-hero h1,
.page-head h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero p,
.dashboard-hero p,
.page-head p {
  max-width: 720px;
  color: var(--muted);
}

.hero-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 10px 10px 0 var(--teal);
  transform: rotate(1deg);
}

.hero-stat {
  min-height: 110px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: #fff;
  font-weight: 900;
}

.hero-stat:nth-child(1) { background: var(--teal); }
.hero-stat:nth-child(2) { background: var(--coral); }
.hero-stat:nth-child(3) { background: var(--blue); }
.hero-stat:nth-child(4) { background: var(--ink); color: var(--gold); }

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
}

.action-row,
.quick-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0.7rem 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(23, 32, 42, 0.18);
}

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

.button.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal-dark);
}

.button.ghost {
  background: #fff;
}

.button.small {
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  font-size: 0.86rem;
}

.button.full {
  width: 100%;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.feature-grid,
.metric-grid,
.task-grid,
.product-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

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

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

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

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

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

.feature-card,
.metric-card,
.task-card,
.product-card,
.panel,
.auth-card,
.order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 32, 42, 0.08);
}

.feature-card,
.metric-card,
.task-card,
.panel,
.auth-card,
.order-card {
  padding: 1rem;
}

.feature-icon,
.subject-dot {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
}

.feature-card h2,
.panel h2,
.task-card h2,
.product-card h2 {
  margin: 0.35rem 0;
  line-height: 1.15;
  letter-spacing: 0;
}

.muted,
.metric-card small,
.mini-row small,
.product-card small,
.status-help {
  color: var(--muted);
}

.metric-card {
  min-height: 126px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong,
.limit-chip span,
.wallet-orb span {
  display: block;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.1;
}

.dashboard-hero {
  min-height: 280px;
  grid-template-columns: 1fr auto;
}

.wallet-orb,
.limit-chip {
  display: grid;
  place-items: center;
  min-width: 150px;
  min-height: 150px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  text-align: center;
  box-shadow: 8px 8px 0 var(--ink);
}

.limit-chip {
  border-radius: var(--radius);
  min-height: 100px;
  box-shadow: 6px 6px 0 rgba(23, 32, 42, 0.2);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-head {
  margin-bottom: 1rem;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 1rem;
  margin-top: 1rem;
}

.narrow {
  max-width: 720px;
  margin: 1rem auto 0;
}

.mini-list,
.cart-list,
.order-list {
  display: grid;
  gap: 0.75rem;
}

.mini-row,
.cart-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.cart-row {
  grid-template-columns: 1fr 84px auto auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #05603a;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 900;
}

.status-pill.pending,
.status-pill.assigned {
  background: #fff7e6;
  color: #9a6700;
}

.status-pill.cancelled,
.status-pill.refunded,
.status-pill.disabled,
.state.danger {
  background: #fef3f2;
  color: var(--danger);
}

.reward-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.reward-strip article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: #fff;
}

.reward-art,
.product-art {
  display: grid;
  place-items: center;
  min-height: 132px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(245, 183, 0, 0.35), rgba(15, 118, 110, 0.2)),
    #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  font-weight: 900;
  overflow: hidden;
}

.product-art img {
  width: 100%;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
  display: block;
}

.reward-art img {
  width: 100%;
  height: 100%;
  min-height: 72px;
  object-fit: cover;
  display: block;
}

.reward-art {
  min-height: 72px;
  font-size: 2rem;
}

.product-card {
  overflow: hidden;
}

.product-card h2 {
  font-size: 1.05rem;
}

.product-card .product-art {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}

.product-body {
  padding: 0.85rem;
}

.product-body p {
  min-height: 58px;
  color: var(--muted);
  font-size: 0.92rem;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.8rem 0;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
}

.product-art.large {
  min-height: 440px;
}

.product-art.large img {
  min-height: 440px;
}

.stock-line {
  margin: -0.35rem 0 0.85rem;
  color: var(--muted);
  font-weight: 800;
}

.auth-wrap {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(100%, 480px);
}

.wide-auth .auth-card {
  width: min(100%, 980px);
}

.stack-form {
  display: grid;
  gap: 0.95rem;
}

.stack-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 800;
}

.grid-form {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.grid-form > .button,
.grid-form > .state {
  grid-column: 1 / -1;
}

.form-section {
  display: grid;
  gap: 0.8rem;
}

.form-section h2 {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.check-line {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.6rem !important;
}

.check-line input {
  width: auto;
}

.state,
.flash {
  margin: 0 0 1rem;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-weight: 800;
}

.state.success,
.flash-success {
  background: #ecfdf3;
  color: #05603a;
}

.flash-info {
  background: #eff6ff;
  color: #1d4ed8;
}

.task-progress {
  margin: 1rem 0;
}

.progress-bar {
  height: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--teal);
  transition: width 0.25s ease;
}

.task-card {
  position: relative;
}

.task-card.is-done {
  background: #f7fbf9;
}

.task-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.task-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0.22rem 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}

.option-btn {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.option-btn:hover {
  border-color: var(--teal);
  background: var(--surface-2);
}

.option-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.task-result {
  margin-top: 1rem;
}

.category-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.category-row a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0.45rem 0.8rem;
  font-weight: 900;
  color: var(--muted);
}

.category-row .is-active {
  background: var(--ink);
  color: #fff;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
}

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

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-product-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 240px;
}

.admin-thumb {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  background: #fff;
}

.inline-form input[type="file"] {
  max-width: 210px;
  padding: 0.5rem;
}

.coin-form input {
  width: 130px;
}

.order-form {
  margin-top: 1rem;
}

.order-form input {
  width: min(100%, 360px);
}

.text-good {
  color: var(--green);
  font-weight: 900;
}

.text-bad {
  color: var(--danger);
  font-weight: 900;
}

.coin-pop {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  pointer-events: none;
}

.coin-pop.show {
  min-width: 180px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink);
  padding: 0.9rem 1rem;
  font-weight: 900;
  box-shadow: 6px 6px 0 var(--ink);
  animation: popin 0.35s ease;
}

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

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

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 0.7rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  .user-chip {
    justify-self: end;
  }

  .hero,
  .dashboard-hero,
  .split-grid,
  .product-detail {
    grid-template-columns: 1fr;
  }

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

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

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

@media (max-width: 640px) {
  .site-header {
    padding: 0.75rem 1rem;
  }

  .brand small,
  .user-chip span {
    display: none;
  }

  .page {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .hero,
  .dashboard-hero,
  .compact-hero {
    min-height: auto;
    padding: 1rem;
  }

  .hero-board,
  .metric-grid,
  .feature-grid,
  .product-grid,
  .task-grid,
  .option-grid,
  .reward-strip,
  .form-row {
    grid-template-columns: 1fr;
  }

  .session-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .impersonation-banner { align-items:flex-start; flex-direction:column; }
  .exam-header,.exam-header-stats { align-items:stretch; flex-direction:column; }.exam-header-stats{display:grid;grid-template-columns:repeat(3,1fr)}.exam-header-stats>div{min-width:0;padding:.5rem}.exam-layout{grid-template-columns:1fr}.exam-sidebar{order:2}.question-navigator{grid-template-columns:repeat(5,1fr)}.exam-toolbar{justify-content:space-between}.wallet-hero{grid-template-columns:1fr}.wallet-breakdown{grid-template-columns:1fr 1fr}.history-item summary{align-items:flex-start;flex-direction:column}

  .hero h1,
  .dashboard-hero h1,
  .page-head h1 {
    font-size: 2.35rem;
  }

  .wallet-orb,
  .limit-chip {
    width: 100%;
    min-height: 100px;
    border-radius: var(--radius);
  }

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

  .cart-row,
  .mini-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .inline-form,
  .coin-form input,
  .order-form input {
    width: 100%;
  }

  th,
  td {
    min-width: 120px;
  }
}

/* Kid-friendly account experience */
.auth-page {
  background:
    radial-gradient(circle at 8% 14%, rgba(245, 183, 0, .18) 0 85px, transparent 86px),
    radial-gradient(circle at 94% 72%, rgba(37, 99, 235, .12) 0 120px, transparent 121px),
    #edf8f4;
}

.auth-page .page {
  padding: 0;
}

.kid-auth {
  width: min(calc(100% - 2rem), 1100px);
  min-height: calc(100vh - 126px);
  margin: 2rem auto 3rem;
  display: grid;
  grid-template-columns: minmax(310px, .82fr) minmax(420px, 1.18fr);
  overflow: hidden;
  border: 2px solid #153b3a;
  border-radius: 28px;
  background: #fff;
  box-shadow: 12px 14px 0 rgba(15, 118, 110, .18), 0 24px 60px rgba(23, 32, 42, .14);
  animation: auth-arrive .55s cubic-bezier(.2,.8,.2,1) both;
}

.kid-auth-wide {
  width: min(calc(100% - 2rem), 1240px);
  grid-template-columns: minmax(310px, .72fr) minmax(540px, 1.28fr);
}

.auth-adventure {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1.5rem, 4vw, 3.5rem);
  color: #fff;
  background: linear-gradient(155deg, #0f766e, #0b596b);
  isolation: isolate;
}

.auth-adventure::before,
.auth-adventure::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.auth-adventure::before { width: 310px; height: 310px; left: -170px; bottom: -95px; }
.auth-adventure::after { width: 220px; height: 220px; right: -110px; top: 55px; }
.auth-adventure .eyebrow { color: #d8ffed; letter-spacing: .1em; }
.auth-adventure h1 { margin: .65rem 0 1rem; font-size: clamp(2.4rem, 4.6vw, 4.25rem); line-height: .98; letter-spacing: -.04em; }
.auth-adventure h1 span { color: #ffd24d; }
.auth-adventure > p:not(.eyebrow) { max-width: 32rem; color: #e7fffa; font-size: 1.06rem; }

.auth-mascot {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
  border: 3px solid #153b3a;
  border-radius: 24px;
  background: #ffd24d;
  color: #153b3a;
  font-size: 2.3rem;
  box-shadow: 7px 7px 0 rgba(10, 43, 48, .5);
  animation: mascot-float 3s ease-in-out infinite;
}

.adventure-steps { display: grid; gap: 1rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.adventure-steps li { display: flex; align-items: center; gap: .85rem; }
.adventure-steps b { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 12px; background: #fff; color: #0f766e; box-shadow: 3px 3px 0 #153b3a; }
.adventure-steps span { display: grid; }
.adventure-steps small { color: #c8f5ec; }
.floating-shape { position: absolute; color: #ffd24d; opacity: .9; animation: twinkle 2.4s ease-in-out infinite; }
.shape-star { right: 12%; top: 5%; font-size: 1.8rem; transform: rotate(12deg); }
.shape-coin { right: 8%; bottom: 7%; font-size: 2.2rem; animation-delay: .7s; }

.auth-form-card { padding: clamp(1.5rem, 4vw, 3.5rem); background: #fffdfa; }
.login-form-card { display: flex; flex-direction: column; justify-content: center; }
.auth-card-heading { display: flex; align-items: center; gap: 1rem; }
.auth-card-heading h2 { margin: .1rem 0 0; font-size: clamp(1.8rem, 3vw, 2.6rem); color: #153b3a; }
.auth-card-heading .eyebrow { margin: 0; color: #cf552d; }
.mini-badge { display: grid; place-items: center; flex: 0 0 54px; height: 54px; border: 2px solid #153b3a; border-radius: 17px; background: #ffb650; color: #153b3a; font-size: 1.35rem; transform: rotate(-3deg); }
.auth-intro { margin: .8rem 0 1.5rem; color: var(--muted); }
.auth-summary { display: flex; align-items: flex-start; gap: .65rem; border: 1px solid #f1a69f; }

.kid-form { display: grid; gap: 1.35rem; }
.kid-form-step { display: grid; gap: 1rem; min-width: 0; margin: 0; padding: 1.15rem; border: 1px solid #cce5df; border-radius: 18px; background: #fff; }
.kid-form-step legend { width: auto; float: none; margin: 0 0 .15rem; padding: 0 .45rem 0 0; color: #153b3a; font-size: 1.18rem; font-weight: 900; }
.kid-form-step legend span { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: .4rem; border-radius: 10px; background: #0f766e; color: #fff; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field-wrap { display: grid; align-content: start; gap: .38rem; min-width: 0; }
.field-wrap label, .field-label { color: #273f43; font-weight: 900; }
.field-wrap label i, .field-label i { margin-right: .32rem; color: #0f766e; }
.field-wrap input, .field-wrap select { min-height: 48px; border: 2px solid #b8cbc7; border-radius: 13px; background: #fff; transition: border-color .18s, box-shadow .18s, transform .18s; }
.field-wrap input:focus, .field-wrap select:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.13); transform: translateY(-1px); }
.field-hint { color: #6d7a7b; font-weight: 600; }
.field-error { color: #a12820; font-size: .9rem; font-weight: 800; animation: error-in .25s ease both; }
.field-error::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: .35rem; border-radius: 50%; background: #c7372d; color: #fff; font-size: .72rem; }
.field-wrap.has-error input, .field-wrap.has-error select, .field-wrap.has-error .subject-choice-grid { border-color: #c7372d; background-color: #fff8f7; }
.phone-control { display: grid; grid-template-columns: minmax(105px, .32fr) minmax(0, 1fr); gap: .55rem; }
.password-control { display: grid; grid-template-columns: minmax(0, 1fr) 48px; }
.password-control input { border-radius: 13px 0 0 13px; }
.password-control button { border: 2px solid #b8cbc7; border-left: 0; border-radius: 0 13px 13px 0; background: #edf8f4; color: #0f766e; cursor: pointer; }

.subject-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; padding: .2rem; border: 2px solid transparent; border-radius: 14px; }
.subject-choice { cursor: pointer; }
.subject-choice input { position: absolute; opacity: 0; pointer-events: none; }
.subject-choice span { display: flex; align-items: center; gap: .45rem; min-height: 43px; padding: .6rem .7rem; border: 2px solid #c9dad6; border-radius: 12px; background: #f8fcfb; color: #38504f; font-size: .9rem; font-weight: 800; transition: .18s ease; }
.subject-choice span i { color: #a5b8b4; }
.subject-choice input:checked + span { border-color: #0f766e; background: #ddf7ed; color: #0b5954; transform: translateY(-1px); box-shadow: 2px 3px 0 rgba(15,118,110,.2); }
.subject-choice input:checked + span i { color: #0f766e; }
.subject-choice input:focus-visible + span { outline: 3px solid rgba(37,99,235,.3); }
.permission-check { display: flex; align-items: flex-start; gap: .8rem; padding: .85rem; border-radius: 13px; background: #edf8f4; cursor: pointer; }
.permission-check input { width: 20px; height: 20px; margin-top: .2rem; accent-color: #0f766e; }
.permission-check span { display: grid; }
.permission-check small { color: #607371; }

.button.kid-primary { min-height: 58px; gap: .65rem; border: 2px solid #153b3a; border-radius: 15px; background: #ffb21f; color: #153b3a; font-size: 1.08rem; box-shadow: 6px 7px 0 #153b3a; transition: transform .18s, box-shadow .18s; }
.button.kid-primary:hover { transform: translateY(-2px); box-shadow: 6px 9px 0 #153b3a; }
.button.kid-primary:active { transform: translate(4px, 4px); box-shadow: 2px 3px 0 #153b3a; }
.button.kid-secondary { gap: .45rem; border: 2px solid #153b3a; border-radius: 13px; background: #0f766e; color: #fff; box-shadow: 4px 4px 0 #153b3a; }
.auth-switch { margin: .3rem 0 0; text-align: center; color: #657573; }
.auth-switch a, .forgot-link, .resend-link { color: #0b6761; font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.forgot-link { justify-self: end; margin-top: -.3rem; }
.signup-callout { display: grid; grid-template-columns: auto 1fr; gap: .8rem 1rem; align-items: center; margin-top: 1.6rem; padding: 1rem; border: 2px dashed #e39518; border-radius: 17px; background: #fff7d9; }
.signup-callout p { margin: .15rem 0 0; color: #5e6b68; font-size: .9rem; }
.signup-callout .button { grid-column: 1 / -1; }
.signup-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #ffd24d; color: #153b3a; font-size: 1.4rem; }
.resend-link { display: block; margin-top: 1.3rem; color: #62716f; text-align: center; font-size: .88rem; }
.login-reward-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 2.2rem; }
.login-reward-row span { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .7rem; border-radius: 10px; background: rgba(255,255,255,.13); font-weight: 800; }
.login-reward-row i { color: #ffd24d; }

@keyframes auth-arrive { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes mascot-float { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-9px) rotate(3deg); } }
@keyframes twinkle { 0%,100% { transform: scale(.9) rotate(-8deg); opacity: .65; } 50% { transform: scale(1.12) rotate(8deg); opacity: 1; } }
@keyframes error-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .kid-auth, .auth-mascot, .floating-shape, .field-error { animation: none; }
  .field-wrap input, .field-wrap select, .button { scroll-behavior: auto; transition: none; }
}

@media (max-width: 900px) {
  .kid-auth, .kid-auth-wide { grid-template-columns: 1fr; }
  .auth-adventure { padding: 2rem; }
  .auth-adventure h1 { font-size: 2.7rem; }
  .adventure-steps { grid-template-columns: repeat(3, 1fr); }
  .adventure-steps li { align-items: flex-start; }
  .adventure-steps small { display: none; }
}

@media (max-width: 650px) {
  .kid-auth, .kid-auth-wide { width: calc(100% - 1rem); margin: .7rem auto 2rem; border-radius: 20px; box-shadow: 5px 7px 0 rgba(15,118,110,.18); }
  .auth-adventure, .auth-form-card { padding: 1.25rem; }
  .auth-mascot { width: 58px; height: 58px; margin-bottom: .8rem; border-radius: 17px; font-size: 1.65rem; }
  .auth-adventure h1 { font-size: 2.25rem; }
  .adventure-steps { grid-template-columns: 1fr; margin-top: 1.2rem; }
  .adventure-steps li:nth-child(n+2) { display: none; }
  .field-grid, .subject-choice-grid { grid-template-columns: 1fr; }
  .phone-control { grid-template-columns: 108px minmax(0,1fr); }
  .kid-form-step { padding: .9rem; }
  .auth-card-heading h2 { font-size: 1.65rem; }
}
