:root {
  --shell-max: 1440px;
  --content-max: 1240px;
  --reading-max: 1160px;
  --ink: #24323a;
  --muted: #6e7b82;
  --paper: #f6f4ef;
  --panel: #fffdfa;
  --line: #dfe4e5;
  --accent: #d97850;
  --accent-dark: #bd5e3b;
  --green: #315f78;
  --lime: #e7eef1;
  --shadow: 0 18px 60px rgba(35, 57, 68, 0.10);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
  font-size: 14px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, rgba(217, 120, 80, 0.10), transparent 25rem),
    linear-gradient(rgba(49, 95, 120, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 95, 120, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 36px 36px, 36px 36px, auto;
  font-family: "Noto Sans TC", sans-serif;
}

body[data-theme="dark"] {
  --ink: #f7fafb;
  --muted: #c3cfd4;
  --paper: #18252c;
  --panel: #223139;
  --line: #52646d;
  --accent: #f0a07b;
  --accent-dark: #c97652;
  --green: #add5e5;
  --lime: #324d59;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  background: radial-gradient(circle at 80% 8%, rgba(228, 147, 111, .10), transparent 24rem), linear-gradient(rgba(238, 245, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(238, 245, 255, .025) 1px, transparent 1px), var(--paper);
}

body[data-theme="dark"] .mode-card, body[data-theme="dark"] .setup-panel, body[data-theme="dark"] .access-layout, body[data-theme="dark"] .admin-form, body[data-theme="dark"] .admin-bank, body[data-theme="dark"] .import-panel, body[data-theme="dark"] .dashboard-section, body[data-theme="dark"] .history-panel, body[data-theme="dark"] .attempt-settings-panel, body[data-theme="dark"] .category-strip, body[data-theme="dark"] .stat-card, body[data-theme="dark"] .quiz-shell, body[data-theme="dark"] .result-panel, body[data-theme="dark"] .quiz-question, body[data-theme="dark"] .score-card, body[data-theme="dark"] .wrong-section, body[data-theme="dark"] .gate-step { background: var(--panel); }
body[data-theme="dark"] .brand-mark { background: transparent; }
body[data-theme="dark"] .mode-card--primary { background: #294f63; border-color: #294f63; color: #fff; }
body[data-theme="dark"] .mode-card--primary .mode-content small { color: rgba(255,255,255,.68); }
body[data-theme="dark"] .home-feedback-button { border-color: var(--line); background: rgba(41,58,67,.58); }
body[data-theme="dark"] .home-feedback-button:hover { background: #293a43; }
body[data-theme="dark"] .access-copy { background: #294f63; color: #fff; }
body[data-theme="dark"] .access-copy .eyebrow { color: #f0a27f; }
body[data-theme="dark"] .subject-card:hover, body[data-theme="dark"] .mode-card:hover, body[data-theme="dark"] .question-row, body[data-theme="dark"] .error-row, body[data-theme="dark"] .file-drop, body[data-theme="dark"] .search-box input { background: #293a43; }
body[data-theme="dark"] .admin-tabs { background: #223139; }
body[data-theme="dark"] .admin-form input, body[data-theme="dark"] .admin-form select, body[data-theme="dark"] .admin-form textarea, body[data-theme="dark"] .category-strip select { background: #18252c; color: var(--ink); border-color: var(--line); }
body[data-theme="dark"] .segmented span, body[data-theme="dark"] .subject-tag { border-color: var(--line); }
body[data-theme="dark"] .segmented input:checked + span, body[data-theme="dark"] .admin-tab.is-active { background: var(--lime); color: var(--ink); }
body[data-theme="dark"] .footer-mark { background: transparent; }
body[data-theme="dark"] .site-footer { background: rgba(34, 49, 57, .88); }
body[data-theme="dark"] .footer-links a, body[data-theme="dark"] .footer-links button { background: #293a43; }
body[data-theme="dark"] .answer-options span, body[data-theme="dark"] .wrong-card { background: #293a43; }
body[data-theme="dark"] .quiz-nav-button--next, body[data-theme="dark"] .answer-options input:checked + span b { background: #315f78; border-color: #315f78; color: #fff; }
body[data-theme="dark"] .wrong-filters button.is-active { background: #315f78; border-color: #315f78; color: #fff; }
body[data-theme="dark"] .wrong-option.is-selected { background: #4b332d; border-color: #9c654e; }
body[data-theme="dark"] .wrong-option.is-correct { background: #294656; border-color: #577d90; }
body[data-theme="dark"] .quiet-submit:hover { background: #4b332d; }
body[data-theme="dark"] .unanswered-dialog { background: var(--panel); color: var(--ink); }
body[data-theme="dark"] .unanswered-buttons button,
body[data-theme="dark"] .unanswered-shortcut { background: #4b332d; border-color: #9c654e; }
body[data-theme="dark"] .report-dialog { background: var(--panel); color: var(--ink); }
body[data-theme="dark"] .feedback-form-grid input, body[data-theme="dark"] .feedback-form-grid select, body[data-theme="dark"] .feedback-form-grid textarea { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .pdf-buyer-email input, body[data-theme="dark"] .pdf-checkout-code-row input, body[data-theme="dark"] .pdf-purchases-dialog input { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .pdf-purchase-record, body[data-theme="dark"] .pdf-purchases-empty, body[data-theme="dark"] .pdf-purchases-guide { background: #293a43; }
body[data-theme="dark"] .report-question-context { background: #293a43; }
body[data-theme="dark"] .report-question-button { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.25); }
body[data-theme="dark"] .wrong-report-button:hover:not(:disabled) { background: #4b332d; }
body[data-theme="dark"] .exam-item { background: #293a43; color: var(--ink); border-color: var(--line); }
body[data-theme="dark"] .student-form input, body[data-theme="dark"] .student-form select { background: #18252c; color: var(--ink); border-color: var(--line); }
body[data-theme="dark"] .student-status-notice.is-pending { background: #493a25; border-color: #8d7043; color: #ffe0a3; }
body[data-theme="dark"] .student-status-notice.is-activated { background: #243f4c; border-color: #52788b; color: #d8eff8; }
body[data-theme="dark"] .demo-video { background: #18252c; }
body[data-theme="dark"] .import-subject-picker select { background: #18252c; color: var(--ink); border-color: var(--line); }
body[data-theme="dark"] .danger-action { background: #4b332d; border-color: #9c654e; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell {
  width: min(var(--shell-max), calc(100% - 64px));
  min-height: calc(100vh - 160px);
  min-height: calc(100dvh - 160px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
}

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 32, 24, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.brand-mark {
  width: 82px;
  height: 38px;
  display: grid;
  place-items: center;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #668fa4; box-shadow: 0 0 0 4px rgba(102, 143, 164, 0.14); }
.version-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 31px; min-height: 21px; padding: 2px 7px; border: 1px solid rgba(49,95,120,.2); border-radius: 99px; background: rgba(49,95,120,.07); color: var(--green); font: 700 11px "Outfit", sans-serif; letter-spacing: .05em; }

.topbar-actions { display: flex; align-items: center; gap: 18px; }

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .55);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.logout-button[hidden] { display: none; }
.logout-button:hover { color: var(--accent-dark); border-color: rgba(217,120,80,.45); background: #fff8f3; }
.logout-button i { font-size: 17px; }

body[data-theme="dark"] .logout-button { background: #293a43; }
body[data-theme="dark"] .logout-button:hover { background: #4b332d; border-color: #b85a38; color: #fff; }

#app { outline: none; }

/* Opening sequence: the page remains usable underneath while the brand mark
   establishes the visual rhythm for the first visit. */
.intro-stage {
  position: fixed;
  z-index: 20;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(244, 112, 0, .1), transparent 25rem),
    linear-gradient(145deg, #f7f4ef 0%, #eee9e2 58%, #e7e1d9 100%);
  color: #292b55;
  pointer-events: none;
  animation: intro-stage-exit 620ms 900ms cubic-bezier(.7, 0, .2, 1) both;
}

.intro-stage::before,
.intro-stage::after {
  position: absolute;
  content: "";
  width: min(72vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(36, 39, 141, .12);
  border-radius: 50%;
  transform: scale(.45);
  animation: intro-ring-in 900ms 80ms cubic-bezier(.2, .8, .2, 1) both;
}

.intro-stage::after {
  width: min(46vw, 480px);
  border-color: rgba(244, 112, 0, .26);
  animation-delay: 180ms;
}

.intro-glow {
  position: absolute;
  width: min(50vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 112, 0, .12), transparent 68%);
  filter: blur(4px);
  animation: intro-glow-in 1000ms 120ms ease both;
}

.intro-orbit {
  position: absolute;
  width: 1px;
  height: 130vh;
  background: linear-gradient(transparent, rgba(36, 39, 141, .12), transparent);
  transform: rotate(37deg) scaleY(0);
  animation: intro-orbit-in 900ms 80ms cubic-bezier(.2, .8, .2, 1) both;
}

.intro-orbit--one { left: 26%; }
.intro-orbit--two { right: 25%; transform: rotate(-37deg) scaleY(0); animation-name: intro-orbit-two-in; animation-delay: 160ms; }

.intro-lockup {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  animation: intro-lockup-in 720ms 100ms cubic-bezier(.2, .8, .2, 1) both;
}

.intro-mark {
  width: 220px;
  height: 78px;
  display: grid;
  place-items: center;
  margin-bottom: 11px;
  filter: drop-shadow(0 14px 24px rgba(58, 49, 40, .14));
}

.intro-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.intro-label { color: rgba(41, 43, 85, .58); font: 500 11px/1 "Outfit", sans-serif; letter-spacing: .38em; margin-left: .38em; }
.intro-rule { width: 0; height: 2px; margin-top: 15px; border-radius: 99px; background: #f47000; animation: intro-rule-in 520ms 480ms ease both; }

body.is-intro .topbar { animation: intro-content-in 720ms 360ms cubic-bezier(.2, .8, .2, 1) both; }
body.is-intro #app > .view-enter { animation: intro-content-in 820ms 420ms cubic-bezier(.2, .8, .2, 1) both; }
body.is-intro .site-footer { animation: intro-footer-in 720ms 600ms cubic-bezier(.2, .8, .2, 1) both; }

@keyframes intro-stage-exit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.035); visibility: hidden; }
}

@keyframes intro-ring-in {
  from { opacity: 0; transform: scale(.45); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes intro-glow-in { from { opacity: 0; transform: scale(.72); } to { opacity: 1; transform: scale(1); } }
@keyframes intro-orbit-in { from { opacity: 0; transform: rotate(37deg) scaleY(0); } to { opacity: 1; transform: rotate(37deg) scaleY(1); } }
@keyframes intro-orbit-two-in { from { opacity: 0; transform: rotate(-37deg) scaleY(0); } to { opacity: 1; transform: rotate(-37deg) scaleY(1); } }
@keyframes intro-lockup-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes intro-rule-in { from { width: 0; } to { width: 48px; } }
@keyframes intro-content-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes intro-footer-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.home-view {
  width: min(var(--content-max), 100%);
  min-height: clamp(680px, calc(100vh - 120px), 820px);
  min-height: clamp(680px, calc(100dvh - 120px), 820px);
  margin: 0 auto;
  padding: 58px 0 42px;
  display: grid;
  grid-template-columns: minmax(400px, .86fr) minmax(520px, 1.14fr);
  grid-template-rows: 1fr auto;
  gap: 36px clamp(56px, 7vw, 96px);
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.eyebrow span { display: block; width: 24px; height: 3px; background: var(--accent); border-radius: 99px; }

.hero-copy h1 {
  margin: 26px 0 22px;
  font-size: clamp(48px, 5.2vw, 76px);
  line-height: 1.12;
  letter-spacing: -0.055em;
}

.hero-copy h1 > span, .hero-copy h1 em { display: block; white-space: nowrap; }
.hero-copy h1 em { font-style: normal; color: var(--accent); }
.hero-copy > p { margin: 0; color: var(--muted); font-size: 16px; letter-spacing: 0.03em; }

.mode-grid { width: 100%; display: grid; gap: 14px; }

.mode-card {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 138px;
  padding: 25px 28px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 24px 24px 24px 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 30px rgba(23, 32, 24, 0.04);
  cursor: pointer;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.mode-card:hover { transform: translateY(-3px); border-color: #c2c9be; box-shadow: var(--shadow); }
.mode-card--primary { background: var(--green); border-color: var(--green); color: #fff; }
.mode-card--primary:hover { border-color: var(--green); }

.mode-number { position: absolute; top: 15px; right: 20px; font: 600 14px "Outfit", sans-serif; opacity: 0.42; letter-spacing: 0.08em; }
.mode-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px 18px 18px 5px; background: #edf3f5; color: #315f78; }
.mode-icon--key { background: #f8e8df; color: var(--accent-dark); }
.mode-icon--combo { background: #fff1d6; color: #a66b13; }
.mode-icon i { font-size: 29px; }
.mode-content { display: flex; flex-direction: column; gap: 7px; }
.mode-content strong { font-size: 21px; letter-spacing: 0.02em; }
.mode-content small { color: var(--muted); font-size: 14px; }
.mode-card--primary .mode-content small { color: rgba(255,255,255,0.65); }
.arrow { font-size: 30px; transform: rotate(-45deg); transition: transform 180ms ease; }
.mode-card:hover .arrow { transform: rotate(-45deg) translateX(4px); }
.home-feedback-button { min-height: 54px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 10px 15px; border: 1px dashed #c9d1ce; border-radius: 13px 13px 13px 5px; background: rgba(255,255,255,.42); color: var(--muted); text-align: left; cursor: pointer; transition: 160ms ease; }
.home-feedback-button:hover { border-color: var(--green); background: rgba(255,255,255,.8); color: var(--green); }
.home-feedback-button > i:first-child { font-size: 21px; }
.home-feedback-button > i:last-child { font-size: 19px; }
.home-feedback-button span { min-width: 0; display: grid; gap: 2px; }
.home-feedback-button strong { color: var(--ink); font-size: 14px; }
.home-feedback-button small { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.home-pdf-purchases-button { border-style: solid; border-color: rgba(49,95,120,.25); }

/* Community review */
.collaboration-view { width: min(var(--reading-max), 100%); min-width: 0; margin: 0 auto; padding: 38px 0 72px; }
.collaboration-hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 40px; margin-top: 38px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.collaboration-hero > *, .collaboration-toolbar > *, .collaboration-list, .case-main, .case-footer > *, .case-dialog-header > div, .case-context, .case-discussion { min-width: 0; }
.collaboration-hero h2 { margin: 16px 0 10px; font-size: clamp(38px, 5vw, 58px); line-height: 1.05; letter-spacing: -.045em; }
.collaboration-hero > div:first-child > p { margin: 0; color: var(--muted); font-size: 16px; }
.collaboration-summary { display: grid; grid-template-columns: repeat(3, minmax(92px, 1fr)); gap: 8px; }
.collaboration-summary > div { min-width: 104px; padding: 16px 18px 15px; border: 1px solid var(--line); border-radius: 14px 14px 14px 5px; background: rgba(255,255,255,.64); }
.collaboration-summary strong, .collaboration-summary span { display: block; }
.collaboration-summary strong { color: var(--green); font: 700 25px "Outfit", sans-serif; }
.collaboration-summary span { margin-top: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.collaboration-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.collaboration-filters { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.55); }
.collaboration-filters button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.collaboration-filters button.is-active { background: var(--green); color: #fff; box-shadow: 0 5px 14px rgba(49,95,120,.18); }
.collaboration-rule { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.collaboration-rule i { color: #518269; font-size: 17px; }
.collaboration-list { display: grid; gap: 12px; }
.collaboration-case h3,
.collaboration-case blockquote,
.case-option-summary > span,
.case-dialog h3,
.case-context-meta,
.case-question,
.case-question-options span,
.case-report-reason p,
.case-comment p,
.case-comment-form > div > span { overflow-wrap: anywhere; word-break: break-word; }
.collaboration-case { position: relative; display: grid; grid-template-columns: 72px 1fr auto; align-items: stretch; min-height: 192px; border: 1px solid var(--line); border-radius: 20px 20px 20px 7px; background: rgba(255,253,250,.9); box-shadow: 0 8px 30px rgba(35,57,68,.045); overflow: hidden; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.collaboration-case:hover { transform: translateY(-2px); border-color: #bdc9cc; box-shadow: 0 16px 44px rgba(35,57,68,.09); }
.collaboration-case.is-leading::before { position: absolute; content: ""; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.case-rank { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-right: 1px solid var(--line); color: #a5afb3; }
.case-rank small { font: 700 9px "Outfit", sans-serif; letter-spacing: .13em; }
.case-rank strong { color: var(--green); font: 700 24px "Outfit", sans-serif; }
.case-main { min-width: 0; padding: 25px 26px 21px; }
.case-topline { display: flex; align-items: center; gap: 8px 10px; color: var(--muted); font-size: 12px; }
.case-topline > * { min-width: 0; }
.case-topline time { margin-left: auto; white-space: nowrap; }
.case-meta { flex: 1 1 260px; overflow-wrap: anywhere; line-height: 1.55; }
.case-type { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.case-type--answer { background: #f9e9e1; color: #a75031; }
.case-type--wording { background: #e8f0f4; color: #315f78; }
.case-type--display { background: #eee9f6; color: #675287; }
.case-overdue-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 23px; padding: 3px 8px; border-radius: 6px; background: #fff0d8; color: #9b641e; font-size: 11px; font-weight: 700; white-space: nowrap; }
.case-main h3 { margin: 16px 0 10px; font-size: 17px; line-height: 1.65; letter-spacing: .01em; }
.case-option-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 13px; }
.case-option-summary > span { min-width: 0; display: flex; align-items: flex-start; gap: 7px; padding: 7px 9px; border-radius: 7px; background: var(--lime); color: var(--muted); font-size: 12px; line-height: 1.45; }
.case-option-summary b { flex: 0 0 auto; color: var(--green); font: 700 11px "Outfit", sans-serif; }
.case-option-summary > span.is-correct { background: color-mix(in srgb, var(--green) 12%, var(--panel)); color: var(--text); }
.case-option-summary > span > span { min-width: 0; flex: 1; }
.case-option-summary em { flex: 0 0 auto; color: var(--green); font-style: normal; font-weight: 700; white-space: nowrap; }
.case-main blockquote { margin: 0; padding-left: 13px; border-left: 2px solid #e6b39d; color: var(--muted); font-size: 14px; line-height: 1.65; }
.case-ai-preview { margin-top: 14px; padding: 12px 14px; border: 1px solid #cdded5; border-radius: 10px; background: #f5faf7; }
.case-ai-preview > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.case-ai-preview > div span { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; font-weight: 700; }
.case-ai-preview > div i { font-size: 15px; }
.case-ai-preview em { padding: 3px 7px; border-radius: 99px; background: #e4f2e9; color: var(--green); font-size: 10px; font-style: normal; font-weight: 700; white-space: nowrap; }
.case-ai-preview p { margin: 8px 0 5px; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.6; }
.case-ai-preview small { color: var(--muted); font-size: 11px; }
.case-ai-preview.is-incorrect, .case-ai-preview.is-ambiguous { border-color: #ead2bf; background: #fff9f3; }
.case-ai-preview.is-incorrect em, .case-ai-preview.is-ambiguous em { background: #f8e7d9; color: #a75031; }
.case-ai-preview.is-pending, .case-ai-preview.is-insufficient { border-color: var(--line); background: rgba(231,238,241,.3); }
.case-ai-preview.is-pending em, .case-ai-preview.is-insufficient em { background: #edf1f2; color: var(--muted); }
.case-ai-preview.is-pending p { color: var(--muted); font-weight: 400; }
.case-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(223,228,229,.78); }
.case-author { display: flex; align-items: center; gap: 8px; min-width: 0; }
.case-author > span { color: var(--muted); font-size: 12px; }
.case-user { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink); font-size: 12px; text-decoration: none; }
.case-user b { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.case-user img, .case-user--anonymous > i { width: 25px; height: 25px; border-radius: 50%; }
.case-user img { object-fit: cover; background: var(--lime); }
.case-user--anonymous > i { display: grid; place-items: center; background: var(--lime); color: var(--green); font-size: 15px; }
.case-signals { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; color: var(--muted); font-size: 12px; }
.case-signals span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.case-signals i { font-size: 15px; }
.case-signals .case-impact { color: var(--accent-dark); font-weight: 600; }
.case-open { width: 126px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-left: 1px solid var(--line); background: rgba(231,238,241,.52); color: var(--green); font-weight: 700; white-space: nowrap; cursor: pointer; transition: color 160ms ease, background 160ms ease; }
.case-open i { font-size: 22px; transition: transform 160ms ease; }
.case-open:hover { background: var(--green); color: #fff; }
.case-open:hover i { transform: translateX(3px); }
.collaboration-loading { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); }
.collaboration-loading i { font-size: 20px; }
.collaboration-empty { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 42px; border: 1px dashed #cad2d4; border-radius: 20px; background: rgba(255,255,255,.45); text-align: center; }
.collaboration-empty > i { margin-bottom: 14px; color: #5d8b73; font-size: 42px; }
.collaboration-empty strong { font-size: 18px; }
.collaboration-empty p { max-width: 440px; margin: 8px 0 20px; color: var(--muted); line-height: 1.7; }
.collaboration-empty button { min-height: 40px; padding: 8px 16px; border: 0; border-radius: 9px; background: var(--green); color: #fff; cursor: pointer; }
.collaboration-empty--error > i { color: var(--accent); }
.collaboration-empty--paused > i { color: #87949a; }
.collaboration-top {
  --collaboration-top-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  z-index: 10;
  right: max(calc(8px + env(safe-area-inset-right, 0px)), calc(50vw - 650px + env(safe-area-inset-right, 0px)));
  bottom: var(--collaboration-top-bottom);
  width: 54px;
  height: 54px;
  display: grid;
  place-content: center;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(49,95,120,.16);
  border-radius: 50%;
  background: rgba(255,253,250,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--green);
  box-shadow: 0 5px 18px rgba(35,57,68,.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(.96);
  pointer-events: none;
  cursor: pointer;
  transition: bottom 180ms ease, opacity 160ms ease, visibility 160ms ease, transform 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.collaboration-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.collaboration-top:hover { color: var(--accent-dark); border-color: rgba(217,120,80,.32); box-shadow: 0 7px 22px rgba(35,57,68,.18); transform: translateY(-2px); }
.collaboration-top:active { transform: translateY(0) scale(.97); }
.collaboration-top i { height: 19px; font-size: 21px; line-height: 19px; }
.collaboration-top span { font: 700 9px/1 "Outfit", sans-serif; letter-spacing: .07em; }

.collaboration-admin-control { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 25px 28px; border: 1px solid #b9d1c3; border-radius: 18px 18px 18px 6px; background: linear-gradient(135deg, #f7fbf8, #eef6f1); }
.collaboration-admin-control.is-disabled { border-color: var(--line); background: #f2f3f1; }
.collaboration-admin-state { display: flex; align-items: center; gap: 17px; }
.collaboration-admin-icon { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px 15px 15px 5px; background: #dcece2; color: #42775a; }
.collaboration-admin-icon i { font-size: 26px; }
.collaboration-admin-control.is-disabled .collaboration-admin-icon { background: #e1e4e3; color: #7f898e; }
.collaboration-admin-state small { color: #5c8b6d; font: 700 10px "Outfit", sans-serif; letter-spacing: .13em; }
.collaboration-admin-state h3 { margin: 5px 0 3px; font-size: 19px; }
.collaboration-admin-state p { margin: 0; color: var(--muted); font-size: 13px; }
.collaboration-switch { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; cursor: pointer; }
.collaboration-switch input { position: absolute; opacity: 0; pointer-events: none; }
.collaboration-switch > span { position: relative; width: 52px; height: 29px; border-radius: 99px; background: #b7c0bd; transition: background 160ms ease; }
.collaboration-switch > span::after { position: absolute; content: ""; top: 4px; left: 4px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform 160ms ease; }
.collaboration-switch input:checked + span { background: #4f8a67; }
.collaboration-switch input:checked + span::after { transform: translateX(23px); }
.collaboration-switch input:focus-visible + span { outline: 3px solid rgba(217,120,80,.28); outline-offset: 2px; }
.collaboration-switch input:disabled + span { opacity: .55; }
.collaboration-switch b { min-width: 46px; font-size: 13px; }
.collaboration-admin-message { min-height: 20px; margin: 7px 3px 0; }
.collaboration-admin-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 13px; }
.collaboration-admin-stats > div { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.collaboration-admin-stats i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--lime); color: var(--green); font-size: 19px; }
.collaboration-admin-stats span { color: var(--muted); font-size: 13px; }
.collaboration-admin-stats strong { font: 700 25px "Outfit", sans-serif; }
.collaboration-archive-panel { margin-top: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 17px 17px 17px 6px; background: var(--panel); }
.collaboration-archive-list { display: grid; gap: 11px; margin-top: 18px; }
.collaboration-archive-row { padding: 20px 21px; border: 1px solid var(--line); border-radius: 13px 13px 13px 5px; background: var(--paper); }
.collaboration-archive-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.collaboration-archive-top > span { display: inline-flex; align-items: center; gap: 6px; color: #4c8061; font-size: 12px; font-weight: 700; }
.collaboration-archive-top > span.is-overdue { color: #a25c2d; }
.collaboration-archive-top time { color: var(--muted); font-size: 11px; }
.collaboration-archive-meta { margin-top: 12px; color: var(--green); font-size: 12px; font-weight: 700; }
.collaboration-archive-row h4 { margin: 8px 0 10px; font-size: 15px; line-height: 1.65; }
.collaboration-archive-row blockquote { margin: 10px 0 0; padding-left: 12px; border-left: 2px solid #e1ad96; color: var(--muted); font-size: 13px; line-height: 1.65; }
.collaboration-archive-footer { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.collaboration-archive-footer span { display: inline-flex; align-items: center; gap: 5px; }
.collaboration-archive-footer button { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid #9fc3ad; border-radius: 7px; background: #eef7f1; color: #397252; font-size: 11px; font-weight: 700; cursor: pointer; }
.collaboration-case-actions { display: inline-flex !important; align-items: center; gap: 7px !important; margin-left: auto; }
.collaboration-case-actions button { margin-left: 0; }
.collaboration-case-actions button.is-close { border-color: #d7b49f; background: #fff5ef; color: #985a38; }
.collaboration-case-actions button:disabled { opacity: .58; cursor: wait; }
.collaboration-archive-row.is-closed .collaboration-archive-top > span { color: #8a654f; }
.collaboration-no-history { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.collaboration-weekly-history { margin-top: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.collaboration-weekly-history summary { padding: 10px 12px; color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; }
.collaboration-weekly-history > div { display: grid; gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.collaboration-weekly-history section { display: grid; grid-template-columns: 100px 72px 72px 1fr; align-items: center; gap: 9px; padding: 10px 12px; background: var(--panel); font-size: 11px; }
.collaboration-weekly-history section strong { color: var(--ink); }
.collaboration-weekly-history section span { color: var(--green); }
.collaboration-weekly-history section small { color: var(--muted); line-height: 1.5; }

.case-dialog { width: min(1120px, calc(100% - 48px)); height: min(780px, calc(100vh - 48px)); height: min(780px, calc(100dvh - 48px)); max-height: none; padding: 0; border: 0; border-radius: 22px 22px 22px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 26px 110px rgba(18,30,35,.32); overflow: hidden; }
.case-dialog::backdrop { background: rgba(18,29,34,.62); backdrop-filter: blur(4px); }
.case-dialog-shell { width: 100%; max-width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.case-dialog-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 30px 20px; border-bottom: 1px solid var(--line); }
.case-dialog-header h3 { margin: 7px 0 0; font-size: 23px; line-height: 1.35; }
.case-dialog-header > button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--lime); color: var(--muted); cursor: pointer; }
.case-dialog-header > button i { display: block; font-size: 21px; line-height: 1; }
.case-status { display: inline-flex; align-items: center; gap: 6px; color: #518269; font-size: 12px; font-weight: 700; }
.case-status i { font-size: 14px; }
.case-dialog-body { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.case-context, .case-discussion { min-height: 100%; padding: 28px 30px 32px; overflow: visible; }
.case-context { border-right: 1px solid var(--line); background: rgba(231,238,241,.24); }
.case-context-meta { color: var(--green); font-size: 12px; font-weight: 700; line-height: 1.6; }
.case-section-label { margin: 22px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.case-question { margin: 8px 0 22px; font-size: 17px; font-weight: 600; line-height: 1.8; }
.case-question-options { display: grid; gap: 8px; margin: -7px 0 22px; }
.case-question-options[hidden] { display: none; }
.case-question-options > div { width: 100%; min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-size: 13px; line-height: 1.6; }
.case-question-options b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: var(--lime); color: var(--green); font: 700 12px "Outfit", sans-serif; }
.case-question-options span { min-width: 0; padding-top: 3px; }
.case-question-options > div.is-correct { grid-template-columns: 30px minmax(0, 1fr) auto; border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: color-mix(in srgb, var(--green) 8%, var(--panel)); }
.case-question-options em { align-self: center; color: var(--green); font-style: normal; font-weight: 700; white-space: nowrap; }
.case-report-reason { padding: 18px; border: 1px solid #ead6cc; border-radius: 12px 12px 12px 4px; background: #fff8f4; }
.case-report-reason > span { color: var(--accent-dark); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.case-report-reason > p { margin: 10px 0 16px; line-height: 1.75; }
.case-report-reason > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.case-report-reason time { color: var(--muted); font-size: 11px; }
.case-ai-review { margin-top: 14px; padding: 16px 17px; border: 1px solid #cdded5; border-radius: 12px; background: #f5faf7; }
.case-ai-review[hidden] { display: none; }
.case-ai-review-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.case-ai-review-heading > span { display: inline-flex; align-items: center; gap: 7px; color: var(--green); }
.case-ai-review-heading i { font-size: 17px; }
.case-ai-review-heading b { font-size: 12px; letter-spacing: .04em; }
.case-ai-review-heading em { padding: 3px 8px; border-radius: 99px; background: #e4f2e9; color: var(--green); font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.case-ai-review.is-incorrect, .case-ai-review.is-ambiguous { border-color: #ead2bf; background: #fff9f3; }
.case-ai-review.is-incorrect .case-ai-review-heading em, .case-ai-review.is-ambiguous .case-ai-review-heading em { background: #f8e7d9; color: #a75031; }
.case-ai-review.is-insufficient, .case-ai-review.is-error { border-color: var(--line); background: var(--panel); }
.case-ai-review.is-insufficient .case-ai-review-heading em, .case-ai-review.is-error .case-ai-review-heading em { background: #edf1f2; color: var(--muted); }
.case-ai-review-content > strong { display: block; color: var(--ink); font-size: 14px; line-height: 1.55; }
.case-ai-review-content > p { margin: 7px 0 11px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.case-ai-review-content > p a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.case-ai-review-content > div { display: flex; flex-wrap: wrap; gap: 6px; }
.case-ai-review-content > div span { padding: 3px 7px; border-radius: 6px; background: rgba(48, 104, 79, .08); color: var(--green); font-size: 11px; font-weight: 700; }
.case-ai-review-content > small { display: flex; align-items: flex-start; gap: 5px; margin-top: 11px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.case-ai-review-loading, .case-ai-review-error { display: flex; align-items: center; gap: 7px; margin: 0 !important; }
.admin-ai-block { min-width: 0; }
.admin-ai-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
.admin-ai-actions button { min-height: 36px; }
.admin-ai-actions button:disabled { opacity: .65; cursor: wait; }
.question-ai-panel { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.question-ai-toolbar, .question-ai-controls, .question-ai-item-head, .question-ai-item-actions, .question-ai-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.question-ai-toolbar, .question-ai-item-head { justify-content: space-between; }
.question-ai-toolbar h3 { margin: 0 0 5px; }
.question-ai-toolbar span, .question-ai-item-head span, .question-ai-item-actions small { color: var(--muted); }
.question-ai-controls select { max-width: 230px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.question-ai-controls button { min-height: 38px; }
.question-ai-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.question-ai-summary-card { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 15px 17px; border: 1px solid var(--line); border-left: 4px solid #a75031; border-radius: 10px; background: var(--panel); }
.question-ai-summary-card span { color: var(--muted); font-size: 13px; }
.question-ai-summary-card strong { font: 700 26px "Outfit", sans-serif; font-variant-numeric: tabular-nums; }
.question-ai-summary-card.is-correct { border-left-color: #4b8b64; }
.question-ai-summary-card.is-ambiguous { border-left-color: #d99738; }
.question-ai-summary-card.is-insufficient { border-left-color: #82939c; }
@media (max-width: 760px) { .question-ai-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.question-ai-item { padding: 17px 0; border-top: 1px solid var(--line); }
.question-ai-item > p { margin: 9px 0; line-height: 1.6; }
.question-ai-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.question-ai-verdict { padding: 3px 8px; border-radius: 99px; background: #e4f2e9; color: var(--green); font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.question-ai-verdict.is-incorrect, .question-ai-verdict.is-ambiguous { background: #f8e7d9; color: #a75031; }
.question-ai-verdict.is-insufficient { background: #edf1f2; color: #677780; }
body[data-theme="dark"] .question-ai-verdict { background: #354d3d; color: #b6d8bb; }
body[data-theme="dark"] .question-ai-verdict.is-incorrect, body[data-theme="dark"] .question-ai-verdict.is-ambiguous { background: #594333; color: #f1c39f; }
body[data-theme="dark"] .question-ai-verdict.is-insufficient { background: #35434b; color: #b6c5cb; }
.question-ai-item .admin-ai-review { margin: 10px 0; }
.question-ai-item-actions { margin-top: 10px; }
.question-ai-pagination { justify-content: center; padding: 18px 0 4px; }
.question-ai-pagination button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.question-ai-pagination button:disabled { opacity: .45; cursor: default; }
.admin-ai-status { color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.admin-ai-status.is-error { color: var(--accent-dark); }
.admin-ai-review { min-width: 0; }
.admin-ai-review > summary { margin: 0; cursor: pointer; list-style: none; }
.admin-ai-review > summary::-webkit-details-marker { display: none; }
.admin-ai-review > summary > span { flex: 1; min-width: 0; }
.admin-ai-review > summary::after { content: ""; flex: 0 0 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.admin-ai-review[open] > summary { margin-bottom: 11px; }
.admin-ai-review[open] > summary::after { transform: rotate(225deg); }
.admin-ai-review > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 3px; }
.admin-ai-review .case-ai-review-content { overflow-wrap: anywhere; }
.admin-ai-review .case-ai-review-content > p { white-space: pre-wrap; }
.admin-ai-empty, .admin-ai-report-reason { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.admin-ai-edit { margin-top: 10px; }
#question-editor-ai { margin-bottom: 16px; }
.case-support-button { width: 100%; min-height: 47px; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; border: 1px solid var(--green); border-radius: 10px; background: transparent; color: var(--green); font-weight: 700; cursor: pointer; }
.case-support-button strong { min-width: 23px; padding: 2px 6px; border-radius: 99px; background: var(--lime); font: 700 12px "Outfit", sans-serif; }
.case-support-button.is-supported { background: var(--green); color: #fff; }
.case-support-button.is-supported strong { background: rgba(255,255,255,.18); }
.case-support-button:disabled { opacity: .6; cursor: wait; }
.case-discussion { display: flex; flex-direction: column; }
.case-discussion-heading { display: flex; align-items: baseline; justify-content: space-between; }
.case-discussion-heading h4 { margin: 0; font-size: 18px; }
.case-discussion-heading span { color: var(--muted); font-size: 12px; }
.case-comments { flex: 1 1 auto; min-height: 150px; margin: 17px 0; overflow: visible; }
.case-comments-empty { height: 100%; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.case-comments-empty i { font-size: 31px; color: #98abb4; }
.case-comments-empty p { max-width: 280px; margin: 10px 0 0; line-height: 1.6; }
.case-comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.case-comment:first-child { padding-top: 0; }
.case-comment > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.case-comment time { color: var(--muted); font-size: 11px; }
.case-comment > div time { margin-left: auto; }
.case-comment-stance { padding: 3px 7px; border-radius: 5px; background: var(--lime); color: var(--green); font-size: 10px; font-weight: 700; }
.case-comment-stance--support { background: #e5f1e9; color: #397252; }
.case-comment-stance--keep { background: #f4e9e4; color: #985339; }
.case-comment-stance--source { background: #e7eff4; color: #315f78; }
.case-comment-stance--rewrite { background: #eee9f6; color: #675287; }
.case-comment > p { margin: 9px 0 0 32px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.case-comment-form { flex: 0 0 auto; padding-top: 17px; border-top: 1px solid var(--line); }
.case-comment-form label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.case-stance-picker { width: 100%; min-width: 0; min-inline-size: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 13px; padding: 0; border: 0; }
.case-stance-picker legend { width: 100%; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.case-stance-picker label { margin: 0; cursor: pointer; }
.case-stance-picker input { position: absolute; opacity: 0; pointer-events: none; }
.case-stance-picker span { display: inline-flex; min-height: 30px; align-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 11px; }
.case-stance-picker input:checked + span { border-color: var(--green); background: var(--green); color: #fff; }
.case-comment-form textarea { width: 100%; max-width: 100%; resize: vertical; min-height: 80px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); line-height: 1.6; }
.case-comment-limit { display: flex; align-items: center; gap: 6px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.case-comment-limit i { color: #518269; font-size: 14px; }
.case-comment-form > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 9px; }
.case-comment-form > div > span { color: var(--accent-dark); font-size: 12px; }
.case-comment-form button { min-height: 39px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font-weight: 700; cursor: pointer; }
.case-comment-form button:disabled { opacity: .6; }

body[data-theme="dark"] .collaboration-summary > div,
body[data-theme="dark"] .collaboration-filters,
body[data-theme="dark"] .collaboration-case,
body[data-theme="dark"] .collaboration-empty { background: var(--panel); }
body[data-theme="dark"] .collaboration-top { background: rgba(34,49,57,.9); border-color: rgba(255,255,255,.14); box-shadow: 0 5px 18px rgba(0,0,0,.3); }
body[data-theme="dark"] .case-open { background: #293a43; }
body[data-theme="dark"] .case-open:hover { background: #315f78; }
body[data-theme="dark"] .case-report-reason { background: #3a302c; border-color: #765243; }
body[data-theme="dark"] .case-ai-review { background: #283a33; border-color: #466855; }
body[data-theme="dark"] .case-ai-review.is-incorrect,
body[data-theme="dark"] .case-ai-review.is-ambiguous { background: #3a332d; border-color: #765c47; }
body[data-theme="dark"] .case-ai-review.is-insufficient,
body[data-theme="dark"] .case-ai-review.is-error { background: #293a43; border-color: #48606a; }
body[data-theme="dark"] .case-ai-preview { background: #283a33; border-color: #466855; }
body[data-theme="dark"] .case-ai-preview.is-incorrect,
body[data-theme="dark"] .case-ai-preview.is-ambiguous { background: #3a332d; border-color: #765c47; }
body[data-theme="dark"] .case-ai-preview.is-pending,
body[data-theme="dark"] .case-ai-preview.is-insufficient { background: #293a43; border-color: #48606a; }
body[data-theme="dark"] .case-comment-form textarea { background: #18252c; }
body[data-theme="dark"] .case-question-options > div { background: #293a43; }
body[data-theme="dark"] .case-type--answer { background: #4b332d; color: #ffc1a5; }
body[data-theme="dark"] .case-type--wording { background: #294656; color: #d8eff8; }
body[data-theme="dark"] .case-type--display { background: #3b334c; color: #dfd4f1; }
body[data-theme="dark"] .case-comment-stance--support { background: #294537; color: #c8ead4; }
body[data-theme="dark"] .case-comment-stance--keep { background: #4b332d; color: #ffc1a5; }
body[data-theme="dark"] .case-comment-stance--source { background: #294656; color: #d8eff8; }
body[data-theme="dark"] .case-comment-stance--rewrite { background: #3b334c; color: #dfd4f1; }
body[data-theme="dark"] .case-overdue-badge { background: #493a25; color: #ffe0a3; }
body[data-theme="dark"] .collaboration-admin-control { background: #243a31; border-color: #456653; }
body[data-theme="dark"] .collaboration-admin-control.is-disabled { background: #29343a; border-color: var(--line); }
body[data-theme="dark"] .collaboration-admin-stats > div,
body[data-theme="dark"] .collaboration-archive-panel { background: var(--panel); }
body[data-theme="dark"] .collaboration-archive-row { background: #293a43; }
body[data-theme="dark"] .collaboration-archive-footer button { background: #294537; border-color: #456653; color: #c8ead4; }
body[data-theme="dark"] .collaboration-case-actions button.is-close { background: #49352e; border-color: #725447; color: #f4c5ac; }

.home-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; line-height: 1.8; letter-spacing: 0.08em; }
.home-note p { margin: 0; }
.note-line { display: block; width: 64px; height: 1px; background: #b7beb3; }

.seo-faq {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(230px, .7fr) minmax(0, 1.3fr);
  gap: clamp(32px, 6vw, 76px);
  margin-top: 22px;
  padding: 42px 0 14px;
  border-top: 1px solid var(--line);
}
.seo-faq-heading > span { color: var(--accent-dark); font: 700 11px "Outfit", sans-serif; letter-spacing: .16em; }
.seo-faq-heading h2 { margin: 10px 0 9px; font-size: clamp(24px, 3vw, 34px); line-height: 1.25; letter-spacing: -.025em; }
.seo-faq-heading p { margin: 0; color: var(--muted); line-height: 1.7; }
.seo-faq-list { display: grid; gap: 8px; }
.seo-faq-list details { border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; background: rgba(255,255,255,.52); }
.seo-faq-list summary { position: relative; padding: 15px 46px 15px 17px; font-weight: 600; line-height: 1.55; cursor: pointer; list-style: none; }
.seo-faq-list summary::-webkit-details-marker { display: none; }
.seo-faq-list summary::after { position: absolute; top: 50%; right: 17px; content: "+"; color: var(--green); font: 500 22px/1 "Outfit", sans-serif; transform: translateY(-50%); }
.seo-faq-list details[open] summary::after { content: "−"; }
.seo-faq-list p { margin: 0; padding: 0 17px 16px; color: var(--muted); line-height: 1.8; }
body[data-theme="dark"] .seo-faq-list details { background: rgba(41,58,67,.58); }

.site-footer { width: min(var(--shell-max), calc(100% - 64px)); display: grid; grid-template-columns: 240px 1fr; align-items: center; gap: 24px 42px; margin: 24px auto 28px; padding: 28px 32px 18px; border: 1px solid var(--line); border-radius: 22px 22px 22px 7px; background: rgba(255, 253, 250, .82); box-shadow: 0 14px 44px rgba(35,57,68,.06); color: var(--muted); backdrop-filter: blur(10px); }
.footer-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.footer-brand > span:last-child { display: grid; gap: 3px; }
.footer-brand strong { font-size: 14px; }
.footer-brand small { color: var(--muted); font: 600 10px "Outfit", sans-serif; letter-spacing: .08em; white-space: nowrap; }
.footer-mark { width: 68px; height: 36px; display: grid; place-items: center; }
.footer-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.footer-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.footer-links a, .footer-links button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.55); color: var(--muted); font-size: 14px; text-decoration: none; cursor: pointer; transition: color 150ms ease, border-color 150ms ease, background 150ms ease; }
.footer-links a:hover, .footer-links button:hover { color: var(--accent-dark); border-color: rgba(217,120,80,.45); background: #fff8f3; }
.footer-links i { color: var(--green); font-size: 16px; }
.footer-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; padding-top: 15px; border-top: 1px solid var(--line); color: #96a1a6; font-size: 14px; }

.guide-dialog { width: min(760px, calc(100% - 28px)); max-height: min(760px, calc(100vh - 32px)); max-height: min(760px, calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); overflow: auto; padding: 0; border: 0; border-radius: 20px 20px 20px 6px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 100px rgba(0,0,0,.28); }
.guide-dialog::backdrop { background: rgba(16, 25, 18, .55); backdrop-filter: blur(3px); }
.guide-dialog-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 30px 34px 22px; border-bottom: 1px solid var(--line); }
.guide-dialog-header h2 { margin: 10px 0 0; font-size: 25px; }
.guide-dialog-header > button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #e9ede7; color: var(--muted); cursor: pointer; }
.guide-dialog-header > button i { font-size: 20px; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 26px 34px 34px; }
.guide-grid > div { padding: 21px 20px 20px; border: 1px solid var(--line); border-radius: 12px; }
.guide-grid > div:last-child { grid-column: 1 / -1; }
.guide-grid i { color: var(--accent); font-size: 23px; }
.guide-grid strong { display: block; margin-top: 12px; font-size: 15px; line-height: 1.45; }
.guide-grid p { margin: 9px 0 0; color: var(--muted); font-size: 15px; line-height: 1.9; letter-spacing: 0.015em; }
.guide-support dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 17px 0 0; }
.guide-support dl > div { min-height: 68px; padding: 13px 14px; border-radius: 9px; background: var(--lime); }
.guide-support dt { color: var(--muted); font-size: 13px; line-height: 1.4; }
.guide-support dd { margin: 6px 0 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.contact-support-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 12px; border: 1px solid var(--green); border-radius: 9px; background: transparent; color: var(--green); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.contact-support-button:hover { background: var(--lime); }
.contact-support-button i { color: inherit; font-size: 17px; }
.guide-support .contact-support-button, .pdf-purchases-guide .contact-support-button { margin-top: 12px; }
.pdf-purchase-notice .contact-support-button { margin: 0 0 10px; }

.sponsor-dialog { width: min(620px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 20px 20px 20px 6px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 100px rgba(0,0,0,.28); }
.sponsor-dialog::backdrop { background: rgba(16, 25, 18, .55); backdrop-filter: blur(3px); }
.sponsor-dialog-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 30px 34px 22px; border-bottom: 1px solid var(--line); }
.sponsor-dialog-header h2 { margin: 10px 0 0; font-size: 25px; }
.sponsor-dialog-header > button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #e9ede7; color: var(--muted); cursor: pointer; }
.sponsor-dialog-header > button i { font-size: 20px; }
.sponsor-dialog-body { display: grid; grid-template-columns: 240px 1fr; align-items: center; gap: 34px; padding: 30px 34px 34px; }
.sponsor-qr-placeholder { width: 220px; aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 8px; padding: 12px; border: 1px dashed #b9c3c4; border-radius: 14px; background: #fff; color: var(--green); text-align: center; }
.sponsor-qr-image { display: block; width: 100%; max-width: 196px; aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }
.sponsor-qr-caption { font-weight: 700; }
.sponsor-copy { display: grid; justify-items: start; gap: 13px; }
.sponsor-heart { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px 14px 14px 4px; background: #f8e8df; color: var(--accent-dark); font-size: 25px; }
.sponsor-copy p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.9; }
.sponsor-copy small { color: var(--accent-dark); font-weight: 600; }
body[data-theme="dark"] .sponsor-dialog-header > button { background: #344852; color: #d8e3e7; }
body[data-theme="dark"] .sponsor-qr-placeholder { border-color: #667982; background: #f8faf9; }

.updates-dialog { width: min(760px, calc(100% - 28px)); max-height: min(760px, calc(100vh - 32px)); max-height: min(760px, calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); overflow: auto; padding: 0; border: 0; border-radius: 20px 20px 20px 6px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 100px rgba(0,0,0,.28); }
.updates-dialog::backdrop { background: rgba(16, 25, 18, .55); backdrop-filter: blur(3px); }
.updates-dialog-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 30px 34px 22px; border-bottom: 1px solid var(--line); }
.updates-dialog-header h2 { margin: 10px 0 0; font-size: 25px; }
.updates-dialog-header > button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #e9ede7; color: var(--muted); cursor: pointer; }
.updates-dialog-header > button i { font-size: 20px; }
.updates-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 34px 0; }
.updates-toolbar strong { color: var(--ink); font-size: 14px; }
.updates-toolbar button { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 7px 12px; border: 0; border-radius: 8px; background: #315f78; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.updates-toolbar button i { font-size: 18px; }
.updates-form { display: grid; gap: 14px; margin: 18px 34px 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.updates-form[hidden], .updates-form .updates-current-choice[hidden] { display: none; }
.updates-form h3 { margin: 0; font-size: 17px; }
.updates-form-row { display: grid; grid-template-columns: minmax(120px, .5fr) minmax(0, 1fr); gap: 12px; }
.updates-form label { display: grid; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 700; }
.updates-form label small { color: var(--muted); font-weight: 400; }
.updates-form input:not([type="checkbox"]), .updates-form textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-weight: 400; }
.updates-form textarea { resize: vertical; line-height: 1.6; }
.updates-form .updates-current-choice { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.updates-form-actions { display: flex; gap: 9px; }
.updates-form-actions button { min-height: 40px; }
.updates-message { margin: 0; padding: 0 34px; color: var(--accent-dark); font-size: 13px; line-height: 1.6; }
.updates-message:empty { display: none; }
.updates-list { display: grid; gap: 12px; padding: 25px 34px 32px; }
.updates-status { margin: 0; padding: 14px 0; color: var(--muted); font-size: 14px; }
.update-item { display: grid; grid-template-columns: 106px 1fr; gap: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 14px 14px 14px 5px; background: rgba(255,255,255,.42); }
.update-item--latest { border-color: rgba(217,120,80,.35); }
.update-version { display: grid; align-content: start; gap: 8px; }
.update-version strong { color: var(--accent-dark); font: 700 25px/1 "Outfit", sans-serif; letter-spacing: .03em; }
.update-version span { width: fit-content; padding: 4px 8px; border-radius: 5px; background: #f8e8df; color: var(--accent-dark); font-size: 12px; }
.update-content h3 { margin: 0; font-size: 18px; }
.update-detail-group { margin-top: 16px; }
.update-detail-group h4 { margin: 0 0 7px; color: var(--green); font-size: 13px; font-weight: 700; }
.update-detail-group ul { display: grid; gap: 7px; margin: 0; padding-left: 20px; color: var(--ink); font-size: 14px; line-height: 1.65; }
.update-detail-group li::marker { color: var(--accent); }
.update-history-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }
.update-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.update-actions button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--green); font: inherit; font-size: 12px; cursor: pointer; }
.update-actions button:hover { border-color: var(--green); }
.update-actions button[data-update-action="delete"] { margin-left: auto; color: var(--accent-dark); }
body[data-theme="dark"] .updates-dialog-header > button { background: #344852; color: #d8e3e7; }
body[data-theme="dark"] .update-item { background: rgba(255,255,255,.04); }
body[data-theme="dark"] .update-version span { background: #4b332d; color: #f4b194; }
body[data-theme="dark"] .version-badge { border-color: rgba(173,213,229,.28); background: rgba(173,213,229,.1); }

.content-view, .setup-view, .access-view { padding: 42px 0 70px; }
.content-view { width: min(var(--content-max), 100%); margin: 0 auto; }
.setup-view { width: min(900px, 100%); margin: 0 auto; }
.access-view { width: min(var(--content-max), 100%); margin: 0 auto; }
.back-button { display: inline-flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 9px 2px; color: var(--muted); font-size: 14px; cursor: pointer; }
.back-button i { font-size: 19px; transition: transform 160ms ease; }
.back-button:hover i { transform: translateX(-3px); }

.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 46px 0 30px; }
.section-heading h2, .access-copy h2 { margin: 14px 0 0; font-size: clamp(36px, 5vw, 58px); letter-spacing: -0.045em; }
.section-heading > p { color: var(--muted); font-size: 14px; }

.subject-list { border-top: 1px solid var(--ink); }
.subject-card {
  position: relative;
  width: 100%;
  min-height: 105px;
  display: grid;
  grid-template-columns: 70px 1fr auto 60px;
  align-items: center;
  gap: 20px;
  padding: 16px 18px 16px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, padding 180ms ease;
}

.subject-card:hover { background: #fff; padding-left: 18px; }
.subject-card.subject-card--maintenance,
.subject-card.subject-card--maintenance:hover {
  padding-left: 6px;
  background: rgba(110, 123, 130, .055);
  cursor: not-allowed;
}
.subject-card--maintenance > .subject-index,
.subject-card--maintenance > .subject-title,
.subject-card--maintenance .subject-attempts,
.subject-card--maintenance > .subject-arrow { opacity: .38; }
.subject-card.subject-card--maintenance > .subject-arrow,
.subject-card.subject-card--maintenance:hover > .subject-arrow {
  background: rgba(110, 123, 130, .12);
  color: var(--muted);
  transform: none;
}
.subject-maintenance-watermark {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 61%;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 190px;
  padding: 7px 20px 6px;
  border: 2px solid rgba(154,72,47,.2);
  border-radius: 7px;
  color: rgba(145,70,47,.27);
  background: rgba(246,244,239,.5);
  box-shadow: inset 0 0 0 2px rgba(154,72,47,.045);
  transform: translate(-50%, -50%) rotate(-4deg);
  pointer-events: none;
}
.subject-maintenance-watermark b { font: 800 22px/1.1 "Noto Sans TC", sans-serif; letter-spacing: .3em; text-indent: .3em; }
.subject-maintenance-watermark small { font: 700 8px/1.2 "Outfit", sans-serif; letter-spacing: .24em; text-indent: .24em; }
.subject-index { color: #939a91; font: 600 14px "Outfit", sans-serif; letter-spacing: 0.1em; }
.subject-title { font-size: clamp(18px, 2.4vw, 25px); font-weight: 600; letter-spacing: 0.02em; }
.bank-update-date { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.catalog-update-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.subject-meta { display: inline-flex; align-items: center; justify-self: end; gap: 8px; }
.subject-attempts { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 99px; background: rgba(49,95,120,.08); color: var(--green); font-size: 13px; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.subject-attempts > i { color: var(--accent); font-size: 16px; }
.subject-attempts strong { color: var(--green); font: 700 15px "Outfit", sans-serif; font-variant-numeric: tabular-nums; }
.attempt-label-mobile { display: none; }
.subject-tag { padding: 6px 10px; border: 1px solid #cfd4cc; border-radius: 99px; color: var(--muted); font: 600 14px "Outfit", sans-serif; letter-spacing: 0.1em; }
.subject-tag--updated, .catalog-front-status--updated {
  position: absolute;
  z-index: 2;
  top: -10px;
  left: 12px;
  padding: 4px 9px;
  border: 2px solid var(--panel);
  border-radius: 7px 7px 7px 2px;
  background: #e53935;
  color: #fff;
  box-shadow: 0 4px 10px rgba(181, 35, 31, .24);
  font: 800 11px/1.2 "Outfit", sans-serif;
  letter-spacing: .12em;
  transform: rotate(-2deg);
}
.subject-tag--maintenance, .catalog-front-status--maintenance { border-color: rgba(184,91,58,.3); background: rgba(184,91,58,.1); color: #9a482f; letter-spacing: .04em; }
.subject-arrow { width: 42px; height: 42px; display: grid; place-items: center; justify-self: end; border-radius: 50%; background: #e9ece6; font-size: 19px; transition: color 180ms ease, background 180ms ease, transform 180ms ease; }
.subject-arrow i { font-size: 22px; }
.subject-card:hover .subject-arrow { background: var(--accent); color: #fff; transform: translateX(4px); }
.mobile-break { display: none; }

.setup-panel { width: min(760px, 100%); margin: 28px auto 0; padding: clamp(32px, 4vw, 52px); background: #fff; border: 1px solid var(--line); border-radius: 30px 30px 30px 10px; box-shadow: var(--shadow); }
.setup-title-row { display: flex; align-items: center; justify-content: flex-end; }
.setup-step { color: var(--muted); font-size: 14px; }
.setup-panel h2 { margin: 20px 0 10px; font-size: clamp(30px, 4vw, 45px); letter-spacing: -0.04em; }
.setup-description { margin: 0 0 30px; color: var(--muted); line-height: 1.7; }

.exam-list { display: grid; gap: 12px; }
.exam-item {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  background: #fafbf8;
}
.exam-item-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--green); color: var(--lime); font: 700 14px "Outfit", sans-serif; }
.exam-item h3 { margin: 0 0 9px; font-size: 19px; }
.exam-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 9px; }
.exam-title-row h3 { margin: 0; }
.catalog-front-status { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border: 1px solid; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.2; }
.exam-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 14px; }
.exam-meta span { display: inline-flex; align-items: center; gap: 6px; }
.exam-meta i { font-size: 17px; color: var(--green); }
.exam-action { min-width: 112px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 0; border-radius: 10px 10px 10px 4px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; transition: 160ms ease; }
.exam-action:hover { background: var(--accent-dark); transform: translateY(-1px); }
.exam-action i { font-size: 19px; }
.exam-item--locked { background: #f1f3ef; color: #8a9088; }
.exam-item--locked .exam-item-number { background: #dfe3dc; color: #747b72; }
.exam-item--locked .exam-meta, .exam-item--locked .exam-meta i { color: #969c94; }
.exam-action:disabled { background: #d4d9d1; color: #7f867d; cursor: not-allowed; transform: none; }
.sequence-note { display: flex; align-items: center; gap: 7px; margin: 4px 4px 0; color: var(--muted); font-size: 14px; }
.sequence-note i { color: var(--accent); font-size: 16px; }

.quiz-view, .result-view { width: min(var(--reading-max), 100%); margin: 0 auto; padding: 32px 0 70px; }
.quiz-shell, .result-panel { overflow: hidden; margin-top: 20px; border: 1px solid var(--line); border-radius: 26px 26px 26px 8px; background: var(--panel); box-shadow: var(--shadow); }
.quiz-header { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 30px 34px; background: var(--green); color: #fff; }
.quiz-kicker, .result-kicker { display: block; margin-bottom: 7px; color: rgba(255,255,255,.72); font-size: 14px; letter-spacing: .08em; }
.quiz-header h2 { margin: 0; font-size: clamp(26px, 4vw, 40px); }
.quiz-header p { margin: 8px 0 0; color: rgba(255,255,255,.66); font-size: 14px; }
.quiz-header-actions { display: flex; align-items: stretch; gap: 9px; }
.report-question-button { min-height: 56px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid #b83d3d; border-radius: 12px; background: #c94c4c; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: 150ms ease; }
.report-question-button:hover:not(:disabled) { background: #a93636; border-color: #8f2d2d; }
.report-question-button i { font-size: 18px; }
.report-question-button.is-reported { color: #d6e4e8; cursor: not-allowed; }
.report-question-button:disabled { opacity: .72; }
.timer-card { min-width: 155px; padding: 14px 18px; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; background: rgba(255,255,255,.10); text-align: center; }
.timer-card span { display: flex; align-items: center; justify-content: center; gap: 5px; color: rgba(255,255,255,.7); font-size: 14px; }
.timer-card strong { display: block; margin-top: 5px; font: 700 27px "Outfit", sans-serif; letter-spacing: .04em; }
.timer-card.is-urgent { border-color: #ffc2aa; background: rgba(217,120,80,.28); }
.quiz-progress { height: 5px; background: #e7ebec; }
.quiz-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 200ms ease; }
.quiz-questions { display: grid; gap: 14px; padding: 28px 34px 16px; }
.quiz-question { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: 16px 16px 16px 5px; background: #fff; }
.quiz-question--single { min-height: 285px; animation: question-in 180ms ease both; }
@keyframes question-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
.question-heading { display: flex; align-items: center; gap: 8px; padding-right: 142px; }
.question-heading span { color: var(--accent-dark); font-size: 14px; font-weight: 700; }
.question-heading small { color: var(--muted); font-size: 14px; }
.question-unanswered-tag { width: fit-content; display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; padding: 6px 10px; border: 1px solid #e2ad97; border-radius: 7px; background: #fff4ef; color: var(--accent-dark); font-size: 14px; font-weight: 700; }
.question-unanswered-tag i { font-size: 17px; }
body[data-theme="dark"] .question-unanswered-tag { border-color: #9c654e; background: #4b332d; color: #f4b194; }
.question-text-row { margin: 14px 0 20px; }
.quiz-question h3 { flex: 1; margin: 0; font-size: 18px; line-height: 1.65; }
.quiz-question .report-question-button { position: absolute; top: 14px; right: 14px; min-height: 38px; padding: 0 10px; border-radius: 8px; font-size: 14px; }
.quiz-question .report-question-button i { font-size: 16px; }
.answer-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.answer-options label { cursor: pointer; }
.answer-options input { position: absolute; opacity: 0; pointer-events: none; }
.answer-options span { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; color: var(--muted); font-size: 14px; transition: 150ms ease; }
.answer-options span b { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 7px; background: var(--lime); color: var(--green); font: 700 14px "Outfit", sans-serif; }
.answer-options label:hover span { border-color: #9bafb9; color: var(--ink); }
.answer-options input:checked + span { border-color: var(--green); background: var(--lime); color: var(--ink); box-shadow: 0 0 0 2px rgba(49,95,120,.08); }
.answer-options input:checked + span b { background: var(--green); color: #fff; }
.answer-options input:focus-visible + span { outline: 3px solid rgba(217,120,80,.2); }
.quiz-navigation { display: grid; grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr); align-items: center; gap: 12px; padding: 10px 34px 4px; }
.quiz-navigation > span { color: var(--muted); font: 600 14px "Outfit", sans-serif; text-align: center; }
.quiz-nav-button { width: 100%; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--green); font-size: 14px; font-weight: 600; cursor: pointer; }
.quiz-nav-button--next { background: var(--green); border-color: var(--green); color: #fff; }
.quiz-nav-button i { font-size: 19px; }
.quiz-nav-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); }
.quiz-nav-button--next:hover:not(:disabled) { background: var(--accent); color: #fff; }
.quiz-nav-button:disabled { opacity: .36; cursor: not-allowed; }
.quiz-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 34px 30px; }
.quiz-submit-row > span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.unanswered-shortcut { min-height: 42px; margin-left: auto; padding: 0 12px; border: 1px solid #e2ad97; border-radius: 9px; background: #fff4ef; color: var(--accent-dark); font-size: 14px; font-weight: 600; cursor: pointer; }
.unanswered-shortcut:hover { background: #f8e8df; }
.unanswered-shortcut[hidden] { display: none; }
.quiz-submit { width: auto; min-width: 220px; padding: 0 24px; white-space: nowrap; }
.quiz-submit[hidden] { display: none; }
.unanswered-dialog { width: min(430px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; padding: 28px; border: 0; border-radius: 20px 20px 20px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 90px rgba(24,37,44,.28); text-align: center; }
.unanswered-dialog::backdrop { background: rgba(24,37,44,.55); backdrop-filter: blur(3px); }
.unanswered-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 15px 15px 15px 5px; background: #f8e8df; color: var(--accent-dark); }
.unanswered-icon i { font-size: 27px; }
.unanswered-dialog h3 { margin: 0; font-size: 21px; }
.unanswered-dialog > p { margin: 7px 0 17px; color: var(--muted); font-size: 14px; }
.unanswered-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.unanswered-buttons button { min-width: 72px; min-height: 38px; padding: 0 11px; border: 1px solid #e2ad97; border-radius: 8px; background: #fff4ef; color: var(--accent-dark); font-size: 14px; font-weight: 600; cursor: pointer; }
.unanswered-buttons button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.unanswered-continue { width: 100%; min-height: 46px; margin-top: 22px; }
.quiet-submit { min-height: 46px; border: 0; border-radius: 10px 10px 10px 4px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.quiet-submit:hover { color: var(--accent-dark); background: #f8e8df; }

.exit-dialog { width: min(410px, calc(100% - 28px)); padding: 30px; border: 0; border-radius: 20px 20px 20px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 90px rgba(24,37,44,.28); text-align: center; }
.exit-dialog::backdrop { background: rgba(24,37,44,.55); backdrop-filter: blur(3px); }
.exit-dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 15px 15px 15px 5px; background: #f8e8df; color: var(--accent-dark); }
.exit-dialog-icon i { font-size: 27px; }
.exit-dialog h3 { margin: 0; font-size: 21px; }
.exit-dialog > p { margin: 7px 0 20px; color: var(--muted); font-size: 14px; }
.exit-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exit-dialog-actions .secondary-action, .exit-dialog-actions .quiet-submit { min-height: 46px; }
body[data-theme="dark"] .exit-dialog { background: var(--panel); color: var(--ink); }
body[data-theme="dark"] .exit-dialog-icon { background: #4b332d; }

.report-dialog { width: min(700px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 20px 20px 20px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 100px rgba(0,0,0,.28); }
.report-dialog::backdrop { background: rgba(24,37,44,.55); backdrop-filter: blur(3px); }
.report-dialog form { padding: 28px; }
.report-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.report-dialog-header h3 { margin: 10px 0 0; font-size: 24px; }
.report-dialog-header > button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #e9ede7; color: var(--muted); cursor: pointer; }
.report-dialog-header > button i { font-size: 20px; }
.report-question-context { display: grid; gap: 8px; margin: 22px 0 16px; padding: 13px 15px; border-radius: 10px; background: #f2f5f4; color: var(--muted); font-size: 14px; line-height: 1.7; }
.report-context-label { color: var(--ink); font-size: 14px; }
.report-context-question { color: var(--ink); }
.report-question-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 3px; }
.report-question-option { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.report-question-option b { width: 23px; height: 23px; flex: 0 0 23px; display: grid; place-items: center; border-radius: 6px; background: var(--lime); color: var(--green); font: 700 14px "Outfit", sans-serif; }
.report-question-option span { overflow-wrap: anywhere; }
.report-reason-field { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.report-reason-field textarea { width: 100%; min-width: 0; min-height: 120px; padding: 11px 12px; border: 1px solid #cfd6d8; border-radius: 9px; background: #fff; color: var(--ink); outline: none; resize: vertical; font: inherit; font-size: 16px; line-height: 1.55; }
.report-reason-field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.report-dialog .form-message { min-height: 20px; margin: 10px 0 0; }
.report-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.report-dialog-actions .secondary-action, .report-dialog-actions .primary-action { min-height: 48px; }
.feedback-dialog { width: min(620px, calc(100% - 28px)); }
.feedback-dialog-intro { margin: 18px 0; color: var(--muted); font-size: 14px; }
.student-data-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pdf-purchases-guide { margin: 18px 0; padding: 15px 17px; border-radius: 12px; background: #f2f5f4; }
.pdf-purchases-guide > strong { display: block; margin-bottom: 8px; font-size: 14px; }
.pdf-purchases-guide ol { display: grid; gap: 5px; margin: 0; padding-left: 21px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.pdf-purchases-guide p { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.pdf-purchases-guide p i { flex: 0 0 auto; margin-top: 1px; color: var(--accent); font-size: 16px; }
.feedback-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feedback-form-grid label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.feedback-form-grid input, .feedback-form-grid select, .feedback-form-grid textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #cfd6d8; border-radius: 9px; background: #fff; color: var(--ink); outline: none; }
.feedback-form-grid input, .feedback-form-grid select { min-height: 44px; }
.feedback-form-grid textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.feedback-form-grid input:focus, .feedback-form-grid select:focus, .feedback-form-grid textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.pdf-purchases-dialog .pdf-purchases-dialog-inner { padding: 28px; }
.pdf-purchases-dialog form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 0; }
.pdf-purchases-dialog form[hidden] { display: none; }
.pdf-purchases-dialog form + form { margin-top: 12px; }
.pdf-purchases-dialog form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.pdf-purchases-dialog input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 11px; border: 1px solid #cfd6d8; border-radius: 9px; background: #fff; color: var(--ink); outline: none; }
.pdf-purchases-dialog input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.pdf-purchases-dialog form .primary-action { min-height: 44px; white-space: nowrap; }
.pdf-purchases-code-actions { display: flex; gap: 8px; }
.pdf-purchases-code-actions .secondary-action, .pdf-purchases-code-actions .primary-action { width: auto; min-height: 44px; white-space: nowrap; }
.pdf-purchases-list { display: grid; gap: 9px; max-height: min(390px, 46vh); margin-top: 12px; overflow-y: auto; }
.pdf-purchase-record { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f7f8f6; }
.pdf-purchase-record > div { min-width: 0; display: grid; gap: 3px; }
.pdf-purchase-record strong, .pdf-purchase-record small { overflow-wrap: anywhere; }
.pdf-purchase-record small { color: var(--muted); font-size: 11px; }
.pdf-purchase-record > span { color: var(--green); font-weight: 700; white-space: nowrap; }
.pdf-purchase-record button { min-height: 38px; padding: 0 12px; white-space: nowrap; }
.pdf-purchase-record.is-expired { opacity: .66; }
.pdf-purchases-empty { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 90px; border-radius: 12px; background: #f7f8f6; color: var(--muted); }
.pdf-purchases-empty i { font-size: 24px; }
.feedback-message-field { grid-column: 1 / -1; }

.mobile-status-dialog { width: min(460px, calc(100% - 28px)); padding: 32px; border: 0; border-radius: 22px 22px 22px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 90px rgba(24,37,44,.28); text-align: center; }
.mobile-status-dialog::backdrop { background: rgba(24,37,44,.55); backdrop-filter: blur(3px); }
.mobile-status-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 17px 17px 17px 5px; background: #f8e8df; color: var(--accent-dark); }
.mobile-status-icon i { font-size: 30px; }
.mobile-status-icon.is-success { background: #e4f0f3; color: var(--green); }
.mobile-status-icon.is-failed { background: #f8e8df; color: var(--accent-dark); }
.mobile-status-kicker { color: var(--muted); font: 600 14px "Outfit", sans-serif; letter-spacing: .08em; }
.mobile-status-dialog h3 { margin: 10px 0 8px; font-size: 22px; line-height: 1.45; }
.mobile-status-dialog > p { margin: 0 auto 22px; max-width: 330px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.mobile-status-dialog .primary-action { min-height: 48px; }
body[data-theme="dark"] .mobile-status-dialog { background: var(--panel); color: var(--ink); }
body[data-theme="dark"] .mobile-status-icon { background: #4b332d; }
body[data-theme="dark"] .mobile-status-icon.is-success { background: #294656; }

.registration-reminder-dialog { width: min(460px, calc(100% - 28px)); padding: 32px; border: 0; border-radius: 22px 22px 22px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 90px rgba(24,37,44,.28); text-align: center; }
.registration-reminder-dialog::backdrop { background: rgba(24,37,44,.55); backdrop-filter: blur(3px); }
.registration-reminder-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 17px 17px 17px 5px; background: #e4f0f3; color: var(--green); }
.registration-reminder-icon i { font-size: 30px; }
.registration-reminder-kicker { color: var(--muted); font: 600 14px "Outfit", sans-serif; letter-spacing: .08em; }
.registration-reminder-dialog h3 { margin: 10px 0 10px; font-size: 24px; line-height: 1.45; }
.registration-reminder-dialog > p { margin: 0 auto 22px; max-width: 350px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.registration-reminder-dialog > p strong { color: var(--ink); font-weight: 700; }
.registration-reminder-emphasis { color: #c94c4c; font-weight: 800; }
.registration-reminder-dialog .primary-action { min-height: 48px; min-width: 150px; }
body[data-theme="dark"] .registration-reminder-dialog { background: var(--panel); color: var(--ink); }
body[data-theme="dark"] .registration-reminder-icon { background: #294656; }
body[data-theme="dark"] .registration-reminder-emphasis { color: #f08d8d; }

.result-panel { padding: clamp(24px, 4vw, 44px); }
.result-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.result-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px 17px 17px 5px; background: var(--green); color: #fff; }
.result-icon i { font-size: 29px; }
.result-kicker { margin-bottom: 5px; color: var(--accent-dark); }
.result-hero h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.result-hero p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.total-score { min-width: 108px; text-align: center; }
.total-score strong { display: block; color: var(--accent); font: 700 48px "Outfit", sans-serif; line-height: 1; }
.total-score span { color: var(--muted); font-size: 14px; }
.section-scores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0; }
.score-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.score-card > span { color: #9ca7ac; font: 600 14px "Outfit", sans-serif; }
.score-card strong, .score-card small { display: block; }
.score-card strong { font-size: 14px; }
.score-card small { margin-top: 3px; color: var(--muted); font-size: 14px; }
.score-card > b { color: var(--green); font: 700 30px "Outfit", sans-serif; }
.score-card > b em { margin-left: 2px; color: var(--muted); font: normal 14px "Noto Sans TC", sans-serif; }
.wrong-section { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.wrong-disclaimer { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.wrong-filters { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 14px; }
.wrong-filters:empty { display: none; }
.wrong-filters button { min-height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.wrong-filters button:hover { border-color: var(--green); color: var(--green); }
.wrong-filters button.is-active { border-color: var(--green); background: var(--green); color: #fff; }
.wrong-list { display: grid; gap: 10px; padding-top: 15px; }
.wrong-card { padding: 17px; border-radius: 11px; background: #faf9f6; }
.wrong-card-title { display: flex; justify-content: space-between; color: var(--accent-dark); font-size: 14px; font-weight: 600; }
.wrong-card-title i { font-size: 18px; }
.wrong-card h4 { margin: 9px 0 12px; font-size: 14px; line-height: 1.6; }
.wrong-card p { margin: 5px 0; color: var(--muted); font-size: 14px; }
.wrong-card p b { color: var(--ink); }
.wrong-card .correct-answer { color: var(--green); }
.unanswered-note { display: flex; align-items: center; gap: 5px; color: var(--accent-dark) !important; }
.wrong-options { display: grid; gap: 7px; margin-top: 12px; }
.wrong-option { min-height: 42px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 14px; }
.wrong-option > b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: var(--lime); color: var(--green); font: 700 14px "Outfit", sans-serif; }
.wrong-option em { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-style: normal; white-space: nowrap; }
.wrong-option em i { font-size: 14px; }
.wrong-option.is-selected { border-color: #e2ad97; background: #fff2ec; color: var(--accent-dark); }
.wrong-option.is-selected > b { background: var(--accent); color: #fff; }
.wrong-option.is-correct { border-color: #9bb7c5; background: #eef4f6; color: var(--green); }
.wrong-option.is-correct > b { background: var(--green); color: #fff; }
.wrong-card > small { display: flex; gap: 6px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.6; }
.wrong-card > small i { color: var(--accent); font-size: 16px; }
.wrong-card > .case-ai-review { margin-top: 12px; }
.wrong-card .case-ai-review-content > p { margin: 7px 0 11px; font-size: 13px; line-height: 1.7; }
.wrong-report-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; padding: 0 12px; border: 1px solid #cf8c8c; border-radius: 8px; background: transparent; color: #a93636; font-size: 13px; font-weight: 700; cursor: pointer; }
.wrong-report-button:hover:not(:disabled) { border-color: #a93636; background: #fff2f0; }
.wrong-report-button.is-reported { border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.wrong-report-button i { font-size: 16px; }
.perfect-result { display: flex; flex-direction: column; align-items: center; padding: 35px 10px; color: var(--muted); }
.perfect-result i { color: var(--green); font-size: 40px; }
.perfect-result strong { margin: 8px 0 3px; color: var(--ink); }
.perfect-result span { font-size: 14px; }
.result-review-notice { display: flex; align-items: flex-start; gap: 9px; margin: 20px 0 0; padding: 13px 15px; border: 1px solid #cbdfe6; border-radius: 10px; background: #eef4f6; color: var(--green); font-size: 14px; line-height: 1.6; }
.result-review-notice[hidden] { display: none; }
.result-review-notice i { flex: 0 0 auto; margin-top: 2px; font-size: 19px; }
body[data-theme="dark"] .result-review-notice { border-color: #42697a; background: #29424e; color: #d3e8f0; }
.result-actions { display: grid; grid-template-columns: .65fr 1.35fr; gap: 10px; margin-top: 20px; }
.result-actions.is-single { grid-template-columns: 1fr; }
.pdf-offer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; margin-top: 0; padding: 18px; border: 1px solid #c9ddcf; border-radius: 16px 16px 16px 6px; background: linear-gradient(135deg, #f1f8f3, #fff); }
.pdf-offer[hidden] { display: none; }
.pdf-offer:not([hidden]) ~ .wrong-section { margin-top: 18px; }
.pdf-offer-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px 13px 13px 4px; background: var(--green); color: #fff; }
.pdf-offer-icon i { font-size: 26px; }
.pdf-offer-copy { min-width: 0; }
.pdf-offer-copy strong, .pdf-offer-copy p, .pdf-offer-copy small { display: block; }
.pdf-offer-copy strong { font-size: 16px; }
.pdf-offer-copy p { margin: 4px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.pdf-offer-copy small { color: var(--green); font-weight: 700; }
.pdf-plan-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.pdf-plan-options label { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.pdf-plan-options label[hidden] { display: none; }
.pdf-plan-options label:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.pdf-plan-options label:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.pdf-plan-options input { accent-color: var(--green); }
.pdf-plan-options b, .pdf-plan-options small { display: block; }
.pdf-plan-options b { font-size: 12px; }
.pdf-plan-options small { margin-top: 3px; font-size: 11px; }
#pdf-ai-availability { display: block; margin: 6px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
#pdf-ai-availability[hidden] { display: none; }
.pdf-preview-trigger { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; margin-top: 8px; padding: 5px 10px; border: 1px solid var(--green); border-radius: 8px; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; }
.pdf-preview-trigger:hover { background: var(--lime); }
.pdf-preview-trigger i { font-size: 17px; }
.pdf-preview-dialog { width: min(690px, calc(100% - 24px)); max-height: min(92vh, 920px); overflow-y: auto; }
.pdf-preview-dialog-inner { padding: 24px; }
.pdf-preview-dialog .report-dialog-header { margin-bottom: 18px; }
.pdf-preview-dialog .report-dialog-header h3 { margin: 0; }
.pdf-preview-dialog .report-dialog-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pdf-preview-page { position: relative; box-sizing: border-box; width: min(100%, 595px); min-height: 660px; margin: 0 auto; padding: 46px 46px 55px; border: 1px solid #dfe5e2; background: #fff; color: #243740; box-shadow: 0 8px 28px rgba(35,57,68,.11); font-family: "Noto Sans TC", sans-serif; }
.pdf-preview-page::before { content: ""; position: absolute; top: 50%; left: 50%; width: min(50%, 250px); aspect-ratio: 1000 / 352; transform: translate(-50%, -50%); background: url("../images/LOGO1-PNG.png") center / contain no-repeat; opacity: .1; pointer-events: none; }
.pdf-preview-page > * { position: relative; z-index: 1; }
.pdf-preview-page h4, .pdf-preview-page h5, .pdf-preview-page p { margin: 0; }
.pdf-preview-page h4 { font-size: 19px; font-weight: 600; text-align: center; line-height: 1.45; }
.pdf-preview-subject { margin: 6px 0 24px; color: #56676f; font-size: 11px; text-align: center; }
.pdf-preview-summary { padding: 12px 14px; border-radius: 7px; background: #f1f8f3; color: #243740; font-size: 12px; }
.pdf-preview-meta { margin-top: 11px; color: #56676f; font-size: 9.5px; }
.pdf-preview-page h5 { margin: 27px 0 13px; font-size: 14px; font-weight: 600; }
.pdf-preview-page h5 small { display: block; margin-top: 4px; color: #56676f; font-size: 9.5px; font-weight: 400; }
.pdf-preview-question { margin-bottom: 18px; padding: 11px 0 4px; border-top: 1px solid #dfe5e2; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.pdf-preview-question > strong { font-size: 10px; font-weight: 600; }
.pdf-preview-question .pdf-preview-stem { margin-top: 6px; color: #243740; font-size: 11px; line-height: 1.7; }
.pdf-preview-question ul { display: grid; gap: 5px; margin: 9px 0 0; padding-left: 12px; list-style: none; color: #44545b; font-size: 10px; }
.pdf-preview-question li span { font-size: 9px; }
.pdf-preview-question .is-correct { color: #34724c; }
.pdf-preview-question .is-wrong, .pdf-preview-question .is-selected { color: #b85a38; }
.pdf-preview-explanation, .pdf-preview-ai { margin: 12px 0 0 12px; font-size: 9.5px; line-height: 1.65; }
.pdf-preview-explanation > b { color: #243740; }
.pdf-preview-ai > b { color: #34724c; }
.pdf-preview-explanation p, .pdf-preview-ai p { margin-top: 3px; color: #56676f; }
.pdf-preview-ai { padding: 9px 10px; border: 1px solid #cdded5; border-radius: 7px; background: #f5faf7; }
.pdf-preview-page-number { margin-top: 22px; color: #8a989e; font-size: 8px; text-align: center; }
.pdf-purchase-notice { margin-top: 12px; padding: 11px 12px; border: 1px solid #dfd3b5; border-radius: 10px; background: #fffaf0; }
.pdf-purchase-notice > strong { display: flex; align-items: center; gap: 5px; color: #795b18; font-size: 13px; }
.pdf-purchase-notice > p { margin: 5px 0 9px; color: #665b44; font-size: 12px; line-height: 1.65; }
.pdf-purchase-notice > label { display: flex; align-items: flex-start; gap: 7px; color: #4c4536; font-size: 12px; font-weight: 700; cursor: pointer; }
.pdf-purchase-notice input { width: 16px; height: 16px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--green); }
.pdf-buyer-email { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.pdf-buyer-email input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #c9d4d7; border-radius: 8px; background: #fff; color: var(--ink); outline: none; }
.pdf-buyer-email input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.pdf-checkout-email-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pdf-checkout-email-actions .secondary-action { width: auto; min-height: 36px; padding: 0 11px; font-size: 12px; }
.pdf-checkout-email-actions .quiet-button { font-size: 12px; }
.pdf-checkout-email-verified { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; color: var(--green); font-size: 12px; font-weight: 700; }
.pdf-checkout-email-verified[hidden], .pdf-checkout-email-actions button[hidden] { display: none; }
.pdf-checkout-email-verified i { font-size: 17px; }
.pdf-checkout-code-row { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; align-items: center; gap: 7px; margin-top: 8px; }
.pdf-checkout-code-row[hidden] { display: none; }
.pdf-checkout-code-row input { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #c9d4d7; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; outline: none; }
.pdf-checkout-code-row input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.pdf-checkout-code-row .secondary-action { width: auto; min-height: 38px; padding: 0 11px; font-size: 12px; white-space: nowrap; }
.pdf-checkout-code-row .quiet-button { white-space: nowrap; }
.pdf-purchase-button { min-width: 180px; overflow: hidden; padding: 0; border: 0; border-radius: 11px 11px 11px 4px; background: var(--green); color: #fff; cursor: pointer; }
.pdf-purchase-button > span, .pdf-purchase-button > b { display: block; padding: 7px 14px; }
.pdf-purchase-button > span { background: rgba(0,0,0,.13); font: 700 14px "Outfit", sans-serif; }
.pdf-purchase-button > b { font-size: 13px; }
.pdf-purchase-button:disabled { opacity: .62; cursor: not-allowed; }
.pdf-offer-message { grid-column: 2 / -1; min-height: 0; margin: -6px 0 0; }

.payment-return-view { width: min(680px, 100%); min-height: calc(100vh - 84px); min-height: calc(100dvh - 84px); display: grid; place-items: center; margin: 0 auto; padding: 40px 0 70px; }
.payment-return-card { width: 100%; padding: 42px; border: 1px solid var(--line); border-radius: 28px 28px 28px 8px; background: var(--panel); text-align: center; box-shadow: 0 20px 60px rgba(35,57,68,.09); }
.payment-return-card .eyebrow { justify-content: center; margin-top: 22px; }
.payment-return-icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto; border-radius: 22px 22px 22px 7px; background: #e7f0f4; color: #315f78; }
.payment-return-icon.is-success { background: #e5f3e8; color: #34724c; }
.payment-return-icon i { font-size: 36px; }
.payment-return-card h2 { margin: 15px 0 8px; font-size: clamp(29px, 5vw, 42px); letter-spacing: -.04em; }
.payment-return-card > p { margin: 0 auto; max-width: 510px; color: var(--muted); line-height: 1.7; }
.payment-return-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 25px; padding: 10px; border-radius: 12px; background: #f5f7f6; }
.payment-return-summary > div { min-width: 0; padding: 10px; }
.payment-return-summary span, .payment-return-summary strong { display: block; overflow-wrap: anywhere; }
.payment-return-summary span { color: var(--muted); font-size: 11px; }
.payment-return-summary strong { margin-top: 4px; font-size: 13px; }
.payment-return-card .form-message { min-height: 24px; margin: 13px 0 0; }
.payment-return-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.payment-return-actions [hidden] { display: none; }
.payment-return-actions button { min-width: 160px; }
.payment-return-support { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.payment-return-support p { margin: 0 0 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.payment-return-support .contact-support-button { font-size: 13px; }

.pdf-settings-view { width: min(1180px, 100%); min-height: calc(100vh - 84px); margin: 0 auto; padding: 42px 0 80px; }
.pdf-settings-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 16px; align-items: start; }
.pdf-settings-panel, .pdf-readiness-panel, .pdf-email-admin-panel, .pdf-sales-stats, .pdf-retention-note, .pdf-orders-panel { border: 1px solid var(--line); border-radius: 19px 19px 19px 7px; background: var(--panel); box-shadow: 0 10px 32px rgba(35,57,68,.05); }
.pdf-settings-panel { padding: 25px; }
.pdf-settings-enabled { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.pdf-settings-enabled strong, .pdf-settings-enabled small { display: block; }
.pdf-settings-enabled small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.pdf-settings-enabled input { width: 22px; height: 22px; accent-color: var(--green); }
.pdf-settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.pdf-settings-fields label { color: var(--muted); font-size: 12px; font-weight: 700; }
.pdf-settings-fields input { width: 100%; height: 47px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font: inherit; font-size: 16px; font-weight: 600; }
.pdf-settings-ai-enabled { margin-top: 18px; }
.pdf-settings-scope { min-width: 0; margin: 15px 0 0; padding: 15px; border: 0; border-radius: 11px; background: #f4f7f5; }
.pdf-settings-scope legend { float: left; width: 100%; margin-bottom: 10px; padding: 0; font-size: 14px; font-weight: 700; }
.pdf-subject-options { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pdf-subject-options label { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; font-size: 14px; font-weight: 600; }
.pdf-subject-options input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.pdf-subject-options label > span, .pdf-subject-options label strong, .pdf-subject-options label small { display: block; min-width: 0; }
.pdf-subject-options label > span { overflow: hidden; }
.pdf-subject-options label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-subject-options label small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }
.pdf-subject-options-empty { grid-column: 1 / -1; margin: 0; padding: 10px 2px; color: var(--muted); font-size: 13px; }
.pdf-settings-scope > small { display: block; margin-top: 10px; color: var(--muted); line-height: 1.5; }
.pdf-settings-panel .form-message { min-height: 24px; margin: 12px 0 5px; }
.pdf-settings-panel > .primary-action { width: 100%; }
.pdf-settings-side { display: grid; gap: 16px; }
.pdf-readiness-panel { padding: 22px; }
.pdf-readiness-panel .subheading { padding-bottom: 12px; }
.pdf-readiness-panel ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.pdf-readiness-panel li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 10px 11px; border-radius: 9px; background: #f4f7f5; font-size: 13px; }
.pdf-readiness-panel li i { font-size: 18px; }
.pdf-readiness-panel li strong { font-size: 11px; }
.pdf-readiness-panel li.is-ready { color: #34724c; }
.pdf-readiness-panel li.is-missing { color: #b85a38; }
.pdf-readiness-panel > p { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pdf-email-admin-panel { padding: 19px; }
.pdf-email-admin-panel.is-missing { border-color: #e3b29f; }
.pdf-email-admin-panel.is-ready { border-color: #a8c9b1; }
.pdf-email-admin-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.pdf-email-admin-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px 11px 11px 4px; background: #f8e8df; color: var(--accent-dark); }
.pdf-email-admin-icon i { font-size: 20px; }
.pdf-email-admin-heading strong, .pdf-email-admin-heading small { display: block; }
.pdf-email-admin-heading small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pdf-email-status-badge { padding: 4px 8px; border-radius: 99px; background: #fff0ea; color: #b85a38; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pdf-email-admin-panel.is-ready .pdf-email-admin-icon { background: #e8f4eb; color: #34724c; }
.pdf-email-admin-panel.is-ready .pdf-email-status-badge { background: #e8f4eb; color: #34724c; }
.pdf-email-admin-panel > p { margin: 13px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pdf-email-admin-panel .secondary-action { width: 100%; min-height: 42px; }
.pdf-sales-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 12px; }
.pdf-sales-stats > div { min-width: 0; padding: 10px; text-align: center; }
.pdf-sales-stats small, .pdf-sales-stats strong { display: block; }
.pdf-sales-stats small { color: var(--muted); font-size: 11px; }
.pdf-sales-stats strong { margin-top: 5px; overflow-wrap: anywhere; font: 700 19px "Outfit", sans-serif; }
.pdf-retention-note { padding: 19px; }
.pdf-retention-note-heading { display: flex; align-items: center; gap: 10px; }
.pdf-retention-note-heading > span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px 11px 11px 4px; background: #fff0d5; color: #946018; }
.pdf-retention-note-heading > span i { font-size: 20px; }
.pdf-retention-note-heading strong, .pdf-retention-note-heading small { display: block; }
.pdf-retention-note-heading small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.pdf-retention-note ul { margin: 14px 0 0; padding: 0; list-style: none; }
.pdf-retention-note li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 9px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.pdf-retention-note li:first-child { border-top: 0; }
.pdf-retention-note li b { color: var(--ink); }
.pdf-retention-note li span { color: var(--muted); }
.pdf-retention-note code { padding: 1px 4px; border-radius: 4px; background: #f1f3f2; color: var(--green); font-size: 11px; }
.pdf-orders-panel { margin-top: 18px; overflow: hidden; }
.pdf-orders-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; }
.pdf-orders-heading h3 { margin: 0; font-size: 20px; }
.pdf-orders-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.pdf-orders-heading .records-refresh { flex: 0 0 auto; }
.pdf-orders-filters { display: grid; grid-template-columns: minmax(260px, 1fr) 190px; gap: 10px; padding: 0 22px 16px; }
.pdf-orders-filters .records-search { position: relative; min-width: 0; }
.pdf-orders-filters .records-search i { position: absolute; top: 50%; left: 12px; z-index: 1; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.pdf-orders-filters input, .pdf-orders-filters select { width: 100%; min-width: 0; height: 43px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); outline: none; }
.pdf-orders-filters input { padding: 0 12px 0 39px; }
.pdf-orders-filters select { padding: 0 10px; }
.pdf-orders-filters input:focus, .pdf-orders-filters select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.pdf-orders-table td { font-size: 12px; }
.pdf-orders-table td strong, .pdf-orders-table td small { display: block; overflow-wrap: anywhere; }
.pdf-orders-table td small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.pdf-order-email { max-width: 210px; }
.pdf-order-status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 99px; background: #eef1f1; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.pdf-order-status.is-available { background: #e8f4eb; color: #34724c; }
.pdf-order-status.is-expired, .pdf-order-status.is-cleared, .pdf-order-status.is-failed, .pdf-order-status.is-cancelled { background: #fff0ea; color: #b85a38; }
.pdf-order-status.is-pending { background: #fff6df; color: #946b13; }
.pdf-admin-download { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 6px 9px; border: 1px solid var(--green); border-radius: 7px; background: transparent; color: var(--green); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pdf-admin-download:hover { background: var(--lime); }
.pdf-admin-download:disabled { opacity: .6; cursor: wait; }
.pdf-admin-download.is-unavailable { cursor: not-allowed; }
.pdf-admin-download.is-unavailable:hover { background: transparent; }
.pdf-admin-download i { font-size: 15px; }
.pdf-orders-panel > .form-message { min-height: 0; margin: 0; padding: 0 18px 16px; }
.pdf-email-dialog-intro { margin: 15px 0 18px; color: var(--muted); line-height: 1.6; }
.admin-hub-card--payments::after { background: #dcecf1; }
.admin-hub-card--payments .admin-hub-icon { background: #315f78; }
.admin-hub-card--payments .admin-hub-arrow { background: #e3f0f4; color: #315f78; }

.primary-action { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 14px; border: 0; border-radius: 12px 12px 12px 4px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; transition: background 160ms ease, transform 160ms ease; }
.primary-action:hover { background: var(--accent-dark); transform: translateY(-1px); }
.primary-action i { font-size: 22px; }
.primary-action:disabled { background: #c8cecf; color: #7d878b; cursor: not-allowed; transform: none; }
.form-message { min-height: 20px; margin: 12px 0 0; text-align: center; color: var(--accent-dark); font-size: 14px; }

.mobile-gate-view { width: min(1120px, 100%); margin: 0 auto; padding: 32px 0 70px; }
.gate-heading { margin: 32px 0 26px; }
.gate-heading h2 { margin: 14px 0 8px; font-size: clamp(34px, 5vw, 54px); letter-spacing: -.045em; }
.gate-heading > p { margin: 0; color: var(--muted); }
.gate-steps { display: grid; gap: 16px; }
.gate-step { padding: clamp(22px, 4vw, 36px); border: 1px solid var(--line); border-radius: 22px 22px 22px 7px; background: var(--panel); box-shadow: 0 8px 28px rgba(35,57,68,.045); transition: opacity 180ms ease, border-color 180ms ease; }
.gate-step.is-active { border-color: #9bafb9; }
.gate-step.is-locked { opacity: .58; }
.gate-step.is-complete { border-color: #88aaba; }
.gate-step-title { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 13px; margin-bottom: 25px; }
.gate-step-title > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px 12px 12px 4px; background: var(--green); color: #fff; font: 700 14px "Outfit", sans-serif; }
.gate-step-title h3 { margin: 0; font-size: 21px; }
.gate-step-title p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.gate-step-title > i { color: var(--accent); font-size: 26px; }
.gate-step.is-complete .gate-step-title > i { color: var(--green); }
.student-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.student-form label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.student-form label > span { color: var(--accent-dark); font-size: 14px; }
.student-form input, .student-form select { width: 100%; min-width: 0; height: 50px; min-height: 50px; padding: 0 13px; border: 1px solid #cfd6d8; border-radius: 9px; background: #fff; color: var(--ink); outline: none; font-size: 16px; line-height: 1.2; }
.student-form select { display: block; padding-right: 36px; }
.student-form input:focus, .student-form select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.license-field { grid-column: 1 / -1; }
.student-confirm { grid-column: 1 / -1; margin-top: 5px; }
.student-form .form-message { grid-column: 1 / -1; margin: -4px 0 0; }
.student-status-notice { grid-column: 1 / -1; display: grid; grid-template-columns: 28px 1fr; align-items: flex-start; gap: 11px; padding: 15px 16px; border: 1px solid; border-radius: 11px; line-height: 1.55; }
.student-status-notice[hidden] { display: none; }
.student-status-notice > i { margin-top: 1px; font-size: 24px; }
.student-status-notice strong { display: block; font-size: 15px; }
.student-status-notice p { margin: 4px 0 0; font-size: 14px; }
.student-status-notice.is-pending { background: #fff6e6; border-color: #e4bd78; color: #77501a; }
.student-status-notice.is-activated { background: #edf6f8; border-color: #9bbdca; color: #294f63; }
.training-notice { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 15px; padding: 14px 16px; border-radius: 11px; background: #f8e8df; color: var(--accent-dark); }
.training-notice > i { margin-top: 1px; font-size: 21px; }
.training-notice strong { font-size: 14px; }
.training-notice p { margin: 3px 0 0; font-size: 14px; }
.training-player { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #1d2c34; }
.training-player video { display: block; width: 100%; max-height: 520px; background: #0d1519; }
.demo-video { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; background: #eef2f3; text-align: center; }
.demo-video[hidden] { display: none; }
.demo-video-icon { color: var(--green); font-size: 56px; line-height: 1; }
.demo-video strong { margin-top: 10px; }
.demo-video p { max-width: 460px; margin: 7px 0 17px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.demo-video button { min-height: 42px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.demo-video button:disabled { background: #b9c2c5; color: #6f7a7f; cursor: not-allowed; }
.demo-video button i { font-size: 18px; }
.video-progress { height: 5px; background: #3b4d57; }
.video-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 100ms linear; }
.video-status { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; background: #243640; color: #c4d0d5; font-size: 14px; }
.video-status strong { color: #fff; font: 600 14px "Outfit", sans-serif; }
.gate-start { margin-top: 18px; }

.admin-login-view { width: min(1040px, 100%); min-height: calc(100vh - 84px); min-height: calc(100dvh - 84px); margin: 0 auto; padding: 38px 0 80px; }
.admin-login-frame { margin-top: 56px; filter: drop-shadow(0 24px 38px rgba(35,57,68,.16)); }
.admin-login-layout { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(380px, .94fr); align-items: stretch; overflow: hidden; background: var(--panel); clip-path: polygon(0 32px, 32px 0, calc(100% - 68px) 0, 100% 68px, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%); }
.admin-login-copy { position: relative; z-index: 1; min-height: 500px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; margin-right: -48px; padding: 54px 102px 54px 54px; background: var(--green); color: #fff; clip-path: polygon(0 0, 100% 0, calc(100% - 48px) 100%, 0 100%); }
.admin-login-copy::before, .admin-login-copy::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.14); transform: rotate(45deg); pointer-events: none; }
.admin-login-copy::before { width: 300px; height: 300px; top: -200px; right: -100px; }
.admin-login-copy::after { width: 160px; height: 160px; right: 34px; bottom: -116px; background: rgba(255,255,255,.035); }
.admin-login-copy-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 0 34px 4px; background: rgba(255,255,255,.14); color: #fff; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.admin-login-copy-icon i { font-size: 30px; }
.admin-login-copy .eyebrow { color: var(--lime); }
.admin-login-copy .eyebrow span { background: var(--accent); }
.admin-login-copy h2 { max-width: 430px; margin: 17px 0 15px; font-size: clamp(42px, 5vw, 58px); letter-spacing: -.055em; line-height: 1.12; }
.admin-login-copy > p { max-width: 430px; margin: 0; color: rgba(255,255,255,.75); font-size: 15px; line-height: 1.85; }
.admin-login-points { display: grid; gap: 11px; margin-top: 38px; color: rgba(255,255,255,.9); font-size: 14px; }
.admin-login-points span { display: inline-flex; align-items: center; gap: 9px; }
.admin-login-points i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 15px; }
.admin-login-card { display: flex; flex-direction: column; justify-content: center; padding: 48px 44px 48px 72px; background: var(--panel); }
.admin-login-card-head { display: flex; align-items: center; gap: 15px; margin-bottom: 27px; }
.admin-login-card-head > div:last-child { min-width: 0; }
.admin-login-card-head h3 { margin: 0; color: var(--ink); font-size: 23px; letter-spacing: -.02em; }
.admin-login-card-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.admin-login-icon { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; background: #ffe8df; color: var(--accent-dark); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.admin-login-icon i { font-size: 26px; }
.admin-account-preview { display: flex; align-items: center; gap: 12px; min-height: 76px; margin: 0 0 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(49,95,120,.035); }
.admin-account-preview[hidden] { display: none; }
.admin-account-avatar { width: 45px; height: 45px; flex: 0 0 45px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--lime); color: var(--green); }
.admin-account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-account-avatar i { font-size: 21px; }
.admin-account-copy { min-width: 0; flex: 1; }
.admin-account-preview strong, .admin-account-preview small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-account-preview strong { font-size: 15px; }
.admin-account-preview small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.admin-account-check { flex: 0 0 auto; color: #4f8c63; font-size: 22px; }
.admin-credentials { display: grid; gap: 15px; margin: 0 0 21px; }
.admin-credentials[hidden] { display: none; }
.admin-credentials label { display: grid; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.admin-input-wrap { position: relative; display: block; }
.admin-input-wrap > i { position: absolute; top: 50%; left: 13px; z-index: 1; transform: translateY(-50%); color: #94a09b; font-size: 19px; pointer-events: none; }
.admin-credentials input { width: 100%; min-height: 49px; padding: 11px 43px 11px 42px; border: 1px solid #d1d7d4; border-radius: 11px; background: #fff; color: var(--ink); outline: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.admin-credentials input::placeholder { color: #a5aeaa; font-weight: 400; }
.admin-credentials input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.09); }
.admin-password-toggle { position: absolute; top: 50%; right: 7px; width: 35px; height: 35px; display: grid; place-items: center; transform: translateY(-50%); border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.admin-password-toggle:hover { background: var(--lime); color: var(--green); }
.admin-password-toggle i { font-size: 19px; }
.admin-login-submit { min-height: 52px; border-radius: 0; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px)); }
.admin-login-submit:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.admin-login-card .form-message { min-height: 22px; display: grid; place-items: center; margin: 10px 0 0; line-height: 1.55; }
.admin-security-note { display: flex; align-items: flex-start; justify-content: center; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
.admin-security-note i { flex: 0 0 auto; margin-top: 1px; font-size: 16px; }
body[data-theme="dark"] .admin-login-copy { background: #294f63; }
body[data-theme="dark"] .admin-login-card { background: var(--panel); }
body[data-theme="dark"] .admin-account-preview { background: #293a43; }
body[data-theme="dark"] .admin-login-icon { background: #4b332d; }

.admin-hub-view { width: min(1040px, 100%); min-height: calc(100vh - 84px); min-height: calc(100dvh - 84px); margin: 0 auto; padding: 42px 0 80px; }
.admin-hub-heading { margin: 44px 0 32px; text-align: center; }
.admin-hub-heading .eyebrow { justify-content: center; }
.admin-hub-heading h2 { margin: 15px 0 7px; font-size: clamp(38px, 5vw, 56px); letter-spacing: -.045em; }
.admin-hub-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.admin-hub-sections { display: grid; gap: 30px; }
.admin-hub-group[hidden], .admin-hub-card[hidden], .admin-hub-link[hidden] { display: none; }
.admin-hub-group h3 { margin: 0 0 13px; color: var(--muted); font-size: 15px; font-weight: 700; }
.admin-hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-hub-card { position: relative; min-height: 194px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; grid-template-areas: "icon arrow" "content content"; align-items: start; gap: 16px; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 20px 20px 20px 7px; background: #fff; text-align: left; cursor: pointer; box-shadow: 0 10px 32px rgba(35,57,68,.05); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.admin-hub-card::after { content: ""; position: absolute; top: -55px; right: -45px; width: 150px; height: 150px; border-radius: 50%; background: var(--lime); opacity: .62; pointer-events: none; }
.admin-hub-card--review::after { background: #ffe8df; }
.admin-hub-card:hover:not(:disabled) { transform: translateY(-3px); border-color: #9eb4be; box-shadow: 0 16px 42px rgba(35,57,68,.1); }
.admin-hub-icon { grid-area: icon; position: relative; z-index: 1; width: 54px; height: 54px; display: grid; place-items: center; align-self: start; justify-self: start; border-radius: 15px 15px 15px 5px; background: var(--green); color: #fff; }
.admin-hub-card--review .admin-hub-icon { background: var(--accent); }
.admin-hub-icon i { font-size: 27px; }
.admin-hub-content { grid-area: content; align-self: end; }
.admin-hub-content strong, .admin-hub-content small { display: block; }
.admin-hub-content strong { font-size: 21px; }
.admin-hub-content small { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.admin-hub-arrow { grid-area: arrow; width: 34px; height: 34px; display: grid; place-items: center; justify-self: end; border-radius: 50%; background: var(--lime); color: var(--green); transition: 180ms ease; }
.admin-hub-card--review .admin-hub-arrow { background: #ffe8df; color: var(--accent-dark); }
.admin-hub-card--feedback::after { background: #dff0e5; }
.admin-hub-card--feedback .admin-hub-icon { background: #4f8c63; }
.admin-hub-card--feedback .admin-hub-arrow { background: #e5f3e8; color: #34724c; }
.admin-hub-card--accounts::after { background: #e8e1f4; }
.admin-hub-card--accounts .admin-hub-icon { background: #75619b; }
.admin-hub-card--accounts .admin-hub-arrow { background: #eee8f8; color: #75619b; }
.admin-hub-card--storage::after { background: #e4ebf8; }
.admin-hub-card--storage .admin-hub-icon { background: #506a9b; }
.admin-hub-card--storage .admin-hub-arrow { background: #e8eef9; color: #506a9b; }
.admin-hub-card--compact { min-height: 148px; padding: 17px; border-radius: 16px 16px 16px 6px; }
.admin-hub-card--compact .admin-hub-icon { width: 43px; height: 43px; border-radius: 12px 12px 12px 4px; }
.admin-hub-card--compact .admin-hub-icon i { font-size: 23px; }
.admin-hub-card--compact .admin-hub-content strong { font-size: 17px; }
.admin-hub-card--compact .admin-hub-content small { font-size: 12px; }
.admin-hub-card--compact .admin-hub-arrow { width: 28px; height: 28px; }
.admin-hub-links { overflow: hidden; border: 1px solid var(--line); border-radius: 16px 16px 16px 6px; background: #fff; box-shadow: 0 9px 30px rgba(35,57,68,.04); }
.admin-hub-link { width: 100%; min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 13px 19px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background 150ms ease; }
.admin-hub-link:last-child { border-bottom: 0; }
.admin-hub-link:hover:not(:disabled) { background: var(--lime); }
.admin-hub-link .admin-hub-icon { flex: 0 0 40px; width: 40px; height: 40px; align-self: center; border-radius: 11px 11px 11px 4px; background: var(--lime); color: var(--green); }
.admin-hub-link .admin-hub-icon i { font-size: 22px; }
.admin-hub-link .admin-hub-content { min-width: 0; flex: 1; align-self: center; }
.admin-hub-link .admin-hub-content strong { font-size: 16px; }
.admin-hub-link .admin-hub-content small { margin-top: 3px; font-size: 12px; }
.admin-hub-link .admin-hub-arrow { flex: 0 0 26px; width: 26px; height: 26px; align-self: center; background: transparent; color: var(--muted); }
.admin-hub-card:hover:not(:disabled) .admin-hub-arrow { transform: translateX(3px); }
.admin-hub-arrow i { font-size: 22px; }
.admin-hub-card:disabled, .admin-hub-link:disabled { filter: grayscale(1); opacity: .55; cursor: not-allowed; }
.admin-hub-card:disabled::after { opacity: 0; }
body[data-theme="dark"] .admin-hub-card { background: var(--panel); }
body[data-theme="dark"] .admin-hub-links { background: var(--panel); }
body[data-theme="dark"] .admin-hub-link:hover:not(:disabled) { background: #293a43; }
body[data-theme="dark"] .admin-hub-card--review::after { background: #4b332d; }

.storage-usage-dialog { width: min(820px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; }
.storage-usage-dialog form { padding: 28px; }
.storage-usage-intro { margin: 14px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.storage-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.storage-summary > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(49,95,120,.035); }
.storage-summary small, .storage-summary strong { display: block; }
.storage-summary small { color: var(--muted); font-size: 11px; }
.storage-summary strong { margin-top: 5px; overflow-wrap: anywhere; font: 700 14px "Outfit", "Noto Sans TC", sans-serif; }
.storage-file-usage { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.storage-file-usage > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.storage-file-usage > small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.storage-meter, .storage-table-meter { overflow: hidden; border-radius: 99px; background: #e6ebed; }
.storage-meter { height: 9px; margin-top: 9px; }
.storage-meter > span, .storage-table-meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #506a9b, #4f8c63); transition: width 220ms ease; }
.storage-table-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 22px 0 10px; }
.storage-table-heading strong, .storage-table-heading small { display: block; }
.storage-table-heading strong { font-size: 16px; }
.storage-table-heading small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.storage-table-heading .secondary-action { min-height: 36px; padding: 7px 11px; white-space: nowrap; }
.storage-table-list { display: grid; gap: 7px; max-height: min(410px, 43vh); overflow-y: auto; }
.storage-table-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(49,95,120,.025); }
.storage-table-name, .storage-table-value { min-width: 0; }
.storage-table-name strong, .storage-table-name small, .storage-table-value strong, .storage-table-value small { display: block; }
.storage-table-name strong { font-size: 13px; }
.storage-table-name small { margin-top: 2px; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.storage-table-value { text-align: right; white-space: nowrap; }
.storage-table-value strong { font: 700 13px "Outfit", sans-serif; }
.storage-table-value small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.storage-table-meter { grid-column: 1 / -1; height: 5px; }
.storage-table-meter.has-data > span { min-width: 3px; }
.storage-usage-empty { min-height: 90px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: 13px; }
.storage-usage-empty i { font-size: 18px; }

.retention-policy-dialog { width: min(720px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; }
.retention-policy-dialog form { padding: 28px; }
.retention-policy-groups { display: grid; gap: 18px; margin: 24px 0 20px; }
.retention-rule-section { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(49,95,120,.025); }
.retention-rule-heading { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line); background: rgba(49,95,120,.045); }
.retention-rule-heading span { min-width: 42px; padding: 4px 8px; border-radius: 99px; background: #e8eef0; color: #486f82; font-size: 12px; font-weight: 700; text-align: center; }
.retention-rule-heading h4 { margin: 0; font-size: 16px; }
.retention-rule-section.is-year .retention-rule-heading span { background: #f9e8df; color: #a75031; }
.retention-rule-section.is-short .retention-rule-heading span { background: #e8eef0; color: #486f82; }
.retention-rule-section.is-keep .retention-rule-heading span { background: #e4efdf; color: #4f7b50; }
.retention-rule-section.is-special .retention-rule-heading span { background: #fff0d5; color: #946018; }
.retention-rule-section ul { margin: 0; padding: 0; list-style: none; }
.retention-rule-section li { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1.7fr); gap: 16px; padding: 11px 15px; border-top: 1px solid rgba(49,95,120,.1); }
.retention-rule-section li:first-child { border-top: 0; }
.retention-rule-section strong, .retention-rule-section small { display: block; }
.retention-rule-section strong { color: var(--ink); font-size: 14px; line-height: 1.6; }
.retention-rule-section small { color: var(--muted); font-size: 13px; line-height: 1.65; }
.retention-policy-done { width: 100%; min-height: 46px; }

.flow-rules-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; }
.flow-rules-dialog form { padding: 28px; }
.flow-rules-list { display: grid; gap: 9px; margin-top: 22px; }
.flow-rule { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: rgba(49,95,120,.025); }
.flow-rule[open] { background: var(--panel); }
.flow-rule summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; cursor: pointer; list-style: none; }
.flow-rule summary::-webkit-details-marker { display: none; }
.flow-rule summary > span { display: flex; align-items: center; gap: 10px; min-width: 0; }
.flow-rule summary i { color: #75619b; font-size: 19px; }
.flow-rule summary b { color: var(--ink); font-size: 15px; }
.flow-rule summary small { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }
.flow-rule summary::after { content: ''; flex: 0 0 8px; width: 8px; height: 8px; margin: -4px 4px 0 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; border-radius: 1px; color: var(--muted); transform: rotate(45deg); transition: transform 180ms ease; }
.flow-rule[open] summary::after { transform: rotate(225deg); }
.flow-rule summary:focus-visible { outline: 2px solid #75619b; outline-offset: -3px; border-radius: 12px; }
.flow-rule ol { margin: 0; padding: 0 19px 17px 43px; border-top: 1px solid var(--line); }
.flow-rule li { padding: 10px 0 0 2px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.flow-rule li::marker { color: #75619b; font-weight: 700; }
@media (max-width: 560px) {
  .flow-rules-dialog form { padding: 20px; }
  .flow-rule summary { align-items: flex-start; flex-wrap: wrap; padding: 13px 14px; }
  .flow-rule summary small { width: 100%; margin: -7px 0 0 29px; text-align: left; }
  .flow-rule summary::after { position: absolute; top: 20px; right: 18px; margin: 0; }
  .flow-rule { position: relative; }
  .flow-rule ol { padding: 0 15px 15px 37px; }
}

.admin-view { padding: 42px 0 70px; }
.admin-heading { margin-bottom: 28px; }
.admin-tabs { display: flex; gap: 7px; margin-bottom: 20px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.62); }
.admin-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; transition: 150ms ease; }
.admin-tab i { font-size: 17px; }
.admin-tab span { color: #9a5b29; font-size: 14px; }
.admin-tab:hover { color: var(--green); background: #fff; }
.admin-tab.is-active { background: var(--green); color: #fff; }
.admin-tab.is-active span { color: var(--lime); }
.admin-tab-panel { display: none; }
.admin-tab-panel.is-visible { display: block; animation: enter 220ms ease both; }
.catalog-settings-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(232,244,239,.8)); }
.catalog-settings-intro > div { display: flex; align-items: center; gap: 14px; }
.catalog-settings-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; color: #fff; background: var(--ink); font-size: 22px; }
.catalog-settings-intro h3, .catalog-settings-intro p { margin: 0; }
.catalog-settings-intro h3 { font-size: 21px; }
.catalog-settings-intro p { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.catalog-settings-status { color: var(--green); font-size: 14px; font-weight: 700; }
.catalog-settings-layout { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.catalog-subject-form, .catalog-subjects-panel { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.catalog-subject-form { display: grid; gap: 14px; position: sticky; top: 92px; }
.catalog-subject-form .subheading, .catalog-subjects-panel .subheading { margin-bottom: 3px; }
.catalog-subject-form label, .catalog-exam-form label, .catalog-exam-edit-form > label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 600; }
.catalog-subject-form input, .catalog-subject-form select, .catalog-exam-form input, .catalog-exam-edit-form > label input { width: 100%; min-width: 0; min-height: 42px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: 14px; }
.catalog-subject-form label small { font-size: 13px; font-weight: 400; line-height: 1.5; }
.catalog-subject-list { display: grid; gap: 14px; margin-top: 16px; }
.catalog-subject-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.62); }
.catalog-subject-card.is-hidden { opacity: .7; }
.catalog-subject-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.catalog-subject-card header > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; }
.catalog-subject-card header span { color: var(--green); font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.catalog-subject-card h4 { width: 100%; margin: 0; font-size: 18px; }
.catalog-subject-card code { color: var(--muted); font-size: 13px; }
.catalog-subject-controls { display: flex; align-items: center; gap: 14px; }
.catalog-visibility { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 14px; font-weight: 600; }
.catalog-visibility input { accent-color: var(--green); }
.catalog-status-select { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.catalog-subject-card header .catalog-status-select > span, .catalog-subject-card header .catalog-visibility > span { color: var(--muted); font-size: 13px; letter-spacing: 0; }
.catalog-status-select select { min-height: 36px; padding: 7px 28px 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; cursor: pointer; }
.catalog-status-select--compact select { min-width: 132px; }
.catalog-exam-list { display: grid; }
.catalog-exam-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.catalog-exam-row > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.catalog-exam-row div { display: grid; gap: 3px; }
.catalog-exam-row strong { font-size: 14px; }
.catalog-exam-row small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.catalog-exam-row .catalog-exam-actions { display: flex; gap: 3px; }
.catalog-icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.catalog-icon-button:hover { color: #a13b32; background: rgba(161,59,50,.08); }
.catalog-icon-button.is-edit:hover { color: var(--green); background: rgba(49,95,120,.1); }
.catalog-empty-exams { margin: 0; padding: 18px; color: var(--muted); font-size: 14px; }
.catalog-exam-edit-form { display: grid; grid-template-columns: 32px minmax(140px, 1.5fr) repeat(3, minmax(74px, .55fr)); gap: 9px; align-items: end; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(217,120,80,.07); }
.catalog-exam-edit-index { align-self: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.catalog-exam-edit-footer { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-exam-edit-options { display: flex; align-items: center; gap: 14px; }
.catalog-exam-visible { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.catalog-exam-visible input { width: 16px; height: 16px; accent-color: var(--green); }
.catalog-exam-edit-actions { display: flex; gap: 7px; }
.catalog-exam-edit-actions .secondary-action, .catalog-exam-edit-actions .primary-action { width: auto; min-height: 38px; padding: 0 13px; border-radius: 9px 9px 9px 3px; font-size: 13px; }
.catalog-exam-edit-actions .primary-action { gap: 6px; }
.catalog-exam-edit-actions .primary-action i { font-size: 17px; }
.catalog-exam-form { display: grid; grid-template-columns: minmax(130px, 1.5fr) repeat(3, minmax(74px, .55fr)) auto; gap: 9px; align-items: end; padding: 14px 18px; background: rgba(43,92,75,.045); }
.catalog-exam-form input { padding: 10px 11px; }
.catalog-exam-form .secondary-action { min-height: 42px; white-space: nowrap; font-size: 14px; }
.catalog-subject-card > footer { display: flex; justify-content: flex-end; padding: 10px 18px; border-top: 1px solid var(--line); }
.catalog-delete-subject { border: 0; color: #9b4037; background: transparent; font: inherit; font-size: 14px; cursor: pointer; }
.access-exam-panel--multiple { display: grid; align-content: center; gap: 14px; }
.access-exam-card { position: relative; width: 100%; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.7); }
.access-exam-card h3 { margin: 8px 0 0; }
.access-exam-card p { margin: 10px 0 20px; color: var(--muted); }
body[data-theme="dark"] .catalog-settings-intro, body[data-theme="dark"] .catalog-subject-form, body[data-theme="dark"] .catalog-subjects-panel, body[data-theme="dark"] .catalog-subject-card, body[data-theme="dark"] .access-exam-card { background: #223139; }
body[data-theme="dark"] .catalog-subject-form input, body[data-theme="dark"] .catalog-subject-form select, body[data-theme="dark"] .catalog-exam-form input, body[data-theme="dark"] .catalog-exam-edit-form > label input, body[data-theme="dark"] .catalog-status-select select { color: var(--ink); background: #293a43; }
.attempt-settings-panel { padding: 26px; border: 1px solid var(--line); border-radius: 17px 17px 17px 6px; background: #fff; box-shadow: 0 9px 32px rgba(35,57,68,.05); }
.attempt-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.attempt-settings-heading > div { display: flex; align-items: center; gap: 12px; }
.attempt-settings-heading > div > i { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 46px; border-radius: 13px 13px 13px 5px; background: var(--lime); color: var(--green); font-size: 23px; }
.attempt-settings-heading h3 { margin: 0; font-size: 21px; }
.attempt-settings-heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.attempt-settings-heading .primary-action { width: auto; min-height: 44px; padding: 0 18px; border-radius: 10px 10px 10px 4px; }
.attempt-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.attempt-settings-grid label { min-width: 0; display: grid; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); font-size: 14px; font-weight: 600; }
.attempt-settings-grid input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #d1d7d4; border-radius: 8px; background: #fbfcfa; color: var(--ink); outline: none; font: 600 18px "Outfit", sans-serif; }
.attempt-settings-grid input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.attempt-settings-grid small { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
.attempt-settings-panel > .form-message { margin-bottom: 0; }
body[data-theme="dark"] .attempt-settings-grid label { background: #293a43; }
body[data-theme="dark"] .attempt-settings-grid input { border-color: var(--line); background: #18252c; color: var(--ink); }
.attempt-statistics { margin-top: 18px; padding: 26px; border: 1px solid var(--line); border-radius: 17px 17px 17px 6px; background: #fff; box-shadow: 0 9px 32px rgba(35,57,68,.05); }
.attempt-statistics .subheading { margin-bottom: 18px; }
.attempt-score-periods { margin-bottom: 28px; }
.attempt-score-table th:first-child { text-align: left; }
.attempt-score-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.attempt-stat-table-wrap .attempt-score-heading h4 { display: block; margin: 0; font-size: 15px; }
.attempt-score-heading h4 span { color: var(--muted); font-size: 12px; font-weight: 500; }
.attempt-score-heading select { min-width: 118px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; }
.attempt-stat-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; margin-bottom: 22px; }
.attempt-stat-summary article { padding: 16px 18px; border-radius: 12px 12px 12px 4px; background: var(--green); color: #fff; }
.attempt-stat-summary span, .attempt-stat-summary small { display: block; color: rgba(255,255,255,.68); font-size: 13px; }
.attempt-stat-summary strong { display: block; margin: 5px 0 2px; color: var(--lime); font: 700 30px "Outfit", sans-serif; }
.attempt-chart-wrap { min-width: 0; margin-bottom: 24px; }
.attempt-chart-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.attempt-chart-heading h4 { margin: 0; font-size: 15px; }
.attempt-chart-heading span { color: var(--muted); font-size: 12px; }
.attempt-chart { padding: 15px 16px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.attempt-chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.attempt-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.attempt-chart-key { width: 8px; height: 8px; border-radius: 3px; background: var(--chart-color); }
.attempt-chart-scroll { overflow-x: auto; padding-top: 8px; }
.attempt-chart-bars { position: relative; min-width: 620px; height: 210px; display: grid; grid-template-columns: repeat(7, minmax(72px, 1fr)); align-items: end; gap: 12px; padding: 0 3px; }
.attempt-chart-bars::before, .attempt-chart-bars::after { position: absolute; right: 0; left: 0; z-index: 0; border-top: 1px dashed var(--line); content: ""; pointer-events: none; }
.attempt-chart-bars::before { top: 33px; }
.attempt-chart-bars::after { top: 103px; }
.attempt-chart-column { position: relative; z-index: 1; height: 210px; display: grid; grid-template-rows: 25px 158px 21px; align-items: end; justify-items: center; gap: 3px; }
.attempt-chart-column > strong { color: var(--green); font: 700 12px "Outfit", sans-serif; font-variant-numeric: tabular-nums; }
.attempt-chart-column > small { color: var(--muted); font: 500 11px "Outfit", sans-serif; white-space: nowrap; }
.attempt-chart-bar { width: 88%; height: 158px; display: grid; grid-template-columns: repeat(5, minmax(5px, 1fr)); align-items: end; gap: 3px; }
.attempt-chart-fill { width: 100%; height: var(--bar-height); min-height: 4px; border-radius: 5px 5px 2px 2px; background: var(--chart-color); transition: filter 150ms ease; }
.attempt-chart-fill.is-empty { min-height: 0; }
.attempt-chart-column:hover .attempt-chart-fill { filter: saturate(1.18) brightness(1.04); }
.attempt-chart-key--life, .attempt-chart-fill--life { --chart-color: #315f78; }
.attempt-chart-key--fx, .attempt-chart-fill--fx { --chart-color: #d97850; }
.attempt-chart-key--invest, .attempt-chart-fill--invest { --chart-color: #9ab64b; }
.attempt-chart-key--property, .attempt-chart-fill--property { --chart-color: #668fa4; }
.attempt-chart-key--ethics, .attempt-chart-fill--ethics { --chart-color: #9b7baa; }
.attempt-stat-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.attempt-stat-table-wrap { min-width: 0; }
.attempt-stat-table-wrap h4 { display: flex; justify-content: space-between; margin: 0 0 9px; font-size: 15px; }
.attempt-stat-table-wrap h4 span { color: var(--muted); font-size: 12px; font-weight: 500; }
.attempt-stat-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.attempt-stat-table table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.attempt-stat-table th, .attempt-stat-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.attempt-stat-table thead th { background: #f6f8f5; color: var(--muted); font-weight: 600; }
.attempt-stat-table tbody tr:last-child > * { border-bottom: 0; }
.attempt-stat-table td strong { color: var(--green); }
.attempt-pass-rate { display: grid; gap: 2px; }
.attempt-pass-rate small { color: var(--muted); font-size: 11px; }
.attempt-pass-rate.is-zero strong { color: var(--accent-dark); }
.attempt-section-list { display: grid; gap: 6px; min-width: 185px; text-align: left; }
.attempt-section-row { display: grid; grid-template-columns: minmax(60px, 1fr) auto auto; align-items: baseline; gap: 8px; }
.attempt-section-row > span { color: var(--muted); }
.attempt-score-table .attempt-section-row > strong { color: var(--ink); }
.attempt-section-row > small, .attempt-section-note { color: var(--muted); font-size: 11px; }
.attempt-stat-empty { margin: 0; padding: 28px 14px; color: var(--muted); text-align: center; }
body[data-theme="dark"] .attempt-statistics { background: var(--panel); }
body[data-theme="dark"] .attempt-chart { background: #18252c; }
body[data-theme="dark"] .attempt-stat-table thead th { background: #293a43; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { position: relative; min-height: 118px; padding: 19px; border: 1px solid var(--line); border-radius: 15px 15px 15px 5px; background: #fff; }
.stat-card span { color: var(--muted); font-size: 14px; }
.stat-card strong { display: block; margin-top: 14px; font: 700 34px "Outfit", sans-serif; letter-spacing: -.04em; }
.stat-card > i { position: absolute; top: 18px; right: 17px; color: var(--accent); font-size: 22px; }
.stat-card:nth-child(2) > i { color: #668fa4; }
.stat-card--dark { background: var(--green); border-color: var(--green); color: #fff; }
.stat-card--dark span { color: rgba(255,255,255,.65); }
.stat-card--dark > i { color: var(--lime); }
.dashboard-section, .history-panel { margin-top: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 17px 17px 17px 6px; background: #fff; }
.subheading { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.subheading h3 { margin: 0; font-size: 18px; }
.subheading span { color: var(--muted); font-size: 14px; }
.frequent-wrong-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; }
.frequent-wrong-toggle::-webkit-details-marker { display: none; }
.frequent-wrong-toggle strong { font-size: 18px; }
.frequent-wrong-toggle::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 150ms ease; }
.frequent-wrong-section[open] .frequent-wrong-toggle::after { transform: rotate(225deg); }
.frequent-wrong-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; border-radius: 3px; }
.frequent-wrong-note { margin: 17px 0 0; color: var(--muted); font-size: 14px; }
.error-list { min-width: 0; display: grid; gap: 7px; padding-top: 13px; }
.error-row { width: 100%; min-width: 0; max-width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) 20px; align-items: center; gap: 11px; padding: 10px 7px; border: 0; border-radius: 9px; background: #fbfcfa; text-align: left; cursor: pointer; }
.error-row:hover { background: #fff2ed; }
.error-badge { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #ffe8df; color: var(--accent-dark); }
.error-badge i { font-size: 17px; }
.error-row > span:nth-child(2) { min-width: 0; overflow: hidden; }
.error-row strong, .error-row small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.error-row strong { display: -webkit-box; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.error-row small { display: block; white-space: nowrap; }
.error-row small { margin-top: 3px; color: var(--muted); font-size: 14px; }
.error-row > i { color: #9ba39a; font-size: 19px; }
.frequent-wrong-list { min-width: 0; display: grid; gap: 8px; padding-top: 13px; }
.frequent-wrong-row { width: 100%; min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfa; text-align: left; cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.frequent-wrong-row:hover { border-color: rgba(217,120,80,.45); background: #fff8f4; }
.frequent-wrong-rank { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px 10px 10px 4px; background: var(--green); color: #fff; font: 700 14px "Outfit", sans-serif; }
.frequent-wrong-copy { min-width: 0; }
.frequent-wrong-copy strong { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.frequent-wrong-copy small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.frequent-wrong-metrics { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.frequent-wrong-metrics span { padding: 5px 8px; border-radius: 7px; background: #ffe8df; color: var(--accent-dark); font-size: 12px; font-weight: 600; }
.frequent-wrong-metrics small { color: var(--muted); font-size: 12px; }
.frequent-wrong-row > i { color: #9ba39a; font-size: 19px; }
body[data-theme="dark"] .frequent-wrong-row { background: #293a43; }
body[data-theme="dark"] .frequent-wrong-row:hover { border-color: #8d5e4b; background: #32434b; }
body[data-theme="dark"] .frequent-wrong-metrics span { background: #4b332d; color: #f4b194; }
.report-list { display: grid; gap: 10px; padding-top: 13px; }
.report-row { padding: 14px; border: 1px solid #e2e6df; border-radius: 11px; background: #fbfcfa; }
.report-row--resolved { opacity: .68; }
.report-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--accent-dark); font-size: 14px; font-weight: 600; }
.report-row-top > span { display: inline-flex; align-items: center; gap: 5px; }
.report-row-top i { font-size: 16px; }
.report-row-top small { flex: 0 0 auto; padding: 3px 7px; border-radius: 99px; background: #fff0d5; color: #9b5a14; font-size: 14px; }
.report-row--resolved .report-row-top small { background: #e7f3e4; color: #4f9659; }
.report-row-question { margin: 10px 0 5px; color: var(--ink); font-size: 14px; line-height: 1.6; }
.report-row-reason { margin: 0; padding: 9px 10px; border-radius: 8px; background: #fff4ef; color: var(--accent-dark); font-size: 14px; line-height: 1.6; }
.report-row-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.report-row-footer > div { display: flex; gap: 6px; }
.report-row-footer button { display: inline-flex; align-items: center; gap: 3px; padding: 5px 8px; border: 0; border-radius: 6px; background: #e9ede7; color: var(--muted); font-size: 14px; cursor: pointer; }
.report-row-footer button:hover { background: var(--lime); color: var(--green); }
body[data-theme="dark"] .report-row, body[data-theme="dark"] .mobile-exam-record { background: #293a43; border-color: var(--line); }
body[data-theme="dark"] .report-row-reason { background: #4b332d; }
.mobile-exam-record-list { display: grid; gap: 10px; padding-top: 13px; }
.mobile-exam-record { padding: 14px; border: 1px solid #e2e6df; border-radius: 11px; background: #fbfcfa; }
.mobile-exam-record--failed { border-color: #e7c4b7; }
.mobile-exam-record-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mobile-exam-record-top strong, .mobile-exam-record-top small { display: block; }
.mobile-exam-record-top strong { color: var(--ink); font-size: 14px; }
.mobile-exam-record-top small { margin-top: 4px; color: var(--muted); font-size: 14px; }
.mobile-exam-record-top > b { color: var(--green); font: 700 25px "Outfit", sans-serif; white-space: nowrap; }
.mobile-exam-record--failed .mobile-exam-record-top > b { color: var(--accent-dark); }
.mobile-exam-record-top em { margin-left: 2px; font: 500 14px "Noto Sans TC", sans-serif; }
.mobile-exam-record-details { display: flex; flex-wrap: wrap; gap: 6px 15px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.mobile-exam-record-details span + span { position: relative; }
.mobile-exam-record-details span + span::before { content: "·"; position: absolute; left: -10px; color: #aab2ad; }
.mobile-exam-record-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.mobile-exam-record-footer small { color: var(--green); }
.mobile-exam-record--failed .mobile-exam-record-footer small { color: var(--accent-dark); }
.subject-issues-panel { margin-bottom: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 15px 15px 15px 5px; background: #fff; box-shadow: 0 7px 24px rgba(35,57,68,.04); }
.subject-issues-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.subject-issues-heading > div { display: flex; align-items: center; gap: 10px; }
.subject-issues-heading > div > i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #ffe8df; color: var(--accent-dark); font-size: 20px; }
.subject-issues-heading span strong, .subject-issues-heading span small { display: block; }
.subject-issues-heading span strong { font-size: 16px; }
.subject-issues-heading span small { margin-top: 2px; color: var(--muted); }
.subject-issues-heading > b { flex: 0 0 auto; padding: 6px 10px; border-radius: 99px; background: #fff0d5; color: #946018; font-weight: 600; }
.subject-issue-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.subject-issue-chip { min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafbf9; color: var(--muted); text-align: left; cursor: pointer; transition: 150ms ease; }
.subject-issue-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.subject-issue-chip strong { min-width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #e9eeec; color: #7c8782; }
.subject-issue-chip.has-issues { border-color: #e5bfad; color: var(--ink); }
.subject-issue-chip.has-issues strong { background: #ffe8df; color: var(--accent-dark); }
.subject-issue-chip:hover, .subject-issue-chip.is-active { border-color: var(--green); background: var(--lime); color: var(--green); }
.subject-issue-chip.is-active strong { background: var(--green); color: #fff; }
.subject-suspended-panel .subject-issues-heading > div > i,
.subject-suspended-panel .subject-issues-heading > b,
.subject-suspended-panel .subject-issue-chip.has-issues strong { background: #e7eef2; color: #315f78; }
.subject-suspended-panel .subject-issue-chip.has-issues { border-color: #b8ceda; }
.subject-suspended-panel .subject-issue-chip.is-active strong { background: var(--green); color: #fff; }
.category-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.category-strip > div { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.category-strip > div i { color: var(--accent); font-size: 22px; }
.category-strip > div strong { font-size: 14px; }
.category-strip > div small { color: var(--muted); font-size: 14px; }
.category-strip label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.category-strip select { min-height: 34px; padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fbfcfa; font-size: 14px; }
.history-list { display: grid; gap: 2px; padding-top: 10px; }
.history-row { display: grid; grid-template-columns: 35px 1fr auto; gap: 11px; align-items: center; padding: 11px 2px; border-bottom: 1px solid #eef0ec; }
.history-row:last-child { border-bottom: 0; }
.history-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: #e7f3e4; color: #4f9659; }
.history-icon--update { background: #fff0d5; color: #a4691d; }
.history-icon--delete { background: #ffe7df; color: var(--accent-dark); }
.history-icon i { font-size: 17px; }
.history-row strong, .history-row small { display: block; }
.history-row strong { font-size: 14px; }
.history-row small { margin-top: 3px; color: var(--muted); font-size: 14px; }
.history-row time { color: var(--muted); font: 14px "Outfit", sans-serif; white-space: nowrap; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.history-pagination button { min-height: 36px; display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; cursor: pointer; }
.history-pagination button:hover:not(:disabled) { border-color: var(--green); background: var(--lime); }
.history-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.history-pagination button i { font-size: 18px; }
.history-pagination > span { min-width: 150px; color: var(--muted); text-align: center; font-size: 14px; }
.empty-bank--compact { padding: 32px 10px 20px; }
.admin-inline-message { padding: 35px 10px; text-align: center; color: var(--muted); font-size: 14px; }
.admin-accounts-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .8fr); gap: 22px; align-items: start; }
.admin-accounts-panel, .admin-account-editor { min-width: 0; padding: 25px; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; background: #fff; box-shadow: 0 8px 30px rgba(23,32,24,.04); }
.admin-accounts-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.admin-accounts-toolbar h3 { margin: 0; font-size: 20px; }
.admin-accounts-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.admin-account-refresh { min-height: 40px; padding: 0 12px; border-radius: 9px; white-space: nowrap; }
.admin-account-search { position: relative; display: block; margin-top: 14px; }
.admin-account-search i { position: absolute; left: 13px; top: 50%; color: var(--muted); font-size: 19px; transform: translateY(-50%); pointer-events: none; }
.admin-account-search input { width: 100%; min-height: 43px; padding: 9px 12px 9px 41px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.admin-account-search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.admin-account-list { display: grid; gap: 10px; padding-top: 14px; }
.admin-initial-password-result { display: grid; gap: 8px; margin-top: 13px; padding: 14px; border: 1px solid #b9d1c3; border-radius: 10px; background: #f0f8f2; color: var(--ink); }
.admin-initial-password-result[hidden] { display: none; }
.admin-initial-password-result > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.admin-initial-password-result code { overflow-wrap: anywhere; font-size: 16px; font-weight: 700; }
.admin-initial-password-result small { color: var(--muted); line-height: 1.5; }
body[data-theme="dark"] .admin-initial-password-result { background: #244036; }
.admin-account-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-areas: "avatar info status" "avatar actions actions"; gap: 9px 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.admin-account-row.is-current { border-color: #a8c1cc; background: #f5f9fa; }
.admin-account-row-avatar { grid-area: avatar; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px 12px 12px 4px; background: var(--lime); color: var(--green); }
.admin-account-row-avatar i { font-size: 22px; }
.admin-account-info { grid-area: info; min-width: 0; align-self: center; }
.admin-account-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.admin-account-name-line strong { overflow-wrap: anywhere; font-size: 16px; }
.admin-account-info > small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-account-current { padding: 3px 7px; border-radius: 99px; background: #e3f0f4; color: var(--green); font-size: 11px; font-weight: 700; }
.admin-account-role { padding: 3px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.admin-account-role--admin { background: #eee8f8; color: #705494; }
.admin-account-role--user { background: #e3f1fb; color: #315d83; }
.admin-account-status { grid-area: status; align-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 99px; background: #eceeed; color: #7a8380; font-size: 12px; white-space: nowrap; }
.admin-account-status.is-active { background: #e6f3e8; color: #34724c; }
.admin-account-actions { grid-area: actions; display: flex; justify-content: flex-end; gap: 6px; }
.admin-account-actions button { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--green); font-size: 12px; cursor: pointer; }
.admin-account-actions button:hover:not(:disabled) { border-color: var(--green); background: var(--lime); }
.admin-account-actions button.is-danger { color: var(--accent-dark); }
.admin-account-actions button.is-danger:hover:not(:disabled) { border-color: var(--accent); background: #fff0e9; }
.admin-account-actions button:disabled { opacity: .45; cursor: not-allowed; }
.admin-account-loading { padding: 44px 10px; text-align: center; color: var(--muted); }
.admin-account-loading i { margin-right: 6px; color: var(--green); }
.admin-account-editor { display: grid; gap: 15px; }
.admin-login-email-panel { display: grid; gap: 18px; margin-top: 22px; padding: 25px; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; background: var(--panel); box-shadow: 0 8px 30px rgba(23,32,24,.04); }
.admin-login-email-panel[hidden] { display: none; }
.admin-login-email-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-login-email-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.admin-login-email-grid input, .admin-login-email-grid select { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #d1d7ce; border-radius: 8px; background: #fbfcfa; color: var(--ink); font: inherit; }
.admin-login-email-grid small, #admin-email-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-login-email-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.admin-login-email-actions button { min-height: 44px; }
.admin-login-email-panel .admin-account-active-field { max-width: 650px; }
body[data-theme="dark"] .admin-login-email-grid input, body[data-theme="dark"] .admin-login-email-grid select { border-color: var(--line); background: #18252c; color: var(--ink); }
.admin-account-editor-head { display: flex; align-items: center; gap: 12px; padding-bottom: 5px; }
.admin-account-editor-icon { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 45px; border-radius: 13px 13px 13px 5px; background: #eee8f8; color: #75619b; }
.admin-account-editor-icon i { font-size: 23px; }
.admin-account-editor-head h3 { margin: 0; font-size: 20px; }
.admin-account-editor-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.admin-account-editor > label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.admin-account-editor > label input:not([type="checkbox"]), .admin-account-editor > label select { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #d1d7ce; border-radius: 8px; background: #fbfcfa; color: var(--ink); outline: none; }
.admin-account-editor > label input:not([type="checkbox"]):focus, .admin-account-editor > label select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.admin-account-editor > label small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-account-editor > label select:disabled { opacity: .65; cursor: not-allowed; }
.admin-account-permissions { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.admin-account-permissions[hidden] { display: none; }
.admin-account-permissions legend { padding: 0 5px; color: var(--ink); font-size: 14px; font-weight: 700; }
.admin-account-permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.admin-account-permission-grid label { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 9px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 12px; cursor: pointer; }
.admin-account-permission-grid input { flex: 0 0 auto; accent-color: var(--green); }
.admin-account-active-field { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f8; }
.admin-account-active-field span { display: grid; gap: 3px; }
.admin-account-active-field strong { color: var(--ink); font-size: 14px; }
.admin-account-active-field input { width: 42px; height: 23px; flex: 0 0 auto; appearance: none; position: relative; margin: 0; border-radius: 99px; background: #c8d0cc; cursor: pointer; transition: 150ms ease; }
.admin-account-active-field input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform 150ms ease; }
.admin-account-active-field input:checked { background: #4f8c63; }
.admin-account-active-field input:checked::after { transform: translateX(19px); }
.admin-account-form-actions { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; }
.admin-account-form-actions .primary-action { min-height: 48px; }
.admin-account-form-actions .quiet-button { min-height: 42px; padding: 0 9px; }
body[data-theme="dark"] .admin-hub-card--accounts::after { background: #413853; }
body[data-theme="dark"] .admin-hub-card--feedback::after { background: #29483a; }
body[data-theme="dark"] .admin-hub-card--feedback .admin-hub-icon { background: #4f8c63; }
body[data-theme="dark"] .admin-hub-card--feedback .admin-hub-arrow { background: #29483a; color: #b9dfc4; }
body[data-theme="dark"] .admin-hub-card--accounts .admin-hub-icon { background: #8d79b6; }
body[data-theme="dark"] .admin-hub-card--accounts .admin-hub-arrow { background: #463d59; color: #d5c7f1; }
body[data-theme="dark"] .admin-hub-card--storage::after { background: #33435f; }
body[data-theme="dark"] .admin-hub-card--storage .admin-hub-icon { background: #6e86b5; }
body[data-theme="dark"] .admin-hub-card--storage .admin-hub-arrow { background: #33435f; color: #c4d3f0; }
body[data-theme="dark"] .admin-hub-card--payments::after { background: #294552; }
body[data-theme="dark"] .storage-summary > div,
body[data-theme="dark"] .storage-file-usage,
body[data-theme="dark"] .storage-table-item { background: #293a43; }
body[data-theme="dark"] .storage-meter,
body[data-theme="dark"] .storage-table-meter { background: #18252c; }
body[data-theme="dark"] .pdf-offer { border-color: #527b60; background: linear-gradient(135deg, #29483a, var(--panel)); }
body[data-theme="dark"] .pdf-preview-trigger { border-color: #a9dfb9; color: #a9dfb9; }
body[data-theme="dark"] .pdf-preview-trigger:hover { background: #29483a; }
body[data-theme="dark"] .pdf-purchase-notice { border-color: #765f32; background: #332d21; }
body[data-theme="dark"] .pdf-purchase-notice > strong { color: #f0cc79; }
body[data-theme="dark"] .pdf-purchase-notice > p, body[data-theme="dark"] .pdf-purchase-notice > label { color: #d9cfb9; }
body[data-theme="dark"] .payment-return-summary,
body[data-theme="dark"] .pdf-settings-scope,
body[data-theme="dark"] .pdf-readiness-panel li { background: #293a43; }
body[data-theme="dark"] .pdf-subject-options label { background: #18252c; }
body[data-theme="dark"] .pdf-settings-fields input { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .pdf-email-admin-panel, body[data-theme="dark"] .pdf-orders-panel { background: var(--panel); }
body[data-theme="dark"] .pdf-email-status-badge { background: #4b332d; color: #f4b194; }
body[data-theme="dark"] .pdf-email-admin-panel.is-ready .pdf-email-status-badge { background: #29483a; color: #a9dfb9; }
body[data-theme="dark"] .pdf-retention-note-heading > span { background: #4a3b23; color: #f0cc79; }
body[data-theme="dark"] .pdf-retention-note code { background: #18252c; color: #a9d8ec; }
body[data-theme="dark"] .pdf-orders-filters input, body[data-theme="dark"] .pdf-orders-filters select { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .pdf-order-status { background: #344852; color: #d8e3e7; }
body[data-theme="dark"] .pdf-order-status.is-available { background: #29483a; color: #a9dfb9; }
body[data-theme="dark"] .pdf-order-status.is-expired, body[data-theme="dark"] .pdf-order-status.is-failed, body[data-theme="dark"] .pdf-order-status.is-cancelled { background: #4b332d; color: #f4b194; }
body[data-theme="dark"] .pdf-order-status.is-pending { background: #493a25; color: #ffe0a3; }
body[data-theme="dark"] .retention-rule-section { background: #22343d; }
body[data-theme="dark"] .retention-rule-heading { background: #293e48; }
body[data-theme="dark"] .admin-account-row, body[data-theme="dark"] .admin-account-active-field { background: #293a43; }
body[data-theme="dark"] .admin-account-row.is-current { border-color: #52788b; background: #263d47; }
body[data-theme="dark"] .admin-account-search input { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .admin-account-role--admin { background: #453856; color: #dfcef9; }
body[data-theme="dark"] .admin-account-role--user { background: #274659; color: #b9dff4; }
body[data-theme="dark"] .admin-account-editor > label input:not([type="checkbox"]), body[data-theme="dark"] .admin-account-editor > label select { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .admin-account-editor, body[data-theme="dark"] .admin-accounts-panel { background: var(--panel); }
body[data-theme="dark"] .feedback-inbox-summary, body[data-theme="dark"] .feedback-inbox-item, body[data-theme="dark"] .feedback-inbox-view > .records-pagination { background: var(--panel); }
body[data-theme="dark"] .feedback-inbox-filters { background: var(--panel); }
body[data-theme="dark"] .feedback-status-tabs { background: #223139; }
body[data-theme="dark"] .feedback-status-tabs button.is-active { background: var(--lime); color: var(--ink); }
body[data-theme="dark"] .feedback-filter-field input, body[data-theme="dark"] .feedback-filter-field select { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .admin-account-actions button { background: #223139; }
.admin-layout { display: grid; grid-template-columns: minmax(350px, .8fr) minmax(0, 1.55fr); gap: 24px; align-items: start; }
.admin-editor-column {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.admin-editor-column::-webkit-scrollbar { width: 6px; }
.admin-editor-column::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--line); }
.admin-form, .admin-bank { padding: 26px; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; background: #fff; box-shadow: 0 8px 30px rgba(23,32,24,.04); }
.admin-form { display: grid; gap: 15px; }
.admin-form[hidden] { display: none; }
.import-panel { padding: 26px; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; background: #fff; box-shadow: 0 8px 30px rgba(23,32,24,.04); }
.import-panel[hidden] { display: none; }
.import-panel-icon { width: 43px; height: 43px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 11px 11px 11px 4px; background: #e7eef1; color: #315f78; }
.import-panel-icon i { font-size: 23px; }
.import-panel h3 { margin: 0; font-size: 20px; }
.import-panel > p { margin: 9px 0 17px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.import-subject-picker { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.import-subject-picker select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #cfd6d8; border-radius: 9px; background: #fff; color: var(--ink); outline: none; }
.import-subject-picker select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.import-badge { padding: 4px 8px; border-radius: 99px; background: var(--lime); color: var(--green); font-size: 14px; }
.file-drop { display: flex; align-items: center; gap: 11px; min-height: 66px; margin-bottom: 12px; padding: 11px 13px; border: 1px dashed #bbc5b8; border-radius: 10px; background: #fafcf8; cursor: pointer; }
.file-drop:hover { border-color: var(--green); background: #f5faef; }
.file-drop > i { color: var(--green); font-size: 24px; }
.file-drop span { display: grid; gap: 3px; }
.file-drop strong { font-size: 14px; }
.file-drop small { color: var(--muted); font-size: 14px; }
.file-drop input { display: none; }
.import-actions { display: grid; grid-template-columns: .9fr 1.1fr; gap: 8px; }
.export-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.export-actions .secondary-action { min-height: 44px; padding: 0 8px; font-size: 14px; }
.danger-action { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; border: 1px solid #e2ad97; border-radius: 10px; background: #fff4ef; color: var(--accent-dark); font-size: 14px; font-weight: 600; cursor: pointer; transition: 150ms ease; }
.danger-action:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.danger-action:disabled { opacity: .55; cursor: wait; }
.danger-action i { font-size: 17px; }
.secondary-action { min-height: 56px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; background: transparent; color: var(--green); font-size: 14px; font-weight: 600; cursor: pointer; transition: 150ms ease; }
.secondary-action:hover { background: var(--lime); border-color: var(--green); }
.secondary-action i { font-size: 19px; }
.excel-guide { margin: 0 0 16px; padding: 12px 13px; border: 1px solid #dce4e6; border-radius: 10px; background: #f4f7f7; color: var(--muted); font-size: 14px; }
.excel-guide > strong { color: var(--green); font-size: 14px; }
.excel-guide p { margin: 9px 0 4px; line-height: 1.7; }
.excel-guide small { font-size: 14px; line-height: 1.6; }
body[data-theme="dark"] .excel-guide { border-color: var(--line); background: #293a43; }
.admin-form label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; border: 1px solid #d1d7ce; border-radius: 8px; padding: 10px 11px; color: var(--ink); background: #fbfcfa; outline: none; resize: vertical; }
.admin-form input, .admin-form select { min-height: 42px; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(24,63,49,.08); }
.admin-form-header, .bank-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.admin-form-header h3, .bank-toolbar h3 { margin: 0; font-size: 20px; }
.quiet-button { border: 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.quiet-button:hover { color: var(--accent-dark); }
.admin-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bank-toolbar { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.bank-toolbar > div { display: flex; align-items: baseline; gap: 9px; }
.bank-toolbar > div span { color: var(--muted); font-size: 14px; }
.bank-toolbar > .bank-searches { align-items: center; gap: 7px; }
.search-box { width: 220px; position: relative; }
.question-number-search { width: 120px; }
.search-box i { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); color: #939a91; font-size: 17px; }
.search-box input { width: 100%; height: 35px; padding: 0 9px 0 31px; border: 1px solid var(--line); border-radius: 8px; outline: none; font-size: 14px; }
.bank-list { display: grid; gap: 10px; padding-top: 15px; }
.question-row { padding: 16px; border: 1px solid #e2e6df; border-radius: 11px; background: #fbfcfa; }
.question-row--issue { border-color: #e3bda9; box-shadow: inset 3px 0 0 var(--accent); }
.question-row--suspended { border-color: #b4a1d2; background: #f4f0fa; box-shadow: inset 3px 0 0 #8466aa; }
.question-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.question-row-meta, .question-row-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.question-row-badges { justify-content: flex-end; }
.question-id { color: var(--muted); font: 600 14px "Outfit", sans-serif; }
.question-row h4 { margin: 10px 0 7px; font-size: 15px; line-height: 1.55; }
.question-row > p { margin: 0; color: var(--muted); font-size: 14px; }
.question-option-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 12px 0; }
.question-option-preview-item { min-width: 0; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 9px 10px; border: 1px solid #e1e5e2; border-radius: 8px; background: #fff; color: var(--muted); font-size: 14px; line-height: 1.5; }
.question-option-preview-item b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; background: #eef1ef; color: var(--ink); font: 600 13px "Outfit", sans-serif; }
.question-option-preview-item span { min-width: 0; overflow-wrap: anywhere; }
.question-option-preview-item > i { margin-top: 3px; color: #34724c; font-size: 17px; }
.question-option-preview-item.is-answer { border-color: #9fc5ab; background: #edf7f0; color: #2f6844; }
.question-option-preview-item.is-answer b { background: #4f8c63; color: #fff; }
.status-pill { padding: 4px 8px; border-radius: 99px; color: #315f78; background: #e7eef1; font-size: 14px; }
.status-pill--needs_review { color: #9b5a14; background: #fff0d5; }
.status-pill--suspended { color: #65498c; background: #e8def6; }
.report-count-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 99px; background: #ffe8df; color: var(--accent-dark); }
.report-count-badge i { font-size: 16px; }
.question-report-stack { display: grid; gap: 8px; margin-top: 14px; padding: 13px; border: 1px solid #e7c7b8; border-radius: 10px; background: #fff8f4; }
.question-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid #edd8ce; }
.question-report-heading strong { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-dark); }
.question-report-heading strong i { font-size: 18px; }
.question-report-heading span { color: var(--muted); }
.question-inline-report { padding: 10px 11px; border: 1px solid #ead7ce; border-radius: 8px; background: #fff; }
.question-inline-report--resolved { opacity: .68; }
.question-inline-report-top, .question-inline-report-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.question-inline-report-footer { margin-top: 12px; }
.question-inline-report-top strong { color: #9b5a14; }
.question-inline-report--resolved .question-inline-report-top strong { color: #4f9659; }
.question-inline-report-top time, .question-inline-report-footer > span { color: var(--muted); }
.question-inline-report > p { margin: 8px 0; color: var(--ink); line-height: 1.65; }
.question-inline-report-footer button { display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; border: 0; border-radius: 7px; background: var(--lime); color: var(--green); cursor: pointer; }
.question-inline-report-footer button:hover { background: var(--green); color: #fff; }
.question-row-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.question-row-actions button { display: inline-flex; align-items: center; gap: 3px; padding: 5px 8px; border: 0; border-radius: 6px; background: #e9ede7; color: var(--muted); font-size: 14px; white-space: nowrap; cursor: pointer; }
.question-row-actions button:hover { color: var(--green); background: var(--lime); }
.question-row-actions .question-publication-button { gap: 6px; padding: 7px 11px; border: 1px solid #dfb576; border-radius: 9px; background: #fff0d5; color: #88500e; font-weight: 700; }
.question-row-actions .question-publication-button:hover { border-color: #c98b39; background: #fce3b7; color: #75400a; }
.question-row-actions .question-publication-button.is-suspended { border-color: #9bc9ad; background: #e5f3e9; color: #286548; }
.question-row-actions .question-publication-button.is-suspended:hover { border-color: #68ad82; background: #d3ebdc; color: #20573d; }
.question-row-actions .question-publication-button i { font-size: 18px; }
.question-row-actions .question-review-switch { margin-right: auto; padding: 4px 2px; background: transparent; color: var(--muted); }
.question-row-actions .question-review-switch:hover { background: transparent; color: var(--ink); }
.question-review-switch-label { font-weight: 600; }
.question-review-switch-track { width: 46px; height: 26px; display: flex; align-items: center; padding: 3px; border: 1px solid #bdc7c3; border-radius: 99px; background: #dbe1de; transition: 160ms ease; }
.question-review-switch-track > span { width: 18px; height: 18px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(27,42,49,.22); transition: transform 160ms ease; }
.question-review-switch.is-reviewing { color: var(--accent-dark); }
.question-review-switch.is-reviewing .question-review-switch-track { border-color: var(--accent); background: var(--accent); }
.question-review-switch.is-reviewing .question-review-switch-track > span { transform: translateX(20px); }
.question-row-actions button:disabled { opacity: .55; cursor: wait; }
.question-row-actions button:last-child:hover { color: var(--accent-dark); background: #ffe7df; }
.question-row-actions i { font-size: 15px; }
.question-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.question-pagination[hidden] { display: none; }
.question-page-numbers { display: flex; align-items: center; gap: 5px; }
.question-pagination button { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; cursor: pointer; }
.question-pagination button:hover:not(:disabled), .question-pagination button.is-active { border-color: var(--green); background: var(--lime); color: var(--green); }
.question-pagination button.is-active { font-weight: 700; }
.question-pagination button:disabled { opacity: .4; cursor: not-allowed; }
.question-pagination button i { font-size: 18px; }
.question-page-ellipsis { padding: 0 2px; color: var(--muted); font-size: 16px; }
.question-page-total { margin-left: 5px; color: var(--muted); font-size: 14px; }
.empty-bank { padding: 60px 10px; text-align: center; color: var(--muted); }
.empty-bank i { color: #bdc5ba; font-size: 38px; }
.empty-bank p { margin: 10px 0 3px; color: var(--ink); font-weight: 600; }
.empty-bank small { font-size: 14px; }
body[data-theme="dark"] .subject-issues-panel, body[data-theme="dark"] .subject-issue-chip, body[data-theme="dark"] .question-inline-report { background: var(--panel); }
body[data-theme="dark"] .subject-issue-chip:hover, body[data-theme="dark"] .subject-issue-chip.is-active { background: var(--lime); }
body[data-theme="dark"] .question-report-stack { border-color: #745343; background: #3d302b; }
body[data-theme="dark"] .question-report-heading { border-color: #745343; }
body[data-theme="dark"] .question-inline-report { border-color: #745343; }

.records-view { padding: 42px 0 76px; }
.records-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 34px 0 25px; }
.records-heading h2 { margin: 12px 0 5px; font-size: clamp(32px, 4vw, 46px); line-height: 1.1; letter-spacing: -.04em; }
.records-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.records-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.records-heading-actions .records-refresh, .records-heading-actions .danger-action { width: auto; min-height: 39px; margin-top: 0; padding: 0 12px; }
.records-import-warning { display: flex; align-items: center; gap: 7px; margin: -9px 0 18px; color: var(--accent-dark); font-size: 14px; }
.records-import-warning i { font-size: 18px; }
.records-refresh { min-height: 39px; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.68); color: var(--muted); font-size: 14px; cursor: pointer; }
.records-refresh:hover { border-color: var(--green); color: var(--green); }
.records-refresh:disabled { opacity: .55; cursor: wait; }
.records-refresh i { font-size: 17px; }
.record-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.record-stat { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); text-align: left; cursor: pointer; transition: 150ms ease; }
.record-stat:hover, .record-stat.is-active { border-color: #9eb4be; background: #fff; box-shadow: 0 7px 22px rgba(35,57,68,.07); }
.record-stat.is-active { box-shadow: inset 0 -3px 0 var(--green), 0 7px 22px rgba(35,57,68,.07); }
.record-stat-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 10px; background: #edf1f2; color: var(--green); }
.record-stat-icon i { font-size: 20px; }
.record-stat-icon--active { color: #34724c; background: #e5f3e8; }
.record-stat-icon--pending { color: #a66b20; background: #fff1d9; }
.record-stat-icon--resigned { color: #7a7470; background: #ecebe9; }
.record-stat > span:last-child { min-width: 0; display: grid; gap: 2px; }
.record-stat small { overflow: hidden; color: var(--muted); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.record-stat strong { font: 700 24px "Outfit", sans-serif; }
.records-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 17px 17px 17px 6px; background: #fff; box-shadow: 0 9px 32px rgba(35,57,68,.05); }
.records-toolbar { display: grid; grid-template-columns: minmax(250px, 1.65fr) repeat(3, minmax(140px, .75fr)); gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fbfcfa; }
.records-toolbar label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 14px; }
.records-toolbar input, .records-toolbar select { width: 100%; height: 42px; padding: 0 10px; border: 1px solid #d6dcda; border-radius: 8px; background: #fff; color: var(--ink); outline: none; font-size: 14px; }
.records-toolbar input:focus, .records-toolbar select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.records-search { position: relative; align-self: end; }
.records-search i { position: absolute; left: 11px; bottom: 11px; z-index: 1; color: #929b97; font-size: 18px; }
.records-search input { padding-left: 35px; }
.records-summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 18px; border-bottom: 1px solid #edf0ed; }
.records-summary p { margin: 0; color: var(--muted); font-size: 14px; }
.records-summary-actions { display: flex; align-items: center; gap: 16px; }
.records-summary-actions label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.records-summary-actions select { height: 32px; padding: 0 25px 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); }
.records-summary button { border: 0; background: transparent; color: var(--green); font-size: 14px; cursor: pointer; }
.records-summary button:hover { color: var(--accent-dark); }
.records-table-wrap { overflow-x: auto; }
.records-table { width: 100%; border-collapse: collapse; }
.records-table th { padding: 12px 14px; border-bottom: 1px solid var(--line); color: #8a9490; background: #fafbf9; font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap; }
.records-table td { padding: 14px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
.records-table tbody tr:last-child td { border-bottom: 0; }
.records-table tbody tr:hover { background: #fbfcfa; }
.record-person { min-width: 150px; }
.record-person strong, .record-person small, .record-organization strong, .record-organization small, .record-score strong, .record-score small, .record-date strong, .record-date small { display: block; }
.record-person strong, .record-organization strong, .record-score strong, .record-date strong { font-size: 14px; font-weight: 600; }
.record-person small, .record-organization small, .record-score small, .record-date small { margin-top: 4px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.record-organization { min-width: 130px; }
.record-score { min-width: 95px; }
.record-score.is-passed strong { color: #34724c; }
.record-score.is-failed strong { color: var(--accent-dark); }
.record-date { min-width: 130px; }
.record-status { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 99px; font-size: 14px; white-space: nowrap; }
.record-status--pending { color: #966019; background: #fff1d9; }
.record-status--activated { color: #34724c; background: #e5f3e8; }
.record-status--resigned { color: #686d6b; background: #ecebe9; }
.record-action { width: 1%; }
.record-action-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.record-action button { display: inline-flex; align-items: center; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--green); font-size: 14px; white-space: nowrap; cursor: pointer; }
.record-action button:hover { border-color: var(--green); background: var(--lime); }
.record-action button.record-delete { color: var(--accent-dark); }
.record-action button.record-delete:hover { border-color: var(--accent); background: #fff0e9; color: var(--accent-dark); }
.record-action button:disabled { opacity: .55; cursor: not-allowed; }
.record-action i { font-size: 15px; }
.records-empty { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); }
.records-empty[hidden] { display: none; }
.records-empty i { margin-bottom: 4px; color: #b5bfba; font-size: 34px; }
.records-empty strong { color: var(--ink); font-size: 14px; }
.records-empty span { font-size: 14px; }
.records-pagination { margin: 0; padding: 16px 18px; border-top: 1px solid var(--line); }
.pdf-orders-pagination-top { border-top: 0; border-bottom: 1px solid var(--line); }
.records-panel > .form-message { margin: 0; padding: 0 18px 14px; }
.feedback-inbox-view { width: min(960px, 100%); min-height: calc(100vh - 84px); min-height: calc(100dvh - 84px); margin: 0 auto; padding: 42px 0 76px; }
.feedback-inbox-heading > .records-refresh { flex: 0 0 auto; }
.feedback-inbox-overview { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.feedback-inbox-summary { width: max-content; min-width: 132px; display: flex; align-items: baseline; gap: 7px; margin-bottom: 16px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px 14px 14px 5px; background: rgba(255,255,255,.72); }
.feedback-inbox-overview .feedback-inbox-summary { margin-bottom: 0; }
.feedback-inbox-summary strong { color: var(--green); font: 700 27px "Outfit", sans-serif; }
.feedback-inbox-summary span { color: var(--muted); font-size: 13px; }
.feedback-status-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #e8ece9; }
.feedback-status-tabs button { min-height: 37px; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.feedback-status-tabs button.is-active { background: #fff; color: var(--green); box-shadow: 0 2px 9px rgba(35,57,68,.09); }
.feedback-inbox-filters { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto; gap: 10px; margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.58); }
.feedback-filter-field { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.feedback-filter-field span { font-weight: 600; }
.feedback-filter-field input, .feedback-filter-field select { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid #d1d7d4; border-radius: 8px; background: #fff; color: var(--ink); outline: none; }
.feedback-filter-field input:focus, .feedback-filter-field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.feedback-filter-reset { align-self: end; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; }
.feedback-filter-reset:hover { border-color: var(--green); color: var(--green); }
.feedback-inbox-list { display: grid; gap: 11px; }
.feedback-inbox-item { min-width: 0; padding: 19px 20px; border: 1px solid var(--line); border-radius: 15px 15px 15px 5px; background: rgba(255,255,255,.76); box-shadow: 0 7px 24px rgba(35,57,68,.035); }
.feedback-inbox-item-head, .feedback-inbox-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.feedback-inbox-item-head time { color: var(--muted); font-size: 12px; }
.feedback-inbox-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.feedback-status { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.feedback-status--pending { background: #fff2d8; color: #976311; }
.feedback-status--resolved { background: #e2f1e7; color: #397450; }
.feedback-category { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border-radius: 99px; background: #e8eef0; color: #486f82; font-size: 12px; font-weight: 700; }
.feedback-category--suggestion { background: #e5f3e8; color: #34724c; }
.feedback-category--problem { background: #fff0e9; color: var(--accent-dark); }
.feedback-category--contact { background: #eee8f8; color: #75619b; }
.feedback-inbox-item > p { margin: 15px 0; color: var(--ink); font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-inbox-item-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.feedback-inbox-item-meta { justify-content: flex-start; min-width: 0; color: var(--muted); font-size: 13px; }
.feedback-inbox-item-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 7px; }
.feedback-inbox-item-actions button { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.feedback-inbox-item-actions button:hover { border-color: var(--green); color: var(--green); }
.feedback-inbox-item-actions .feedback-delete-action:hover { border-color: #c85e5e; color: #b84646; }
.feedback-inbox-item-actions button:disabled { opacity: .5; cursor: wait; }
.feedback-author { display: inline-flex; align-items: center; gap: 7px; color: var(--green); text-decoration: none; }
.feedback-author img { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; }
.feedback-author--anonymous { color: var(--muted); }
.feedback-author--anonymous > i { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #edf1f2; }
.feedback-contact { min-width: 0; display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.feedback-contact.is-empty { opacity: .72; }
.feedback-inbox-view > .records-pagination { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.55); }
.review-dialog { width: min(480px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 19px 19px 19px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 90px rgba(24,37,44,.3); }
.review-dialog::backdrop { background: rgba(21,31,36,.56); backdrop-filter: blur(3px); }
.review-dialog form { padding: 25px; }
.review-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.review-dialog-head span { color: var(--accent-dark); font: 700 14px "Outfit", sans-serif; letter-spacing: .13em; }
.review-dialog-head h3 { margin: 4px 0 0; font-size: 23px; }
.review-dialog-head button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--lime); color: var(--green); cursor: pointer; }
.review-dialog-head button i { font-size: 21px; }
.review-person { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 20px 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf9; }
.review-person > div { display: flex; align-items: center; gap: 10px; }
.review-person strong, .review-person small { display: block; }
.review-person strong { font-size: 14px; }
.review-person small { margin-top: 3px; color: var(--muted); font-size: 14px; }
.review-person > b { font: 700 27px "Outfit", sans-serif; }
.review-person > b.is-passed { color: #34724c; }
.review-person > b.is-failed { color: var(--accent-dark); }
.review-person > b small { display: inline; margin-left: 2px; font: 500 14px "Noto Sans TC", sans-serif; }
.review-status-field { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.review-status-field select { width: 100%; height: 44px; padding: 0 11px; border: 1px solid #d1d7d4; border-radius: 9px; background: #fff; color: var(--ink); outline: none; }
.review-status-field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.review-hint { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.review-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 9px; margin-top: 20px; }
.review-actions .secondary-action, .review-actions .primary-action { min-height: 47px; }

.records-email-settings { border-color: #a7bec8; color: var(--green); }
.records-email-settings.is-configured { border-color: #7bb18a; background: #eaf5ec; color: #34724c; }
.email-settings-dialog { width: min(760px, calc(100% - 28px)); max-height: min(860px, calc(100vh - 30px)); max-height: min(860px, calc(100dvh - 30px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); overflow: auto; padding: 0; border: 0; border-radius: 21px 21px 21px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 100px rgba(24,37,44,.32); }
.email-settings-dialog::backdrop { background: rgba(21,31,36,.6); backdrop-filter: blur(3px); }
.email-settings-dialog form { padding: 27px; }
.email-enabled-field { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 22px 0 17px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: #f7f9f8; }
.email-enabled-field span { min-width: 0; }
.email-enabled-field strong, .email-enabled-field small { display: block; }
.email-enabled-field strong { font-size: 15px; }
.email-enabled-field small { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.email-enabled-field input { width: 42px; height: 23px; flex: 0 0 auto; appearance: none; position: relative; margin: 0; border-radius: 99px; background: #c8d0cc; cursor: pointer; transition: 150ms ease; }
.email-enabled-field input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform 150ms ease; }
.email-enabled-field input:checked { background: #4f8c63; }
.email-enabled-field input:checked::after { transform: translateX(19px); }
.email-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.email-field { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.email-field--wide { grid-column: 1 / -1; }
.email-field input, .email-field textarea, .email-field select { width: 100%; padding: 10px 11px; border: 1px solid #d1d7d4; border-radius: 9px; background: #fff; color: var(--ink); outline: none; resize: vertical; }
.email-field input, .email-field select { min-height: 43px; }
.email-field input:focus, .email-field textarea:focus, .email-field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49,95,120,.08); }
.email-field small { color: #8b9692; font-size: 13px; line-height: 1.55; }
.email-template-help { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 11px 12px; border-radius: 9px; background: var(--lime); color: var(--muted); font-size: 13px; }
.email-template-help strong { margin-right: 3px; color: var(--green); }
.email-template-help span { padding: 3px 7px; border-radius: 6px; background: var(--panel); color: var(--green); font-family: monospace; }
.email-settings-dialog .form-message { min-height: 22px; margin: 12px 0 0; }
.option-settings-dialog { width: min(820px, calc(100% - 28px)); max-height: min(820px, calc(100vh - 30px)); max-height: min(820px, calc(100dvh - 30px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); overflow: auto; padding: 0; border: 0; border-radius: 21px 21px 21px 7px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 100px rgba(24,37,44,.32); }
.option-settings-dialog::backdrop { background: rgba(21,31,36,.6); backdrop-filter: blur(3px); }
.option-settings-shell { padding: 27px; }
.option-settings-intro { margin: 12px 0 20px; color: var(--muted); font-size: 14px; }
.option-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.option-settings-group { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #f7f9f8; }
.option-settings-title strong, .option-settings-title small { display: block; }
.option-settings-title strong { font-size: 16px; }
.option-settings-title small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.option-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin: 14px 0 12px; }
.option-add-form input { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.option-add-form input:focus { outline: 2px solid rgba(79,140,99,.2); border-color: var(--green); }
.option-add-form button { min-width: 74px; border: 0; border-radius: 8px; background: var(--green); color: #fff; font-weight: 700; cursor: pointer; }
.option-settings-list { display: grid; gap: 7px; max-height: 330px; overflow: auto; padding-right: 2px; }
.option-settings-empty { padding: 20px 8px; color: var(--muted); text-align: center; font-size: 13px; }
.option-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 43px; padding: 7px 8px 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.option-settings-row span { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.option-settings-row.is-hidden span { color: var(--muted); text-decoration: line-through; }
.option-settings-row button { flex: 0 0 auto; min-width: 76px; min-height: 29px; border: 1px solid #bed0c4; border-radius: 7px; background: #edf6ef; color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; }
.option-settings-row.is-hidden button { border-color: var(--line); background: transparent; color: var(--muted); }
.option-settings-dialog .form-message { min-height: 22px; margin: 12px 0 0; }
.email-settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.email-settings-actions .secondary-action, .email-settings-actions .primary-action { min-height: 48px; }

body[data-theme="dark"] .records-panel, body[data-theme="dark"] .record-stat, body[data-theme="dark"] .records-refresh { background: var(--panel); }
body[data-theme="dark"] .records-import-warning { color: #f4b194; }
body[data-theme="dark"] .records-toolbar, body[data-theme="dark"] .records-table th, body[data-theme="dark"] .records-table tbody tr:hover, body[data-theme="dark"] .review-person, body[data-theme="dark"] .email-enabled-field, body[data-theme="dark"] .option-settings-group { background: #293a43; }
body[data-theme="dark"] .records-toolbar input, body[data-theme="dark"] .records-toolbar select, body[data-theme="dark"] .review-status-field select, body[data-theme="dark"] .email-field input, body[data-theme="dark"] .email-field textarea, body[data-theme="dark"] .email-field select, body[data-theme="dark"] .admin-credentials input { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .records-email-settings.is-configured { border-color: #527b60; background: #29483a; color: #a9dfb9; }
body[data-theme="dark"] .record-action button.record-delete:hover { border-color: #9c654e; background: #4b332d; color: #f4b194; }

@media (max-width: 680px) {
  .pdf-offer { grid-template-columns: auto 1fr; padding: 15px; }
  .pdf-preview-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100svh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    border-radius: 0;
    overflow: hidden;
  }
  .pdf-preview-dialog-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0; }
  .pdf-preview-dialog .report-dialog-header { flex: 0 0 auto; align-items: center; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .pdf-preview-dialog .report-dialog-header > button { flex: 0 0 44px; width: 44px; height: 44px; }
  .pdf-preview-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 24px; -webkit-overflow-scrolling: touch; }
  .pdf-preview-page { min-height: 570px; padding: 26px 20px 50px; }
  .pdf-purchase-button { grid-column: 1 / -1; width: 100%; }
  .pdf-offer-message { grid-column: 1 / -1; }
  .pdf-checkout-code-row { grid-template-columns: 1fr 1fr; }
  .pdf-checkout-code-row input { grid-column: 1 / -1; }
  .pdf-purchases-dialog form { grid-template-columns: 1fr; }
  .pdf-purchases-dialog form .primary-action { width: 100%; }
  .pdf-purchases-code-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pdf-purchases-code-actions .secondary-action, .pdf-purchases-code-actions .primary-action { width: 100%; }
  .pdf-purchase-record { grid-template-columns: 1fr auto; }
  .pdf-purchase-record button { grid-column: 1 / -1; width: 100%; }
  .payment-return-view { min-height: calc(100dvh - 68px); padding: 20px 0 45px; }
  .payment-return-card { padding: 28px 17px; border-radius: 22px 22px 22px 7px; }
  .payment-return-summary { grid-template-columns: 1fr; }
  .payment-return-actions { display: grid; }
  .payment-return-actions button { width: 100%; }
  .pdf-settings-view { padding: 24px 0 50px; }
  .pdf-settings-layout { grid-template-columns: 1fr; }
  .pdf-settings-panel, .pdf-readiness-panel { padding: 18px 15px; }
  .pdf-settings-fields { grid-template-columns: 1fr; }
  .pdf-subject-options { grid-template-columns: 1fr; }
  .pdf-sales-stats { grid-template-columns: 1fr; }
  .pdf-orders-heading { align-items: flex-start; flex-direction: column; padding: 18px 15px 14px; }
  .pdf-orders-heading .records-refresh { width: 100%; }
  .pdf-orders-filters { grid-template-columns: 1fr; padding: 0 15px 14px; }
}

/* Dark-mode text and control contrast */
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder { color: #91a2aa; opacity: 1; }
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea { color: var(--ink); color-scheme: dark; }
body[data-theme="dark"] .search-box input { color: var(--ink); }
body[data-theme="dark"] .report-reason-field textarea { border-color: var(--line); background: #18252c; color: var(--ink); }
body[data-theme="dark"] .subject-index,
body[data-theme="dark"] .footer-bottom,
body[data-theme="dark"] .records-table th,
body[data-theme="dark"] .records-table td::before,
body[data-theme="dark"] .search-box i,
body[data-theme="dark"] .records-search i { color: #b9c7cd; }
body[data-theme="dark"] .question-heading span,
body[data-theme="dark"] .result-kicker,
body[data-theme="dark"] .wrong-card-title,
body[data-theme="dark"] .student-form label > span { color: #f0aa89; }
body[data-theme="dark"] .unanswered-note { color: #f0aa89 !important; }
body[data-theme="dark"] .admin-tab span { color: #e6b48f; }
body[data-theme="dark"] .admin-tab.is-active span { color: var(--ink); }
body[data-theme="dark"] .topbar { border-bottom-color: var(--line); }
body[data-theme="dark"] .mode-icon { background: #294656; color: #b9ddeb; }
body[data-theme="dark"] .mode-icon--key { background: #4b332d; color: #f4b194; }
body[data-theme="dark"] .quiz-header { background: #294f63; }
body[data-theme="dark"] .result-icon,
body[data-theme="dark"] .gate-step-title > span,
body[data-theme="dark"] .demo-video button,
body[data-theme="dark"] .admin-hub-icon,
body[data-theme="dark"] .wrong-option.is-correct > b,
body[data-theme="dark"] .question-inline-report-footer button:hover { background: #315f78; color: #fff; }
body[data-theme="dark"] .primary-action,
body[data-theme="dark"] .exam-action,
body[data-theme="dark"] .admin-hub-card--review .admin-hub-icon { background: #b85a38; color: #fff; }
body[data-theme="dark"] .primary-action:hover,
body[data-theme="dark"] .exam-action:hover { background: #a64d30; }
body[data-theme="dark"] .subject-card:hover .subject-arrow,
body[data-theme="dark"] .unanswered-buttons button:hover,
body[data-theme="dark"] .unanswered-shortcut:hover,
body[data-theme="dark"] .wrong-option.is-selected > b,
body[data-theme="dark"] .danger-action:hover { border-color: #b85a38; background: #b85a38; color: #fff; }
body[data-theme="dark"] .subject-arrow,
body[data-theme="dark"] .guide-dialog-header > button,
body[data-theme="dark"] .report-dialog-header > button { background: #344852; color: #d8e3e7; }
body[data-theme="dark"] .subject-card--maintenance,
body[data-theme="dark"] .subject-card--maintenance:hover { background: rgba(255,255,255,.025); }
body[data-theme="dark"] .subject-card--maintenance > .subject-arrow,
body[data-theme="dark"] .subject-card--maintenance:hover > .subject-arrow { background: rgba(255,255,255,.07); color: var(--muted); }
body[data-theme="dark"] .subject-maintenance-watermark { border-color: rgba(240,160,123,.24); background: rgba(24,37,44,.54); color: rgba(240,160,123,.34); box-shadow: inset 0 0 0 2px rgba(240,160,123,.04); }
body[data-theme="dark"] .exit-dialog-icon,
body[data-theme="dark"] .mobile-status-icon { color: #f4b194; }
body[data-theme="dark"] .quiet-submit:hover,
body[data-theme="dark"] .quiz-nav-button:not(.quiz-nav-button--next):hover:not(:disabled) { color: #f4b194; }
body[data-theme="dark"] .exam-item--locked { background: #27363d; color: #b5c2c7; }
body[data-theme="dark"] .exam-item--locked .exam-item-number { background: #3a4c54; color: #d8e2e6; }
body[data-theme="dark"] .exam-item--locked .exam-meta,
body[data-theme="dark"] .exam-item--locked .exam-meta i { color: #aebdc3; }
body[data-theme="dark"] .exam-action:disabled,
body[data-theme="dark"] .primary-action:disabled,
body[data-theme="dark"] .demo-video button:disabled { background: #40525b; color: #bdcbd1; }
body[data-theme="dark"] .form-message,
body[data-theme="dark"] .report-row-top,
body[data-theme="dark"] .report-row-reason,
body[data-theme="dark"] .question-report-heading strong,
body[data-theme="dark"] .review-dialog-head span { color: #f0aa89; }
body[data-theme="dark"] .stat-card > i { color: #f0a07b; }
body[data-theme="dark"] .stat-card:nth-child(2) > i { color: #add5e5; }
body[data-theme="dark"] .stat-card--dark { border-color: #78aec5; background: #294f63; color: #fff; }
body[data-theme="dark"] .stat-card--dark span { color: #d5e2e7; }
body[data-theme="dark"] .stat-card--dark > i { color: #f0a07b; }
body[data-theme="dark"] .score-card > span { color: var(--muted); }
body[data-theme="dark"] .question-inline-report-top strong { color: #f2c77f; }
body[data-theme="dark"] .question-inline-report--resolved .question-inline-report-top strong { color: #8fd3a5; }
body[data-theme="dark"] .report-row-footer button,
body[data-theme="dark"] .question-row-actions button { background: #344750; color: #d7e2e6; }
body[data-theme="dark"] .question-row-actions .question-publication-button { border-color: #a67a3f; background: #57442a; color: #ffda9a; }
body[data-theme="dark"] .question-row-actions .question-publication-button:hover { border-color: #d5a45c; background: #6a502f; color: #ffe5b6; }
body[data-theme="dark"] .question-row-actions .question-publication-button.is-suspended { border-color: #579573; background: #294b3c; color: #b5e8c9; }
body[data-theme="dark"] .question-row-actions .question-publication-button.is-suspended:hover { border-color: #79ba94; background: #315942; color: #d6f2df; }
body[data-theme="dark"] .question-row--suspended { border-color: #8575a5; background: #39344d; box-shadow: inset 3px 0 0 #ae93d2; }
body[data-theme="dark"] .question-option-preview-item { border-color: var(--line); background: #223139; color: var(--muted); }
body[data-theme="dark"] .question-option-preview-item b { background: #344750; color: var(--ink); }
body[data-theme="dark"] .question-option-preview-item.is-answer { border-color: #527b60; background: #29483a; color: #b9dfc4; }
body[data-theme="dark"] .question-option-preview-item.is-answer b { background: #4f8c63; color: #fff; }
body[data-theme="dark"] .report-row-footer button:hover,
body[data-theme="dark"] .question-row-actions button:hover { background: var(--lime); color: var(--green); }
body[data-theme="dark"] .question-row-actions button:last-child:hover { background: #4b332d; color: #f0aa89; }
body[data-theme="dark"] .question-row-actions .question-review-switch,
body[data-theme="dark"] .question-row-actions .question-review-switch:hover { background: transparent; color: var(--ink); }
body[data-theme="dark"] .question-review-switch-track { border-color: #667982; background: #40535c; }
body[data-theme="dark"] .question-review-switch-track > span { background: #dfe8eb; }
body[data-theme="dark"] .question-review-switch.is-reviewing { color: #f4b194; }
body[data-theme="dark"] .question-review-switch.is-reviewing .question-review-switch-track { border-color: #b85a38; background: #b85a38; }
body[data-theme="dark"] .subject-issue-chip strong { background: #354850; color: #d5e0e4; }
body[data-theme="dark"] .subject-issue-chip.has-issues strong { background: #4b332d; color: #f0aa89; }
body[data-theme="dark"] .subject-issue-chip.is-active strong { background: #315f78; color: #fff; }
body[data-theme="dark"] .subject-issues-heading > b { background: #59422f; color: #ffd28e; }
body[data-theme="dark"] .subject-issues-heading > div > i { background: #4b332d; color: #f4b194; }
body[data-theme="dark"] .subject-suspended-panel .subject-issues-heading > div > i,
body[data-theme="dark"] .subject-suspended-panel .subject-issues-heading > b,
body[data-theme="dark"] .subject-suspended-panel .subject-issue-chip.has-issues strong { background: #334b59; color: #c6e1ee; }
body[data-theme="dark"] .subject-suspended-panel .subject-issue-chip.is-active strong { background: var(--green); color: #fff; }
body[data-theme="dark"] .status-pill { background: #29495a; color: #c3e2ee; }
body[data-theme="dark"] .status-pill--needs_review { background: #59422f; color: #ffd28e; }
body[data-theme="dark"] .status-pill--suspended { background: #57476e; color: #e6d5ff; }
body[data-theme="dark"] .report-count-badge { background: #4b332d; color: #f4b194; }
body[data-theme="dark"] .report-row-top small { background: #59422f; color: #ffd28e; }
body[data-theme="dark"] .report-row--resolved .report-row-top small { background: #29483a; color: #a9dfb9; }
body[data-theme="dark"] .error-badge { background: #4b332d; color: #f4b194; }
body[data-theme="dark"] .history-icon { background: #29483a; color: #a9dfb9; }
body[data-theme="dark"] .history-icon--update { background: #59422f; color: #ffd28e; }
body[data-theme="dark"] .history-icon--delete { background: #4b332d; color: #f4b194; }
body[data-theme="dark"] .import-panel-icon { background: #29495a; color: #c3e2ee; }
body[data-theme="dark"] .record-score.is-passed strong,
body[data-theme="dark"] .review-person > b.is-passed { color: #8fd3a5; }
body[data-theme="dark"] .record-score.is-failed strong,
body[data-theme="dark"] .review-person > b.is-failed { color: #f0aa89; }
body[data-theme="dark"] .record-status--pending { background: #59422f; color: #ffd28e; }
body[data-theme="dark"] .record-status--activated { background: #29483a; color: #a9dfb9; }
body[data-theme="dark"] .record-status--resigned { background: #3b494f; color: #d6dfe2; }
body[data-theme="dark"] .record-stat-icon { background: #344852; color: #c3e2ee; }
body[data-theme="dark"] .record-stat-icon--active { background: #29483a; color: #a9dfb9; }
body[data-theme="dark"] .record-stat-icon--pending { background: #59422f; color: #ffd28e; }
body[data-theme="dark"] .record-stat-icon--resigned { background: #3b494f; color: #d6dfe2; }

.access-layout { min-height: 520px; margin-top: 28px; display: grid; grid-template-columns: .95fr 1.05fr; overflow: hidden; border: 1px solid var(--line); border-radius: 30px 30px 30px 10px; background: #fff; box-shadow: var(--shadow); }
.access-copy { padding: clamp(40px, 6vw, 80px); background: var(--green); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.access-copy .eyebrow { color: var(--lime); }
.access-copy p { max-width: 380px; margin: 22px 0 0; color: rgba(255,255,255,.68); line-height: 1.8; }
.access-exam-panel { padding: clamp(40px, 6vw, 80px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.access-exam-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 18px 18px 18px 5px; background: #ffe7df; color: var(--accent-dark); }
.access-exam-icon i { font-size: 32px; }
.access-label { margin-bottom: 10px; color: var(--muted); font-size: 14px; letter-spacing: .08em; }
.access-exam-panel h3 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.03em; }
.access-exam-panel > p { margin: 12px 0 32px; color: var(--muted); }

.view-enter { animation: enter 340ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Readability scale: keep hierarchy while making supporting text easier to read. */
.topbar-meta { font-size: 14px; }
.eyebrow { font-size: 14px; }
.hero-copy > p { font-size: 17px; }
.mode-content strong { font-size: 23px; }
.mode-content small { font-size: 15px; }
.home-note { font-size: 14px; }
.footer-brand strong { font-size: 15px; }
.footer-links a, .footer-links button { font-size: 14px; }
.footer-bottom { font-size: 14px; }
.guide-grid strong { font-size: 15px; }
.guide-grid p { font-size: 14px; }
.back-button { font-size: 15px; }
.section-heading > p { font-size: 14px; }
.subject-tag { font-size: 14px; }
.setup-step { font-size: 14px; }
.exam-item h3 { font-size: 20px; }
.exam-meta { font-size: 14px; }
.sequence-note { font-size: 14px; }
.quiz-kicker, .result-kicker { font-size: 14px; }
.quiz-header p { font-size: 14px; }
.timer-card span { font-size: 14px; }
.question-heading span { font-size: 14px; }
.question-heading small { font-size: 14px; }
.quiz-question h3 { font-size: 19px; }
.answer-options span { font-size: 14px; }
.quiz-nav-button { font-size: 14px; }
.quiz-submit-row > span { font-size: 14px; }
.exit-dialog > p, .mobile-status-dialog > p { font-size: 14px; }
.quiet-submit { font-size: 14px; }
.result-hero p { font-size: 14px; }
.total-score span { font-size: 14px; }
.score-card strong { font-size: 15px; }
.score-card small { font-size: 14px; }
.wrong-filters button { font-size: 14px; }
.wrong-card-title { font-size: 14px; }
.wrong-card h4 { font-size: 15px; }
.wrong-card p { font-size: 14px; }
.wrong-option { font-size: 14px; }
.wrong-option em { font-size: 14px; }
.perfect-result span { font-size: 14px; }
.form-message { font-size: 14px; }
.gate-heading > p, .gate-step-title p { font-size: 14px; }
.student-form label { font-size: 14px; }
.student-form label > span { font-size: 14px; }
.training-notice strong { font-size: 14px; }
.training-notice p, .demo-video p { font-size: 14px; }
.demo-video button { font-size: 14px; }
.video-status { font-size: 14px; }
.admin-tab { font-size: 14px; }
.admin-tab span { font-size: 14px; }
.stat-card span { font-size: 14px; }
.subheading span { font-size: 14px; }
.error-row strong { font-size: 14px; }
.error-row small { font-size: 14px; }
.category-strip > div strong { font-size: 15px; }
.category-strip > div small, .category-strip label { font-size: 14px; }
.category-strip select { font-size: 14px; }
.history-row strong { font-size: 14px; }
.history-row small { font-size: 14px; }
.admin-inline-message { font-size: 14px; }
.import-panel > p, .import-subject-picker, .admin-form label { font-size: 14px; }
.import-badge { font-size: 14px; }
.file-drop strong { font-size: 14px; }
.file-drop small, .excel-guide { font-size: 14px; }
.export-actions .secondary-action, .danger-action { font-size: 14px; }
.excel-guide > strong { font-size: 14px; }
.excel-guide small { font-size: 14px; }
.admin-form-header h3, .bank-toolbar h3 { font-size: 21px; }
.quiet-button { font-size: 14px; }
.bank-toolbar > div span { font-size: 14px; }
.search-box input { font-size: 14px; }
.question-row h4 { font-size: 16px; }
.question-row > p { font-size: 14px; }
.question-row-actions button { font-size: 14px; }
.empty-bank small { font-size: 14px; }
.access-label { font-size: 14px; }

/* Touch devices can keep :hover active after a tap. Restore resting styles there. */
@media (hover: none) and (pointer: coarse) {
  .logout-button:hover { color: var(--muted); border-color: var(--line); background: rgba(255, 255, 255, .55); }
  .mode-card:hover { transform: none; border-color: var(--line); box-shadow: 0 8px 30px rgba(23, 32, 24, .04); }
  .mode-card--primary:hover { border-color: var(--green); background: var(--green); color: #fff; }
  .mode-card:hover .arrow { transform: rotate(-45deg); }
  .footer-links a:hover, .footer-links button:hover { color: var(--muted); border-color: var(--line); background: rgba(255, 255, 255, .55); }
  .back-button:hover i { transform: none; }
  .subject-card:hover { padding-left: 6px; background: transparent; }
  .subject-card:hover .subject-arrow { background: #e9ece6; color: var(--ink); transform: none; }
  .exam-action:hover:not(:disabled), .primary-action:hover:not(:disabled) { background: var(--accent); transform: none; }
  .report-question-button:hover:not(:disabled) { background: #c94c4c; border-color: #b83d3d; }
  .answer-options label:hover input:not(:checked) + span { border-color: var(--line); color: var(--muted); }
  .quiz-nav-button:hover:not(:disabled) { border-color: var(--line); color: var(--green); }
  .quiz-nav-button--next:hover:not(:disabled) { border-color: var(--green); background: var(--green); color: #fff; }
  .quiet-submit:hover { background: transparent; color: var(--muted); }
  .wrong-filters button:hover:not(.is-active) { border-color: var(--line); color: var(--muted); }
  .wrong-report-button:hover:not(:disabled) { border-color: #cf8c8c; background: transparent; }
  .admin-hub-card:hover:not(:disabled) { transform: none; border-color: var(--line); box-shadow: 0 10px 32px rgba(35, 57, 68, .05); }
  .admin-hub-card:hover:not(:disabled) .admin-hub-arrow { transform: none; }
  .admin-tab:hover:not(.is-active) { background: transparent; color: var(--muted); }
  .error-row:hover { background: #fbfcfa; }
  .report-row-footer button:hover, .question-row-actions button:hover { background: #e9ede7; color: var(--muted); }
  .subject-issue-chip:hover:not(.is-active) { border-color: var(--line); background: #fafbf9; color: var(--muted); }
  .subject-issue-chip.has-issues:hover:not(.is-active) { border-color: #e5bfad; color: var(--ink); }
  .history-pagination button:hover:not(:disabled), .question-pagination button:hover:not(:disabled):not(.is-active) { border-color: var(--line); background: var(--panel); color: var(--ink); }
  .file-drop:hover { border-color: #bbc5b8; background: #fafcf8; }
  .admin-password-toggle:hover { background: transparent; color: var(--muted); }
  .danger-action:hover { border-color: #e2ad97; background: #fff4ef; color: var(--accent-dark); }
  .secondary-action:hover { border-color: var(--line); background: transparent; }
  .quiet-button:hover { color: var(--muted); }
  .records-summary button:hover { color: var(--green); }
  .question-inline-report-footer button:hover { background: var(--lime); color: var(--green); }
  .question-row-actions button:last-child:hover { background: #e9ede7; color: var(--muted); }
  .question-row-actions .question-review-switch:hover { background: transparent; color: var(--muted); }
  .records-refresh:hover { border-color: var(--line); color: var(--muted); }
  .record-stat:hover:not(.is-active) { border-color: var(--line); background: rgba(255, 255, 255, .72); box-shadow: none; }
  .records-table tbody tr:hover { background: transparent; }
  .record-action button:hover { border-color: var(--line); background: transparent; color: var(--green); }
  .record-action button.record-delete:hover { border-color: var(--line); background: transparent; color: var(--accent-dark); }

  body[data-theme="dark"] .logout-button:hover,
  body[data-theme="dark"] .footer-links a:hover,
  body[data-theme="dark"] .footer-links button:hover { background: #293a43; border-color: var(--line); color: var(--muted); }
  body[data-theme="dark"] .mode-card:hover { background: var(--panel); }
  body[data-theme="dark"] .mode-card--primary:hover { background: #294f63; border-color: #294f63; color: #fff; }
  body[data-theme="dark"] .subject-card:hover { background: transparent; }
  body[data-theme="dark"] .subject-card:hover .subject-arrow { background: #344852; color: #d8e3e7; }
  body[data-theme="dark"] .exam-action:hover:not(:disabled),
  body[data-theme="dark"] .primary-action:hover:not(:disabled) { background: #b85a38; }
  body[data-theme="dark"] .quiet-submit:hover { background: transparent; color: var(--muted); }
  body[data-theme="dark"] .error-row:hover,
  body[data-theme="dark"] .records-table tbody tr:hover { background: #293a43; }
  body[data-theme="dark"] .subject-issue-chip:hover:not(.is-active) { background: var(--panel); }
  body[data-theme="dark"] .danger-action:hover { border-color: #9c654e; background: #4b332d; color: var(--accent-dark); }
  body[data-theme="dark"] .report-row-footer button:hover,
  body[data-theme="dark"] .question-row-actions button:hover { background: #344750; color: #d7e2e6; }
  body[data-theme="dark"] .question-row-actions .question-review-switch:hover { background: transparent; color: var(--ink); }
  body[data-theme="dark"] .question-inline-report-footer button:hover { background: #315f78; color: #fff; }
  body[data-theme="dark"] .record-stat:hover:not(.is-active),
  body[data-theme="dark"] .records-refresh:hover { background: var(--panel); }
  body[data-theme="dark"] .record-action button.record-delete:hover { border-color: var(--line); background: transparent; color: var(--accent-dark); }
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 3px solid rgba(217, 120, 80, .28); outline-offset: 2px; }

@media (max-width: 1100px) {
  .app-shell, .site-footer { width: calc(100% - 40px); }
  .home-view { width: min(760px, 100%); min-height: 0; padding: 56px 0 48px; grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 36px; }
  .hero-copy { max-width: 680px; }
  .hero-copy h1 { font-size: clamp(52px, 8vw, 72px); }
  .home-note { grid-column: auto; }
  .seo-faq { grid-column: auto; }
  .access-layout { grid-template-columns: 1fr; min-height: 0; }
  .access-copy, .access-exam-panel { min-height: 280px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-editor-column { position: static; max-height: none; padding-right: 0; overflow: visible; }
  .catalog-settings-layout { grid-template-columns: 1fr; }
  .catalog-subject-form { position: static; }
  .catalog-exam-form { grid-template-columns: 1fr 1fr; }
  .catalog-exam-form label:first-child, .catalog-exam-form .secondary-action { grid-column: 1 / -1; }
  .admin-accounts-layout { grid-template-columns: 1fr; }
  .admin-login-email-grid { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .subject-issue-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .records-toolbar { grid-template-columns: 1.4fr repeat(3, 1fr); }
  .site-footer { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .catalog-settings-intro { align-items: flex-start; flex-direction: column; }
  .catalog-subject-card > header { align-items: flex-start; }
  .catalog-subject-controls { align-items: flex-end; flex-direction: column; }
  .catalog-exam-edit-form { grid-template-columns: 32px repeat(2, minmax(0, 1fr)); }
  .catalog-exam-edit-name, .catalog-exam-edit-footer { grid-column: 2 / -1; }
  .app-shell { width: min(100% - 32px, 680px); }
  .home-view { padding-top: 48px; grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 42px; }
  .hero-copy h1 { font-size: clamp(48px, 12vw, 70px); }
  .home-note { grid-column: auto; }
  .seo-faq { grid-column: auto; grid-template-columns: 1fr; gap: 22px; }
  .admin-login-frame { margin-top: 42px; }
  .admin-login-layout { grid-template-columns: 1fr; }
  .admin-login-copy { min-height: 320px; margin: 0 0 -38px; padding: 38px 34px 76px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 38px), 0 100%); }
  .admin-login-copy-icon { margin-bottom: 22px; }
  .admin-login-points { grid-template-columns: repeat(3, 1fr); margin-top: 28px; }
  .admin-login-card { padding: 72px 34px 36px; }
  .admin-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storage-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-layout { grid-template-columns: 1fr; min-height: 0; }
  .access-copy { min-height: 310px; }
  .access-exam-panel { min-height: 330px; }
  .admin-layout { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .record-stats { grid-template-columns: repeat(2, 1fr); }
  .records-toolbar { grid-template-columns: 1fr 1fr; }
  .records-search { grid-column: 1 / -1; }
  .category-strip { flex-wrap: wrap; }
  .category-strip > div { width: 100%; }
  .attempt-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attempt-stat-tables { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collaboration-hero { grid-template-columns: 1fr; align-items: start; gap: 24px; }
  .collaboration-summary { width: 100%; }
  .collaboration-summary > div { min-width: 0; }
  .collaboration-case { grid-template-columns: 58px 1fr; }
  .case-open { grid-column: 1 / -1; width: 100%; min-height: 48px; border-left: 0; border-top: 1px solid var(--line); }
  .case-dialog-body { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; overflow-y: auto; }
  .case-context, .case-discussion { min-height: 0; overflow: visible; }
  .case-context { border-right: 0; border-bottom: 1px solid var(--line); }
  .collaboration-admin-control { align-items: flex-start; }
}

@media (max-width: 560px) {
  .app-shell { width: calc(100% - 24px); }
  .catalog-subject-card > header { flex-direction: column; }
  .catalog-subject-controls { width: 100%; align-items: center; flex-flow: row wrap; justify-content: space-between; }
  .catalog-exam-row { grid-template-columns: 32px minmax(0, 1fr); }
  .catalog-exam-row .catalog-exam-actions { grid-column: 2; flex-wrap: wrap; justify-content: flex-end; }
  .catalog-exam-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .catalog-exam-edit-index { display: none; }
  .catalog-exam-edit-name, .catalog-exam-edit-footer { grid-column: 1 / -1; }
  .catalog-exam-edit-footer { align-items: stretch; flex-direction: column; }
  .catalog-exam-edit-options { align-items: stretch; flex-direction: column; }
  .catalog-exam-edit-actions > button { flex: 1; }
  .topbar { height: 68px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 68px; height: 30px; }
  .topbar-meta { display: none; }
  .topbar-actions { gap: 0; }
  .retention-policy-dialog form, .storage-usage-dialog form { padding: 22px 18px; }
  .storage-table-heading { align-items: stretch; flex-direction: column; }
  .storage-table-heading .secondary-action { width: 100%; }
  .retention-rule-section li { grid-template-columns: 1fr; gap: 2px; }
  .logout-button { min-height: 34px; padding: 6px 10px; }
  .home-view { min-height: calc(100vh - 68px); min-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding: 38px 0 30px; gap: 34px; }
  .hero-copy h1 { margin: 19px 0 16px; font-size: clamp(36px, 11.8vw, 46px); }
  .hero-copy > p { font-size: 14px; }
  .seo-faq { padding-top: 32px; }
  .mode-card { min-height: 124px; padding: 22px 18px; gap: 14px; border-radius: 19px 19px 19px 7px; }
  .mode-icon { width: 48px; height: 48px; border-radius: 14px 14px 14px 4px; }
  .mode-icon i { font-size: 25px; }
  .mode-content strong { font-size: 18px; }
  .arrow { font-size: 22px; }
  .collaboration-view { padding-top: 24px; }
  .collaboration-hero { margin-top: 30px; padding-bottom: 26px; }
  .collaboration-hero h2 { margin-top: 13px; font-size: 39px; }
  .collaboration-hero > div:first-child > p { font-size: 14px; line-height: 1.7; }
  .collaboration-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .collaboration-summary > div { padding: 13px 6px; text-align: center; }
  .collaboration-summary strong { font-size: 22px; }
  .collaboration-summary span { font-size: 10px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
  .collaboration-toolbar { align-items: flex-start; flex-direction: column; padding: 16px 0; }
  .collaboration-filters { width: 100%; }
  .collaboration-filters button { flex: 1; justify-content: center; }
  .collaboration-rule { align-items: flex-start; font-size: 12px; line-height: 1.55; }
  .collaboration-top { --collaboration-top-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); right: calc(18px + env(safe-area-inset-right, 0px)); width: 50px; height: 50px; }
  .collaboration-case { grid-template-columns: 1fr; }
  .case-rank { position: absolute; top: 20px; right: 18px; z-index: 1; display: block; border: 0; }
  .case-rank small { display: none; }
  .case-rank strong { font-size: 17px; opacity: .45; }
  .case-main { padding: 21px 18px 18px; }
  .case-topline { padding-right: 30px; flex-wrap: wrap; }
  .case-topline time { width: 100%; margin-left: 0; }
  .case-main h3 { margin-top: 13px; font-size: 16px; }
  .case-option-summary { grid-template-columns: 1fr; }
  .case-footer { align-items: flex-start; flex-direction: column; gap: 12px; }
  .case-author { width: 100%; flex-wrap: wrap; }
  .case-signals { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px 14px; line-height: 1.5; }
  .case-signals span { flex: 0 1 auto; }
  .case-open { grid-column: auto; }
  .case-dialog {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .case-dialog-shell { height: 100%; max-height: 100%; overflow: hidden; }
  .case-dialog-body { flex: 1 1 auto; display: block; width: 100%; max-width: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .case-dialog-header, .case-context, .case-discussion { width: 100%; max-width: 100%; padding-left: max(19px, env(safe-area-inset-left, 0px)); padding-right: max(19px, env(safe-area-inset-right, 0px)); }
  .case-dialog-header { gap: 12px; padding-top: max(20px, env(safe-area-inset-top, 0px)); }
  .case-context, .case-discussion { overflow: visible; }
  .case-discussion { padding-bottom: max(27px, env(safe-area-inset-bottom, 0px)); }
  .case-dialog-header h3 { font-size: 20px; overflow-wrap: anywhere; }
  .case-dialog-header > button { flex: 0 0 36px; }
  .case-question { font-size: 16px; }
  .case-question-options > div { grid-template-columns: 27px minmax(0, 1fr); padding: 10px; }
  .case-question-options > div.is-correct { grid-template-columns: 27px minmax(0, 1fr); }
  .case-question-options > div.is-correct em { grid-column: 2; justify-self: start; }
  .case-report-reason { min-width: 0; padding: 15px; }
  .case-report-reason > div { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
  .case-report-reason time { width: 100%; padding-left: 32px; }
  .case-comment > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .case-comment > div .case-user { align-self: center; }
  .case-comment-stance { align-self: center; white-space: nowrap; }
  .case-comment > div time { grid-column: 1 / -1; width: 100%; margin-left: 32px; }
  .case-comment > p { margin-left: 0; }
  .case-stance-picker label { flex: 0 1 auto; min-width: 0; }
  .case-stance-picker span { max-width: 100%; white-space: normal; text-align: center; }
  .case-comment-limit { align-items: flex-start; }
  .case-comment-limit i { flex: 0 0 auto; margin-top: 1px; }
  .case-comment-form > div { align-items: stretch; flex-direction: column; gap: 8px; }
  .case-comment-form > div > span { width: 100%; min-height: 0; }
  .case-comment-form button { width: 100%; justify-content: center; }
  .collaboration-admin-control { align-items: stretch; flex-direction: column; padding: 20px 18px; }
  .collaboration-switch { justify-content: flex-end; }
  .collaboration-admin-state { align-items: flex-start; }
  .collaboration-admin-stats { grid-template-columns: 1fr; }
  .collaboration-archive-panel { padding: 18px 14px; }
  .collaboration-archive-row { padding: 17px 15px; }
  .collaboration-weekly-history section { grid-template-columns: 1fr 1fr; }
  .collaboration-weekly-history section small { grid-column: 1 / -1; }
  .collaboration-archive-footer button { width: 100%; justify-content: center; margin-left: 0; }
  .collaboration-case-actions { width: 100%; margin-left: 0; }
  .collaboration-case-actions button { flex: 1; width: auto; }
  .content-view, .setup-view, .access-view { padding-top: 24px; }
  .section-heading { margin-top: 32px; align-items: start; }
  .section-heading > p { display: none; }
  .section-heading h2, .access-copy h2 { font-size: 36px; }
  .subject-card { grid-template-columns: 32px 1fr auto 38px; gap: 10px; min-height: 92px; padding-right: 4px; }
  .subject-tag { display: none; }
  .subject-tag--updated, .subject-tag--maintenance { display: inline-flex; }
  .subject-tag--updated { top: -9px; left: 7px; max-width: none; padding: 4px 8px; white-space: nowrap; }
  .subject-tag--maintenance { max-width: 88px; padding: 4px 7px; font-size: 10px; line-height: 1.2; text-align: center; white-space: normal; }
  .subject-maintenance-watermark { left: 58%; min-width: 132px; padding: 6px 11px 5px; }
  .subject-maintenance-watermark b { font-size: 17px; letter-spacing: .22em; text-indent: .22em; }
  .subject-maintenance-watermark small { font-size: 7px; letter-spacing: .15em; text-indent: .15em; }
  .subject-attempts { gap: 4px; padding: 6px 8px; font-size: 12px; }
  .subject-attempts > i, .attempt-label-prefix, .attempt-label-suffix { display: none; }
  .subject-attempts strong { font-size: 14px; }
  .attempt-label-mobile { display: inline; }
  .subject-arrow { width: 36px; height: 36px; }
  .mobile-break { display: block; }
  .setup-panel { margin-top: 18px; padding: 26px 18px; border-radius: 22px 22px 22px 8px; }
  .setup-panel h2 { font-size: 29px; }
  .quiz-view, .result-view { padding-top: 20px; }
  .quiz-header { align-items: stretch; flex-direction: column; padding: 24px 18px; }
  .quiz-header-actions { width: 100%; flex-direction: column; }
  .quiz-question .report-question-button { top: 11px; right: 11px; width: auto; min-height: 34px; padding: 0 8px; }
  .question-heading { min-height: 34px; padding-right: 128px; }
  .report-question-options { grid-template-columns: 1fr; }
  .timer-card { width: 100%; }
  .quiz-questions { padding: 18px 12px 8px; }
  .quiz-question { padding: 18px 14px; }
  .quiz-question--single { min-height: 0; }
  .answer-options { grid-template-columns: 1fr; }
  .answer-options span { min-height: 48px; }
  .quiz-navigation { grid-template-columns: 1fr auto 1fr; gap: 7px; padding: 10px 12px 2px; }
  .quiz-nav-button { min-width: 0; padding: 0 9px; }
  .quiz-navigation > span { font-size: 14px; }
  .quiz-submit-row { align-items: stretch; flex-direction: column; padding: 13px 12px 20px; }
  .unanswered-shortcut, .quiz-submit { width: 100%; min-width: 0; margin-left: 0; }
  .result-panel { padding: 22px 14px; }
  .result-hero { grid-template-columns: auto 1fr; }
  .result-icon { width: 48px; height: 48px; }
  .total-score { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: center; gap: 7px; padding-top: 16px; border-top: 1px solid var(--line); }
  .section-scores { grid-template-columns: 1fr; }
  .wrong-section { padding: 17px 12px; }
  .result-actions { grid-template-columns: 1fr; }
  .exam-item { grid-template-columns: 40px 1fr; padding: 17px 14px; }
  .exam-item-number { width: 38px; height: 38px; }
  .exam-action { grid-column: 1 / -1; width: 100%; }
  .access-layout { border-radius: 22px 22px 22px 8px; }
  .access-copy, .access-exam-panel { padding: 34px 24px; min-height: 280px; }
  .mobile-gate-view { padding: 20px 0 45px; }
  .admin-login-view { min-height: calc(100vh - 68px); min-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding-top: 24px; }
  .admin-login-frame { margin-top: 32px; }
  .admin-login-layout { clip-path: polygon(0 22px, 22px 0, calc(100% - 42px) 0, 100% 42px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%); }
  .admin-login-copy { min-height: 300px; padding: 30px 22px 68px; }
  .admin-login-copy-icon { width: 50px; height: 50px; margin-bottom: 20px; }
  .admin-login-copy-icon i { font-size: 26px; }
  .admin-login-copy h2 { margin-top: 17px; font-size: 40px; }
  .admin-login-copy > p { font-size: 14px; }
  .admin-login-points { grid-template-columns: 1fr; gap: 8px; margin-top: 22px; }
  .admin-login-card { padding: 66px 20px 28px; }
  .admin-login-card-head { margin-bottom: 23px; }
  .admin-login-card-head h3 { font-size: 21px; }
  .admin-hub-view { min-height: calc(100vh - 68px); min-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding-top: 24px; }
  .admin-hub-heading { margin: 42px 0 22px; }
  .admin-hub-heading h2 { font-size: 40px; }
  .admin-hub-sections { gap: 24px; }
  .admin-hub-grid { grid-template-columns: 1fr; gap: 10px; }
  .admin-hub-card { min-height: 158px; padding: 18px; }
  .admin-hub-card--compact { min-height: 130px; padding: 16px; }
  .admin-hub-icon { width: 50px; height: 50px; }
  .admin-hub-card--compact .admin-hub-icon { width: 43px; height: 43px; }
  .admin-hub-content strong { font-size: 21px; }
  .admin-hub-card--compact .admin-hub-content strong { font-size: 17px; }
  .admin-hub-link { min-height: 72px; gap: 11px; padding: 12px 14px; }
  .gate-heading { margin: 25px 0 20px; }
  .gate-heading h2 { font-size: 34px; }
  .gate-step { padding: 21px 15px; border-radius: 18px 18px 18px 6px; }
  .gate-step-title { grid-template-columns: 40px 1fr auto; gap: 10px; margin-bottom: 20px; }
  .gate-step-title > span { width: 38px; height: 38px; }
  .gate-step-title h3 { font-size: 19px; }
  .gate-step-title > i { font-size: 23px; }
  .student-form { grid-template-columns: 1fr; gap: 13px; }
  .license-field, .student-confirm, .student-form .form-message, .student-status-notice { grid-column: auto; }
  .demo-video { min-height: 250px; padding: 24px 18px; }
  .training-notice { padding: 13px; }
  .admin-form, .admin-bank { padding: 19px 15px; }
  .admin-accounts-panel, .admin-account-editor { padding: 19px 15px; }
  .admin-accounts-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-account-refresh { width: 100%; }
  .admin-account-row { grid-template-columns: 39px minmax(0, 1fr); grid-template-areas: "avatar info" "avatar status" "actions actions"; }
  .admin-account-row-avatar { width: 39px; height: 39px; }
  .admin-account-status { justify-self: start; }
  .admin-account-actions { justify-content: stretch; }
  .admin-account-actions button { flex: 1; justify-content: center; }
  .admin-account-form-actions { grid-template-columns: 1fr; }
  .admin-account-permission-grid { grid-template-columns: 1fr; }
  .admin-account-form-actions .quiet-button { order: 2; }
  .feedback-dialog form { padding: 23px 18px; }
  .feedback-form-grid { grid-template-columns: 1fr; }
  .feedback-message-field { grid-column: auto; }
  .feedback-inbox-view { min-height: calc(100vh - 68px); min-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding-top: 24px; }
  .feedback-inbox-heading > .records-refresh { width: 100%; justify-content: center; }
  .feedback-inbox-overview { align-items: stretch; flex-direction: column; }
  .feedback-inbox-summary { width: 100%; }
  .feedback-status-tabs { width: 100%; }
  .feedback-status-tabs button { flex: 1; justify-content: center; padding-inline: 8px; }
  .feedback-inbox-filters { grid-template-columns: 1fr; }
  .feedback-filter-reset { width: 100%; }
  .feedback-inbox-item { padding: 17px 15px; }
  .feedback-inbox-item-head, .feedback-inbox-item-meta { align-items: flex-start; flex-direction: column; gap: 9px; }
  .feedback-inbox-item-footer { align-items: stretch; flex-direction: column; }
  .feedback-inbox-item-actions { width: 100%; }
  .feedback-inbox-item-actions button { flex: 1; justify-content: center; }
  .feedback-inbox-item > p { margin: 13px 0; }
  .import-panel { padding: 19px 15px; }
  .site-footer { width: calc(100% - 24px); grid-template-columns: 1fr; gap: 18px; padding: 22px 18px 16px; }
  .footer-links { grid-template-columns: 1fr 1fr; gap: 7px; }
  .footer-bottom { gap: 10px; flex-direction: column; }
  .guide-dialog-header { padding: 23px 20px 17px; }
  .guide-grid { grid-template-columns: 1fr; padding: 17px 20px 22px; }
  .guide-support dl { grid-template-columns: 1fr; }
  .sponsor-dialog-header { padding: 23px 20px 17px; }
  .sponsor-dialog-body { grid-template-columns: 1fr; justify-items: center; gap: 22px; padding: 22px 20px 25px; }
  .sponsor-copy { justify-items: center; text-align: center; }
  .updates-dialog-header { padding: 23px 20px 17px; }
  .updates-toolbar { padding: 16px 16px 0; }
  .updates-form { margin: 16px 16px 0; padding: 16px; }
  .updates-form-row { grid-template-columns: 1fr; }
  .updates-message { padding: 0 16px; }
  .updates-list { padding: 20px 16px 24px; }
  .update-item { grid-template-columns: 1fr; gap: 13px; padding: 18px 16px; }
  .admin-tabs { overflow-x: auto; }
  .admin-tab { white-space: nowrap; }
  .attempt-settings-panel { padding: 18px 14px; }
  .attempt-settings-heading { align-items: stretch; flex-direction: column; }
  .attempt-settings-heading .primary-action { width: 100%; }
  .attempt-settings-grid { grid-template-columns: 1fr; }
  .attempt-statistics { padding: 18px 14px; }
  .attempt-stat-summary { grid-template-columns: repeat(2, 1fr); }
  .subject-issues-panel { padding: 15px 13px; }
  .subject-issues-heading { align-items: flex-start; flex-direction: column; }
  .subject-issue-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-section, .history-panel { padding: 18px 14px; }
  .frequent-wrong-row { grid-template-columns: 34px minmax(0, 1fr) 18px; gap: 10px; padding: 11px 8px; }
  .frequent-wrong-rank { width: 32px; height: 32px; }
  .frequent-wrong-metrics { grid-column: 2; flex-wrap: wrap; gap: 5px 8px; }
  .frequent-wrong-row > i { grid-column: 3; grid-row: 1; }
  .history-row { grid-template-columns: 31px 1fr; }
  .history-row time { grid-column: 2; }
  .report-row-footer { align-items: flex-start; flex-direction: column; }
  .report-row-footer > div { width: 100%; }
  .report-row-footer button { flex: 1; justify-content: center; }
  .bank-toolbar { align-items: flex-start; flex-direction: column; }
  .bank-toolbar > .bank-searches { width: 100%; align-items: stretch; }
  .search-box { width: 100%; }
  .question-row-top { align-items: flex-start; flex-direction: column; }
  .question-row-badges { justify-content: flex-start; }
  .question-option-preview { grid-template-columns: 1fr; }
  .question-inline-report-top, .question-inline-report-footer { align-items: flex-start; flex-direction: column; }
  .question-inline-report-footer button { width: 100%; justify-content: center; }
  .export-actions { grid-template-columns: 1fr; }
  .records-view { padding-top: 24px; }
  .records-heading { align-items: flex-start; flex-direction: column; margin-top: 29px; }
  .records-heading h2 { font-size: 34px; }
  .records-heading-actions { width: 100%; justify-content: flex-start; }
  .records-heading-actions .records-refresh { align-self: auto; margin-top: 0; }
  .email-settings-dialog form { padding: 22px 16px; }
  .option-settings-shell { padding: 22px 16px; }
  .option-settings-grid { grid-template-columns: 1fr; }
  .email-settings-grid { grid-template-columns: 1fr; }
  .email-field--wide { grid-column: auto; }
  .email-settings-actions { grid-template-columns: 1fr; }
  .record-stats { gap: 8px; }
  .record-stat { padding: 13px 11px; }
  .record-stat-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .record-stat strong { font-size: 21px; }
  .records-toolbar { grid-template-columns: 1fr; padding: 14px; }
  .records-search { grid-column: auto; }
  .records-summary { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px 14px; }
  .records-summary-actions { width: 100%; justify-content: space-between; }
  .records-table-wrap { overflow: visible; }
  .records-table, .records-table tbody { display: block; }
  .records-table thead { display: none; }
  .records-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 8px; padding: 16px 14px; border-bottom: 1px solid var(--line); }
  .records-table tr:last-child { border-bottom: 0; }
  .records-table td { min-width: 0; display: block; padding: 0; border: 0; }
  .records-table td::before { content: attr(data-label); display: block; margin-bottom: 6px; color: #929b97; font-size: 14px; }
  .records-table .record-action { grid-column: 1 / -1; width: 100%; }
  .records-table .record-action::before { display: none; }
  .record-action-buttons { width: 100%; }
  .record-action button { min-width: 0; flex: 1; justify-content: center; min-height: 39px; }
  .record-person, .record-organization, .record-score, .record-date { min-width: 0; }
  .record-person small, .record-organization small, .record-score small, .record-date small { white-space: normal; }
}

@media (max-width: 400px) {
  .storage-summary { grid-template-columns: 1fr; }
  .subject-issue-list { grid-template-columns: 1fr; }
  .record-stats { grid-template-columns: 1fr; }
  .record-stat { min-height: 62px; }
  .records-refresh { align-self: flex-start; margin-top: 0; }
  .records-table tr { grid-template-columns: 1fr; }
  .records-table .record-action { grid-column: auto; }
}

/* Keep editable controls at 16px or larger to avoid mobile focus zoom.
   Include touch devices in landscape, and retain native pinch-to-zoom. */
@media (max-width: 820px), (any-pointer: coarse) {
  input:not(:where([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"], [type="button"], [type="submit"], [type="reset"], [type="image"])),
  select,
  textarea {
    font-size: max(16px, 1em) !important;
  }

  .attempt-settings-grid input { font-size: 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .intro-stage { display: none; }
  body.is-intro .topbar, body.is-intro #app > .view-enter, body.is-intro .site-footer { animation: none; }
}

.combo-view { max-width: var(--content-max); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: start; column-gap: 28px; }
.combo-view > .back-button, .combo-heading, .combo-view > .form-message { grid-column: 1 / -1; }
.combo-heading { margin: 32px 0 22px; }
.combo-pick, .combo-board { min-width: 0; }
.combo-subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.combo-challenge { --challenge-color: #427c91; --challenge-soft: #e6f2f4; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; min-width: 0; min-height: 118px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.combo-challenge--life { --challenge-color: #bc6171; --challenge-soft: #fff0f1; }
.combo-challenge--fx { --challenge-color: #5276b4; --challenge-soft: #edf2ff; }
.combo-challenge--invest { --challenge-color: #9b723d; --challenge-soft: #fff4e4; }
.combo-challenge--property { --challenge-color: #6771ad; --challenge-soft: #f0f0ff; }
.combo-challenge--ethics { --challenge-color: #388576; --challenge-soft: #e9f6f0; }
.combo-challenge:hover { transform: translateY(-3px); border-color: var(--challenge-color); box-shadow: 0 10px 24px rgba(19, 53, 65, .12); }
.combo-challenge:focus-visible { outline: 3px solid #e8b65c; outline-offset: 3px; }
.combo-challenge-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--challenge-soft); color: var(--challenge-color); font-size: 19px; }
.combo-challenge-copy { display: grid; min-width: 0; gap: 3px; padding-right: 15px; }
.combo-challenge-copy small { color: var(--challenge-color); font: 800 10px "Outfit", sans-serif; letter-spacing: .11em; }
.combo-challenge-copy strong { font-size: 16px; font-weight: 750; line-height: 1.33; overflow-wrap: anywhere; }
.combo-challenge-copy em { font-size: 13px; font-style: normal; opacity: .78; }
.combo-challenge-state { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.combo-challenge-state i { font-size: 19px; }
.combo-challenge-featured { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 17px; min-height: 108px; padding: 18px 20px; overflow: hidden; background: linear-gradient(115deg, #fff2d9, #ffe6b5); color: #43351f; border-color: #e8c987; }
.combo-challenge-featured::after { content: ""; position: absolute; width: 150px; height: 150px; right: 32px; bottom: -94px; border: 1px solid rgba(136, 91, 30, .2); border-radius: 50%; pointer-events: none; }
.combo-challenge-featured .combo-challenge-icon { width: 54px; height: 54px; border-radius: 16px; background: rgba(146, 96, 25, .12); color: #8a5c20; font-size: 28px; }
.combo-challenge-featured .combo-challenge-copy { gap: 3px; }
.combo-challenge-featured .combo-challenge-copy small { color: #8a5c20; font-size: 11px; }
.combo-challenge-featured .combo-challenge-copy strong { font-size: 23px; }
.combo-challenge-featured .combo-challenge-state { color: #795728; }
.combo-challenge.is-active { border-color: #e8b65c; background: linear-gradient(135deg, #315f78, #1c4055); color: #fff; box-shadow: inset 0 0 0 2px #e8b65c, 0 8px 20px rgba(19, 53, 65, .14); }
.combo-challenge.is-active .combo-challenge-icon { background: rgba(255, 215, 131, .18); color: #ffd783; }
.combo-challenge.is-active .combo-challenge-copy small { color: #ffd783; }
.combo-challenge.is-active .combo-challenge-state { top: 10px; right: 10px; gap: 2px; padding: 4px 8px; border-radius: 999px; background: #ffd783; color: #43351f; }
.combo-challenge.is-unavailable { opacity: .6; }
.combo-challenge.is-unavailable .combo-challenge-state { color: var(--challenge-color); }
.combo-challenge.is-unavailable.combo-challenge-featured .combo-challenge-state { color: #ffd783; }
body[data-theme="dark"] .combo-challenge:not(.is-active, .combo-challenge-featured) .combo-challenge-icon { background: rgba(255, 255, 255, .1); color: #c1dbe7; }
body[data-theme="dark"] .combo-challenge:not(.is-active, .combo-challenge-featured) .combo-challenge-copy small { color: #c1dbe7; }
.combo-start-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.combo-start-row > span { min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.4; }
.combo-start-row .primary-action { width: auto; min-width: 146px; min-height: 48px; padding: 0 16px; }
.combo-board { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.combo-board-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 20px; background: #315f78; color: #fff; }
.combo-board-heading h3 { display: inline-flex; align-items: center; min-width: 0; gap: 10px; margin: 0; font-size: 19px; }
.combo-board-heading h3 span { min-width: 0; overflow-wrap: anywhere; }
.combo-board-heading h3 i { color: #ffd783; font-size: 23px; }
.combo-board-heading > span { color: rgba(255,255,255,.7); white-space: nowrap; }
.combo-board-count { display: grid; gap: 2px; text-align: right; }
.combo-board-count small { font-size: 11px; }
.combo-board-count strong { color: #fff; font-size: 12px; }
.combo-record { display: grid; gap: 6px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(110deg, rgba(255,215,131,.24), rgba(255,215,131,.05)); }
.combo-record-label { display: inline-flex; align-items: center; gap: 5px; color: #996a23; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.combo-record-label i { font-size: 18px; }
.combo-record-best { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; color: var(--muted); font-size: 14px; }
.combo-record-best strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 18px; }
.combo-record-best b { flex: none; color: var(--green); font: 800 29px "Outfit", sans-serif; white-space: nowrap; }
.combo-record-best b small { color: var(--muted); font-size: 11px; letter-spacing: .07em; }
body[data-theme="dark"] .combo-record-label { color: #f5cd84; }
.combo-board-empty { margin: 0; padding: 28px 20px; color: var(--muted); text-align: center; }
.combo-scores { margin: 0; padding: 0; list-style: none; }
.combo-scores li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.combo-scores li:last-child { border-bottom: 0; }
.combo-rank { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); font: 700 14px "Outfit", sans-serif; }
.combo-scores li:nth-child(-n+3) { background: rgba(255,215,131,.09); }
.combo-scores li:first-child .combo-rank { background: #f5d37f; color: #5f4813; }
.combo-scores li:nth-child(2) .combo-rank { background: #d9e1e5; color: #455660; }
.combo-scores li:nth-child(3) .combo-rank { background: #e9bd9c; color: #663e25; }
.combo-scores strong { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.combo-scores b { color: var(--green); font: 700 23px "Outfit", sans-serif; white-space: nowrap; }
.combo-scores b small { color: var(--muted); font-size: 11px; letter-spacing: .07em; }
.combo-play { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.combo-view.is-playing .combo-play { grid-column: 1 / -1; width: min(100%, 820px); justify-self: center; }
.combo-play-top { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 19px 24px; background: var(--green); color: #fff; }
.combo-play-top > span { font-weight: 600; }
.combo-play-top > div { display: flex; align-items: baseline; gap: 7px; }
.combo-play-top strong { font: 800 35px "Outfit", sans-serif; }
.combo-play-top small { font: 700 12px "Outfit", sans-serif; letter-spacing: .08em; }
.combo-question { padding: 28px; }
.combo-question.is-next { animation: combo-next-question-in .26s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes combo-next-question-in { from { opacity: .45; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
.combo-question-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.combo-question-meta > small { min-width: 0; color: var(--muted); }
.combo-idle-countdown { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 5px 9px; border-radius: 8px; background: var(--lime); color: var(--green); font-size: 12px; font-weight: 700; white-space: nowrap; }
.combo-idle-countdown i { font-size: 16px; }
.combo-idle-time { margin-left: 2px; font: 800 16px "Outfit", sans-serif; font-variant-numeric: tabular-nums; }
.combo-idle-countdown.is-low { background: #fff1d6; color: #9a5a12; }
body[data-theme="dark"] .combo-idle-countdown.is-low { background: rgba(236, 177, 77, .17); color: #f4ca82; }
.combo-question h3 { margin: 13px 0 26px; font-size: clamp(19px, 3vw, 25px); line-height: 1.65; }
.combo-options { display: grid; gap: 10px; }
.combo-options button { display: flex; align-items: center; gap: 15px; min-height: 62px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.combo-options button:disabled { opacity: .6; cursor: wait; }
.combo-options b { flex: 0 0 33px; width: 33px; height: 33px; display: grid; place-items: center; border-radius: 8px; background: var(--lime); color: var(--green); font: 700 16px "Outfit", sans-serif; }
.combo-finish { display: grid; justify-items: center; padding: 30px; text-align: center; }
.combo-finish-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 50%; background: #fff1d6; color: #a66b13; font-size: 27px; }
.combo-finish > span:nth-child(2) { color: var(--muted); font-weight: 600; }
.combo-finish h3 { margin: 2px 0 8px; color: var(--green); font: 700 27px "Outfit", sans-serif; }
.combo-finish h3 strong { font-size: 66px; }
.combo-finish > p { margin: 0 0 16px; }
.combo-finish-question { width: 100%; padding: 17px; border-radius: 12px; background: var(--lime); line-height: 1.6; text-align: left; }
.combo-finish-question-text { margin: 0 0 14px; font-weight: 700; overflow-wrap: anywhere; }
.combo-finish-options { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.combo-finish-options li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 45px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.combo-finish-options li b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--lime); font: 700 14px "Outfit", sans-serif; }
.combo-finish-options li span { min-width: 0; overflow-wrap: anywhere; }
.combo-finish-options li em { padding: 3px 6px; border-radius: 5px; font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.combo-finish-options li.is-correct { box-shadow: inset 3px 0 #4b9869; }
.combo-finish-options li.is-correct em { background: #e4f3e9; color: #2b7048; }
.combo-finish-options li.is-chosen { box-shadow: inset 3px 0 #c76666; }
.combo-finish-options li.is-chosen em { background: #fae9e8; color: #9c4141; }
body[data-theme="dark"] .combo-finish-options li.is-correct em { background: rgba(105, 191, 136, .16); color: #a8d7b6; }
body[data-theme="dark"] .combo-finish-options li.is-chosen em { background: rgba(219, 120, 120, .16); color: #f1b1ad; }
.combo-finish-explanation { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }
.combo-finish-explanation strong { margin-right: 8px; color: var(--ink); }
.combo-finish label { width: 100%; margin: 22px 0 8px; text-align: left; font-weight: 600; }
.combo-finish input { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font: inherit; }
.combo-finish-actions { display: flex; width: 100%; gap: 10px; margin-top: 16px; }
.combo-finish-actions .primary-action { flex: 1; }
.combo-pick[hidden], .combo-play[hidden], .combo-board[hidden] { display: none; }
body[data-theme="dark"] .combo-scores b, body[data-theme="dark"] .combo-finish h3 { color: #a9d5e9; }
@media (min-width: 821px) {
  .combo-start-row > span { font-size: 17px; }
  .combo-start-row .primary-action { font-size: 16px; }
  .combo-board-heading h3 { font-size: 21px; }
  .combo-scores li { min-height: 52px; }
  .combo-scores strong { font-size: 17px; }
}

@media (max-width: 820px) {
  .combo-view { display: block; }
  .combo-board { margin-top: 20px; }
  .combo-play { margin-bottom: 20px; }
}

@media (max-width: 560px) {
  .combo-heading { align-items: start; gap: 10px; flex-direction: column; }
  .combo-heading h2 { font-size: 36px; }
  .combo-subjects { gap: 8px; }
  .combo-challenge { min-height: 110px; gap: 8px; padding: 12px; border-radius: 14px; }
  .combo-challenge-copy { padding-right: 0; }
  .combo-challenge-copy strong { font-size: 14px; }
  .combo-challenge-state { top: 11px; right: 11px; }
  .combo-challenge-state span { display: none; }
  .combo-challenge.is-active .combo-challenge-state span { display: inline; }
  .combo-challenge.is-unavailable .combo-challenge-state span { display: inline; font-size: 10px; }
  .combo-challenge-featured { min-height: 94px; gap: 13px; padding: 14px 16px; }
  .combo-challenge-featured .combo-challenge-icon { width: 46px; height: 46px; font-size: 24px; }
  .combo-challenge-featured .combo-challenge-copy strong { font-size: 20px; }
  .combo-start-row { align-items: stretch; flex-direction: column; margin: 12px 0 20px; }
  .combo-start-row .primary-action { width: 100%; }
  .combo-board { margin-top: 20px; }
  .combo-play { margin-bottom: 20px; }
  .combo-question, .combo-finish { padding: 20px; }
  .combo-finish-actions { flex-direction: column; }
}
