@charset "UTF-8";

@font-face {
  font-family: "Alifbo Naskh";
  src: url("assets/noto-naskh-arabic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  color-scheme: light;
  --beige: #d8c3a5;
  --ink: #052c1e;
  --emerald: #0f4921;
  --olive: #4e5d42;
  --surface: #f3ede3;
  --paper: #fffaf1;
  --rail: #f9f4ec;
  --line: #ded5c6;
  --muted: #e8ddcd;
  --tint: #e3ebdc;
  --pressed: #f0e9dc;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --arabic: "Alifbo Naskh", "Traditional Arabic", "Times New Roman", serif;
  --ar-scale: 1;
  --center: 1010px;
  --radius-panel: 23px;
  --radius-control: 14px;
  --surface-shadow: 0 6px 22px #30251b0a, 0 1px 2px #30251b0d;
  --ease: 170ms cubic-bezier(.2,.75,.25,1);
  accent-color: var(--emerald);
}

html { scroll-padding-block: 12px 105px; overflow-x: clip; }
html[data-ar-size="small"] { --ar-scale: .84; }
html[data-ar-size="large"] { --ar-scale: 1.22; }
* { box-sizing: border-box; }
body {
  min-width: 290px;
  margin: 0;
  font: 1rem/1.5 var(--body);
  color: var(--ink);
  background: var(--surface);
}
::selection { color: var(--paper); background: var(--emerald); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a, summary, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p, figure { margin: 0; }
h1, h2 { font-family: var(--display); line-height: 1.12; text-wrap: balance; }
h1 { font-size: 3.25rem; letter-spacing: -.04em; font-weight: 760; }
h2 { font-size: 1.6rem; letter-spacing: -.028em; font-weight: 720; }
svg { display: block; width: 22px; height: 22px; flex: 0 0 auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.skip {
  position: fixed;
  z-index: 8;
  top: 10px;
  left: 10px;
  padding: .7rem 1rem;
  background: var(--paper);
  clip-path: inset(50%);
}
.skip:focus { clip-path: none; }

.layout {
  display: grid;
  grid-template-columns: 226px minmax(0,1fr);
  align-items: start;
  gap: 28px;
  min-height: 100dvh;
  max-width: 1450px;
  margin-inline: auto;
  padding-inline: 24px;
}
.sidebar {
  position: sticky;
  top: 24px;
  margin-block: 24px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: var(--rail);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--surface-shadow);
  padding: 20px 13px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font: 770 1.63rem/1 var(--display);
  letter-spacing: -.035em;
}
.sidebar .brand { margin: 4px 0 26px 10px; }
.brand-mark {
  display: grid;
  inline-size: 37px;
  block-size: 37px;
  place-items: center;
  padding-top: .18em;
  border: 1px solid #214c33;
  border-radius: 12px;
  font: 400 1.7rem/1 var(--arabic);
  background: var(--ink);
  color: var(--paper);
}
.side-nav { display: grid; gap: 4px; }
.side-nav a {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  border-radius: 12px;
  padding-inline: 12px;
  color: var(--olive);
  font-weight: 650;
  font-size: .93rem;
}
.side-nav a:hover { background: var(--pressed); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--tint); color: var(--emerald); font-weight: 720; }
.side-nav a[aria-current="page"] svg { stroke-width: 2; }
.side-extra { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.stage { width: min(100%,var(--center)); margin-inline: auto; }
.topbar { display: flex; justify-content: flex-end; min-height: 82px; align-items: center; background: var(--surface); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-control {
  display: inline-grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--emerald);
  background: var(--rail);
}
.icon-control svg { width: 20px; height: 20px; }
.icon-control:hover, .icon-control[aria-current], .bookmark-control[aria-pressed="true"] { background: var(--tint); }
.bookmark-control[aria-pressed="true"] svg { fill: currentColor; }
.mobile-brand, .mobile-nav { display: none; }
.top-profile {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: .6rem;
  min-height: 44px;
  padding: 4px 5px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--rail);
  font-size: .86rem;
  font-weight: 670;
}
.top-profile:hover { background: var(--paper); }
.top-profile > span:last-child { overflow: hidden; text-overflow: ellipsis; max-width: 12rem; white-space: nowrap; }
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 36px;
  aspect-ratio: 1;
  border: 1px solid #d8e2d3;
  border-radius: 50%;
  overflow: hidden;
  color: var(--emerald);
  background: var(--tint);
  font: 720 1.3rem/1 var(--display);
}
.avatar svg { width: 19px; height: 19px; }
.avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
.avatar-large { inline-size: 80px; font-size: 2.6rem; }
.avatar-large svg { width: 33px; height: 33px; }

main { padding: 8px 0 68px; min-width: 0; }
main:not([data-page="home"],[data-page="video"]) { max-width: 780px; }
main:focus { outline: none; }
.page-heading { margin-bottom: 24px; }
.page-heading p { max-width: 58ch; color: var(--olive); margin-top: 7px; }
.page-heading-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.page-heading-row h1 { min-width: 0; overflow-wrap: anywhere; }
.course-test-action { margin-bottom: 18px; }
.test-topics { margin-top: 18px; }
.test-topics h2 { margin-bottom: 8px; }
.profile-library { margin-top: 12px; }
.library-search { display: flex; gap: 8px; align-items: center; padding-inline: 11px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.library-search svg { width: 20px; height: 20px; flex: none; color: var(--olive); }
.library-search input { min-width: 0; width: 100%; min-height: 48px; padding-inline: 3px; border: 0; color: var(--ink); background: transparent; font-size: 1rem; }
.library-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-block: 9px 13px; }
.library-filters .button { min-height: 44px; padding-inline: 11px; font-size: .88rem; background: var(--rail); border-color: var(--line); }
.library-filters .button[aria-pressed="true"] { background: var(--tint); border-color: #b7c9ae; }
.library-message { margin-block: 8px; color: var(--olive); }
.library-list { margin: 0; padding: 0 8px; list-style: none; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.library-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px; align-items: center; padding: 4px 0; }
.library-row + .library-row { border-top: 1px solid var(--line); }
.library-link { display: flex; align-items: center; gap: 9px; padding: 3px 5px; min-width: 0; min-height: 49px; border-radius: 10px; }
.library-link:hover { background: var(--rail); }
.home-subjects { margin-bottom: 16px; }
.nahv-series { margin-bottom: 19px; }
.nahv-series .link-row { min-height: 64px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: 0 0 5px -4px;
  padding-inline: 3px 8px;
  border-radius: 9px;
  color: var(--emerald);
  font-weight: 650;
  font-size: .95rem;
}
.back-link:hover { background: var(--tint); }
.back-link svg { width: 19px; }
.arabic { font-family: var(--arabic); font-weight: 400; unicode-bidi: isolate; }
.inline-ar { font-size: calc(1.4em * var(--ar-scale)); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 46px;
  padding: .64rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-weight: 690;
  line-height: 1.24;
  text-align: left;
  transition: background var(--ease), border-color var(--ease);
}
.button svg { width: 18px; height: 18px; }
.button.primary { background: var(--emerald); color: var(--paper); }
.button.primary:hover:not(:disabled) { background: var(--ink); }
.button.cream { background: var(--paper); color: var(--ink); }
.button.cream:hover { background: #efe3ce; }
.button.outline, .button.audio { color: var(--emerald); border-color: #d7e0d1; background: var(--tint); }
.button.outline:hover, .button.audio:hover { background: #d7e4d3; }
.button:disabled { opacity: .55; }
.button:active:not(:disabled), .side-nav a:active { filter: brightness(.94); }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  isolation: isolate;
  min-height: 326px;
  overflow: hidden;
  color: var(--paper);
  background: linear-gradient(132deg,#103b29 0%,var(--ink) 78%);
  border: 1px solid #214834;
  border-radius: 30px;
  box-shadow: 0 14px 27px #183a2824, 0 2px 4px #1b35251a;
}
.hero-copy { position: relative; z-index: 1; max-width: 57%; padding: 36px 0 36px 40px; }
.hero-copy p { color: #e5d3b7; font-size: .89rem; margin-bottom: 7px; font-weight: 660; font-variant-numeric: tabular-nums; }
.hero h2 { font-size: 3.6rem; line-height: 1.02; letter-spacing: -.04em; text-wrap: unset; }
.hero .button { margin-top: 24px; }
.hero .button:focus-visible, .track-green .button:focus-visible { outline-color: var(--paper); }
.hero-arch {
  position: absolute;
  right: 8%;
  bottom: -32px;
  width: 34%;
  height: 99%;
  display: grid;
  place-items: center;
  isolation: isolate;
  border: 1px solid #d8c3a565;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 45% 45% 0 0;
  background: #c7c0a10b;
  color: #f4e5c9;
}
.hero-arch::before, .hero-arch::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: 0;
  border: 1px solid #d8c3a534;
  border-bottom: 0;
  border-radius: inherit;
  pointer-events: none;
}
.hero-arch::before { inset: 12px 12px 0; }
.hero-arch::after { inset: -20px -20px 0; }
.hero-letter { font-size: 13rem; line-height: 1; padding-bottom: .15em; }
.hero-phrase { font-size: clamp(1.8rem,4.3vw,3.4rem); max-width: 86%; text-align: center; line-height: 1.4; }

.home-secondary { display: grid; grid-template-columns: .8fr 1.2fr; gap: 16px; margin-top: 18px; }
.progress-card {
  display: grid;
  gap: 10px;
  padding: 19px 21px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--surface-shadow);
}
.progress-card:hover:is(a) { border-color: #aca896; }
.home-secondary .progress-card { align-content: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.progress-stat { display: block; font: 740 2.65rem/1.1 var(--display); letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; }
.progress-stat small { font: 640 .9rem/1.2 var(--body); color: var(--olive); }
.meter { height: 6px; overflow: hidden; background: var(--muted); border-radius: 99px; }
.meter span { display: block; height: 100%; background: var(--emerald); border-radius: inherit; }

.rows { display: grid; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--paper); box-shadow: var(--surface-shadow); }
.link-row, summary { display: flex; align-items: center; min-width: 0; gap: 12px; }
.link-row {
  position: relative;
  min-height: 66px;
  padding: 11px 15px;
  transition: background var(--ease);
}
.link-row:first-child { border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
.link-row:last-child { border-radius: 0 0 var(--radius-panel) var(--radius-panel); }
.link-row:only-child { border-radius: var(--radius-panel); }
.rows > .link-row + .link-row::before {
  content: "";
  position: absolute;
  inset: 0 15px auto 64px;
  height: 1px;
  background: var(--line);
}
.link-row:hover, .choice:hover { background: var(--rail); }
.link-row:active, summary:active { background: var(--pressed); }
.link-row:focus-visible { z-index: 1; outline-offset: -3px; }
.row-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  inline-size: 36px;
  aspect-ratio: 1;
  border-radius: 11px;
  color: var(--emerald);
  background: var(--tint);
}
.row-icon svg { width: 19px; height: 19px; }
.link-row:is([href="#videos"],[href="#quiz/sentences"],[href="#deck/sentences"]) .row-icon { background: #eee0cd; }
.link-row:is([href="#review"],[href="#quiz/alphabet"]) .row-icon { background: #e9e5d7; }
.row-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-text strong { display: block; font-weight: 690; line-height: 1.2; }
.row-text small, .row-end small { display: block; color: var(--olive); font-size: .81rem; margin-top: 3px; line-height: 1.35; }
.row-end { display: inline-flex; align-items: center; gap: 5px; color: var(--olive); font-size: .86rem; }
.row-end svg, summary > svg { width: 16px; height: 16px; color: #66715b; }

.grammar-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.track {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 9px;
  min-width: 0;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--surface-shadow);
}
.track-green { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.track-word { font-size: 3.65rem; line-height: 1.2; color: var(--olive); }
.track-green .track-word { color: var(--beige); }
.track .button { margin-top: 5px; }
.chapter-list { display: grid; gap: 13px; }
.chapter { border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--paper); box-shadow: var(--surface-shadow); }
summary { padding: 12px 15px; min-height: 55px; border-radius: var(--radius-panel); cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
summary > svg, summary .row-end svg { transition: transform var(--ease); }
details[open] > summary > svg, details[open] > summary .row-end svg { transform: rotate(90deg); }
.chapter > .rows { margin: 1px 12px 12px; box-shadow: none; }
.deck-count { color: var(--olive); font-size: .89rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 15px; }
.deck-count .meter { flex: 1; }

.flashcard {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  min-height: 223px;
  padding: 23px 16px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--surface-shadow);
}
.flashcard p { font-size: 1.1rem; font-weight: 650; }
.flashcard .arabic { max-width: 100%; }
.letter-sheet { min-height: 280px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.letter-sheet .audio { background: var(--paper); color: var(--ink); }
.letter-sheet .audio:focus-visible { outline-color: var(--paper); }
.flash-letter { font-size: calc(clamp(5rem,16vw,9rem) * var(--ar-scale)); line-height: 1; }
.flash-word { font-size: calc(clamp(2rem,6vw,3.55rem) * var(--ar-scale)); line-height: 1.52; }
.forms { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.forms div { background: var(--paper); border-radius: 16px; border: 1px solid var(--line); padding: 7px 9px; text-align: center; }
.forms span:not(.arabic) { display: block; font-size: .83rem; color: var(--olive); }
.forms .arabic { font-size: calc(2rem * var(--ar-scale)); }
.conversation-reply { min-height: 0; margin-top: 12px; gap: 8px; }
.conversation-reply strong { color: var(--olive); font-size: .88rem; }
.small-note { color: var(--olive); margin-top: 8px; font-size: .84rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.lesson-body, .quiz { display: grid; gap: 16px; }
.lesson-body > p { max-width: 70ch; }
.example, .quiz-example { padding: 17px 14px; border: 1px solid var(--line); border-radius: var(--radius-panel); text-align: center; background: var(--paper); }
.example-ar, .quiz-example .arabic { font-size: calc(clamp(2rem,5vw,3.15rem) * var(--ar-scale)); line-height: 1.6; }
.quiz-word { font: 740 2.4rem/1.35 var(--display); letter-spacing: -.03em; }
.example figcaption { color: var(--olive); }
.example-pairs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 8px; }
.example-pair { display: grid; grid-template-rows: auto 1fr; align-items: start; flex: 1 1 76px; min-width: 0; margin: 0; }
.example-pair figcaption { overflow-wrap: anywhere; }
.written { padding-bottom: 4px; }
.written h2 { margin-top: 7px; }
.written ol { padding-left: 1.4rem; }
.written li { margin-block: 5px; }
.written summary { display: inline-flex; min-height: 44px; padding-left: 0; color: var(--emerald); text-decoration: underline; text-underline-offset: 3px; }
.written p { padding: 8px 12px; background: var(--paper); border-radius: 12px; }
.quiz h2 { font-size: 1.45rem; }
.quiz > .audio { justify-self: start; }
.choices { border: 0; display: grid; gap: 8px; padding: 0; margin: 0; min-width: 0; }
.choice { display: flex; align-items: center; gap: 11px; min-height: 53px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); cursor: pointer; }
.choice input { inline-size: 19px; block-size: 19px; margin: 0; flex: none; }
.choice:has(:checked), .choice.correct { background: var(--tint); border-color: #8ca38b; }
.choice.incorrect { background: #f3dfd4; border-color: #a47868; }
.feedback { background: var(--paper); border: 1px solid #a8b49a; border-radius: 15px; padding: 13px 15px; }
.feedback p { margin-top: 3px; }
.result { max-width: 570px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.result .meter, .profile-progress .meter { background: #526c56; }
.result .meter span, .profile-progress .meter span { background: var(--paper); }
.empty { padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--paper); }
.empty h2 { margin: 10px 0 7px; }
.empty .button { margin-top: 15px; }
.progress-list { display: grid; gap: 15px; max-width: 570px; margin-top: 18px; }
.progress-list article { display: grid; gap: 7px; }

.identity {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px;
  margin-bottom: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--surface-shadow);
}
.identity-text { min-width: 0; overflow-wrap: anywhere; }
.profile-edit-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--emerald);
  background: var(--tint);
  border: 1px solid #d7e0d1;
  border-radius: 50%;
}
.profile-edit-toggle:hover, .profile-edit-toggle[aria-expanded="true"] { background: #d7e4d3; }
.profile-edit-toggle svg { width: 19px; height: 19px; }
.profile-editor { grid-column: 1/-1; padding-top: 13px; border-top: 1px solid var(--line); }
.profile-editor:focus { outline: none; }
.profile-editor .name-fields { display: grid; grid-template-columns: minmax(0,1fr) auto; max-width: 25rem; }
.profile-editor .name-fields input { width: 100%; }
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.photo-control { position: relative; cursor: pointer; }
.photo-control:focus-within { outline: 2px solid var(--emerald); outline-offset: 3px; }
form label { display: block; font-size: .9rem; margin-bottom: 6px; font-weight: 650; }
.name-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.name-fields input {
  width: min(100%,16rem);
  min-height: 45px;
  background: var(--rail);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 11px;
}
.profile-progress { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.progress-stat.compact { font-size: 1.7rem; letter-spacing: -.025em; line-height: 1.15; }
.progress-more { display: flex; align-items: center; gap: 5px; font-size: .89rem; }
.progress-more svg { width: 17px; height: 17px; }
.pomodoro-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 16px 19px; margin-top: 13px; }
.pomodoro-card h2, .settings h2 { font-size: 1.28rem; }
.pomodoro-card p { margin-block: 5px 10px; color: var(--olive); }
.pomodoro-switch { position: relative; width: 52px; height: 44px; border: 0; background: transparent; padding: 0; }
.pomodoro-switch::before { content: ""; position: absolute; inset: 7px 0; border-radius: 20px; background: #746e62; transition: background var(--ease); }
.pomodoro-switch span { position: absolute; top: 10px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #0004; transition: transform var(--ease); }
.pomodoro-switch[aria-checked="true"]::before { background: var(--emerald); }
.pomodoro-switch[aria-checked="true"] span { transform: translateX(22px); }
.pomodoro-status { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; color: var(--olive); margin-block: .25rem .65rem; }
.pomodoro-status [data-pomodoro-clock], .pomodoro-break .pomodoro-break-clock { color: var(--ink); font-size: 2.5rem; font-weight: 720; letter-spacing: -.04em; line-height: 1.12; font-variant-numeric: tabular-nums; }
.pomodoro-option { margin-top: 14px; }
.pomodoro-option p { font-weight: 650; }
.pomodoro-card .small-note { margin: 13px 0 0; }
.pomodoro-badge { padding: 8px 10px; min-width: 57px; min-height: 44px; display: grid; place-content: center; border-radius: 14px; background: var(--tint); font-variant-numeric: tabular-nums; font-weight: 700; }
.pomodoro-break { width: min(calc(100% - 32px), 360px); max-height: calc(100% - 32px); margin: auto; padding: 25px; text-align: center; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: var(--surface-shadow); }
.pomodoro-break[open] { animation: pomodoro-break-in 210ms cubic-bezier(.22,.72,.23,1); }
.pomodoro-break::backdrop { background: #052c1ebd; }
.pomodoro-break .pomodoro-break-clock { margin-block: 12px; }
@keyframes pomodoro-break-in {
  from { opacity: .4; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
html:has(.pomodoro-break[open]) { overflow: hidden; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--pressed); }
.pills button { background: transparent; border: 1px solid transparent; border-radius: 10px; min-height: 44px; padding: 5px 14px; font-weight: 660; font-size: .89rem; }
.pills button:hover { background: var(--rail); }
.pills button:disabled { opacity: .65; cursor: default; }
.pills button[aria-pressed="true"] { color: var(--emerald); background: var(--paper); border-color: var(--line); box-shadow: 0 2px 6px #30251b16; }
.settings { display: grid; gap: 7px; margin-top: 18px; }
.settings h2 { margin: 0 0 3px 2px; }
.settings details { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; }
.settings details form, .size-options { padding: 0 14px 12px; }

.video-filters, .word-directions { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 0 19px; }
.video-summary { max-width: 570px; margin-bottom: 15px; }
.video-summary .button { justify-self: start; margin-top: 5px; }
.video-watch small, .video-order-note { color: var(--olive); }
.video-order-note { margin-block: 9px; font-size: .88rem; }
.video-locked { color: var(--olive); }
.video-locked .row-icon { background: var(--rail); }
.daily-nahv { display: grid; gap: 5px; margin-block: 8px; color: var(--olive); font-size: .88rem; }
.video-watch { margin-top: 14px; }
.video-resume { margin-bottom: 15px; }
.video-resume .link-row { border: 1px solid var(--line); background: var(--paper); box-shadow: var(--surface-shadow); }
.video-row .row-end small { text-align: right; }
.video-filters a, .word-directions a { display: flex; align-items: center; min-height: 44px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 12px; font-size: .9rem; font-weight: 660; background: var(--rail); }
.video-filters a:hover, .word-directions a:hover { background: var(--paper); }
.video-filters a[aria-current="page"], .word-directions a[aria-current="page"] { color: var(--emerald); background: var(--tint); border-color: #c3d0bc; }
.video-section + .video-section { margin-top: 19px; }
.video-section h2 { margin: 0 0 8px 2px; }
.video-screen { overflow: hidden; background: var(--ink); border-radius: var(--radius-panel); box-shadow: var(--surface-shadow); }
.video-screen iframe { display: block; width: 100%; min-height: 200px; aspect-ratio: 16/9; border: 0; }
.video-help { max-width: 67ch; color: var(--olive); margin-top: 12px; font-size: .92rem; }
.notice {
  position: fixed;
  z-index: 5;
  bottom: 22px;
  right: max(15px,env(safe-area-inset-right));
  max-width: min(28rem,calc(100vw - 30px));
  padding: 11px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  box-shadow: 0 5px 22px #0003;
}

@media (max-width: 1050px) {
  .layout { grid-template-columns: 200px minmax(0,1fr); gap: 22px; }
  .hero { min-height: 296px; }
  .hero h2 { font-size: 2.95rem; }
  .hero-letter { font-size: 11rem; }
}
@media (max-width: 740px) {
  .layout { display: block; padding-inline: 18px; }
  .sidebar { display: none; }
  .mobile-brand { display: inline-flex; font-size: clamp(.91rem, 3.4vw, 1.2rem); }
  .brand-mark { inline-size: 34px; block-size: 34px; }
  .topbar { justify-content: space-between; min-height: 68px; padding-top: env(safe-area-inset-top); }
  .top-profile { padding: 3px; }
  .top-profile > span:last-child { display: none; }
  main { padding: 9px 0 calc(106px + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 17px; }
  h1 { font-size: 2.26rem; }
  h2 { font-size: 1.4rem; }
  .hero { min-height: 253px; border-radius: 24px; }
  .hero-copy { max-width: 66%; padding: 27px 0 27px 21px; }
  .hero h2 { font-size: 2.06rem; }
  .hero .button { margin-top: 17px; font-size: .86rem; }
  .hero .button svg { width: 15px; }
  .hero-arch { right: 5%; width: 34%; bottom: -19px; height: 91%; }
  .hero-arch::before { inset: 8px 8px 0; }
  .hero-arch::after { inset: -11px -11px 0; }
  .hero-letter { font-size: 7.4rem; padding-bottom: .13em; }
  .hero-phrase { font-size: 1.65rem; }
  .home-secondary, .grammar-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .home-secondary { margin-top: 13px; }
  .progress-card { padding: 15px 16px; }
  .progress-stat { font-size: 2.2rem; }
  .mobile-nav {
    position: fixed;
    z-index: 4;
    inset: auto 12px max(10px,env(safe-area-inset-bottom));
    width: min(calc(100% - 24px),460px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 3px;
    padding: 5px;
    border: 1px solid #fbf7ef;
    border-radius: 24px;
    background: var(--rail);
    box-shadow: 0 4px 24px #231f1930, 0 0 0 1px #6e604329;
  }
  .mobile-nav a { display: grid; place-items: center; align-content: center; gap: 3px; min-height: 48px; border-radius: 18px; font-size: .72rem; color: var(--olive); font-weight: 660; }
  .mobile-nav a[aria-current="page"] { background: var(--tint); color: var(--emerald); font-weight: 740; }
  .mobile-nav a[aria-current="page"] svg { stroke-width: 2; }
  .notice { bottom: calc(79px + env(safe-area-inset-bottom)); }
  .track { grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 7px 15px; padding: 18px; }
  .track-word { grid-row: 1/4; align-self: start; font-size: 3rem; }
  .track .button { grid-column: 2; }
  .avatar-large { inline-size: 68px; }
  .page-actions .button.primary { flex: 1 0 auto; }
}
@media (max-width: 365px) {
  .layout { padding-inline: 13px; }
  .mobile-brand { gap: 4px; }
  .mobile-brand .brand-mark { inline-size: 28px; block-size: 28px; }
  .top-actions { gap: 4px; }
  .pomodoro-badge { min-width: 49px; padding-inline: 6px; }
  .hero-copy { padding-inline-start: 16px; }
  .hero h2 { font-size: 1.76rem; }
  .hero-arch { right: 4%; }
  .hero-letter { font-size: 6.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

