:root {
  color-scheme: light;
  --navy: #0b3d62;
  --navy-2: #082f4c;
  --blue: #2d7dd2;
  --blue-soft: #d7ebf9;
  --sky: #eff7fc;
  --ink: #142b3b;
  --muted: #5b7180;
  --line: #d7e2e9;
  --paper: #ffffff;
  --canvas: #f4f8fb;
  --green: #19775a;
  --amber: #9a6412;
  --shadow: 0 16px 48px rgba(11, 61, 98, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); min-height: 100vh; }
html, body { scroll-padding-bottom: 100px; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(45,125,210,.45); outline-offset: 2px; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.025em; }
h3 { font-size: 1.1rem; margin-bottom: .5rem; }
p { line-height: 1.6; }
small { color: var(--muted); }

[hidden] { display: none !important; }
.eyebrow { margin: 0 0 .55rem; color: var(--blue); font-size: .74rem; font-weight: 800; letter-spacing: .12em; }
.button { min-height: 44px; border: 0; border-radius: 12px; padding: .72rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:disabled { opacity: .55; cursor: wait; }
.button.primary { color: white; background: var(--navy); box-shadow: 0 8px 18px rgba(11,61,98,.18); }
.button.primary:hover { background: var(--navy-2); }
.button.secondary { color: var(--navy); background: var(--blue-soft); }
.button.quiet { color: var(--navy); background: transparent; border: 1px solid var(--line); }
.button-row { display: flex; gap: .6rem; flex-wrap: wrap; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 50% 0%, #d9edf9, var(--canvas) 45%); }
.login-card { width: min(100%, 480px); padding: clamp(1.5rem, 5vw, 3rem); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; box-shadow: var(--shadow); }
.login-card img { border-radius: 22px; margin-bottom: 1.2rem; }
.login-card h1 { font-size: clamp(2rem,7vw,3.1rem); }
.login-card label, .note-entry label, .finish-card label { display: block; font-weight: 750; margin: 1rem 0 .45rem; }
.login-card input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: .85rem .9rem; color: var(--ink); background: #fff; resize: vertical; }
.login-card input { min-height: 48px; margin-bottom: .75rem; }
.login-card .button { width: 100%; }
.error { color: #a23232; min-height: 1.5em; margin: .75rem 0 0; }

.app-shell { min-height: 100vh; padding-bottom: 84px; }
.topbar { position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 max(1rem, env(safe-area-inset-left)); background: rgba(244,248,251,.88); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(215,226,233,.8); }
.brand { display: flex; align-items: center; gap: .72rem; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 11px; }
.brand span { display: flex; flex-direction: column; }
.brand strong { font-size: .98rem; }
.brand small { font-size: .7rem; }
.top-actions { display: flex; align-items: center; gap: .5rem; }
.sync-state { font-size: .75rem; color: var(--muted); }
.sync-state[data-tone="good"] { color: var(--green); }
.sync-state[data-tone="warn"] { color: var(--amber); }

main { width: min(1120px, 100%); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); outline: none; }
.hero { min-height: 360px; border-radius: 28px; padding: clamp(1.5rem, 5vw, 4rem); color: white; background: linear-gradient(130deg, rgba(8,47,76,.98), rgba(11,61,98,.94)), radial-gradient(circle at 90% 10%, var(--blue), transparent 50%); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2rem; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 360px; height: 360px; right: -100px; top: -150px; border-radius: 50%; border: 70px solid rgba(93,173,235,.18); }
.hero h1 { max-width: 800px; margin-bottom: 1rem; }
.hero-copy { max-width: 640px; color: #d9e7f0; margin-bottom: 0; }
.hero .eyebrow { color: #83c8f3; }
.hero-meter { position: relative; z-index: 1; min-width: 145px; padding: 1rem; border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(255,255,255,.09); }
.hero-meter strong { display: block; font-size: 2rem; }
.hero-meter span { font-size: .75rem; color: #d9e7f0; }
.metric-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 1rem 0 2.5rem; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.metric-strip div { background: white; padding: 1rem; display: flex; flex-direction: column; }
.metric-strip strong { font-size: 1.45rem; color: var(--navy); }
.metric-strip span { color: var(--muted); font-size: .78rem; }
.today-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: .7rem; }
.today-heading h2 { margin-bottom: 0; }
.complete-pill { color: var(--green); background: #dcf4e9; border-radius: 999px; padding: .4rem .75rem; font-size: .76rem; font-weight: 800; }
.lesson-grid { display: grid; gap: .85rem; }
.lesson-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: clamp(1rem, 3vw, 1.6rem); background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 20px rgba(11,61,98,.045); }
.lesson-card.learn { background: linear-gradient(135deg,#eef7fd,#fff); border-color: #b9d9ee; }
.lesson-card.role { background: linear-gradient(135deg,#0b3d62,#155c8d); color: white; border: 0; }
.lesson-card.role .eyebrow { color: #8ed1fa; }
.lesson-card.role textarea { color: var(--ink); }
.step { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--navy); border-radius: 50%; font-weight: 800; }
.role .step { color: var(--navy); background: white; }
.lesson-card p { margin-bottom: .8rem; }
.lesson-card textarea { min-height: 88px; }
.timer-card { display: flex; align-items: center; justify-content: space-between; background: #fff; }
.timer-card strong { display: block; font-size: 2.3rem; font-variant-numeric: tabular-nums; color: var(--navy); }
.timer-card p { margin: 0; color: var(--muted); }
.coach-note { margin: .8rem 0 0; padding: 1rem; border-radius: 12px; background: var(--sky); border-left: 4px solid var(--blue); }
.score-picker { display: grid; grid-template-columns: repeat(5,1fr); gap: .45rem; margin: .9rem 0; }
.score-picker button { min-height: 68px; padding: .5rem .2rem; border: 1px solid var(--line); background: white; border-radius: 11px; font-size: 1.2rem; font-weight: 850; cursor: pointer; }
.score-picker button small { display: block; font-size: .58rem; font-weight: 650; }
.score-picker button.selected { color: white; background: var(--navy); border-color: var(--navy); }
.score-picker button.selected small { color: #d9e7f0; }
.buyer-line { margin: 1rem 0; padding: 1rem; border-left: 4px solid var(--blue); background: var(--sky); font-weight: 650; }
.buyer-line span { display: block; color: var(--blue); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .4rem; }

.page-head { padding: clamp(1rem,4vw,3rem) 0 1.5rem; max-width: 780px; }
.page-head h1 { color: var(--navy); }
.page-head > p:last-child { color: var(--muted); font-size: 1.05rem; }
.week-list { display: grid; gap: .75rem; }
.week-card { background: white; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.week-card summary { list-style: none; padding: 1rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; cursor: pointer; }
.week-card summary::-webkit-details-marker { display: none; }
.week-number { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--navy); font-weight: 800; }
.week-card summary span:nth-child(2) { display: flex; flex-direction: column; }
.week-card summary small { margin-top: .2rem; }
.week-count { font-weight: 800; color: var(--blue); }
.week-sessions { padding: 0 .6rem .6rem; }
.session-row { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .8rem; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.session-row span:nth-child(2) { display: flex; flex-direction: column; }
.session-row.done strong { color: var(--green); }
.session-check { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: var(--blue-soft); font-size: .72rem; font-weight: 850; }
.session-row.done .session-check { color: white; background: var(--green); }
.row-arrow { font-size: 1.4rem; color: var(--muted); }

.note-entry, .notes-list article, .more-grid article, .skill-table, .progress-hero { padding: 1.25rem; background: white; border: 1px solid var(--line); border-radius: 18px; }
.note-entry .button { margin-top: .75rem; }
.notes-list { display: grid; gap: .75rem; margin-top: .75rem; }
.notes-list time { color: var(--blue); font-size: .72rem; font-weight: 800; }
.notes-list p { margin: .5rem 0 0; white-space: pre-wrap; }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: white; border: 1px dashed var(--line); border-radius: 18px; }
.progress-hero { display: flex; align-items: center; gap: 2rem; margin-bottom: 1rem; }
.progress-ring { --progress: 0deg; width: 160px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--blue) var(--progress), var(--blue-soft) 0); position: relative; }
.progress-ring::after { content:""; position:absolute; inset:16px; background:white; border-radius:50%; }
.progress-ring span { position:relative; z-index:1; color:var(--navy); font-size:1.8rem; font-weight:850; }
.progress-hero > div:last-child { display:grid; grid-template-columns:auto 1fr; gap:.2rem .7rem; align-items:baseline; }
.progress-hero > div:last-child strong { color:var(--navy); font-size:1.4rem; }
.progress-hero > div:last-child span { color:var(--muted); }
.skill-table h2 { margin-bottom: 1rem; }
.skill-table > div { display:grid; grid-template-columns:minmax(130px,1fr) 2fr 36px; align-items:center; gap:.8rem; padding:.65rem 0; border-top:1px solid var(--line); }
.mini-bar { height:8px; background:var(--blue-soft); border-radius:99px; overflow:hidden; }
.mini-bar i { display:block; height:100%; background:var(--blue); border-radius:inherit; }
.more-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:.8rem; }
.more-grid article p { color:var(--muted); }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: max(.7rem,env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 1rem), 620px); height: 64px; padding: .35rem; display: grid; grid-template-columns: repeat(5,1fr); background: rgba(8,47,76,.96); border: 1px solid rgba(255,255,255,.15); border-radius: 20px; box-shadow: 0 18px 45px rgba(8,47,76,.26); backdrop-filter: blur(18px); }
.bottom-nav a { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.16rem; color:#b9cfdd; text-decoration:none; border-radius:14px; font-size:.67rem; font-weight:700; }
.bottom-nav a span { font-size:.9rem; }
.bottom-nav a.active { color:white; background:rgba(255,255,255,.12); }
.toast { position:fixed; z-index:50; left:50%; bottom:90px; transform:translateX(-50%); width:max-content; max-width:calc(100% - 2rem); padding:.8rem 1rem; color:white; background:var(--navy-2); border-radius:12px; box-shadow:var(--shadow); font-weight:700; }

@media (min-width: 760px) {
  .lesson-grid { grid-template-columns: repeat(2,1fr); }
  .lesson-card.timer-card, .lesson-card.finish-card { grid-column: 1 / -1; }
  .finish-card > div { max-width: 850px; }
}

@media (min-width: 1000px) {
  .app-shell { padding-left: 84px; padding-bottom: 0; }
  .bottom-nav { left: 12px; top: 50%; bottom: auto; transform: translateY(-50%); width: 66px; height: 360px; grid-template-columns: 1fr; border-radius: 22px; }
  .bottom-nav a { font-size: .62rem; }
  .toast { bottom: 24px; }
}

@media (max-width: 640px) {
  .topbar { height: 60px; }
  .brand small, .top-actions .button { display:none; }
  main { padding: .75rem; }
  .hero { min-height: 330px; grid-template-columns:1fr; align-items:end; padding:1.4rem; border-radius:22px; }
  .hero h1 { font-size:2.35rem; }
  .hero-meter { justify-self:start; min-width:130px; }
  .metric-strip { margin-bottom:2rem; }
  .metric-strip div { padding:.75rem; }
  .metric-strip strong { font-size:1.2rem; }
  .today-heading { align-items:start; }
  .lesson-card { grid-template-columns:1fr; gap:.65rem; border-radius:15px; }
  .step { width:28px; height:28px; }
  .timer-card { display:flex; }
  .score-picker { gap:.25rem; }
  .score-picker button { min-height:62px; }
  .score-picker button small { font-size:.5rem; }
  .week-card summary { grid-template-columns:auto 1fr auto; gap:.65rem; padding:.8rem; }
  .week-number { width:38px; height:38px; }
  .week-card summary small { display:none; }
  .progress-hero { align-items:flex-start; gap:1rem; }
  .progress-ring { width:120px; }
  .skill-table > div { grid-template-columns:1fr 36px; }
  .skill-table .mini-bar { grid-column:1 / -1; grid-row:2; }
  .more-grid { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}
