: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);
  --nav-height: 54px;
  --edge-left: 10px;
  --edge-right: 18px;
}

* {
  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: 38px;
  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(236, 93, 66, 0.24);
  outline-offset: 2px;
}

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

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

.phone-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100svh;
  margin: 0 auto;
  background: #f8fbfc;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 0 1px rgba(22, 36, 31, 0.06), 0 28px 80px rgba(22, 36, 31, 0.16);
}

.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) + 8px);
}

.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="settings"] .app-header {
  display: none;
}

.phone-shell[data-tab="wrong"] .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/harbour-study-hero-1280.jpg");
  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;
}

.exam-profile {
  min-height: clamp(168px, 42svh, 230px);
  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/study-hero-rotation-1.jpg?v=20260507-clean"));
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.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/study-hero-rotation-1.jpg?v=20260507-clean"));
  background-position: center;
  background-size: cover;
}

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

.exam-profile h2 {
  margin-top: 5px;
  max-width: 238px;
  font-size: 22px;
  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;
}

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

.stats-summary div,
.metric-grid 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 {
  font-size: 17px;
  line-height: 1.1;
  font-weight: 950;
  color: var(--ink);
}

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

.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(82px, 15svh, 112px);
  padding: 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-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: 16px;
  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);
}

.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;
  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));
}

.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 var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.reference-card summary {
  padding: 7px 9px;
  cursor: pointer;
  font-weight: 850;
  font-size: 12.5px;
}

.reference-card p {
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

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

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

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

.reference-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11.5px;
}

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

.reference-content tr:last-child td {
  border-bottom: 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);
}

.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;
}

#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;
}

.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;
}

.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"] {
  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: min(100vw, 430px);
  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(4, 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;
}

dialog h2 {
  font-size: 17px;
}

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

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

  .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 {
    grid-template-columns: 1fr;
  }
}
