:root {
  color-scheme: light;
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-strong: #f8fbfc;
  --ink: #0d1c2a;
  --muted: #607080;
  --line: #d5e0e8;
  --brand: #0d3b63;
  --brand-dark: #071a2d;
  --green: #00947e;
  --mint: #e7f7f5;
  --blue: #2f6f97;
  --violet: #49556c;
  --gold: #c79a3a;
  --cyan: #2ac7d1;
  --wrong: #b83245;
  --right: #16734f;
  --shadow: 0 18px 48px rgba(9, 30, 49, 0.13);
  --shadow-soft: 0 10px 26px rgba(9, 30, 49, 0.07);
  --control-height: 42px;
  --radius-card: 8px;
  --radius-dialog: 16px;
  --nav-height: 54px;
  --edge-left: clamp(12px, 3vw, 28px);
  --edge-right: clamp(12px, 3vw, 28px);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 14% -8%, rgba(42, 199, 209, 0.22), transparent 34%),
    radial-gradient(circle at 94% 10%, rgba(199, 154, 58, 0.13), transparent 28%),
    linear-gradient(180deg, rgba(248, 251, 252, 0.64), rgba(238, 243, 246, 0.96)),
    linear-gradient(90deg, rgba(13, 59, 99, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(13, 59, 99, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, auto, 28px 28px, 28px 28px, auto;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
.file-button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
.file-button {
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

button:active,
.file-button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

button:focus-visible,
.file-button:focus-within,
input:focus,
select:focus,
a:focus-visible {
  outline: 3px solid rgba(13, 59, 99, 0.16);
  outline-offset: 2px;
}

input:focus,
select:focus {
  border-color: rgba(13, 59, 99, 0.42);
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.phone-shell {
  width: 100%;
  max-width: none;
  min-height: 100svh;
  margin: 0 auto;
  background: #f8fbfc;
  position: relative;
  overflow-x: hidden;
  box-shadow: none;
}

.phone-shell[data-auth="guest"] {
  min-height: 100svh;
  background:
    linear-gradient(180deg, rgba(7, 26, 45, 0.04), rgba(7, 26, 45, 0.54)),
    linear-gradient(90deg, rgba(7, 26, 45, 0.36), rgba(7, 26, 45, 0.04) 62%),
    url("./assets/login-victoria-harbour-gpt.jpg?v=20260528-wechat-ime1") center / cover no-repeat;
}

.phone-shell[data-auth="guest"] .app-header,
.phone-shell[data-auth="guest"] main,
.phone-shell[data-auth="guest"] .bottom-nav {
  display: none;
}

.phone-shell[data-auth="user"] .login-page {
  display: none;
}

.login-page {
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top) + 24px) clamp(18px, 5vw, 42px) calc(env(safe-area-inset-bottom) + 22px);
  display: grid;
  align-content: end;
  gap: clamp(14px, 4vh, 26px);
}

.login-hero-copy {
  max-width: 560px;
  color: #fff;
  text-shadow: 0 3px 18px rgba(7, 26, 45, 0.28);
}

.login-hero-copy .eyebrow {
  color: rgba(231, 247, 245, 0.92);
}

.login-hero-copy h1 {
  margin-top: 8px;
  font-size: clamp(31px, 8.5vw, 54px);
  line-height: 1.02;
  font-weight: 950;
}

.login-hero-copy p:last-child {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(15px, 3.5vw, 19px);
  font-weight: 850;
}

.login-card {
  width: min(100%, 372px);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 48px rgba(7, 26, 45, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.login-card h2 {
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1.12;
}

.login-card p {
  color: #607080;
  font-size: 12.5px;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: #405466;
  font-size: 12.5px;
  font-weight: 900;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border-color: #cad9e4;
  background: rgba(255, 255, 255, 0.98);
  font-size: 15px;
}

.login-card .primary.wide {
  min-height: 44px;
  margin-top: 4px;
  border-radius: 12px;
  font-size: 15px;
}

.app-header {
  min-height: 92px;
  padding: calc(env(safe-area-inset-top) + 12px) var(--edge-right) 10px var(--edge-left);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-end;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(223, 232, 227, 0.84);
  background: rgba(248, 251, 252, 0.93);
  backdrop-filter: blur(18px);
}

.app-header > div {
  min-width: 0;
}

.app-header h1 {
  max-width: 232px;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.app-header small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.eyebrow {
  color: var(--blue);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.switch-button,
.home-reset {
  min-width: 58px;
  min-height: 30px;
  padding: 0 8px;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.home-reset {
  background: rgba(7, 26, 45, 0.52);
  color: #fff;
}

.page {
  display: none;
  padding: 10px var(--edge-right) calc(var(--nav-height) + env(safe-area-inset-bottom) + 14px) var(--edge-left);
}


.phone-shell[data-exam-selected="false"] .page {
  padding-bottom: 28px;
}

.phone-shell[data-exam-selected="true"][data-tab="home"] .app-header {
  display: none;
}

.phone-shell[data-exam-selected="true"][data-tab="home"] #homePage {
  padding-top: calc(env(safe-area-inset-top) + 6px);
}

.phone-shell[data-tab="practice"] .page {
  padding-top: calc(env(safe-area-inset-top) + 8px);
  padding-bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom));
}

.phone-shell[data-tab="practice"] .app-header {
  display: none;
}

.phone-shell[data-tab="wrong"] .app-header,
.phone-shell[data-tab="stats"] .app-header,
.phone-shell[data-tab="settings"] .app-header {
  display: none;
}

.phone-shell[data-tab="wrong"] .page,
.phone-shell[data-tab="stats"] .page,
.phone-shell[data-tab="settings"] .page {
  padding-top: calc(env(safe-area-inset-top) + 8px);
}

.phone-shell[data-tab="practice"] .page.active {
  gap: 8px;
}

.page.active {
  display: grid;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.gate-hero,
.exam-entry,
.exam-entry-banner,
.exam-profile,
.stats-summary div,
.metric-grid div,
.progress-panel,
.action-grid button,
.question-title,
.option,
.answer-panel,
.list-open,
.chapter-row,
.guide-grid article,
.collector-card,
.contact-card,
.settings-group {
  min-width: 0;
  max-width: 100%;
}

.gate-hero,
.exam-entry,
.exam-entry-banner,
.exam-profile,
.progress-panel,
.action-grid button,
.question-title,
.option,
.answer-panel,
.list-open,
.chapter-row {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.exam-entry-banner > span:last-child,
.option span:last-child,
.list-open span,
.question-title,
#explanation {
  min-width: 0;
}

.license-gate {
  display: grid;
  gap: 9px;
}

.gate-hero {
  min-height: 168px;
  padding: 15px;
  border-radius: 8px;
  overflow: hidden;
  color: #f8fbf7;
  display: grid;
  align-content: end;
  gap: 6px;
  background:
    linear-gradient(180deg, rgba(7, 26, 45, 0.12), rgba(7, 26, 45, 0.7)),
    linear-gradient(90deg, rgba(7, 26, 45, 0.72), rgba(7, 26, 45, 0.18) 58%, rgba(7, 26, 45, 0.08)),
    url("./assets/hero-victoria-study-08.jpg?v=20260528-wechat-ime1");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.gate-hero .eyebrow {
  color: #cdeee3;
}

.gate-hero h2 {
  max-width: 320px;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.gate-hero p:last-child {
  max-width: 320px;
  color: rgba(248, 251, 247, 0.82);
  font-size: 13px;
  line-height: 1.45;
}

.exam-entry-grid {
  display: grid;
  gap: 8px;
}

.exam-entry {
  width: 100%;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(22, 36, 31, 0.07);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.exam-entry:active {
  transform: scale(0.985);
}

.exam-entry:focus-visible {
  outline: 2px solid rgba(42, 199, 209, 0.7);
  outline-offset: 2px;
}

.exam-entry-banner {
  width: 100%;
  min-height: 72px;
  justify-content: flex-start;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f8fbf7;
  text-align: left;
  background: linear-gradient(135deg, #071a2d, #0d3b63);
}

.exam-entry-s .exam-entry-banner {
  background: linear-gradient(135deg, #071a2d, #00806f);
}

.license-chip {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.license-chip b {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 23px;
  font-weight: 950;
}

.license-chip i {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.88;
}

.license-chip-s i {
  background: var(--gold);
}

.exam-entry strong {
  display: block;
  font-size: 16.5px;
  line-height: 1.2;
  letter-spacing: 0;
}

.exam-entry small {
  display: block;
  margin-top: 4px;
  color: rgba(248, 251, 247, 0.76);
  font-size: 11.5px;
  line-height: 1.35;
}

.exam-entry a,
.info-strip a {
  min-height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(13, 59, 99, 0.18);
  background: #eef6fb;
}

.info-strip {
  padding: 8px;
  border: 1px solid #d8e6df;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: #f8faf8;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.info-strip a {
  min-height: 30px;
  padding: 4px 5px;
  font-size: 11.2px;
}

.exam-dashboard {
  display: grid;
  gap: 8px;
}

.home-license-head {
  min-width: 0;
  min-height: clamp(158px, 25svh, 220px);
  padding: 18px 14px 20px;
  border: 1px solid rgba(13, 59, 99, 0.1);
  border-radius: 8px;
  display: grid;
  position: relative;
  align-items: center;
  justify-items: center;
  gap: 14px;
  background:
    linear-gradient(90deg, rgba(248, 252, 255, 0.98), rgba(239, 249, 252, 0.78) 46%, rgba(239, 249, 252, 0.34)),
    linear-gradient(180deg, rgba(218, 245, 252, 0.58), rgba(255, 255, 255, 0.22)),
    var(--exam-profile-image, url("./assets/hero-victoria-study-08.jpg?v=20260528-wechat-ime1"));
  background-position: 56% center;
  background-size: cover;
  box-shadow: 0 14px 30px rgba(9, 30, 49, 0.1);
  overflow: hidden;
}

.home-license-head::before {
  display: none;
}

.home-license-head > * {
  position: relative;
  z-index: 1;
}

.home-license-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: center;
}

.home-license-head strong {
  color: var(--brand);
  font-size: clamp(23px, 5.8vw, 34px);
  line-height: 1.12;
  font-weight: 950;
}

.home-license-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.hero-switch-button {
  display: none;
}

.phone-shell[data-exam-selected="true"] .home-license-head {
  min-height: clamp(148px, 23svh, 220px);
  padding: 12px;
  justify-items: stretch;
  align-items: start;
  border: 0;
  background: #dcebf2;
  box-shadow: 0 12px 24px rgba(9, 30, 49, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.phone-shell[data-exam-selected="true"] .home-license-head::before {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: 0;
  display: block;
  background: var(--exam-profile-image, url("./assets/hero-victoria-study-08.jpg?v=20260528-wechat-ime1")) 56% center / cover no-repeat;
  transform: scale(1.012);
  transform-origin: center;
  pointer-events: none;
}

.phone-shell[data-exam-selected="true"] .home-license-head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  background: linear-gradient(180deg, rgba(7, 26, 45, 0.08), rgba(7, 26, 45, 0.08));
  pointer-events: none;
}

.phone-shell[data-exam-selected="true"] .home-license-head > div,
.phone-shell[data-exam-selected="true"] .license-toggle {
  display: none;
}

.phone-shell[data-exam-selected="true"] .hero-switch-button {
  display: inline-flex;
  justify-self: start;
  min-height: 32px;
  padding: 0 12px;
  border-color: rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: #fff;
  background: rgba(7, 26, 45, 0.64);
  box-shadow: 0 8px 18px rgba(9, 30, 49, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 950;
}

.license-toggle {
  width: min(76vw, 450px);
  min-height: 74px;
  padding: 4px;
  border: 1px solid rgba(13, 59, 99, 0.1);
  border-radius: 999px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.86), 0 8px 18px rgba(9, 30, 49, 0.07);
}

.license-toggle button {
  min-height: 64px;
  padding: 8px;
  border-color: transparent;
  border-radius: 999px;
  display: grid;
  gap: 2px;
  background: transparent;
  color: #7f95a8;
}

.license-toggle button.active {
  border-color: rgba(56, 153, 204, 0.2);
  background: linear-gradient(180deg, #ffffff, #e9f5fb);
  color: #087cb4;
  box-shadow: 0 8px 16px rgba(9, 30, 49, 0.11);
}

.license-toggle span {
  font-size: clamp(24px, 6vw, 36px);
  line-height: 1;
  font-weight: 950;
}

.license-toggle small {
  font-size: clamp(13px, 3.2vw, 18px);
  font-weight: 900;
}

.license-hint {
  position: relative;
  margin-top: -2px;
  padding: 10px;
  border: 1px solid rgba(13, 59, 99, 0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 28px rgba(9, 30, 49, 0.12);
  backdrop-filter: blur(14px);
}

.license-hint::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(13, 59, 99, 0.12);
  border-top: 1px solid rgba(13, 59, 99, 0.12);
  background: rgba(255, 255, 255, 0.82);
  transform: translateX(-50%) rotate(45deg);
}

.license-hint div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.license-hint strong {
  color: var(--brand);
  font-size: 14px;
  line-height: 1.2;
}

.license-hint span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.license-hint button {
  flex: 0 0 auto;
  min-height: 34px;
  border-color: rgba(8, 124, 180, 0.18);
  border-radius: 999px;
  background: #e9f5fb;
  color: #087cb4;
  font-size: 12px;
  font-weight: 900;
}

.user-strip,
.account-panel {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(13, 59, 99, 0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(22, 36, 31, 0.06);
}

.user-strip div,
.account-panel div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-strip span,
.account-panel span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
}

.user-strip strong,
.account-panel strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.admin-account-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.user-strip button,
.account-actions button {
  min-height: 34px;
  border-color: rgba(13, 59, 99, 0.16);
  color: var(--brand);
  background: #edf5fa;
  font-size: 12px;
  font-weight: 900;
}

.account-actions,
.offline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.exam-profile {
  min-height: clamp(108px, 20svh, 138px);
  padding: 14px;
  border-radius: 8px;
  display: flex;
  position: relative;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-end;
  color: #f8fbf7;
  background:
    linear-gradient(90deg, rgba(7, 26, 45, 0.9), rgba(13, 59, 99, 0.58) 62%, rgba(7, 26, 45, 0.22)),
    var(--exam-profile-image, url("./assets/hero-victoria-study-08.jpg?v=20260528-wechat-ime1"));
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.exam-profile.hidden {
  display: none !important;
}

.phone-shell[data-exam="SQE"] .exam-profile {
  background:
    linear-gradient(90deg, rgba(7, 26, 45, 0.92), rgba(0, 77, 88, 0.62) 62%, rgba(7, 26, 45, 0.24)),
    var(--exam-profile-image, url("./assets/hero-victoria-study-08.jpg?v=20260528-wechat-ime1"));
  background-position: center;
  background-size: cover;
}

.exam-profile .eyebrow {
  color: #cdeee3;
}

.exam-profile h2 {
  margin-top: 5px;
  max-width: 238px;
  font-size: 21px;
  line-height: 1.16;
  letter-spacing: 0;
  word-break: keep-all;
}

.exam-profile p:not(.eyebrow) {
  margin-top: 5px;
  color: rgba(248, 251, 247, 0.78);
  font-size: 13px;
}

.exam-profile .header-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: none;
}

.stats-summary,
.metric-grid,
.study-snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.stats-summary div,
.metric-grid div,
.study-snapshot div {
  min-height: 50px;
  padding: 8px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(9, 30, 49, 0.06);
}

.stats-summary span,
.metric-grid span,
.study-snapshot strong {
  font-size: 17px;
  line-height: 1.1;
  font-weight: 950;
  color: var(--ink);
}

.stats-summary small,
.metric-grid small,
.study-snapshot span {
  color: var(--muted);
  font-size: 10.5px;
}

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

.study-snapshot div {
  min-height: 58px;
}

.stats-snapshot {
  margin-top: -2px;
}

.progress-panel {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(22, 36, 31, 0.07);
}

.progress-panel div:first-child {
  display: grid;
  gap: 5px;
}

.progress-panel strong {
  font-size: 15px;
}

.progress-panel span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.progress-track,
.mini-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e6eeea;
  overflow: hidden;
}

.progress-track i,
.mini-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--cyan), var(--green));
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.action-grid button {
  min-height: clamp(64px, 11svh, 86px);
  padding: 10px 12px;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  text-align: left;
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--line);
  box-shadow: 0 10px 28px rgba(22, 36, 31, 0.07);
}

.action-with-note {
  position: relative;
  min-width: 0;
}

.action-with-note button {
  width: 100%;
  padding-right: 132px;
}

.action-with-note a {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  z-index: 1;
  width: 92px;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #edf6f1;
  color: var(--green);
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
}

.action-grid .action-main {
  border-color: rgba(13, 59, 99, 0.28);
  background: linear-gradient(135deg, #ffffff, #eef7f8);
}

.action-grid strong {
  min-width: 82px;
  font-size: 15.5px;
  line-height: 1.2;
}

.action-grid small {
  margin-left: auto;
  max-width: 150px;
  color: var(--muted);
  font-size: 10.8px;
  line-height: 1.38;
  text-align: right;
}

.schedule-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(22, 36, 31, 0.06);
}

.schedule-panel div {
  min-height: 50px;
  padding: 7px 5px;
  border-radius: 8px;
  display: grid;
  align-content: center;
  gap: 3px;
  background: #f4f9fb;
  text-align: center;
}

.schedule-panel span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
}

.schedule-panel strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.schedule-panel a {
  grid-column: 1 / -1;
  min-height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--brand);
}

.offline-panel {
  min-height: 76px;
  padding: 10px;
  border: 1px solid rgba(25, 123, 98, 0.22);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: linear-gradient(135deg, #ffffff, #eef8f4);
  box-shadow: 0 10px 24px rgba(22, 36, 31, 0.06);
}

.offline-panel div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.offline-panel span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.offline-panel strong {
  color: var(--ink);
  font-size: 16px;
}

.offline-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.offline-panel button {
  min-height: 40px;
  padding: 0 12px;
  border-color: rgba(25, 123, 98, 0.28);
  color: #fff;
  background: var(--brand);
  font-weight: 900;
  white-space: nowrap;
}

.offline-actions button:last-child {
  color: var(--brand);
  background: #fff;
}

.settings-offline-panel {
  margin-top: 0;
}

.screen-title {
  padding: 10px;
  border: 1px solid rgba(13, 59, 99, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(22, 36, 31, 0.06);
}

.screen-title h2 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.subtle {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.practice-top {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 8;
  padding-bottom: 2px;
  background: linear-gradient(180deg, #f8fbfc 72%, rgba(248, 251, 252, 0));
}

.topic-button {
  min-height: 38px;
  min-width: 56px;
  padding: 0 10px;
  color: var(--brand);
  background: #eef6fb;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 17px;
  font-weight: 900;
}

.practice-counter {
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 8px 20px rgba(9, 30, 49, 0.06);
}

.font-controls {
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 30px minmax(34px, auto) 30px;
  align-items: center;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 8px 20px rgba(9, 30, 49, 0.06);
}

.font-controls button {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: #edf4f0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
}

.font-controls span {
  min-width: 34px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.practice-counter span {
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.mini-progress {
  height: 4px;
}

.question-tag {
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--green);
  background: var(--mint);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.35;
}

.mock-meta {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #b9d8cd;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #effaf5;
}

.mock-meta span {
  color: var(--brand);
  font-size: 15px;
  font-weight: 950;
}

.mock-meta strong {
  font-size: 11.5px;
}

.reference-card {
  border: 1px solid #cfdee8;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(9, 30, 49, 0.06);
}

.reference-card summary {
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  color: #516976;
  font-weight: 900;
  font-size: 14px;
  list-style: none;
}

.reference-card summary::-webkit-details-marker {
  display: none;
}

.reference-card summary::before {
  content: "▦";
  margin-right: 8px;
  color: #607887;
  font-size: 16px;
}

.reference-card summary::after {
  content: "⌄";
  float: right;
  color: #6e7c84;
  font-size: 18px;
  line-height: 1;
}

.reference-card[open] summary::after {
  content: "⌃";
}

.case-reference-card summary {
  color: #435b67;
  background: rgba(240, 246, 250, 0.78);
}

.reference-card p {
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
  white-space: pre-line;
}

.reference-content {
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
}

.reference-content h3 {
  margin: 6px 0 0;
  color: var(--brand);
  font-size: 14px;
  line-height: 1.3;
}

.reference-content p,
.reference-content li {
  color: #425261;
  font-size: 13px;
  line-height: 1.72;
}

.reference-content ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.case-reference-content > p,
.case-reference-content > h3,
.case-reference-content > ol {
  padding: 0 10px;
}

.reference-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.reference-content table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 0;
  background: #fff;
  font-size: 12.5px;
}

.reference-content th,
.reference-content td {
  padding: 8px 10px;
  border-bottom: 1px solid #e6eef2;
  border-right: 1px solid #e6eef2;
  vertical-align: top;
  text-align: left;
  line-height: 1.55;
}

.reference-content tr:last-child td {
  border-bottom: 0;
}

.reference-content th:last-child,
.reference-content td:last-child {
  border-right: 0;
}

.reference-content th {
  color: var(--brand);
  background: #eef6fb;
  font-weight: 900;
}

.question-title {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 16px;
  line-height: 1.38;
  letter-spacing: 0;
  box-shadow: 0 12px 30px rgba(22, 36, 31, 0.07);
}

.question-title.case-question {
  display: grid;
  gap: 10px;
  padding: 0;
  border-color: #d3e1e8;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
}

.case-question h3 {
  margin: 8px 0 -2px;
  padding: 0 2px 7px;
  border-bottom: 1px solid #d8e5ec;
  color: #17344a;
  background: transparent;
  font-size: 15.5px;
  line-height: 1.35;
}

.case-question h3:first-child {
  margin-top: 0;
}

.case-question p,
.case-question ol {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #2f3f49;
  font-size: 14px;
  line-height: 1.78;
  box-shadow: 0 6px 16px rgba(9, 30, 49, 0.035);
}

.case-question p {
  white-space: pre-line;
}

.case-question strong,
.reference-content strong {
  color: #162f46;
  font-weight: 950;
}

.case-question ol {
  padding-left: 34px;
}

.case-question li + li {
  margin-top: 8px;
}

.phone-shell[data-font-size="large"] .question-title {
  font-size: 18px;
  line-height: 1.45;
}

.phone-shell[data-font-size="large"] .option span:last-child {
  font-size: 14.5px;
  line-height: 1.45;
}

.phone-shell[data-font-size="large"] #explanation,
.phone-shell[data-font-size="large"] .reference-content p,
.phone-shell[data-font-size="large"] .reference-content li {
  font-size: 13.5px;
}

.phone-shell[data-font-size="xlarge"] .question-title {
  font-size: 20px;
  line-height: 1.5;
}

.phone-shell[data-font-size="xlarge"] .option {
  min-height: 50px;
}

.phone-shell[data-font-size="xlarge"] .option span:last-child {
  font-size: 16px;
  line-height: 1.5;
}

.phone-shell[data-font-size="xlarge"] #explanation,
.phone-shell[data-font-size="xlarge"] .reference-content p,
.phone-shell[data-font-size="xlarge"] .reference-content li {
  font-size: 15px;
}

.options {
  display: grid;
  gap: 7px;
}

.option {
  width: 100%;
  min-height: 44px;
  padding: 8px 9px;
  justify-content: flex-start;
  text-align: left;
  border-color: #dbe7e1;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(9, 30, 49, 0.045);
}

.option .letter {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #edf4f0;
  color: var(--green);
  font-weight: 950;
}

.option span:last-child {
  line-height: 1.36;
  font-size: 13px;
}

.option.selected {
  border-color: var(--green);
  background: #f1faf6;
}

.option.correct {
  border-color: rgba(22, 115, 79, 0.7);
  background: #eef9f4;
}

.option.wrong {
  border-color: rgba(184, 50, 69, 0.72);
  background: #fff0f2;
}

.option.correct .letter {
  color: #fff;
  background: var(--right);
}

.option.wrong .letter {
  color: #fff;
  background: var(--wrong);
}

.answer-panel {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(22, 36, 31, 0.08);
}

.answer-result {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.answer-result strong {
  font-size: 15px;
}

.answer-result span {
  color: var(--muted);
  font-size: 11.5px;
}

.knowledge-notice {
  margin: 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #ead39a;
  color: #7a5112;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre-line;
}

.statement-analysis {
  display: grid;
  gap: 7px;
}

.statement-analysis > strong {
  color: var(--ink);
  font-size: 13px;
}

.statement-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.statement-row span,
.statement-row b {
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 950;
}

.statement-row span {
  color: var(--brand);
  background: #eaf4fb;
}

.statement-row b {
  color: #fff;
  background: var(--muted);
}

.statement-row p {
  color: #33423d;
  font-size: 12.5px;
  line-height: 1.55;
}

.statement-true {
  border-color: rgba(22, 115, 79, 0.32);
  background: #f0faf5;
}

.statement-true b {
  background: var(--right);
}

.statement-false {
  border-color: rgba(184, 50, 69, 0.25);
  background: #fff7f8;
}

.statement-false b {
  background: var(--wrong);
}

#explanation {
  color: #33423d;
  line-height: 1.58;
  font-size: 12.5px;
  white-space: pre-line;
}

.answer-dock {
  position: sticky;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 6px);
  z-index: 9;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 7px;
  padding: 7px 0 0;
  background: linear-gradient(180deg, rgba(248, 251, 252, 0), #f8fbfc 30%);
}

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.secondary {
  border-color: rgba(13, 59, 99, 0.16);
  color: var(--brand);
  background: #eef6fb;
  font-weight: 900;
}

.wide {
  width: 100%;
}

.danger {
  border-color: rgba(184, 50, 69, 0.3);
  color: var(--wrong);
  background: #fff2f4;
}

.small-button,
.mini-action {
  min-height: 32px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 850;
}

.remove-wrong {
  justify-self: start;
  border-color: rgba(184, 50, 69, 0.32);
  color: var(--wrong);
  background: #fff2f4;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.list-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.question-list {
  display: grid;
  gap: 7px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.list-row.has-action {
  grid-template-columns: minmax(0, 1fr) auto;
}

.list-open {
  min-height: 48px;
  justify-content: flex-start;
  text-align: left;
  padding: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(9, 30, 49, 0.045);
}

.list-open strong {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: var(--mint);
}

.list-open span {
  min-width: 0;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.35;
}

.chapter-stats {
  display: grid;
  gap: 7px;
}

.leaderboard-panel {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(22, 36, 31, 0.06);
}

.section-line-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.section-line-title strong {
  font-size: 15px;
}

.section-line-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.leaderboard-total {
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--brand);
  background: #eef8fb;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 900;
}

.ranking-list {
  display: grid;
  gap: 7px;
}

.ranking-row {
  min-height: 58px;
  padding: 9px;
  border: 1px solid #dde8ee;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: #f8fbfc;
}

.ranking-row.current {
  border-color: rgba(0, 148, 126, 0.28);
  background: #effaf6;
}

.ranking-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 950;
}

.ranking-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ranking-row strong {
  font-size: 14px;
}

.ranking-row small {
  color: var(--muted);
  font-size: 10.8px;
}

.ranking-row b {
  min-width: 48px;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
  text-align: right;
}

.chapter-row {
  min-height: 52px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(9, 30, 49, 0.045);
}

.chapter-row strong {
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
}

.chapter-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.chapter-row span {
  min-width: 42px;
  color: var(--green);
  font-size: 15px;
  font-weight: 950;
  text-align: right;
}

.guide-grid {
  display: grid;
  gap: 7px;
}

.guide-grid article,
.collector-card,
.contact-card,
.settings-group {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  background: rgba(255, 255, 255, 0.96);
}

.contact-card {
  min-height: 92px;
  align-content: center;
}

.guide-grid strong,
.collector-card strong {
  font-size: 14px;
}

.guide-grid p,
.collector-card p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.48;
}

.collector-card code {
  padding: 10px;
  border-radius: 8px;
  display: block;
  overflow-x: auto;
  color: #41514b;
  background: #f2f6f3;
  font-size: 12px;
}

.settings-group label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
}

select,
input[type="search"],
input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  border-radius: 8px;
  background: #eef5f1;
  border: 1px solid var(--line);
}

.segmented button {
  min-height: 32px;
  padding: 0 4px;
  border-color: transparent;
  background: transparent;
  font-size: 11.5px;
}

.segmented button.active {
  background: #fff;
  border-color: rgba(25, 123, 98, 0.3);
  color: var(--green);
  font-weight: 900;
}

.file-button input {
  display: none;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 12;
  transform: translateX(-50%);
  width: 100vw;
  max-width: none;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  background: rgba(251, 252, 250, 0.94);
  border-top: 1px solid rgba(223, 232, 227, 0.92);
  backdrop-filter: blur(18px);
}

.phone-shell[data-exam-selected="false"] .bottom-nav {
  display: none;
}

.bottom-nav button {
  min-height: 40px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #83908a;
  padding: 0 4px;
}

.bottom-nav button.active {
  color: var(--brand);
  background: #e8f3fa;
}

.bottom-nav span {
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}

.bottom-nav small {
  font-size: 10px;
  font-weight: 850;
}

dialog {
  width: min( calc(100vw - 36px), 360px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 32, 29, 0.28);
}

dialog form {
  padding: 14px;
  display: grid;
  gap: 9px;
}

.message-dialog {
  width: min(calc(100vw - 34px), 342px);
  border-radius: var(--radius-dialog);
  overflow: hidden;
}

.message-dialog form {
  padding: 18px;
  gap: 14px;
  background: #fff;
}

.dialog-head,
.sheet-title-row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head h2,
.sheet-title-row h2 {
  min-width: 0;
}

.dialog-close,
.sheet-close {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: rgba(13, 59, 99, 0.12);
  border-radius: 999px;
  color: #546879;
  background: rgba(255, 255, 255, 0.78);
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.dialog-close:active,
.sheet-close:active {
  transform: scale(0.96);
}

dialog.sheet-dialog {
  width: min(calc(100vw - 16px), 560px);
  max-height: min(78vh, 760px);
  margin: auto auto 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

dialog.auth-dialog {
  width: min(calc(100vw - 28px), 372px);
  border-radius: var(--radius-dialog);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(9, 30, 49, 0.22);
}

.auth-dialog::backdrop {
  background: rgba(7, 26, 45, 0.34);
  backdrop-filter: blur(5px);
}

.auth-dialog form {
  padding: 18px;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(231, 247, 245, 0.72), rgba(255, 255, 255, 0.96) 42%),
    #fff;
}

.auth-dialog h2 {
  color: var(--brand-dark);
  font-size: 21px;
  line-height: 1.16;
  font-weight: 950;
}

.auth-dialog p {
  color: #607080;
  font-size: 13px;
}

.auth-dialog label {
  gap: 7px;
  color: #405466;
  font-size: 13px;
  font-weight: 900;
}

.auth-dialog input[type="text"],
.auth-dialog input[type="password"] {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 13px;
  border-color: #cad9e4;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 16px;
}

.auth-dialog input::placeholder {
  color: #97a8b6;
}

.auth-dialog .primary.wide {
  min-height: 44px;
  border-radius: 13px;
  font-size: 16px;
}

.sheet-dialog form {
  max-height: min(78vh, 760px);
  padding: 0;
  overflow: hidden;
  background: #f5f7fb;
}

.sheet-head {
  padding: 16px 16px 14px;
  color: #fff;
  background: #2f4d66;
}

.sheet-head h2 {
  font-size: 22px;
}

.sheet-head p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.74);
}

.sheet-close {
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.topic-list {
  max-height: min(58vh, 560px);
  padding: 14px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
}

.topic-list h3 {
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid #d8dee8;
  color: #526271;
  font-size: 13px;
}

.topic-choice {
  min-height: 62px;
  padding: 12px;
  border-color: #e1e7ef;
  justify-content: space-between;
  background: #fff;
  box-shadow: 0 8px 20px rgba(9, 30, 49, 0.045);
}

.topic-choice span {
  min-width: 0;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
  line-height: 1.35;
}

.topic-choice small {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.topic-choice.active {
  border-color: #2f4d66;
  box-shadow: inset 0 0 0 1px #2f4d66;
}

.topic-choice.active::after {
  content: "✓";
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2f4d66;
  font-weight: 950;
}

.topic-choice-primary {
  min-height: 72px;
}

.sheet-dialog .wide {
  margin: 0 14px 14px;
  width: calc(100% - 28px);
}

dialog h2 {
  font-size: 17px;
}

dialog p {
  color: var(--muted);
  line-height: 1.6;
}

.dialog-status {
  min-height: 18px;
  color: var(--wrong);
  font-size: 12px;
  font-weight: 850;
}

dialog label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dialog-actions .wide {
  grid-column: 1 / -1;
}

.dialog-actions button {
  min-height: 42px;
  border-radius: 10px;
}

@media (min-width: 820px) {
  :root {
    --edge-left: clamp(22px, 3vw, 40px);
    --edge-right: clamp(22px, 3vw, 40px);
  }

  .phone-shell {
    width: 100%;
    max-width: none;
    box-shadow: none;
  }

  .app-header h1 {
    max-width: none;
    font-size: 28px;
  }

  .page {
    padding-left: var(--edge-left);
    padding-right: var(--edge-right);
  }

  .phone-shell[data-exam-selected="true"][data-tab="home"] #homePage {
    padding-top: 14px;
  }

  .exam-dashboard {
    grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.1fr);
    align-items: start;
    gap: 12px;
  }

  .home-license-head {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 720px);
  }

  .user-strip {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 720px);
  }

  .license-toggle {
    width: 300px;
  }

  .home-license-head {
    min-height: 260px;
    padding: 28px;
  }

  .license-toggle {
    width: min(520px, 56vw);
  }

  .exam-profile h2 {
    max-width: 520px;
    font-size: 31px;
  }

  .exam-profile p:not(.eyebrow) {
    font-size: 16px;
  }

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

  .action-grid button {
    min-height: 96px;
    align-items: flex-start;
    flex-direction: column;
  }

  .action-grid small {
    margin-left: 0;
    max-width: none;
    text-align: left;
    font-size: 13px;
  }

  .action-grid strong {
    font-size: 21px;
  }

  .schedule-panel,
  .offline-panel {
    grid-column: 2;
  }

  .phone-shell[data-tab="practice"] .page.active {
    width: 100%;
    margin: 0;
  }

  .question-title {
    font-size: 26px;
  }

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

  .answer-panel,
  .reference-card {
    font-size: 16px;
  }

  .bottom-nav {
    width: 100vw;
    max-width: none;
  }

  .license-gate {
    grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
    align-items: start;
    gap: 12px;
  }

  .gate-hero {
    min-height: 340px;
    grid-row: span 2;
  }

  .gate-hero h2 {
    max-width: 520px;
    font-size: 34px;
  }

  .gate-hero p:last-child {
    max-width: 520px;
    font-size: 16px;
  }

  .exam-entry-grid {
    gap: 12px;
  }

  .exam-entry-banner {
    min-height: 126px;
  }

  .info-strip {
    grid-column: 1 / -1;
  }

  .phone-shell[data-tab="wrong"] .page.active,
  .phone-shell[data-tab="stats"] .page.active,
  .phone-shell[data-tab="settings"] .page.active,
  .phone-shell[data-tab="home"] .page.active {
    width: 100%;
    margin: 0;
  }

  .screen-title {
    padding: 18px;
  }

  .screen-title h2 {
    font-size: 28px;
  }

  .subtle,
  .list-head span,
  .guide-grid p,
  .collector-card p,
  .chapter-row small {
    font-size: 14px;
  }

  .question-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .list-row.has-action {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .list-open {
    min-height: 68px;
    padding: 12px;
  }

  .list-open span,
  .chapter-row strong {
    font-size: 15px;
  }

  .stats-summary,
  .study-snapshot {
    gap: 12px;
  }

  .stats-summary div,
  .study-snapshot div {
    min-height: 96px;
    padding: 18px;
  }

  .stats-summary span,
  .study-snapshot strong {
    font-size: 34px;
  }

  .stats-summary small,
  .study-snapshot span {
    font-size: 14px;
  }

  .chapter-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .leaderboard-panel,
  .account-panel {
    padding: 18px;
  }

  .ranking-row {
    min-height: 72px;
    padding: 14px;
    grid-template-columns: 38px minmax(0, 1fr) 88px;
  }

  .ranking-row strong {
    font-size: 16px;
  }

  .chapter-row {
    min-height: 78px;
    padding: 14px;
  }

  .chapter-row span {
    font-size: 22px;
  }

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

  .contact-card,
  .settings-group,
  .collector-card,
  .guide-grid article {
    padding: 18px;
  }

  .internal-settings:not(.hidden) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .internal-settings .settings-group:first-child,
  .internal-settings .collector-card {
    grid-column: 1 / -1;
  }

  .internal-settings .settings-group:first-child {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .practice-top {
    grid-template-columns: 44px minmax(0, 1fr) 76px 160px;
    gap: 10px;
  }

  .icon-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .practice-counter,
  .font-controls {
    min-height: 46px;
  }

  .question-tag,
  .reference-card summary,
  .reference-content p,
  .reference-content li,
  .statement-row p,
  #explanation,
  .answer-result span,
  .knowledge-notice {
    font-size: 15px;
  }

  .reference-content table {
    font-size: 14px;
  }

  .case-question h3 {
    font-size: 18px;
  }

  .case-question p,
  .case-question li {
    font-size: 16px;
    line-height: 1.82;
  }

  .option {
    min-height: 72px;
    padding: 14px;
  }

  .option span:last-child {
    font-size: 16px;
    line-height: 1.5;
  }

  .answer-dock {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .answer-dock button {
    min-height: 52px;
  }
}

@media (min-width: 700px) and (max-width: 899px) {
  :root {
    --edge-left: clamp(18px, 3vw, 28px);
    --edge-right: clamp(18px, 3vw, 28px);
  }

  .phone-shell {
    width: 100%;
    max-width: 100vw;
    box-shadow: none;
  }

  .bottom-nav {
    width: 100vw;
  }

  .page {
    padding-left: var(--edge-left);
    padding-right: var(--edge-right);
  }

  .app-header h1 {
    max-width: none;
    font-size: 27px;
  }

  .license-gate {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
  }

  .gate-hero {
    min-height: 310px;
    grid-row: span 2;
    padding: 20px;
  }

  .gate-hero h2 {
    max-width: 440px;
    font-size: 31px;
  }

  .gate-hero p:last-child {
    max-width: 420px;
    font-size: 15px;
  }

  .info-strip {
    grid-column: 1 / -1;
  }

  .phone-shell[data-exam-selected="true"][data-tab="home"] #homePage {
    padding-top: 12px;
  }

  .phone-shell[data-tab="home"] .page.active,
  .phone-shell[data-tab="practice"] .page.active,
  .phone-shell[data-tab="wrong"] .page.active,
  .phone-shell[data-tab="stats"] .page.active,
  .phone-shell[data-tab="settings"] .page.active {
    width: 100%;
    margin: 0;
  }

  .exam-dashboard {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .exam-profile {
    min-height: 170px;
    padding: 20px;
    grid-row: auto;
  }

  .exam-profile h2 {
    max-width: 520px;
    font-size: 29px;
  }

  .exam-profile p:not(.eyebrow) {
    font-size: 15px;
  }

  .stats-summary,
  .metric-grid,
  .study-snapshot,
  .action-grid,
  .ranking-list,
  .chapter-stats,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ranking-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .stats-summary div,
  .metric-grid div,
  .study-snapshot div {
    min-height: 82px;
    padding: 14px;
  }

  .stats-summary span,
  .metric-grid span,
  .study-snapshot strong {
    font-size: 28px;
  }

  .action-grid button {
    min-height: 94px;
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .action-grid strong {
    font-size: 21px;
  }

  .action-grid small {
    margin-left: 0;
    max-width: none;
    text-align: left;
    font-size: 13px;
  }

  .action-with-note button {
    padding-right: 126px;
  }

  .schedule-panel,
  .offline-panel {
    grid-column: auto;
  }

  .screen-title {
    padding: 16px;
  }

  .screen-title h2 {
    font-size: 26px;
  }

  .practice-top {
    grid-template-columns: 44px minmax(0, 1fr) 72px 150px;
    gap: 10px;
  }

  .icon-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .practice-counter,
  .font-controls {
    min-height: 46px;
  }

  .question-title {
    padding: 16px;
    font-size: 24px;
    line-height: 1.48;
  }

  .option {
    min-height: 68px;
    padding: 14px;
  }

  .option span:last-child,
  .list-open span,
  .chapter-row strong {
    font-size: 15.5px;
    line-height: 1.5;
  }

  .answer-panel,
  .reference-card,
  .statement-row p,
  #explanation,
  .reference-content p,
  .reference-content li,
  .knowledge-notice {
    font-size: 15px;
  }

  .reference-content table {
    font-size: 13.5px;
  }

  .case-question h3 {
    font-size: 17px;
  }

  .case-question p,
  .case-question li {
    font-size: 15.5px;
    line-height: 1.8;
  }

  .answer-dock {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .answer-dock button {
    min-height: 50px;
  }

  .question-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .list-row.has-action {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .list-open {
    min-height: 66px;
    padding: 12px;
  }

  .chapter-row {
    min-height: 76px;
    padding: 13px;
  }

  .chapter-row span {
    font-size: 21px;
  }

  .contact-card,
  .account-panel,
  .settings-group,
  .collector-card,
  .guide-grid article {
    padding: 16px;
  }

  dialog {
    width: min(calc(100vw - 48px), 460px);
  }
}

@media (max-width: 360px) {
  :root {
    --edge-left: 8px;
    --edge-right: 8px;
  }

  .app-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .app-header h1 {
    max-width: 100%;
  }

  .header-actions {
    width: 100%;
    grid-auto-flow: column;
    justify-content: end;
  }

  .phone-shell[data-tab="practice"] .app-header {
    gap: 5px;
  }

  .phone-shell[data-tab="practice"] .app-header h1 {
    max-width: 100%;
  }

  .app-header h1,
  .gate-hero h2,
  .exam-profile h2 {
    font-size: 20px;
  }

  .action-grid,
  .schedule-panel,
  .info-strip {
    grid-template-columns: 1fr;
  }

  .stats-summary,
  .metric-grid,
  .study-snapshot,
  .ranking-list {
    grid-template-columns: 1fr;
  }

  .ranking-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .ranking-row b {
    min-width: 0;
    text-align: left;
  }
}
