:root {
  --ink: #071d2b;
  --ink-2: #163847;
  --muted: #6b7d83;
  --paper: #f3f6f5;
  --card: #ffffff;
  --line: #dde5e3;
  --teal: #19a994;
  --teal-light: #dff6f0;
  --amber: #f1a43b;
  --amber-light: #fff1d8;
  --blue: #3974e8;
  --red: #df5b5b;
  --shadow: 0 14px 42px rgba(7, 29, 43, .08);
  --radius: 22px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
body.auth-loading .app-shell { visibility: hidden; }
body.authenticated .auth-screen { display: none; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; }
.auth-screen { position: fixed; z-index: 200; inset: 0; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; color: white; background: radial-gradient(circle at 80% 15%, #145160 0, transparent 34%), var(--ink); }
.auth-card { width: 100%; max-width: 390px; text-align: center; }
.auth-logo { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 22px; color: var(--ink); background: #5cdecb; border-radius: 24px; box-shadow: 0 18px 50px rgba(92,222,203,.18); }
.auth-logo svg { width: 45px; height: 45px; fill: currentColor; stroke: none; }
.auth-card h1 { margin: 7px 0 9px; font-size: 42px; letter-spacing: -.05em; }.auth-card > p { margin-bottom: 28px; color: #9bb2ba; font-size: 13px; }.auth-card > small { display: block; margin-top: 25px; color: #76919a; font-size: 10px; }
.auth-connecting { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; color: #b8cbcf; font-size: 12px; }.auth-connecting i { width: 19px; height: 19px; border: 2px solid rgba(255,255,255,.18); border-top-color: #5cdecb; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-form { display: grid; gap: 13px; padding: 22px; border: 1px solid rgba(255,255,255,.11); border-radius: 24px; background: rgba(255,255,255,.07); text-align: left; box-shadow: 0 25px 70px rgba(0,0,0,.18); }
.login-form label, .new-user-form label { color: #b9c9cd; font-size: 10px; font-weight: 800; }.login-form input, .new-user-form input, .new-user-form select { width: 100%; height: 48px; display: block; margin-top: 6px; padding: 0 13px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; outline: 0; color: white; background: rgba(255,255,255,.08); }.login-form input:focus { border-color: #5cdecb; }.form-error { margin: 0; padding: 10px; border-radius: 10px; color: #ffd5d5; background: rgba(223,91,91,.18); font-size: 11px; line-height: 1.4; }
.topbar {
  height: calc(68px + env(safe-area-inset-top));
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(243,246,245,.94); backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(221,229,227,.7);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; background: var(--ink); color: #fff; border-radius: 13px; }
.brand-mark svg { width: 26px; height: 26px; stroke: none; fill: currentColor; }
.brand strong { display: block; font-size: 17px; letter-spacing: .06em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; letter-spacing: .18em; }
.icon-button, .round-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--card); }
.top-actions { display: flex; align-items: center; gap: 7px; }.profile-button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 14px; color: white; background: var(--ink); font-size: 12px; font-weight: 900; }

main { padding: 0 16px calc(94px + env(safe-area-inset-bottom)); }
.page { display: none; max-width: 1160px; margin: 0 auto; animation: pageIn .25s ease; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }
.eyebrow { display: block; color: #77ddcd; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.dark { color: var(--teal); }
h1, h2, h3, p { margin-top: 0; }

.hero-card { position: relative; min-height: 305px; margin: 8px -2px 0; padding: 30px 24px 22px; overflow: hidden; color: white; border-radius: 28px; background: var(--ink); box-shadow: var(--shadow); }
.hero-card::before { content: ""; position: absolute; width: 250px; height: 250px; right: -110px; top: -95px; border: 1px solid rgba(92,222,203,.28); border-radius: 50%; box-shadow: 0 0 0 36px rgba(92,222,203,.06), 0 0 0 72px rgba(92,222,203,.04); }
.hero-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 68px; height: 48px; opacity: .12; background: radial-gradient(42px 10px at 42px 20px, transparent 95%, #fff 100%) 0 0/84px 28px; }
.hero-copy { position: relative; z-index: 2; max-width: 230px; }
.hero-copy h1 { margin: 10px 0 12px; font-size: clamp(29px, 9vw, 42px); line-height: 1.13; letter-spacing: -.04em; }
.hero-copy em { color: #5cdecb; font-style: normal; }
.hero-copy p { color: #9db2b9; font-size: 13px; }
.progress-ring { --progress: 0deg; position: absolute; z-index: 2; right: 21px; top: 45px; width: 94px; height: 94px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#5cdecb var(--progress), rgba(255,255,255,.12) 0); }
.progress-ring::before { content: ""; position: absolute; inset: 8px; background: var(--ink); border-radius: inherit; }
.progress-ring span { position: relative; display: flex; align-items: baseline; }
.progress-ring strong { font-size: 27px; }.progress-ring small { font-size: 12px; color: #8ca2aa; }
.primary-button, .secondary-button, .danger-button { min-height: 50px; border-radius: 15px; padding: 0 19px; font-weight: 800; border: 0; }
.primary-button { color: var(--ink); background: #5cdecb; box-shadow: 0 8px 22px rgba(92,222,203,.18); }
.primary-button span { margin-left: 8px; }
.secondary-button { color: var(--ink); background: white; border: 1px solid var(--line); }
.danger-button { color: #b93e3e; background: #fff0f0; }
.full { width: 100%; }
.hero-action { position: absolute; z-index: 2; left: 22px; right: 22px; bottom: 20px; display: flex; align-items: center; justify-content: space-between; width: calc(100% - 44px); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 30px 2px 14px; }
.section-heading.compact { margin-top: 28px; }
.section-heading h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.03em; }
.date-chip { padding: 7px 10px; border-radius: 10px; color: var(--muted); background: #e8efed; font-size: 11px; }
.text-button { padding: 7px 0; border: 0; color: var(--teal); background: transparent; font-size: 13px; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat-card { min-width: 0; padding: 14px 12px; border: 1px solid #e7eceb; border-radius: 18px; background: var(--card); box-shadow: 0 8px 24px rgba(7,29,43,.04); }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 10px; font-size: 13px; font-weight: 900; }
.stat-icon.teal { color: var(--teal); background: var(--teal-light); }.stat-icon.amber { color: #d68620; background: var(--amber-light); }.stat-icon.blue { color: var(--blue); background: #e8efff; }
.stat-card strong { display: block; font-size: 22px; }.stat-card small { color: var(--muted); font-size: 11px; }
.route-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.route-card { min-height: 112px; padding: 17px; text-align: left; border: 1px solid #e5ebea; border-radius: 19px; background: var(--card); color: var(--ink); box-shadow: 0 8px 22px rgba(7,29,43,.04); }
.route-card .route-symbol { width: 35px; height: 35px; display: grid; place-items: center; margin-bottom: 13px; border-radius: 11px; background: var(--teal-light); color: var(--teal); font-weight: 900; }
.route-card strong { display: block; font-size: 15px; }.route-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.scan-note { display: flex; align-items: center; gap: 13px; margin: 24px 0 8px; padding: 16px; border: 1px dashed #cbd8d5; border-radius: 18px; background: rgba(255,255,255,.6); }
.scan-icon { width: 39px; height: 39px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--teal); background: var(--teal-light); }
.scan-note strong { font-size: 13px; }.scan-note p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.page-head { padding: 24px 2px 15px; }
.page-head h1 { margin: 5px 0 7px; font-size: 30px; letter-spacing: -.04em; }.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.sticky-tools { position: sticky; z-index: 20; top: calc(68px + env(safe-area-inset-top)); margin: 0 -16px; padding: 8px 16px 12px; background: rgba(243,246,245,.95); backdrop-filter: blur(14px); }
.search-box { height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 7px 22px rgba(7,29,43,.04); }
.search-box svg { width: 20px; color: #779097; }.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }.search-box button { width: 28px; height: 28px; border: 0; color: #789096; background: #edf2f1; border-radius: 50%; }
.filter-row { display: flex; gap: 8px; margin-top: 11px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 11px; font-weight: 700; }.filter-chip.active { border-color: var(--ink); color: white; background: var(--ink); }
.inline-filters { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.inline-filters label { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; font-weight: 700; }.inline-filters input { width: 17px; height: 17px; accent-color: var(--teal); }
.inline-filters select, .learn-toolbar select, .setup-card select { min-height: 36px; max-width: 48%; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink-2); background: white; font-size: 11px; }
.port-list { display: grid; gap: 9px; padding-top: 5px; }
.port-card { position: relative; padding: 15px 15px 14px; border: 1px solid #e2e9e7; border-radius: 17px; background: var(--card); box-shadow: 0 7px 22px rgba(7,29,43,.035); }
.port-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.port-card h3 { margin: 0; font-size: 17px; }.port-card h3 span { color: #a0afb2; font-weight: 500; }.port-card .english { margin: 5px 0 12px; color: var(--teal); font-size: 14px; font-weight: 900; letter-spacing: .04em; word-break: break-word; }
.port-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }.port-badges span { padding: 5px 8px; border-radius: 8px; color: #60767d; background: #edf2f1; font-size: 9px; font-weight: 700; }.port-badges .important { color: #b76c0a; background: var(--amber-light); }
.source-page { flex: 0 0 auto; color: #9aabad; font-size: 9px; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }.empty-state span { font-size: 42px; }.empty-state h3 { margin: 12px 0 6px; color: var(--ink); }

.learn-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 2px 14px; }.learn-head h1 { margin: 5px 0 0; font-size: 29px; }
.learn-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 15px; }.learn-toolbar select { max-width: 62%; min-height: 40px; }.learn-toolbar #learnMode { width: 100%; max-width: none; min-height: 44px; font-weight: 800; }
.switch-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }.switch-label input { position: absolute; opacity: 0; }.switch-label span { position: relative; width: 37px; height: 22px; border-radius: 999px; background: #cdd8d6; transition: .2s; }.switch-label span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .2s; }.switch-label input:checked + span { background: var(--teal); }.switch-label input:checked + span::after { transform: translateX(15px); }
.session-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; color: var(--muted); font-size: 10px; font-weight: 800; }.session-progress > div { height: 5px; flex: 1; overflow: hidden; border-radius: 99px; background: #dfe7e5; }.session-progress i { display: block; width: 10%; height: 100%; border-radius: inherit; background: var(--teal); transition: width .3s; }
.flashcard { min-height: 395px; display: flex; flex-direction: column; padding: 20px; border: 1px solid #dfe7e5; border-radius: 28px; background: white; box-shadow: var(--shadow); }
.flashcard-top { display: flex; align-items: center; justify-content: space-between; }.flashcard-top > span { padding: 6px 9px; border-radius: 8px; color: var(--teal); background: var(--teal-light); font-size: 10px; font-weight: 800; }.flashcard-top button { border: 0; color: var(--amber); background: transparent; font-size: 25px; }
.flashcard-question { flex: 1; display: grid; place-content: center; text-align: center; }.flashcard-question small { color: var(--muted); font-size: 12px; }.flashcard-question h2 { margin: 14px 0 10px; font-size: clamp(31px, 10vw, 47px); letter-spacing: -.05em; word-break: break-word; }.flashcard-question p { margin: 0; color: var(--muted); font-size: 13px; }
.flashcard-answer { margin: 0 0 14px; padding: 16px; border-radius: 17px; background: #eef8f5; text-align: center; }.flashcard-answer > span { display: block; color: var(--muted); font-size: 9px; }.flashcard-answer strong { display: block; margin-top: 5px; color: var(--teal); font-size: 22px; letter-spacing: .03em; word-break: break-word; }.answer-meta { display: flex; justify-content: center; gap: 10px; margin-top: 9px; color: #71878d; font-size: 9px; }
.reveal-button { min-height: 51px; border: 0; border-radius: 15px; color: white; background: var(--ink); font-weight: 800; }
.memory-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }.memory-button { min-height: 83px; padding: 9px 5px; border: 1px solid var(--line); border-radius: 16px; background: white; }.memory-button span { display: block; margin-bottom: 3px; font-size: 18px; font-weight: 900; }.memory-button strong { display: block; font-size: 11px; }.memory-button small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }.memory-button.again span { color: var(--red); }.memory-button.unsure span { color: var(--amber); }.memory-button.know span { color: var(--teal); }

.quiz-title { padding-bottom: 20px; }.quiz-title p { line-height: 1.6; }
.setup-card { padding: 7px 18px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.setup-card > label { min-height: 61px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf1f0; font-size: 13px; font-weight: 800; }.setup-card > label:last-child { border-bottom: 0; }
.setup-card select { min-width: 120px; }
.check-row span strong, .check-row span small { display: block; }.check-row span small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }.check-row input { width: 20px; height: 20px; accent-color: var(--teal); }
.quiz-setup > button { margin-top: 12px; }.quiz-setup .secondary-button b { min-width: 24px; display: inline-grid; place-items: center; margin-left: 6px; padding: 3px 6px; border-radius: 999px; color: white; background: var(--red); font-size: 10px; }
.quiz-progress { display: flex; align-items: center; gap: 12px; padding: 20px 2px; }.quiz-progress button { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; background: white; }.quiz-progress div { flex: 1; height: 6px; overflow: hidden; border-radius: 99px; background: #dfe7e5; }.quiz-progress i { display: block; height: 100%; background: var(--teal); transition: .3s; }.quiz-progress span { color: var(--muted); font-size: 11px; font-weight: 800; }
.question-card { padding: 24px 19px 20px; border: 1px solid var(--line); border-radius: 25px; background: white; box-shadow: var(--shadow); }.question-type { padding: 6px 9px; color: var(--teal); background: var(--teal-light); border-radius: 8px; font-size: 9px; font-weight: 900; }.question-card > p { margin: 42px 0 8px; color: var(--muted); font-size: 12px; text-align: center; }.question-card h2 { min-height: 78px; display: grid; place-items: start center; margin: 0 0 25px; font-size: 35px; text-align: center; letter-spacing: -.04em; }
.answer-input input { width: 100%; height: 55px; padding: 0 15px; border: 1.5px solid #cdd9d6; border-radius: 14px; outline: 0; text-align: center; text-transform: uppercase; font-size: 17px; font-weight: 800; letter-spacing: .04em; }.answer-input input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(25,169,148,.1); }
.question-card .primary-button { margin-top: 13px; }.answer-feedback { margin-top: 12px; padding: 12px; border-radius: 12px; font-size: 12px; line-height: 1.5; }.answer-feedback.correct { color: #087565; background: var(--teal-light); }.answer-feedback.wrong { color: #a53f3f; background: #fff0f0; }.answer-feedback strong { display: block; font-size: 14px; }
.quiz-choices { display: grid; gap: 9px; }.choice-button { min-height: 50px; padding: 10px 14px; border: 1px solid #cfdad8; border-radius: 13px; color: var(--ink); background: #f9fbfa; text-align: left; font-size: 13px; font-weight: 800; }.choice-button.selected { border-color: var(--teal); background: var(--teal-light); }.choice-button.correct-choice { border-color: var(--teal); color: #087565; background: var(--teal-light); }.choice-button.wrong-choice { border-color: var(--red); color: #a53f3f; background: #fff0f0; }
.quiz-result { padding: 55px 8px 10px; text-align: center; }.result-orbit { width: 138px; height: 138px; display: grid; place-content: center; margin: 0 auto 22px; border: 12px solid var(--teal-light); border-radius: 50%; box-shadow: inset 0 0 0 3px var(--teal); }.result-orbit strong { font-size: 48px; line-height: 1; }.result-orbit span { color: var(--muted); font-size: 11px; }.quiz-result h2 { margin-bottom: 8px; font-size: 27px; }.quiz-result > p { color: var(--muted); font-size: 12px; }.result-stats { display: flex; justify-content: center; gap: 40px; margin: 24px 0; }.result-stats span { color: var(--muted); font-size: 11px; }.result-stats strong { display: block; color: var(--ink); font-size: 23px; }.quiz-result button { margin-top: 10px; }

.admin-head { padding-bottom: 15px; }.admin-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 18px; }.admin-summary div { padding: 13px 6px; border-radius: 15px; background: var(--ink); color: white; text-align: center; }.admin-summary strong, .admin-summary span { display: block; }.admin-summary strong { font-size: 21px; }.admin-summary span { margin-top: 2px; color: #9cb2b9; font-size: 9px; }
.admin-actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }.admin-actions-grid button { min-height: 104px; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: white; }.admin-actions-grid button > span { width: 31px; height: 31px; display: grid; place-items: center; margin-bottom: 9px; border-radius: 10px; color: var(--teal); background: var(--teal-light); font-size: 17px; font-weight: 900; }.admin-actions-grid strong, .admin-actions-grid small { display: block; }.admin-actions-grid strong { font-size: 13px; }.admin-actions-grid small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.admin-list-head { margin-top: 28px; }.admin-search { margin-bottom: 12px; }.admin-list { display: grid; gap: 8px; }.admin-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: white; }.admin-row.disabled { opacity: .58; }.admin-row strong { display: block; font-size: 13px; }.admin-row p { margin: 4px 0 6px; color: var(--teal); font-size: 11px; font-weight: 800; }.admin-row small { color: var(--muted); font-size: 9px; }.row-actions { display: flex; gap: 5px; align-items: center; }.row-actions button { min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; font-size: 11px; }

.bottom-nav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(70px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid rgba(212,222,220,.92); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); }
.bottom-nav button { position: relative; min-width: 0; border: 0; color: #7b8f95; background: transparent; font-size: 9px; }.bottom-nav svg { display: block; width: 21px; height: 21px; margin: 0 auto 3px; }.bottom-nav button.active { color: var(--teal); font-weight: 900; }.bottom-nav .nav-main { width: 46px; height: 46px; display: grid; place-items: center; margin: -23px auto 1px; border: 5px solid var(--paper); border-radius: 17px; color: white; background: var(--ink); box-shadow: 0 7px 18px rgba(7,29,43,.22); }.bottom-nav .nav-main svg { margin: 0; }.bottom-nav button.active .nav-main { background: var(--teal); }

.modal-backdrop { position: fixed; z-index: 79; inset: 0; background: rgba(2,17,25,.55); backdrop-filter: blur(3px); }
.modal { z-index: 80; width: calc(100% - 24px); max-width: 590px; max-height: calc(100vh - 28px); margin: auto; padding: 21px 18px calc(21px + env(safe-area-inset-bottom)); overflow: auto; border: 0; border-radius: 25px; color: var(--ink); background: white; box-shadow: 0 25px 80px rgba(7,29,43,.3); }.modal::backdrop { background: rgba(2,17,25,.55); backdrop-filter: blur(3px); }.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 19px; }.modal-head h2 { margin: 4px 0 0; }.modal-close { width: 38px; height: 38px; border: 0; border-radius: 12px; background: #eef2f1; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }.form-grid label { color: var(--muted); font-size: 10px; font-weight: 800; }.form-grid label.wide { grid-column: 1/-1; }.form-grid input:not([type=checkbox]) { width: 100%; height: 43px; display: block; margin-top: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #fbfcfc; }.form-grid input:focus { border-color: var(--teal); }.check-field { min-height: 44px; display: flex; align-items: center; gap: 9px; }.check-field input { width: 19px; height: 19px; accent-color: var(--teal); }.modal-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 9px; margin-top: 20px; }
.history-list { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }.history-item { padding: 12px; border-radius: 12px; background: #f2f6f5; }.history-item strong, .history-item span { display: block; }.history-item strong { font-size: 12px; }.history-item span { margin-top: 4px; color: var(--muted); font-size: 9px; }.history-list + .danger-button { width: 100%; margin-top: 15px; }
.profile-info { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 18px; }.profile-info span { padding: 14px; border-radius: 14px; color: var(--muted); background: #f1f5f4; font-size: 9px; }.profile-info strong { display: block; margin-top: 5px; color: var(--ink); font-size: 13px; }
.password-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; padding: 13px; border-radius: 14px; background: #f3f6f5; }.password-form label { color: var(--muted); font-size: 9px; font-weight: 800; }.password-form input { width: 100%; height: 40px; display: block; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; outline: 0; }.password-form .form-error, .password-form button { grid-column: 1/-1; }
.new-user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 20px; padding: 16px; border-radius: 17px; background: #f3f6f5; }.new-user-form label { color: var(--muted); }.new-user-form input, .new-user-form select { height: 42px; border-color: var(--line); color: var(--ink); background: white; }.new-user-form .form-error, .new-user-form button { grid-column: 1/-1; }.users-list { display: grid; gap: 8px; max-height: 42vh; overflow-y: auto; }.user-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }.user-row.disabled { opacity: .5; }.user-row strong, .user-row small { display: block; }.user-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }.user-row button { min-width: 52px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #f6f9f8; font-size: 10px; }
.user-role [data-page="admin"], .user-role #page-admin { display: none !important; }.user-role .bottom-nav { grid-template-columns: repeat(4,1fr); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100% - 36px); padding: 11px 16px; border-radius: 12px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .25s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .topbar { padding-left: 28px; padding-right: 28px; }
  main { padding-left: 28px; padding-right: 28px; padding-bottom: 110px; }
  .hero-card { min-height: 330px; padding: 40px; }.hero-copy { max-width: 400px; }.progress-ring { width: 130px; height: 130px; right: 55px; top: 48px; }.hero-action { left: 40px; right: auto; width: 280px; bottom: 32px; }
  .stats-grid { gap: 15px; }.stat-card { padding: 19px; }.route-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .port-list { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .flashcard { max-width: 700px; min-height: 455px; margin: 0 auto; padding: 28px; }.learn-head, .learn-toolbar, .session-progress, .memory-actions { max-width: 700px; margin-left: auto; margin-right: auto; }.memory-actions { margin-top: 14px; }
  .quiz-setup, .quiz-stage, .quiz-result { max-width: 620px; margin-left: auto; margin-right: auto; }
  .admin-actions-grid { grid-template-columns: repeat(4,1fr); }.admin-list { grid-template-columns: repeat(2,1fr); }
  .bottom-nav { left: 50%; right: auto; bottom: 18px; width: 520px; height: 68px; padding: 7px; border: 1px solid var(--line); border-radius: 23px; transform: translateX(-50%); box-shadow: 0 15px 40px rgba(7,29,43,.14); }
  .bottom-nav .nav-main { border-color: var(--paper); }
  .sticky-tools { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}

@media (min-width: 1024px) {
  .hero-card { min-height: 360px; }.hero-copy h1 { font-size: 48px; }.route-grid { grid-template-columns: repeat(7, 1fr); }
  .port-list { grid-template-columns: repeat(3, minmax(0,1fr)); }.admin-list { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 360px) {
  main { padding-left: 12px; padding-right: 12px; }.topbar { padding-left: 13px; padding-right: 13px; }.hero-card { min-height: 314px; padding-left: 19px; padding-right: 19px; }.progress-ring { width: 82px; height: 82px; right: 15px; }.hero-copy { max-width: 205px; }.hero-action { left: 18px; right: 18px; width: calc(100% - 36px); }.stat-card { padding-left: 9px; padding-right: 9px; }.bottom-nav { padding-left: 3px; padding-right: 3px; }.question-card h2 { font-size: 31px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
