/* Enamel street signs: cobalt plates with a white keyline, and red and yellow for signals. The course is a route with stops. */
:root {
  --bg: #eef1f7; --surface: #ffffff; --sunk: #e0e5f0; --line: #c3cbdc;
  --ink: #101a36; --muted: #4d5874; --cobalt: #1a3bb0; --cobalt-ink: #ffffff; --red: #d0202e; --yellow: #ffc62e;
  --good: #11784a; --bad: #bb1f2a; --tone: #d0202e;
  --display: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif; --body: "Be Vietnam Pro", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0c1224; --surface: #151d36; --sunk: #1f2946; --line: #36426a;
  --ink: #edf0fa; --muted: #a7b1cf; --cobalt: #6d8bff; --cobalt-ink: #081030; --red: #ff6470; --yellow: #ffd257;
  --good: #58d59a; --bad: #ff8c8f; --tone: #ff7f89; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0c1224; --surface: #151d36; --sunk: #1f2946; --line: #36426a;
  --ink: #edf0fa; --muted: #a7b1cf; --cobalt: #6d8bff; --cobalt-ink: #081030; --red: #ff6470; --yellow: #ffd257;
  --good: #58d59a; --bad: #ff8c8f; --tone: #ff7f89; color-scheme: dark; }

* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--body) }
h1, h2, h3 { margin: 0; text-wrap: balance }
h1 { font: 800 clamp(2.4rem, 5.5vw, 4rem)/1 var(--display); letter-spacing: .01em }
h2 { font: 800 1.9rem/1.05 var(--display); letter-spacing: .01em }
h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.3 }
p { margin: 0 } a { color: var(--cobalt) }
button, input, select { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px }
.muted { color: var(--muted) } .small { font-size: .84rem }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted) }
.vi { font-weight: 600 }

/* shell */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh }
.side { background: #142d8c; color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 1.55rem var(--display); padding: 0 6px }
.plate { width: 36px; height: 36px; display: grid; place-items: center; background: var(--yellow); color: #101a36; border-radius: 6px; font-size: 1.4rem; flex: none }
.side nav { display: grid; gap: 2px }
.side nav a { color: #dfe6ff; text-decoration: none; padding: 9px 12px; border-radius: 7px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; white-space: nowrap }
.side nav a:hover { background: rgb(255 255 255 / .1) }
.side nav a[aria-current="page"] { background: #fff; color: #142d8c; font-weight: 700 }
.badge { background: #d0202e; color: #fff; border-radius: 99px; font-size: .72rem; font-weight: 700; padding: 1px 7px }
.badge[hidden] { display: none }
.page { min-width: 0; display: grid; grid-template-rows: 1fr auto }
main { padding: 28px clamp(16px, 4vw, 44px) 40px; display: grid; gap: 28px; align-content: start; max-width: 1120px; width: 100%; margin: 0 auto }
footer { padding: 0 clamp(16px, 4vw, 44px) 26px; font-size: .78rem; color: var(--muted); max-width: 1120px; width: 100%; margin: 0 auto }
@media (max-width: 860px) {
  .shell { display: block }
  .side { position: sticky; height: auto; padding: 8px 12px; gap: 6px; z-index: 5 }
  .brand { font-size: 1.25rem } .plate { width: 28px; height: 28px; font-size: 1.1rem }
  .side nav { display: flex; overflow-x: auto; scrollbar-width: none }
  .side nav a { padding: 6px 10px; font-size: .88rem; gap: 5px }
}

/* building blocks */
.btn { display: inline-block; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink) }
.btn:hover { border-color: var(--cobalt) }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--cobalt-ink) }
.btn:disabled { opacity: .5; cursor: not-allowed }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.between { justify-content: space-between }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 12px; min-width: 0; align-content: start; grid-template-columns: minmax(0, 1fr) }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px }
.head { display: grid; gap: 6px } .head p { max-width: 68ch }
.stack { display: grid; gap: 14px }

/* hero plate: an enamel sign */
.hero { background: #142d8c; color: #fff; border-radius: 14px; padding: clamp(18px, 3vw, 30px); display: grid; gap: 16px; box-shadow: inset 0 0 0 3px #142d8c, inset 0 0 0 5px rgb(255 255 255 / .85) }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5rem) }
.hero p { max-width: 60ch; color: #e4e9ff }
.six { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px }
@media (max-width: 640px) { .six { grid-template-columns: repeat(3, minmax(0, 1fr)) } }
.six button { background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .35); color: #fff; border-radius: 9px; padding: 10px 4px; cursor: pointer; display: grid; gap: 2px; justify-items: center; min-width: 0; --tone: var(--yellow) }
.six button:hover { background: rgb(255 255 255 / .2) }
.six b { font: 700 clamp(1.8rem, 4vw, 2.6rem)/1.25 var(--body) }
.six .tn { font-size: .72rem; font-weight: 700; color: #ffd257 }
.six small { font-size: .72rem; color: #d7deff; text-align: center }
.hero .btn.primary { background: var(--yellow); border-color: var(--yellow); color: #101a36 }
.hero .btn { background: transparent; border-color: rgb(255 255 255 / .6); color: #fff }
.contour { display: inline-flex; gap: 3px; color: var(--tone); vertical-align: middle }
.contour svg { display: block; overflow: visible }

/* today */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; display: grid }
.stat b { font: 800 1.9rem/1.1 var(--display); font-variant-numeric: tabular-nums }
.meter { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden }
.meter i { display: block; height: 100%; background: var(--cobalt) }
.levelbar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 54px; gap: 10px; align-items: center; font-size: .86rem }
.levelbar span:last-child { text-align: right; font-variant-numeric: tabular-nums }
.days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; max-width: 320px }
.days i { aspect-ratio: 1; border-radius: 3px; background: var(--sunk) }
.days i.on { background: var(--cobalt) } .days i.goal { background: var(--good) } .days i.now { outline: 2px solid var(--red); outline-offset: 1px }

/* course route */
.levelhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 3px solid var(--ink); padding-bottom: 6px }
.tag { font: 800 .95rem var(--display); background: var(--yellow); color: #101a36; padding: 1px 9px; border-radius: 4px }
.unit { display: grid; gap: 8px } .units { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px }
.route { list-style: none; margin: 0; padding: 0; display: grid }
.stop { position: relative; padding-left: 34px }
.stop::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 3px; background: var(--line) }
.stop:first-child::before { top: 16px } .stop:last-child::before { bottom: calc(100% - 16px) }
.stop.done::before { background: var(--cobalt) }
.dot { position: absolute; left: 3px; top: 8px; width: 19px; height: 19px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); z-index: 1 }
.stop.done .dot { background: var(--cobalt); border-color: var(--cobalt) }
.stop.next .dot { background: var(--yellow); border-color: var(--red) }
.stop a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--ink) }
.stop a:hover { background: var(--sunk) }
.stop .n { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; margin-right: 6px }
.stop .t { font-weight: 500 } .stop.next .t { font-weight: 700 }
.check { font-size: .78rem; font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; white-space: nowrap }

.coursecard { text-decoration: none; color: var(--ink) } .coursecard:hover { border-color: var(--cobalt) }
/* lesson */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px }
.card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg) }
.card .w { font-weight: 700; font-size: 1.14rem; overflow-wrap: anywhere; line-height: 1.5 }
.card .m { font-size: .85rem; color: var(--muted); grid-column: 1 }
.speak { border: 1px solid var(--line); background: var(--surface); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; grid-row: 1 / span 3; grid-column: 2; align-self: center; flex: none }
.speak:hover { border-color: var(--cobalt) }
.speak[hidden] { display: none }
.sent { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line) }
.sent:last-child { border-bottom: 0 }
.sent .v { font-weight: 600; font-size: 1.04rem; overflow-wrap: anywhere; line-height: 1.6 }
.sent .e { color: var(--muted); font-size: .9rem; grid-column: 1 }
.who { font-size: .72rem; font-weight: 700; color: var(--cobalt); text-transform: uppercase; letter-spacing: .05em; grid-column: 1 }
.vnote { border-left: 4px solid var(--red); padding: 8px 12px; background: var(--surface); font-size: .86rem }
.vnote[hidden] { display: none }

/* quiz */
.quiz { max-width: 660px; margin: 0 auto; width: 100%; display: grid; gap: 16px }
.bar { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden }
.bar i { display: block; height: 100%; background: var(--cobalt); transition: width .2s }
.prompt { font-weight: 700; font-size: clamp(1.4rem, 3.6vw, 2rem); line-height: 1.45; overflow-wrap: anywhere }
.opts { display: grid; gap: 8px }
.opt { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; display: flex; gap: 10px; overflow-wrap: anywhere }
.opt:hover:not(:disabled) { border-color: var(--cobalt) }
.opt:disabled { cursor: default }
.opt kbd { font: 700 .75rem var(--body); color: var(--muted) }
.opt.right { border-color: var(--good); background: color-mix(in oklab, var(--good) 14%, var(--surface)) }
.opt.wrong { border-color: var(--bad); background: color-mix(in oklab, var(--bad) 12%, var(--surface)) }
.answer, .search, select { width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface) }
.answer { font-size: 1.12rem } .search { max-width: 420px }
select { width: auto; max-width: 100%; text-overflow: ellipsis }
.keys { display: flex; flex-wrap: wrap; gap: 4px }
.keys button { min-width: 38px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; font-weight: 600 }
.keys .tone { color: var(--red); font-size: .76rem }
.tiles { display: flex; flex-wrap: wrap; gap: 6px; min-height: 48px; align-items: flex-start }
.tiles.line { border-bottom: 2px solid var(--line); padding-bottom: 8px }
.tiles button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 500 }
.fb { padding: 12px 14px; border-radius: 9px; font-weight: 500 }
.fb.ok { background: color-mix(in oklab, var(--good) 15%, var(--surface)); color: var(--good) }
.fb.no { background: color-mix(in oklab, var(--bad) 13%, var(--surface)); color: var(--bad) }
.fb[hidden] { display: none }

.lline { padding: 9px 12px; border-radius: 8px; border-left: 4px solid transparent; display: grid; gap: 2px }
.lline.now { background: color-mix(in oklab, var(--yellow) 28%, transparent); border-left-color: var(--red) }
.lline .who { color: var(--cobalt) }
/* speaking */
.mic { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 99px; padding: 14px 24px; font-weight: 700; cursor: pointer; background: var(--red); color: #fff; font-size: 1.04rem }
.mic.on { animation: pulse 1.1s infinite ease-in-out }
.mic:disabled { opacity: .55; cursor: not-allowed }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in oklab, var(--red) 28%, transparent) } }
.syl { display: flex; flex-wrap: wrap; gap: 5px; font-size: 1.2rem; font-weight: 600 }
.syl span { padding: 2px 8px; border-radius: 6px; border-bottom: 3px solid transparent }
.syl .ok { background: color-mix(in oklab, var(--good) 16%, transparent); border-color: var(--good) }
.syl .tone { background: color-mix(in oklab, var(--yellow) 32%, transparent); border-color: #b98900 }
.syl .sound { background: color-mix(in oklab, #e8710a 22%, transparent); border-color: #c75d00 }
.syl .miss { background: color-mix(in oklab, var(--bad) 13%, transparent); border-color: var(--bad) }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted) }
.legend-note { flex-basis: 100% }
.chatlog { display: grid; gap: 10px; max-height: 58vh; overflow-y: auto; padding: 4px }
.bub { max-width: 82%; padding: 10px 13px; border-radius: 12px; display: grid; gap: 4px; overflow-wrap: anywhere }
.bub.them { background: var(--sunk); justify-self: start }
.bub.me { background: var(--cobalt); color: var(--cobalt-ink); justify-self: end }
.bub .v { font-weight: 600; line-height: 1.55 }
.bub details { font-size: .84rem; color: var(--muted) }
.fix { font-size: .84rem; border-left: 3px solid var(--yellow); padding: 6px 10px; background: var(--surface); border-radius: 0 6px 6px 0; justify-self: end; max-width: 82% }
.pat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 4px 16px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline }
.pat:last-child { border-bottom: 0 }
.pat .f { font-weight: 700; color: var(--cobalt) }
@media (max-width: 640px) { .pat { grid-template-columns: 1fr } }
.tablewrap { overflow-x: auto }
table { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 420px }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 6px 10px; border-bottom: 2px solid var(--ink) }
td { padding: 8px 10px; border-bottom: 1px solid var(--line) }
tr:last-child td { border-bottom: 0 }
.jump { display: flex; gap: 6px; flex-wrap: wrap }
textarea.code { width: 100%; min-height: 70px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 8px; font: 400 .78rem monospace; color: var(--ink) }
@media (prefers-reduced-motion: reduce) { .bar i { transition: none } .mic.on { animation: none; outline: 3px solid var(--yellow) } }
