:root {
  --ink: #17263b;
  --ink-soft: #566579;
  --navy: #132238;
  --navy-2: #203a5b;
  --cream: #f7f4ee;
  --paper: #fffdf9;
  --line: #e6e1d8;
  --blue: #6e9bd6;
  --blue-soft: #e9f0fb;
  --coral: #ed806c;
  --coral-soft: #fff0ed;
  --green: #63a78d;
  --green-soft: #eaf6f0;
  --purple: #8d80c4;
  --warm: #e6aa57;
  --shadow: 0 16px 45px rgba(24, 39, 60, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--cream); }

body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--cream); }

button, input, textarea, select { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(110, 155, 214, 0.35);
  outline-offset: 2px;
}

.app-shell { max-width: 720px; min-height: 100vh; margin: 0 auto; padding-bottom: 92px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(22px + env(safe-area-inset-top)) 20px 14px;
  color: #fff;
  background: var(--navy);
}

.topbar h1 { margin: 2px 0 0; font-size: 25px; letter-spacing: -0.04em; }

.eyebrow, .card-kicker, .modal-kicker {
  margin: 0;
  color: rgba(255,255,255,0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.page-heading .eyebrow, .card-kicker, .modal-kicker { color: var(--blue); }

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 13px;
  color: #fff;
  background: rgba(255,255,255,0.09);
  font-size: 22px;
}

main { padding: 22px 16px 0; }

.view { display: none; animation: fade-in 180ms ease-out; }
.view.active { display: block; }

@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.welcome-row, .hero-card-top, .task-heading, .stat-row, .list-heading, .button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-row { align-items: flex-start; margin-bottom: 16px; }

h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 4px 0 0; font-size: 25px; letter-spacing: -0.045em; line-height: 1.15; }
h3 { margin: 0; font-size: 17px; letter-spacing: -0.025em; }
p { line-height: 1.55; }
.muted, .page-heading > p:last-child, .install-help, .version-note { color: var(--ink-soft); font-size: 13px; }
.muted { margin: 0; }

.phase-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--navy-2);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
}

.hero-card {
  padding: 21px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 25px;
  color: #fff;
  background: linear-gradient(148deg, #14253c 0%, #244364 100%);
  box-shadow: var(--shadow);
}

.hero-card-top { align-items: flex-start; gap: 12px; }
.hero-card h2 { max-width: 260px; margin-top: 6px; font-size: 24px; }
.hero-card .card-kicker { color: #a9c9ef; }
.day-number { color: rgba(255,255,255,0.15); font-size: 66px; font-weight: 800; line-height: 0.82; letter-spacing: -0.08em; }

.skill-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0; }
.skill-tag { padding: 5px 8px; border-radius: 8px; color: #dbe9f8; background: rgba(255,255,255,0.11); font-size: 11px; }

.task-block { padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.14); }
.task-heading { justify-content: flex-start; gap: 8px; color: #d5e3f2; font-size: 13px; font-weight: 750; }
.task-icon { color: #9fc1e7; font-size: 14px; }
.task-steps { margin: 12px 0 0; padding-left: 22px; color: #fff; }
.task-steps li { margin: 7px 0; padding-left: 2px; color: #edf5fd; font-size: 14px; line-height: 1.5; }

.evidence-box { display: flex; gap: 9px; margin: 16px 0; padding: 12px 13px; border-radius: 14px; background: rgba(255,255,255,0.09); }
.evidence-box strong { font-size: 12px; }
.evidence-box p { margin: 3px 0 0; color: #cfdfef; font-size: 12px; line-height: 1.45; }

.hero-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.primary-button, .secondary-button, .small-button {
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  font-weight: 800;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}
.primary-button:active, .secondary-button:active, .small-button:active, .quick-card:active { transform: scale(0.98); }
.primary-button { padding: 11px 14px; color: var(--navy); background: #f8d58d; }
.primary-button:hover { background: #ffe2a8; }
.secondary-button { padding: 10px 14px; color: var(--navy-2); background: var(--blue-soft); }
.hero-card .secondary-button { color: #e2eef9; background: rgba(255,255,255,0.1); }
.small-button { min-height: 35px; padding: 7px 10px; color: var(--navy); background: #fff; font-size: 11px; }

.extension-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 17px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.14); }
.extension-box .card-kicker { color: #a9c9ef; }
.extension-box p { margin: 4px 0 0; color: #c8d8e9; font-size: 12px; }

.practice-card { margin: 13px 0; padding: 17px; border: 1px solid #d8e0ea; border-radius: 21px; background: linear-gradient(155deg, #fbfdff, #f2f7fc); box-shadow: 0 6px 20px rgba(46, 74, 105, 0.07); }
.practice-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.practice-heading h3 { margin-top: 5px; font-size: 17px; }
.practice-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.practice-badges { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 5px; }
.practice-type, .practice-status { padding: 5px 7px; border-radius: 8px; color: #426fa9; background: #e6f0fb; font-size: 10px; font-weight: 850; white-space: nowrap; }
.practice-status { color: #377c61; background: #e5f4ed; }
.practice-switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 13px; }
.practice-switcher-label { color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.practice-switcher button { min-height: 30px; padding: 5px 9px; border: 1px solid #d7e1ec; border-radius: 9px; color: #57708a; background: #fff; font-size: 10px; font-weight: 800; }
.practice-switcher button.active { border-color: #7da8d6; color: #244e7d; background: #e4f0fc; }
.practice-media { display: grid; gap: 7px; margin-top: 14px; padding: 10px; border-radius: 12px; color: #53697f; background: #e8f1fa; font-size: 11px; line-height: 1.35; }
.practice-audio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.practice-audio-secondary { color: #49657f; background: #f6fbff; }
.practice-media button:disabled { cursor: default; opacity: 0.45; }
.practice-rate { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 0 2px; color: #53697f; font-size: 10px; font-weight: 800; }
.practice-rate select { display: inline-block; width: auto; min-height: 34px; margin: 0; padding: 6px 7px; border-color: #cbd9e7; color: #35526e; font-size: 11px; }
.practice-audio-status { color: #355f87; font-weight: 800; }
.practice-audio-hint { color: #6d8196; font-size: 10px; }
.practice-transcript { margin-top: 9px; color: #667586; font-size: 11px; line-height: 1.55; }
.practice-transcript summary { cursor: pointer; color: #4777b7; font-weight: 800; }
.practice-transcript p { margin: 7px 0 0; white-space: pre-wrap; }
.practice-passage, .practice-prompt { margin-top: 14px; padding: 13px; border-left: 3px solid #8bb5de; border-radius: 11px; color: #364c63; background: #fff; font-size: 13px; line-height: 1.62; }
.practice-prompt { border-left-color: #d5a156; }
.practice-prompt p { margin: 5px 0 0; }
.practice-support { margin-top: 12px; padding: 11px 13px; border-radius: 12px; color: #536173; background: rgba(255,255,255,0.72); font-size: 11px; line-height: 1.5; }
.practice-support strong { color: var(--navy-2); }
.practice-support ul { margin: 6px 0 0; padding-left: 18px; }
.practice-support li { margin: 4px 0; }
.practice-table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid #dce4ec; border-radius: 11px; background: #fff; }
.practice-table { width: 100%; min-width: 260px; border-collapse: collapse; color: #536173; font-size: 11px; }
.practice-table th, .practice-table td { padding: 9px 10px; border-bottom: 1px solid #edf0f3; text-align: left; }
.practice-table th { color: var(--navy-2); background: #f2f6fa; font-weight: 850; }
.practice-table tr:last-child td { border-bottom: 0; }
.practice-questions { display: grid; gap: 10px; margin-top: 14px; }
.practice-question { min-width: 0; margin: 0; padding: 11px 12px; border: 1px solid #dce4ec; border-radius: 12px; background: #fff; }
.practice-question legend { max-width: 100%; padding: 0 4px; color: var(--navy-2); font-size: 12px; font-weight: 850; line-height: 1.4; }
.practice-option { display: flex; align-items: flex-start; gap: 7px; margin: 8px 0 0; color: #536173; font-size: 12px; font-weight: 550; line-height: 1.35; }
.practice-option input { flex: 0 0 auto; width: auto; margin: 2px 0 0; }
.practice-evidence-label { margin-top: 12px; }
.practice-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 13px; }
.practice-actions .primary-button, .practice-actions .secondary-button { width: 100%; }
.practice-result { margin-top: 10px; }
.practice-score { padding: 10px 11px; border-radius: 11px; color: #356c56; background: #eaf6ef; font-size: 12px; line-height: 1.5; }
.practice-feedback { display: grid; gap: 3px; margin-top: 7px; padding: 9px 10px; border-radius: 10px; color: #59687a; background: rgba(255,255,255,0.8); font-size: 11px; line-height: 1.4; }
.practice-feedback strong { color: var(--navy-2); }

.quick-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 13px 0; }
.quick-card { display: grid; grid-template-columns: 42px 1fr 20px; align-items: center; gap: 11px; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 18px; text-align: left; color: var(--ink); background: var(--paper); box-shadow: 0 5px 20px rgba(31, 45, 66, 0.04); }
.quick-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; font-size: 13px; font-weight: 850; }
.quick-symbol.warm { color: #a36716; background: #fff2d8; }
.quick-symbol.blue { color: #4777b7; background: var(--blue-soft); }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { font-size: 13px; }
.quick-card small { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.arrow { color: #9ba8b6; font-size: 25px; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { min-height: 105px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.wide-stat { grid-column: 1 / -1; min-height: 87px; }
.stat-label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -0.06em; }
.stat-note { display: block; margin-top: 4px; color: #8b98a6; font-size: 10px; }
.wide-stat .stat-row span:last-child { color: var(--navy-2); font-size: 12px; font-weight: 800; }
.progress-track { height: 8px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: #e9edf2; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #75a4de, #83c5a8); transition: width 300ms ease; }

.notice-card { display: flex; gap: 11px; margin-top: 12px; padding: 14px; border: 1px solid #eadfcf; border-radius: 18px; background: #fff9ee; }
.notice-mark { display: grid; flex: 0 0 auto; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #986921; background: #f5ddb0; font-size: 12px; font-weight: 900; }
.notice-card strong { font-size: 12px; }
.notice-card p { margin: 3px 0 0; color: #806a48; font-size: 12px; }

.page-heading { margin: 3px 0 19px; }
.page-heading .eyebrow { color: var(--blue); }
.page-heading h2 { margin-top: 5px; }
.page-heading > p:last-child { margin: 7px 0 0; }

.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 13px; background: #e9e6df; }
.segment { border: 0; border-radius: 10px; padding: 9px; color: var(--ink-soft); background: transparent; font-size: 12px; font-weight: 750; }
.segment.active { color: var(--navy); background: var(--paper); box-shadow: 0 2px 8px rgba(31, 45, 66, 0.08); }
.record-panel { display: none; }
.record-panel.active { display: block; }

.form-card, .trend-card, .review-card, .target-card { margin-bottom: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 5px 18px rgba(31, 45, 66, 0.035); }
.form-heading { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 15px; }
.form-heading p { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; }
.form-icon { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; border-radius: 11px; color: #4d79b6; background: var(--blue-soft); font-size: 12px; font-weight: 900; }
.form-icon.coral { color: #ba5b48; background: var(--coral-soft); }
.form-icon.green { color: #377c61; background: var(--green-soft); }
.form-icon.purple { color: #63559e; background: #efecfa; }
.form-icon.warm { color: #9b691f; background: #fff2d8; }

label { display: block; margin-bottom: 12px; color: #536173; font-size: 11px; font-weight: 750; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; border: 1px solid #dddfe3; border-radius: 11px; padding: 10px 11px; color: var(--ink); background: #fff; font-size: 13px; font-weight: 500; }
textarea { resize: vertical; line-height: 1.45; }
select { appearance: auto; }
input::placeholder, textarea::placeholder { color: #a4adb8; }
.form-grid { display: grid; gap: 0 10px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-card .primary-button { width: 100%; margin-top: 2px; }

.list-heading { margin: 16px 2px 9px; }
.list-heading h3 { font-size: 15px; }
.list-heading span { color: var(--ink-soft); font-size: 11px; }
.entry-list, .assessment-list, .review-list { display: grid; gap: 9px; }
.empty-state { padding: 18px; border: 1px dashed #cfd5dc; border-radius: 16px; color: var(--ink-soft); background: rgba(255,255,255,0.45); font-size: 12px; text-align: center; }
.entry { padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,0.68); }
.entry-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.entry-title { font-size: 13px; font-weight: 850; }
.entry-meta { color: var(--ink-soft); font-size: 10px; }
.entry-body { margin: 8px 0 0; color: #59687a; font-size: 12px; line-height: 1.5; }
.entry-badge { display: inline-flex; padding: 4px 7px; border-radius: 7px; color: #426fa9; background: var(--blue-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.entry-badge.coral { color: #b55b4b; background: var(--coral-soft); }
.entry-badge.green { color: #377c61; background: var(--green-soft); }
.entry-badge.warm { color: #9a681d; background: #fff2d8; }

.target-card { display: flex; justify-content: space-between; gap: 12px; padding: 18px; color: #fff; background: linear-gradient(145deg, #253e60, #34577c); }
.target-card .card-kicker { color: #a9c9ef; }
.target-card h3 { margin-top: 6px; font-size: 15px; line-height: 1.35; }
.target-card p { margin: 7px 0 0; color: #d1dfed; font-size: 11px; line-height: 1.45; }
.target-score { flex: 0 0 auto; align-self: center; color: rgba(255,255,255,0.2); font-size: 47px; font-weight: 850; letter-spacing: -0.08em; }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 4px; }
.score-grid label { margin: 0; color: var(--ink-soft); text-align: center; }
.score-grid label span { display: block; color: var(--navy-2); font-size: 12px; font-weight: 900; }
.score-grid input { text-align: center; }
.assessment-row { padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,0.68); }
.assessment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assessment-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 11px; }
.assessment-score { padding: 7px 4px; border-radius: 9px; color: var(--ink); background: #f1f3f6; text-align: center; font-size: 12px; font-weight: 800; }
.assessment-score small { display: block; margin-bottom: 2px; color: var(--ink-soft); font-size: 9px; }

.review-card { padding-bottom: 13px; }
.review-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #eeeae3; }
.review-item:last-child { border-bottom: 0; }
.review-item strong { display: block; font-size: 12px; }
.review-item small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.review-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.review-day { color: var(--blue); font-size: 11px; font-weight: 850; }
.review-done { padding: 5px 8px; border: 1px solid #c9d8ea; border-radius: 8px; color: var(--blue); background: #f3f8fd; font-size: 10px; font-weight: 800; }
.prompt-snippet { padding: 13px; border-radius: 13px; color: #665991; background: #f3f0fc; font-size: 12px; line-height: 1.55; }
.install-help { margin: 10px 0 0; }
.version-note { margin: 20px 0; text-align: center; }

.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 720px; margin: 0 auto; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(222, 220, 214, 0.9); background: rgba(255,253,249,0.94); box-shadow: 0 -10px 30px rgba(29, 44, 63, 0.06); backdrop-filter: blur(16px); }
.nav-item { display: grid; place-items: center; gap: 2px; min-height: 49px; border: 0; border-radius: 13px; color: #8a96a3; background: transparent; }
.nav-item span { font-size: 19px; line-height: 1; }
.nav-item small { font-size: 10px; font-weight: 750; }
.nav-item.active { color: var(--navy-2); background: var(--blue-soft); }

.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: end center; padding: 16px; background: rgba(16, 28, 44, 0.45); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(100%, 560px); padding: 23px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 25px 25px 18px 18px; background: var(--paper); box-shadow: 0 -10px 50px rgba(16, 28, 44, 0.18); }
.modal h2 { margin-top: 7px; font-size: 23px; }
.modal > p { margin: 9px 0 17px; color: var(--ink-soft); font-size: 13px; }
.modal-close { position: absolute; top: 14px; right: 15px; width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--ink-soft); background: #eef1f3; font-size: 21px; }

.toast { position: fixed; z-index: 40; right: 18px; bottom: calc(85px + env(safe-area-inset-bottom)); left: 18px; max-width: 500px; margin: 0 auto; padding: 12px 14px; border-radius: 13px; color: #fff; background: rgba(19,34,56,0.95); box-shadow: 0 10px 30px rgba(19,34,56,0.2); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (min-width: 620px) {
  .app-shell { border-right: 1px solid #e9e5dd; border-left: 1px solid #e9e5dd; background: rgba(255,253,249,0.25); }
  main { padding-right: 24px; padding-left: 24px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .hero-card { padding: 25px; }
  .bottom-nav { padding-right: 22px; padding-left: 22px; }
}

@media (max-width: 390px) {
  .hero-actions { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .score-grid { gap: 4px; }
  .score-grid input { padding-right: 3px; padding-left: 3px; font-size: 11px; }
}
