:root {
  color-scheme: light;
  --bg: #eaf9f7;
  --panel: #ffffff;
  --panel-2: #d9f4f1;
  --line: #b7e2de;
  --text: #143b3a;
  --muted: #668481;
  --blue: #0abab5;
  --green: #078b87;
  --orange: #bd6b24;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Georgia, "Times New Roman", serif; display: grid; grid-template-columns: 280px 1fr; }
button, input, select { font: inherit; }
button { border: 0; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hidden { display: none !important; }
.mobile-only { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.sidebar { height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; background: #f7fffe; border-right: 1px solid var(--line); }
.sidebar__header { padding: 26px 22px 18px; display: flex; align-items: start; justify-content: space-between; }
.eyebrow { margin: 0 0 4px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: 24px; }
.search { padding: 0 16px 14px; }
.search input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: var(--panel); color: var(--text); outline: none; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #0abab52b; }
.book-progress { margin: 0 16px 14px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #e5f8f6; }
.book-progress__summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.book-progress__summary strong { color: var(--text); font-size: 12px; }
.book-progress__track { height: 8px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: #c4e9e6; }
.book-progress__track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0abab5, #5ddbd2); transition: width .25s ease; }
.book-progress__percent { display: block; margin-top: 6px; color: var(--green); font-size: 11px; font-weight: 650; }
.unit-list { overflow-y: auto; padding: 0 10px 18px; }
.unit-button { width: 100%; padding: 11px 12px; border-radius: 9px; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: transparent; color: #456b68; cursor: pointer; text-align: left; }
.unit-button > span:first-child { min-width: 0; }
.unit-button:hover { background: var(--panel-2); color: var(--text); }
.unit-button.active { background: #c9f0ed; color: #087d79; }
.unit-count { flex: none; color: var(--muted); font-size: 12px; }
.unit-count.started { color: #078b87; }
.unit-count.complete { min-width: 22px; color: var(--green); font-size: 15px; font-weight: 800; text-align: center; }

main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 72px; padding: 10px 24px; border-bottom: 1px solid var(--line); display: flex; gap: 18px; align-items: center; justify-content: space-between; color: var(--muted); }
.topbar__leading, .topbar__actions, .account, .account__user { display: flex; align-items: center; }
.topbar__leading { min-width: 0; gap: 12px; }
#unit-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { gap: 12px; }
.voice-picker { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; }
.voice-picker select { width: min(260px, 28vw); padding: 7px 30px 7px 10px; border: 1px solid #82cbc6; border-radius: 9px; background: white; color: var(--text); outline: none; }
.voice-picker select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #0abab52b; }
.account { gap: 9px; }
.sync-status { max-width: 118px; color: var(--muted); font-size: 11px; line-height: 1.2; text-align: right; }
.sync-status[data-state="synced"] { color: var(--green); }
.sync-status[data-state="saving"] { color: var(--blue); }
.sync-status[data-state="error"] { color: var(--orange); }
.microsoft-button { min-height: 38px; padding: 8px 12px; border: 1px solid #50627b; border-radius: 9px; display: flex; align-items: center; gap: 9px; background: #f6f8fb; color: #172033; cursor: pointer; font-size: 13px; font-weight: 650; white-space: nowrap; }
.microsoft-button > span:last-child { display: block; }
.microsoft-button:hover { background: white; }
.microsoft-button:disabled { opacity: .55; cursor: not-allowed; }
.microsoft-mark { width: 14px; height: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; }
.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }
.account__user { max-width: 270px; gap: 8px; }
.account__initial { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: white; font-size: 13px; font-weight: 800; }
.account__name { max-width: 135px; overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 7px 9px; border-radius: 8px; background: transparent; color: var(--green); cursor: pointer; }
.text-button:hover { background: var(--panel-2); color: var(--text); }
.practice { flex: 1; padding: 34px; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #ffffff 0, var(--bg) 58%); }
.empty-state { max-width: 480px; text-align: center; color: var(--muted); }
.empty-state h2 { margin: 18px 0 8px; color: var(--text); font-size: 28px; }
.empty-state p { margin: 0; line-height: 1.6; }
.empty-state__icon { width: 74px; height: 74px; margin: auto; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(145deg, #079f9a, #5ddbd2); color: white; font-size: 28px; font-weight: 750; box-shadow: 0 14px 35px #0a7f792e; }
.card { width: min(900px, 100%); min-height: 540px; padding: 28px 38px 38px; border: 1px solid var(--line); border-radius: 20px; background: #ffffffed; box-shadow: 0 24px 70px #0a7f7924; }
.card__meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }
.card__status { display: flex; align-items: center; gap: 12px; }
.complete-button { padding: 7px 11px; border: 1px solid #7bc9c4; border-radius: 9px; background: #e4f8f6; color: #087d79; cursor: pointer; font-size: 12px; font-weight: 700; }
.complete-button:hover { background: #c9f0ed; }
.complete-button.is-complete { border-color: transparent; background: transparent; color: var(--green); }
.complete-button:disabled { cursor: default; }
.start-panel { min-height: 440px; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); text-align: center; }
.start-actions { display: flex; align-items: center; justify-content: center; gap: 8px; }
.primary-button { padding: 14px 28px; border-radius: 12px; background: var(--blue); color: #073c3a; font-weight: 750; cursor: pointer; }
.primary-button:hover { background: #36cbc5; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.save-note { max-width: 360px; margin: 0; color: #7f91aa; font-size: 12px; line-height: 1.45; }
.exercise { min-height: 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.question, .answer { width: 100%; margin: 0; white-space: pre-line; line-height: 1.45; }
.question { min-height: 130px; font-size: clamp(23px, 3vw, 32px); }
.countdown { height: 92px; color: var(--orange); font-size: 68px; font-weight: 800; }
.answer { min-height: 120px; color: var(--green); font-size: clamp(24px, 3.2vw, 35px); font-weight: 700; opacity: 0; transition: opacity .2s; }
.answer.visible { opacity: 1; }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.controls button, .icon-button { padding: 11px 18px; border-radius: 10px; background: #d9f1ef; color: var(--text); cursor: pointer; }
.controls button:disabled { opacity: .38; cursor: not-allowed; }
.controls .pause-button { min-width: 100px; background: #e9b67f; }

.scrim { display: none; }
@media (max-width: 1100px) and (min-width: 761px) {
  .voice-picker > span { display: none; }
  .account__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .voice-picker select { width: min(180px, 20vw); }
  .sync-status { width: 20px; height: 20px; overflow: hidden; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; background: transparent; font-size: 0; white-space: nowrap; }
  .sync-status::before { content: attr(data-symbol); font-size: 12px; font-weight: 800; }
}

@media (max-width: 760px) {
  body { display: block; }
  .mobile-only { display: inline-grid; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 310px); z-index: 20; transform: translateX(-105%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; z-index: 10; background: #0009; }
  .scrim.open { display: block; }
  .topbar { min-height: 116px; padding: 10px 14px; align-items: stretch; flex-direction: column; gap: 8px; }
  .topbar__leading { min-height: 38px; }
  .topbar__actions { justify-content: space-between; }
  .topbar .voice-picker { min-width: 0; }
  .voice-picker span { display: none; }
  .voice-picker select { width: min(42vw, 210px); }
  .account__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sync-status { width: 20px; height: 20px; overflow: hidden; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; background: transparent; font-size: 0; white-space: nowrap; }
  .sync-status::before { content: attr(data-symbol); font-size: 12px; font-weight: 800; }
  .microsoft-button { padding-inline: 9px; }
  .microsoft-button > span:last-child { max-width: 98px; overflow: hidden; text-overflow: ellipsis; }
  .account__user { gap: 3px; }
  .practice { padding: 16px; }
  .card { min-height: 520px; padding: 20px 18px 26px; }
  .controls button { flex: 1 1 42%; }
}

@media (max-width: 410px) {
  .microsoft-button > span:last-child { max-width: 54px; }
}
