:root {
  color-scheme: light;
  --navy: #062f69;
  --navy-2: #0b4b99;
  --blue: #1478df;
  --blue-soft: #eaf4ff;
  --teal: #0e9f95;
  --teal-soft: #e5f7f4;
  --amber: #f5a623;
  --amber-soft: #fff4da;
  --coral: #eb5b51;
  --coral-soft: #fff0ee;
  --purple: #7657d6;
  --purple-soft: #f1edff;
  --ink: #10233f;
  --muted: #637289;
  --line: #dde6f0;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --shadow: 0 12px 30px rgba(23, 52, 86, 0.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { background: #e9eef5; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(20, 120, 223, 0.09), transparent 28rem),
    radial-gradient(circle at 90% 90%, rgba(14, 159, 149, 0.08), transparent 24rem),
    #e9eef5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--canvas);
  box-shadow: 0 0 80px rgba(21, 43, 69, 0.16);
  overflow-x: hidden;
}

.page {
  min-height: 100vh;
  padding: 0 18px calc(104px + env(safe-area-inset-bottom));
}

.page.no-nav { padding-bottom: 24px; }

.splash {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: linear-gradient(160deg, var(--navy), var(--blue));
  color: white;
}

.splash h1 { margin: 8px 0 0; letter-spacing: .08em; }
.splash p { margin: 0; opacity: .78; }
.splash-mark { width: 84px; height: 84px; padding: 18px; border-radius: 25px; background: rgba(255,255,255,.14); }
.splash-mark::before, .splash-mark::after, .splash-mark span { content: ""; display: block; height: 10px; border-radius: 10px; background: white; transform: rotate(62deg); transform-origin: center; }
.splash-mark::before { margin: 6px 0 13px; }
.splash-mark::after { margin-top: 13px; }

.top-hero {
  position: relative;
  margin: 0 -18px 18px;
  padding: calc(22px + env(safe-area-inset-top)) 22px 34px;
  color: white;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 20%, rgba(89, 224, 205, .42), transparent 20%),
    linear-gradient(145deg, var(--navy) 4%, var(--navy-2) 65%, #116abf);
  border-radius: 0 0 34px 34px;
}

.top-hero::after {
  content: "";
  position: absolute;
  right: -45px;
  bottom: -75px;
  width: 210px;
  height: 210px;
  border: 35px solid rgba(255,255,255,.055);
  border-radius: 50%;
}

.hero-row, .section-title, .card-row, .metric-row, .quiz-head, .viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}

.top-hero h1 { margin: 0; font-size: clamp(28px, 8vw, 38px); letter-spacing: -.04em; }
.top-hero .subtitle { margin: 8px 0 0; color: rgba(255,255,255,.77); font-size: 15px; }
.hero-greeting { position: relative; z-index: 1; }

.round-button, .icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 15px;
  background: rgba(255,255,255,.14);
  color: white;
  cursor: pointer;
}

.icon-button.light { background: #edf4fb; color: var(--navy); }
.icon-button svg, .round-button svg { width: 22px; height: 22px; }

.progress-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 17px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.11);
  backdrop-filter: blur(15px);
}

.progress-summary strong { display: block; font-size: 18px; }
.progress-summary p { margin: 6px 0 0; color: rgba(255,255,255,.74); font-size: 13px; }

.ring {
  --value: 32;
  --ring-color: #57d8c8;
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--value) * 1%), rgba(255,255,255,.16) 0);
}

.ring::before { content: ""; width: 54px; height: 54px; border-radius: 50%; background: var(--navy-2); }
.ring span { position: absolute; font-weight: 800; font-size: 16px; }
.ring.light::before { background: white; }
.ring.light span { color: var(--navy); }

.section { margin-top: 25px; }
.section-title { margin-bottom: 13px; }
.section-title h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.section-title p, .section-title button { margin: 0; color: var(--muted); font-size: 13px; }
.section-title button { border: 0; background: none; cursor: pointer; }

.card {
  border: 1px solid rgba(208, 221, 234, .9);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(18, 54, 92, .06);
}

.task-list { display: grid; gap: 11px; }
.task-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 76px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: white;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(24, 58, 94, .04);
}

.task-card:active, .topic-card:active, .tool-card:active { transform: scale(.985); }
.task-card .task-icon, .square-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--blue);
}
.task-card:nth-child(2) .task-icon { background: var(--amber-soft); color: var(--amber); }
.task-card:nth-child(3) .task-icon { background: var(--teal-soft); color: var(--teal); }
.task-card:nth-child(4) .task-icon { background: var(--purple-soft); color: var(--purple); }
.task-icon svg, .square-icon svg { width: 24px; height: 24px; }
.task-copy strong { display: block; font-size: 16px; }
.task-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.chevron { color: #9caabd; }

.primary-button, .secondary-button, .answer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 17px;
  font-weight: 780;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  color: white;
  background: linear-gradient(135deg, var(--navy-2), var(--blue));
  box-shadow: 0 10px 22px rgba(20,120,223,.24);
}
.primary-button.teal { background: linear-gradient(135deg, #087f78, #16b1a6); }
.secondary-button { color: var(--navy-2); background: var(--blue-soft); }
.primary-button svg, .secondary-button svg { width: 21px; height: 21px; }

.daily-cta { margin-top: 15px; }

.insight-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 17px;
  overflow: hidden;
}
.insight-card .mini-chart { align-self: center; }
.insight-card h3 { margin: 0 0 6px; font-size: 16px; }
.insight-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.bar { height: 7px; margin-top: 12px; overflow: hidden; border-radius: 9px; background: #e8eef5; }
.bar span { display: block; width: var(--width, 50%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--teal)); }

.bottom-nav {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 520px);
  padding: 9px 10px calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(205, 216, 228, .92);
  background: rgba(255,255,255,.94);
  box-shadow: 0 -10px 28px rgba(20, 42, 67, .07);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 5px 3px;
  border: 0;
  background: none;
  color: #78879a;
  font-size: 11px;
  cursor: pointer;
}
.nav-item svg { width: 23px; height: 23px; }
.nav-item.active { color: var(--blue); font-weight: 760; }

.subpage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -18px 20px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 20px;
  color: white;
  background: linear-gradient(140deg, var(--navy), var(--navy-2));
  border-radius: 0 0 28px 28px;
}
.subpage-head h1 { margin: 0; font-size: 26px; }
.subpage-head p { margin: 4px 0 0; color: rgba(255,255,255,.7); font-size: 13px; }

.path-summary {
  margin: -2px 0 18px;
  padding: 19px;
  color: white;
  border: 0;
  background:
    radial-gradient(circle at 95% 30%, rgba(83,217,201,.3), transparent 30%),
    linear-gradient(145deg, var(--navy-2), var(--blue));
}
.path-summary .metric-row strong { font-size: 30px; }
.path-summary p { margin: 6px 0 0; color: rgba(255,255,255,.75); font-size: 13px; }

.roadmap { position: relative; display: grid; gap: 12px; padding-left: 28px; }
.roadmap::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 26px; width: 3px; border-radius: 3px; background: #dce6f0; }
.stage-card { position: relative; padding: 17px; }
.stage-card::before { content: attr(data-number); position: absolute; left: -39px; top: 18px; display: grid; place-items: center; width: 30px; height: 30px; border: 4px solid var(--canvas); border-radius: 50%; background: #d6e0eb; color: #68768a; font-weight: 800; }
.stage-card.done::before { content: "✓"; color: white; background: var(--teal); }
.stage-card.current { border-color: #89bdf4; box-shadow: 0 10px 26px rgba(20,120,223,.11); }
.stage-card.current::before { color: white; background: var(--blue); }
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stage-head h3 { margin: 0; font-size: 17px; }
.stage-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.status-pill, .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--navy-2);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 760;
}
.status-pill.done { color: #08766e; background: var(--teal-soft); }
.stage-lessons { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.lesson-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; padding: 8px 0; border: 0; background: none; text-align: left; cursor: pointer; }
.lesson-row .lesson-check { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #ccd8e5; border-radius: 8px; color: white; }
.lesson-row.completed .lesson-check { border-color: var(--teal); background: var(--teal); }
.lesson-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.lesson-number { color: var(--muted); font-size: 11px; }
.more-lessons { border: 0; padding: 8px; color: var(--blue); background: var(--blue-soft); border-radius: 12px; cursor: pointer; }

.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 15px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: #8998aa; }
.search-input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--line);
  outline: none;
  border-radius: 17px;
  color: var(--ink);
  background: white;
}
.search-input:focus { border-color: #82b8ef; box-shadow: 0 0 0 4px rgba(20,120,223,.09); }

.recommendation {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 13px;
  margin-top: 15px;
  padding: 16px;
  border-color: #b6d8f7;
  background: linear-gradient(135deg, white, #edf7ff);
}
.recommendation h3 { margin: 3px 0 4px; font-size: 17px; }
.recommendation p { margin: 0; color: var(--muted); font-size: 12px; }
.recommendation .primary-button { width: auto; min-height: 42px; padding: 0 16px; }

.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.topic-card { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; min-height: 90px; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: white; cursor: pointer; text-align: left; }
.topic-card .visual-mini { display: grid; place-items: center; width: 42px; height: 42px; }
.topic-card strong { display: block; font-size: 14px; }
.topic-card span { display: block; margin-top: 5px; color: var(--blue); font-size: 13px; font-weight: 750; }
.topic-card .bar { margin-top: 7px; height: 5px; }

.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mode-button { display: grid; place-items: center; gap: 7px; min-height: 82px; padding: 9px 4px; border: 1px solid var(--line); border-radius: 16px; background: white; font-size: 11px; cursor: pointer; }
.mode-button .square-icon { width: 36px; height: 36px; border-radius: 12px; }

.history-list, .finding-list, .attachment-list, .course-results { overflow: hidden; }
.history-row, .finding-card, .attachment-row, .course-result {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: white;
}
.history-row:last-child, .attachment-row:last-child, .course-result:last-child { border-bottom: 0; }
.history-row strong, .attachment-row strong { display: block; font-size: 14px; }
.history-row span, .attachment-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.sign { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 56px; height: 56px; font-weight: 900; }
.sign.speed { border: 6px solid #de272c; border-radius: 50%; background: white; color: #171717; font-size: 18px; }
.sign.yield { width: 60px; height: 54px; }
.sign.yield::before { content: ""; width: 0; height: 0; border-left: 29px solid transparent; border-right: 29px solid transparent; border-top: 51px solid #de272c; }
.sign.yield::after { content: ""; position: absolute; top: 8px; width: 0; height: 0; border-left: 20px solid transparent; border-right: 20px solid transparent; border-top: 35px solid white; }
.sign.no-entry { border: 6px solid #de272c; border-radius: 50%; background: white; }
.sign.no-entry::after { content: ""; width: 28px; height: 10px; border-radius: 3px; background: #de272c; }
.sign.warning { width: 58px; height: 52px; }
.sign.warning::before { content: ""; width: 0; height: 0; border-left: 28px solid transparent; border-right: 28px solid transparent; border-bottom: 50px solid #de272c; }
.sign.warning::after { content: "!"; position: absolute; top: 12px; display: grid; place-items: center; width: 0; height: 0; border-left: 19px solid transparent; border-right: 19px solid transparent; border-bottom: 34px solid white; color: #111; line-height: 51px; text-indent: -3px; }
.sign.parking { border: 5px solid white; outline: 2px solid var(--blue); border-radius: 8px; color: white; background: var(--blue); font-size: 28px; }

.diagnostic-summary { display: grid; grid-template-columns: 1fr 112px; align-items: center; gap: 16px; padding: 18px; }
.diagnostic-summary .big-number { font-size: 44px; line-height: 1; color: var(--coral); font-weight: 850; }
.diagnostic-summary p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.diagnostic-ring { justify-self: end; width: 100px; height: 100px; }
.diagnostic-ring::before { width: 76px; height: 76px; }
.diagnostic-ring span { text-align: center; font-size: 12px; }
.diagnostic-ring b { display: block; font-size: 24px; }

.error-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 16px 0 22px; }
.error-chip { display: grid; place-items: center; gap: 4px; min-width: 0; padding: 8px 1px; border-radius: 14px; background: white; font-size: 9px; color: var(--muted); }
.error-chip b { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 10px; color: white; background: var(--chip, var(--blue)); font-size: 13px; }

.finding-list { display: grid; gap: 10px; overflow: visible; }
.finding-card { grid-template-columns: 44px 1fr auto; border: 1px solid var(--line); border-radius: 18px; }
.finding-card h3 { margin: 0 0 4px; font-size: 14px; }
.finding-card p { margin: 0; color: var(--muted); font-size: 11px; }
.mini-action { padding: 8px 10px; border: 1px solid currentColor; border-radius: 11px; color: var(--blue); background: white; font-size: 11px; cursor: pointer; }

.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.tool-card { display: grid; grid-template-columns: 45px 1fr; align-items: center; gap: 11px; min-height: 84px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: white; cursor: pointer; text-align: left; }
.tool-card strong { font-size: 14px; }
.tool-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.course-card { overflow: hidden; }
.course-cover { height: 132px; display: grid; place-content: center; justify-items: center; color: white; background:
  linear-gradient(135deg, rgba(6,47,105,.75), rgba(20,120,223,.45)),
  radial-gradient(circle at 30% 20%, #2bb8a5, transparent 35%),
  linear-gradient(145deg, #0e4e92, #51b2df); }
.course-cover .flag { display: flex; width: 66px; height: 35px; overflow: hidden; border: 2px solid rgba(255,255,255,.8); border-radius: 5px; box-shadow: 0 5px 15px rgba(0,0,0,.12); }
.course-cover .flag i { flex: 1; }
.course-cover .flag i:nth-child(1) { background: #159a65; }
.course-cover .flag i:nth-child(2) { background: white; }
.course-cover .flag i:nth-child(3) { background: #e74444; }
.course-cover p { margin: 10px 0 0; font-weight: 800; }
.course-card-copy { padding: 16px; }
.course-card-copy h3 { margin: 0; font-size: 18px; }
.course-card-copy p { margin: 7px 0 15px; color: var(--muted); font-size: 12px; }

.storage-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; padding: 16px; }
.storage-card h3 { margin: 0; font-size: 15px; }
.storage-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.account-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 13px; padding: 16px; }
.account-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; color: white; background: linear-gradient(145deg, var(--blue), var(--teal)); font-size: 20px; font-weight: 850; box-shadow: 0 8px 18px rgba(20,120,223,.18); }
.account-card > span:nth-child(2) { min-width: 0; }
.account-card > span:nth-child(2) strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.account-card > span:nth-child(2) small { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.account-actions { display: flex; grid-column: 1 / -1; gap: 8px; padding-top: 2px; }
.account-actions button { flex: 1; min-height: 40px; }

.install-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; padding: 14px; border-color: #b9d8f5; background: linear-gradient(135deg, #fff, #edf7ff); }
.install-app-icon { display: grid; place-items: center; width: 50px; height: 50px; overflow: hidden; border-radius: 14px; box-shadow: 0 7px 16px rgba(12,76,143,.18); }
.install-app-icon img { width: 100%; height: 100%; }
.install-card > span:nth-child(2) { min-width: 0; }
.install-card > span:nth-child(2) strong, .install-card > span:nth-child(2) small { display: block; }
.install-card > span:nth-child(2) strong { color: var(--navy); font-size: 14px; }
.install-card > span:nth-child(2) small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.install-overlay { position: fixed; z-index: 250; inset: 0; display: grid; align-items: end; padding: 16px; background: rgba(3,25,52,.55); backdrop-filter: blur(6px); }
.install-sheet { position: relative; width: min(100%, 480px); max-height: calc(100vh - 32px); margin: 0 auto; padding: 25px; overflow-y: auto; border-radius: 28px; background: white; box-shadow: 0 30px 80px rgba(0,20,50,.35); }
.install-sheet .tag { display: table; margin: 13px auto 0; }
.install-guide-icon { display: block; width: 76px; height: 76px; margin: 0 auto; border-radius: 20px; box-shadow: 0 10px 25px rgba(15,102,184,.24); }
.install-sheet h2 { margin: 12px 34px 6px; color: var(--navy); font-size: 22px; text-align: center; }
.install-sheet > p { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.install-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; color: var(--muted); background: #edf3f9; cursor: pointer; }
.install-close svg { width: 19px; }
.install-steps { display: grid; gap: 10px; margin: 20px 0 14px; padding: 0; list-style: none; counter-reset: none; }
.install-steps li { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 15px; background: #f9fbfd; }
.install-steps li > b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: white; background: var(--blue); }
.install-steps li > span { color: #263c58; font-size: 12px; font-weight: 750; }
.install-steps small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.install-result { display: grid; grid-template-columns: auto 1fr; gap: 9px; margin-bottom: 15px; padding: 12px; border-radius: 14px; color: #08766e; background: var(--teal-soft); font-size: 11px; line-height: 1.5; }
.install-sheet > .primary-button { width: 100%; }

.lesson-page { background: #f5f8fc; }
.lesson-progress { margin: 0 -18px; padding: calc(16px + env(safe-area-inset-top)) 18px 16px; color: white; background: linear-gradient(145deg, var(--navy), var(--blue)); }
.lesson-progress .viewer-head h1 { margin: 0; font-size: 22px; text-align: center; }
.lesson-progress .viewer-head p { margin: 2px 0 0; color: #ffd56a; text-align: center; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.stepper b { margin-right: 4px; font-size: 12px; }
.stepper i { flex: 1; height: 6px; border-radius: 10px; background: rgba(255,255,255,.25); }
.stepper i.done { background: #54d7c7; }
.stepper i.current { background: var(--amber); }

.scene-card { position: relative; height: 250px; margin: 0 -18px; overflow: hidden; background:
  linear-gradient(#8bd1f5 0 47%, #d9e9c0 47% 62%, #8b8e91 62%);
}
.scene-card::before { content: ""; position: absolute; left: 50%; bottom: -55px; width: 150px; height: 210px; transform: translateX(-50%); background: #555a5e; clip-path: polygon(40% 0,60% 0,100% 100%,0 100%); }
.scene-card::after { content: ""; position: absolute; left: 50%; bottom: 8px; width: 7px; height: 115px; transform: translateX(-50%); background: repeating-linear-gradient(#fff 0 18px,transparent 18px 34px); }
.scene-label { position: absolute; z-index: 3; left: 14px; top: 14px; padding: 8px 12px; border-radius: 12px; color: white; background: rgba(6,47,105,.9); font-size: 12px; font-weight: 780; }
.scene-card .sign { position: absolute; z-index: 3; right: 35px; top: 50px; transform: scale(1.15); filter: drop-shadow(0 4px 3px rgba(0,0,0,.18)); }
.car { position: absolute; z-index: 2; bottom: 32px; left: 50%; width: 78px; height: 42px; transform: translateX(-82px); border-radius: 18px 20px 8px 8px; background: #1478df; box-shadow: inset 0 -9px rgba(0,0,0,.12); }
.car::before, .car::after { content: ""; position: absolute; bottom: -7px; width: 18px; height: 18px; border: 5px solid #252b32; border-radius: 50%; background: #aeb8c2; }
.car::before { left: 8px; } .car::after { right: 8px; }
.car.cross { left: 67%; bottom: 99px; transform: rotate(90deg) scale(.8); background: white; }

.lesson-stack { display: grid; gap: 12px; margin-top: -18px; position: relative; z-index: 4; }
.learning-card { padding: 17px; }
.learning-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--navy-2); font-size: 17px; }
.learning-card p { margin: 0; line-height: 1.65; }
.keyword-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keyword { padding: 12px 7px; border: 1px solid #b7d6f4; border-radius: 14px; text-align: center; background: #f7fbff; }
.keyword b { display: block; color: var(--navy); font-size: 16px; }
.keyword span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.sentence { padding: 14px; border-radius: 15px; color: var(--navy); background: var(--purple-soft); font-size: 18px; font-weight: 700; text-align: center; line-height: 1.45; }
.sentence em { color: var(--purple); font-style: normal; border-bottom: 2px solid var(--purple); }
.sentence-parts { display: flex; justify-content: center; gap: 10px; margin-top: 10px; color: var(--purple); font-size: 12px; }
.lesson-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.answer-button { color: white; background: var(--teal); }
.answer-button.false { background: var(--amber); }
.answer-feedback { display: none; margin-top: 12px; padding: 12px; border-radius: 13px; font-size: 13px; line-height: 1.55; }
.answer-feedback.show { display: block; }
.answer-feedback.correct { color: #076a62; background: var(--teal-soft); }
.answer-feedback.wrong { color: #a13c34; background: var(--coral-soft); }

.quiz-page { padding: 0 18px calc(24px + env(safe-area-inset-bottom)); background: #f8fafc; }
.quiz-top { margin: 0 -18px; padding: calc(16px + env(safe-area-inset-top)) 18px 16px; color: white; background: linear-gradient(145deg, var(--navy), var(--navy-2)); }
.quiz-head h1 { margin: 0; font-size: 20px; }
.quiz-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; }
.quiz-meta span { padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.12); font-size: 12px; }
.quiz-visual { display: grid; place-items: center; min-height: 210px; padding: 30px; }
.quiz-visual .sign { transform: scale(2); }
.question-card { padding: 20px; }
.question-card .italian { margin: 0; font-size: 21px; font-weight: 760; line-height: 1.48; text-align: center; }
.question-card .translation { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.55; }
.question-keywords { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 14px; }
.question-keywords .tag { background: #f0f4f8; color: var(--muted); }
.quiz-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px; }
.quiz-actions .answer-button { min-height: 62px; font-size: 18px; }
.quiz-feedback { margin-top: 14px; padding: 15px; border-radius: 16px; }
.quiz-feedback.correct { color: #076a62; background: var(--teal-soft); }
.quiz-feedback.wrong { color: #a13c34; background: var(--coral-soft); }
.quiz-feedback h3 { margin: 0 0 5px; }
.quiz-feedback p { margin: 0; font-size: 13px; line-height: 1.55; }
.quiz-next { margin-top: 12px; }
.quiz-finish { display: grid; min-height: 100vh; place-content: center; gap: 18px; text-align: center; }
.score-circle { display: grid; place-items: center; width: 170px; height: 170px; margin: auto; border: 16px solid var(--teal-soft); border-top-color: var(--teal); border-radius: 50%; }
.score-circle b { display: block; font-size: 45px; }
.quiz-finish h1 { margin: 0; }
.quiz-finish p { margin: 0; color: var(--muted); }
.quiz-finish .primary-button, .quiz-finish .secondary-button { width: 100%; }

.viewer-page { padding: 0 0 calc(18px + env(safe-area-inset-bottom)); }
.viewer-head { padding: calc(12px + env(safe-area-inset-top)) 14px 12px; color: white; background: var(--navy); }
.viewer-title { min-width: 0; flex: 1; }
.viewer-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.viewer-title span { display: block; margin-top: 2px; color: rgba(255,255,255,.68); font-size: 11px; }
.viewer-frame { display: block; width: 100%; height: calc(100vh - 142px - env(safe-area-inset-top)); border: 0; background: white; }
.viewer-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 9px; padding: 10px 12px; background: white; box-shadow: 0 -8px 20px rgba(18,45,75,.08); }

.course-results { max-height: 52vh; margin-top: 12px; border: 1px solid var(--line); border-radius: 18px; }
.course-result { grid-template-columns: auto 1fr auto; width: 100%; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.course-result .num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.course-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; }
.settings-row strong { display: block; font-size: 14px; }
.settings-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.step-control { display: flex; align-items: center; gap: 12px; }
.step-control button { width: 34px; height: 34px; border: 0; border-radius: 11px; color: var(--blue); background: var(--blue-soft); cursor: pointer; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  max-width: calc(100% - 40px);
  padding: 11px 16px;
  transform: translate(-50%, 22px);
  border-radius: 14px;
  color: white;
  background: rgba(15, 33, 54, .93);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.empty-state { padding: 28px 18px; text-align: center; }
.empty-state .square-icon { margin: 0 auto 13px; }
.empty-state h3 { margin: 0; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

@media (min-width: 760px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100vh - 48px); border-radius: 30px; overflow: hidden; }
  .page { min-height: calc(100vh - 48px); }
  .bottom-nav { bottom: 24px; border-radius: 0 0 30px 30px; }
  .viewer-frame { height: calc(100vh - 190px); }
}

@media (max-width: 370px) {
  .page { padding-left: 14px; padding-right: 14px; }
  .top-hero, .subpage-head, .lesson-progress, .scene-card, .quiz-top { margin-left: -14px; margin-right: -14px; }
  .topic-card { grid-template-columns: 34px 1fr; padding: 10px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .keyword-row { grid-template-columns: 1fr; }
}

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

/* Account and administration surfaces */
.auth-body {
  min-height: 100vh;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 12%, rgba(63, 202, 190, .22), transparent 30rem),
    radial-gradient(circle at 92% 84%, rgba(20, 120, 223, .2), transparent 30rem),
    linear-gradient(145deg, #032657, #0a4b96 62%, #0e6cb7);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  width: min(1120px, 100%);
  min-height: calc(100vh - 56px);
  margin: auto;
}

.auth-brand { color: white; }
.auth-brand h1 { margin: 18px 0; font-size: clamp(38px, 5vw, 65px); line-height: 1.08; letter-spacing: -.05em; }
.auth-brand > p:not(.eyebrow) { max-width: 650px; margin: 0; color: rgba(255,255,255,.76); font-size: 17px; line-height: 1.75; }
.auth-logo { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 25px; border-radius: 24px; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.auth-logo img { width: 58px; height: 58px; border-radius: 17px; }
.auth-benefits { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.auth-benefits span { padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.84); background: rgba(255,255,255,.08); font-size: 12px; }

.auth-card { padding: 28px; border: 1px solid rgba(255,255,255,.55); border-radius: 30px; background: rgba(255,255,255,.97); box-shadow: 0 30px 80px rgba(1, 21, 48, .32); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 5px; border-radius: 16px; background: #eef3f8; }
.auth-tab { height: 42px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-weight: 760; cursor: pointer; }
.auth-tab.active { color: var(--navy); background: white; box-shadow: 0 4px 12px rgba(21,49,78,.08); }
.auth-form { display: grid; gap: 17px; margin-top: 26px; }
.auth-form h2 { margin: 0; font-size: 26px; }
.auth-form p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.auth-form label { display: grid; gap: 7px; color: #34455c; font-size: 13px; font-weight: 700; }
.auth-form input, .admin-input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #d4dfeb; outline: none; border-radius: 14px; color: var(--ink); background: white; }
.auth-form input:focus, .admin-input:focus { border-color: #78b2ec; box-shadow: 0 0 0 4px rgba(20,120,223,.09); }
.auth-form button:disabled { opacity: .65; cursor: wait; }
.auth-form .form-note { font-size: 11px; line-height: 1.55; }
.auth-message { display: none; margin-top: 15px; padding: 11px 13px; border-radius: 12px; color: #08766e; background: var(--teal-soft); font-size: 13px; }
.auth-message.show { display: block; }
.auth-message.error { color: #9c3831; background: var(--coral-soft); }
.ios-install-hint { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.ios-install-hint summary { color: var(--blue); font-weight: 750; text-align: center; cursor: pointer; }
.ios-install-hint ol { margin: 12px 0 0; padding-left: 22px; line-height: 1.8; }

.admin-body { min-height: 100vh; background: #eef3f8; }
.admin-shell { display: grid; grid-template-columns: 245px minmax(0,1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 22px 16px; color: white; background: linear-gradient(180deg, #052d65, #073f84); }
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; text-decoration: none; }
.admin-brand img { width: 44px; height: 44px; border-radius: 13px; }
.admin-brand b, .admin-brand small { display: block; }
.admin-brand b { font-size: 17px; }.admin-brand small { margin-top: 2px; color: rgba(255,255,255,.6); font-size: 10px; }
.admin-sidebar nav { display: grid; gap: 6px; margin-top: 18px; }
.admin-sidebar nav button { height: 44px; padding: 0 13px; border: 0; border-radius: 13px; color: rgba(255,255,255,.68); background: transparent; text-align: left; cursor: pointer; }
.admin-sidebar nav button.active, .admin-sidebar nav button:hover { color: white; background: rgba(255,255,255,.12); }
.admin-account { display: grid; gap: 4px; margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.07); }
.admin-account span { overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,.58); font-size: 10px; }
.admin-account button { margin-top: 8px; padding: 7px; border: 0; border-radius: 9px; color: white; background: rgba(255,255,255,.12); cursor: pointer; }

.admin-main { min-width: 0; padding: 28px clamp(20px, 4vw, 54px) 60px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.admin-header h1 { margin: 3px 0 0; font-size: 31px; }
.admin-header .secondary-button { min-height: 44px; text-decoration: none; }
.admin-kicker { margin: 0; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.admin-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.admin-summary article { padding: 18px; }
.admin-summary span, .admin-summary small { display: block; color: var(--muted); font-size: 11px; }
.admin-summary strong { display: block; margin: 7px 0; font-size: 27px; }
.admin-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) 150px 150px auto; gap: 10px; margin-bottom: 15px; padding: 13px; }
select.admin-input { appearance: auto; }
.admin-create-toggle { width: auto; min-height: 48px; white-space: nowrap; }
.admin-create-form { margin-bottom: 15px; padding: 20px; }
.admin-form-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.admin-form-head h2 { margin: 0; }.admin-form-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.admin-form-head button { width: 36px; height: 36px; border: 0; border-radius: 11px; background: #edf3f9; cursor: pointer; }
.admin-form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-bottom: 16px; }
.admin-form-grid label { display: grid; gap: 6px; color: #405168; font-size: 11px; font-weight: 720; }
.admin-form-grid .check-label { display: flex; align-items: center; gap: 8px; padding-top: 25px; }.check-label input { width: 18px; height: 18px; }
.admin-create-form > .primary-button { width: auto; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; min-width: 940px; border-collapse: collapse; }
.admin-table th { padding: 13px 14px; color: var(--muted); background: #f7f9fc; font-size: 10px; letter-spacing: .05em; text-align: left; }
.admin-table td { padding: 14px; border-top: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.admin-table td strong, .admin-table td small { display: block; }.admin-table td small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.admin-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: var(--navy); background: var(--blue-soft); font-size: 9px; font-weight: 800; }
.admin-pill.active { color: #08766e; background: var(--teal-soft); }.admin-pill.suspended, .admin-pill.inactive { color: #983a34; background: var(--coral-soft); }.admin-pill.admin { color: #6748c8; background: var(--purple-soft); }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 170px; }
.row-actions button { padding: 6px 8px; border: 1px solid #d5e0eb; border-radius: 8px; color: #36506c; background: white; font-size: 9px; cursor: pointer; }
.row-actions button:hover { border-color: #82b8ef; color: var(--blue); }
.payment-ready-card { padding: 28px; background: linear-gradient(135deg, white, #edf7ff); }
.payment-ready-card h2 { margin: 14px 0 8px; }.payment-ready-card p, .provider-note p { margin: 0; color: var(--muted); line-height: 1.7; }
.provider-note { margin-top: 16px; padding: 22px; }.provider-note h3 { margin: 0 0 8px; }

@media (max-width: 900px) {
  .auth-body { padding: 18px; }
  .auth-layout { grid-template-columns: 1fr; gap: 25px; align-content: center; }
  .auth-brand h1 { font-size: 36px; }.auth-brand > p:not(.eyebrow), .auth-benefits { display: none; }.auth-logo { width: 58px; height: 58px; margin-bottom: 15px; }.auth-logo img { width: 46px; height: 46px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; display: grid; grid-template-columns: auto 1fr auto; align-items: center; height: auto; padding: 11px 14px; }
  .admin-brand { padding: 0; }.admin-brand img { width: 37px; height: 37px; }.admin-sidebar nav { display: flex; justify-content: center; margin: 0; }.admin-sidebar nav button { height: 38px; }
  .admin-account { display: none; }
  .admin-summary { grid-template-columns: repeat(2,1fr); }
  .admin-toolbar { grid-template-columns: 1fr 1fr; }
  .admin-form-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 560px) {
  .auth-body { padding: 0; background: #f4f7fb; }.auth-layout { min-height: 100vh; gap: 0; }.auth-brand { padding: calc(30px + env(safe-area-inset-top)) 22px 28px; background: linear-gradient(145deg,var(--navy),var(--blue)); }.auth-brand h1 { margin-bottom: 0; font-size: 30px; }.auth-brand .eyebrow { font-size: 10px; }.auth-card { align-self: stretch; padding: 22px; border-radius: 26px 26px 0 0; box-shadow: none; }
  .admin-sidebar { grid-template-columns: 1fr; gap: 9px; }.admin-brand { justify-content: center; }.admin-sidebar nav { overflow-x: auto; justify-content: flex-start; }.admin-sidebar nav button { white-space: nowrap; }
  .admin-main { padding: 20px 14px 40px; }.admin-header h1 { font-size: 25px; }.admin-header .secondary-button { padding: 0 12px; font-size: 11px; }
  .admin-summary { gap: 8px; }.admin-summary article { padding: 13px; }.admin-summary strong { font-size: 22px; }
  .admin-toolbar, .admin-form-grid { grid-template-columns: 1fr; }.admin-create-toggle { width: 100%; }
  .install-card { grid-template-columns: auto minmax(0,1fr); }.install-card > button, .install-card > .status-pill { grid-column: 1 / -1; width: 100%; }
}
