@font-face {
  font-family: Geist;
  src: url("./assets/geist-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Devanagari";
  src: url("./assets/noto-sans-devanagari-devanagari-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CFF, U+A8E0-A8FF, U+11B00-11B09;
}

:root {
  color-scheme: dark;
  --shell: #101217;
  --surface: #171a22;
  --raised: #1c1f29;
  --border: #292d39;
  --text: #f4f4f6;
  --muted: #afb2c0;
  --subtle: #969baa;
  --accent: #ff667c;
  --green: #80e0c3;
  --width: 704px;
  --gutter: clamp(16px, 4.3vw, 28px);
  --tabs-height: 60px;
  --top-height: 70px;
  font: 16px/1.5 Geist, "Noto Sans Devanagari", system-ui, sans-serif;
  scrollbar-color: #4c5061 #141720;
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #0c0e13; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(ellipse at 50% -26%, #211920 0%, transparent 56%) #0c0e13;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
button:not(:disabled), select, summary { cursor: pointer; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) {
  body:not(.admin-body) { touch-action: pan-x pan-y; -webkit-user-select: none; user-select: none; }
  input, textarea, [contenteditable]:not([contenteditable="false"]) {
    -webkit-user-select: text;
    user-select: text;
  }
}
button:disabled { opacity: 0.72; }
:focus-visible { outline: 2px solid #ff9dad; outline-offset: 3px; }
main:focus, [tabindex="-1"]:focus { outline: none; }
h1, h2, p { margin: 0; }
h1, h2, strong { color: var(--text); }
svg { flex: none; vertical-align: middle; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 10; padding: 8px 12px; border-radius: 8px; background: var(--raised); }

.app-shell {
  margin: 0 auto;
  width: 100%;
  max-width: var(--width);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--shell);
  border-inline: 1px solid #21232d;
}

.top-bar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(13px + env(safe-area-inset-top)) var(--gutter) 13px;
  background: #101217fa;
  border-bottom: 1px solid #242731;
}
.brand, .header-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { display: block; width: 43px; height: 43px; border-radius: 12px; object-fit: cover; }
.brand > span { font-size: 1rem; font-weight: 750; letter-spacing: -0.025em; line-height: 1.18; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .01em; line-height: 1.25; }
.language-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 41px;
  min-height: 41px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #dce0ed;
  background: #181b24;
  font-size: .81rem;
  font-weight: 650;
}
.language-button { padding: 0 10px; }
.icon-button { color: #c0c4d2; }
.language-button:hover, .icon-button:hover { background: #222635; }

#main { padding: 22px var(--gutter) calc(var(--tabs-height) + env(safe-area-inset-bottom) + 23px); }
.tab-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  position: fixed;
  inset: auto 0 0;
  z-index: 4;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 5px clamp(8px, 4.1vw, 16px) calc(5px + env(safe-area-inset-bottom));
  min-height: calc(var(--tabs-height) + env(safe-area-inset-bottom));
  background: #101415;
  border: 1px solid #28282e;
}
.tab {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: start;
  flex-direction: column;
  gap: 3px;
  min-height: 48px;
  padding: 2px 0 3px;
  color: #999;
  font: .72rem/1.2 Arial, sans-serif;
  letter-spacing: .015em;
  text-align: center;
}
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: #ff4b4b; }
.tab[aria-current="page"] .tab-icon { color: #e02424; }
.tab-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
  background: currentColor;
  mask: var(--tab-icon) center / contain no-repeat;
}
.tab-icon-learn { --tab-icon: url("./assets/tab-home-outline.svg"); transform: translateY(-3px) scaleX(.88); }
.tab-icon-news { --tab-icon: url("./assets/tab-package.svg"); }
.tab-icon-practice { --tab-icon: url("./assets/tab-camera.svg"); }
.tab-icon-holdings { --tab-icon: url("./assets/tab-text-box.svg"); }
.tab-icon-my { --tab-icon: url("./assets/tab-account-tie.svg"); }

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(18px, 5vw, 28px);
  border: 1px solid #49323e;
  border-radius: 20px;
  background: radial-gradient(ellipse at 91% 15%, #3b1f31 0%, transparent 65%), linear-gradient(135deg, #22202a 0%, #201821 100%);
}
#hero-chart { position: absolute; inset: 0 0 auto auto; z-index: -1; width: 65%; height: 83%; }
.hero-copy { position: relative; max-width: 420px; }
.hero-label, .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ff9aa8;
  font-size: .70rem;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.3;
}
.hero h1 {
  margin: 11px 0 11px;
  font-size: clamp(2.45rem, 7.45vw, 3.45rem);
  font-weight: 780;
  line-height: 1.005;
  letter-spacing: -.072em;
  text-shadow: 0 2px 24px #1f1325;
}
.hero p { max-width: min(75%, 270px); color: #c8beca; font-size: .9rem; line-height: 1.44; }
.primary-button {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 15px;
  border: 1px solid #ff8798;
  border-radius: 9px;
  color: #230e1b;
  background: #ff7186;
  font-size: .86rem;
  font-weight: 770;
  line-height: 1.35;
}
.primary-button:hover { background: #ff93a3; }
.hero .primary-button { margin-top: 19px; }
.hero-progress { margin-top: 22px; padding-top: 14px; border-top: 1px solid #ffbac323; }
.progress-description { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; color: #c7bbc8; font-size: .75rem; }
.progress-description strong { font-weight: 650; color: #f3c8d0; }
.segments { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 5px; margin-top: 8px; }
.segments span { height: 4px; border-radius: 2px; background: #574050; }
.segments .filled { background: var(--accent); }
.lesson-meter { display: block; width: 100%; height: 7px; margin-top: 7px; accent-color: var(--accent); }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 12px; }
.quick-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(130deg, #1b1e29 0%, #171a22 78%);
  color: var(--muted);
  font-size: .77rem;
}
.quiz-quick { background: linear-gradient(130deg, #221d24 0%, #171a22 78%); }
.quick-card:hover { border-color: #5c5268; }
.quick-card strong { font-size: .98rem; letter-spacing: -.025em; }
.quick-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 5px; color: var(--subtle); }
.tile-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 43px;
  height: 43px;
  background: #32202a;
  color: #ff889a;
  border: 1px solid #4d2c39;
  border-radius: 11px;
}
.quick-top .tile-icon { width: 35px; height: 35px; border-radius: 9px; }
.tile-icon.amber { background: #372a25; color: #ffbc82; border-color: #584136; }
.tile-icon.blue { background: #262c42; color: #a8b8ff; border-color: #3b4668; }
.tile-icon.teal { background: #1b3431; color: #77dec1; border-color: #30514a; }
.tile-icon.violet { background: #302940; color: #d0b3ff; border-color: #493a61; }
.tile-icon.pink { background: #39283a; color: #f0a7df; border-color: #593b55; }

.content-section { margin-top: 25px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.section-heading h2 { font-size: 1.24rem; letter-spacing: -.032em; font-weight: 730; }
.section-heading > span, .section-heading > time { color: var(--subtle); font-size: .72rem; letter-spacing: .08em; font-weight: 660; white-space: nowrap; }
.module-list, .term-list, .headline-list { display: grid; gap: 8px; }
.module-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.module-row:hover { background: var(--raised); border-color: #464859; }
.module-row.current-module { border-color: #593440; background: linear-gradient(110deg, #221c28, var(--surface) 70%); }
.row-copy { display: flex; flex-direction: column; }
.row-copy strong { font-size: .98rem; letter-spacing: -.025em; line-height: 1.3; }
.row-meta { font-size: .68rem; letter-spacing: .055em; color: var(--subtle); line-height: 1.2; font-weight: 650; }
.row-summary { color: var(--muted); font-size: .77rem; line-height: 1.35; margin-top: 3px; }
.row-end { color: var(--subtle); }
.row-end.done { color: var(--green); }
.holding-list { list-style: none; margin: 0 0 12px; padding: 0; }
.holding-value { font-size: .87rem; font-variant-numeric: tabular-nums; }
.page-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 17px; margin-top: 22px; border-top: 1px solid var(--border); color: var(--subtle); font-size: .77rem; }
.page-footer a { color: #c8ccdb; }
.page-footer a:hover, .source-link:hover, .back-link:hover, .text-link:hover { text-decoration: underline; }
.page-footer a, .back-link, .source-link, .text-link, .done-pill { display: inline-flex; align-items: center; gap: 6px; }

.page-heading { display: flex; align-items: center; gap: 13px; padding: 3px 0 19px; }
.page-heading h1, .policy h1 { font-size: clamp(1.6rem, 5.7vw, 2.05rem); font-weight: 760; letter-spacing: -.05em; line-height: 1.12; }
.page-heading p { color: var(--muted); font-size: .90rem; margin-top: 5px; }
.page-heading .tile-icon { width: 47px; height: 47px; }
.back-link, .source-link, .text-link { color: #c4c8db; font-size: .85rem; font-weight: 600; min-height: 38px; }
.back-link { margin: -4px 0 9px; }
.lesson-heading { padding: 21px; background: radial-gradient(ellipse at 94% 0%, #3c2637, transparent 75%), #1b1d27; border: 1px solid #3b2d3e; border-radius: 16px; }
.lesson-heading .tile-icon { display: grid; margin-bottom: 13px; width: 48px; height: 48px; }
.lesson-heading h1 { font-size: clamp(1.85rem, 7.8vw, 2.6rem); line-height: 1.09; letter-spacing: -.06em; margin: 8px 0 7px; }
.lesson-heading > p:last-child { color: var(--muted); font-size: .95rem; }
.prose { color: #d0d2de; }
.prose section { margin-top: 22px; }
.prose h2 { font-size: 1.13rem; font-weight: 720; letter-spacing: -.02em; margin-bottom: 6px; line-height: 1.4; }
.prose p { line-height: 1.67; }
.example { display: flex; gap: 12px; padding: 15px; margin: 22px 0 12px; border: 1px solid #4b3a3e; border-radius: 12px; background: #231e26; font-size: .91rem; }
.example .tile-icon { width: 35px; height: 35px; border-radius: 9px; }
.example h2 { font-size: .94rem; }
.note { font-size: .85rem; color: var(--muted); }
.lesson-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 17px; }
.done-pill { color: var(--green); font-size: .85rem; }

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 47px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--raised);
  color: var(--subtle);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input { width: 100%; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box input::placeholder { color: #a5a9b9; }
.filter-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 12px;
  min-height: 39px;
  color: #c6c8d5;
  font-size: .82rem;
  font-weight: 600;
}
.chip:hover { background: var(--raised); }
.chip[aria-pressed="true"] { background: #332231; color: #ffafbc; border-color: #684453; }
.result-count { color: var(--subtle); font-size: .79rem; margin-bottom: 9px; }
.term { border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.term summary, .answer-review summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  min-height: 55px;
  color: var(--subtle);
}
.term summary::-webkit-details-marker, .answer-review summary::-webkit-details-marker { display: none; }
.term summary:hover { color: var(--text); }
.term[open] summary svg, .answer-review[open] summary svg { transform: rotate(90deg); }
.term summary small { display: block; color: var(--muted); margin-top: 3px; font-size: .78rem; }
.term p { padding: 0 13px 13px; color: #cfd3e3; font-size: .93rem; }
.empty-state { padding: 24px 12px; text-align: center; color: var(--muted); }
.empty-state h2 { font-size: 1.12rem; margin-top: 7px; }
.empty-state p { font-size: .92rem; margin-top: 3px; }

.streak-card { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 13px; border: 1px solid #4a3839; border-radius: 13px; background: linear-gradient(120deg, #302326, #1a1b24); }
.streak-card div { display: flex; flex-direction: column; gap: 3px; }
.streak-card div span { font-size: .83rem; color: var(--muted); }
.quiz-panel { padding: clamp(14px, 4.5vw, 22px); border-radius: 15px; border: 1px solid var(--border); background: var(--surface); }
.quiz-panel h2 { margin: 6px 0 8px; font-size: 1.35rem; letter-spacing: -.03em; line-height: 1.25; }
.quiz-panel > p { color: var(--muted); }
.quiz-panel .primary-button { margin-top: 16px; }
.quiz-options { display: grid; gap: 7px; margin: 14px 0 0; }
.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 49px;
  border: 1px solid #353949;
  border-radius: 9px;
  padding: 8px 10px;
  text-align: left;
  background: var(--raised);
}
.choice:hover:not(:disabled) { border-color: #8c5264; }
.choice-letter { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: #c4c7db; background: #292d3a; font-size: .78rem; }
.choice.right, .quiz-feedback.right { border-color: #3d7467; color: #a3edda; background: #1b302f; opacity: 1; }
.choice.wrong, .quiz-feedback.wrong { border-color: #885161; color: #ffc1ca; background: #352631; opacity: 1; }
.quiz-feedback { margin-top: 13px; padding: 10px 12px; border: 1px solid; border-radius: 8px; font-size: .9rem; }
.quiz-feedback p { margin-top: 2px; color: #e1dfe6; }
.quiz-panel .quiz-score { font-size: 2.4rem; line-height: 1.2; font-weight: 740; letter-spacing: -.065em; color: var(--text); }
.quiz-score span { color: var(--subtle); }
.quiz-result { text-align: center; }
.answer-review { margin-top: 14px; text-align: left; border: 1px solid var(--border); border-radius: 9px; }
.answer-review summary { font-size: .9rem; color: var(--text); }
.answer-review div { padding: 10px 13px; border-top: 1px solid var(--border); }
.answer-review p { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.news-section { margin-top: 1px; }
.news-section .section-heading { border-bottom: 1px solid var(--border); padding-bottom: 9px; }
.headline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.headline:hover { background: var(--raised); }
.headline > svg { color: var(--subtle); }
.headline small { display: block; color: #afb7cb; font-size: .75rem; font-weight: 600; margin-bottom: 3px; }
.headline strong { display: block; font-size: .96rem; line-height: 1.35; }
.headline .tile-icon { width: 36px; height: 36px; border-radius: 9px; }

#main.practice-view { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding-top: 13px; padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom) + 12px); }
.practice-header { position: sticky; top: calc(var(--top-height) + env(safe-area-inset-top)); z-index: 2; background: var(--shell); }
.practice-header .page-heading { padding-bottom: 11px; }
.demo-banner { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 10px; border: 1px solid #355950; border-radius: 9px; color: #a5ecd6; background: #1a302e; font-size: .84rem; font-weight: 690; }
.demo-banner small { display: block; margin-top: 2px; font-size: .72rem; font-weight: 510; }
.practice-frame { display: block; width: 100%; min-height: 240px; height: calc(100vh - 276px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); height: calc(100dvh - 276px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border: 1px solid var(--border); border-radius: 12px; background: #141720; }

@media (min-height: 480px) {
  .app-shell:has(.practice-view) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
  #main.practice-view { flex: 1; }
  .practice-frame { flex: 1; height: auto; min-height: 0; }
}

.policy { padding: 20px var(--gutter) 35px; max-width: 100%; }
.policy .page-heading { padding-bottom: 11px; }
.policy .prose section { padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.policy .secondary-button { margin-top: 13px; }
.policy .reset-status { margin-top: 9px; color: var(--green); font-size: .88rem; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px; border: 1px solid #434858; border-radius: 9px; padding: 7px 11px; background: var(--raised); color: var(--text); font-size: .85rem; font-weight: 640; }
.secondary-button:hover { background: #282d3c; }
.confirm-delete:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

[lang="hi"] .hero h1, [lang="hi"] h1, [lang="hi"] h2, [lang="hi"] .eyebrow { letter-spacing: 0; }
[lang="hi"] .hero h1 { line-height: 1.2; }
[lang="hi"] .hero-label { letter-spacing: 0; }
@media (max-width: 410px) {
  :root { --top-height: 68px; }
  .app-shell { border-inline: none; }
  .header-actions { gap: 6px; }
  .brand img { width: 39px; height: 39px; border-radius: 10px; }
  #main { padding-top: 16px; }
  .hero p { max-width: 78%; }
  .module-row { gap: 9px; }
}
@media (max-width: 340px) {
  :root { --gutter: 12px; }
  .brand { gap: 6px; }
  .brand > span { font-size: .88rem; }
  .hero h1 { font-size: 2.1rem; }
  .tab { font-size: .66rem; }
}
@media (max-height: 440px) {
  .top-bar { position: relative; }
  .practice-header { top: 0; }
}
