/* Study paths share content; native palette and density remain marker-scoped. */
.study-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.study-paths a { display: grid; gap: 6px; align-content: center; min-height: 78px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; }
.study-paths a[aria-current] { border-color: var(--purple-dark); box-shadow: inset 0 -3px var(--purple-dark); }
.study-paths strong { font-family: var(--font-ui); font-size: .95rem; }
.study-paths [lang="bn"] { color: var(--muted); font-size: .88rem; }
.study-figures-active { background: var(--surface); }
.figure-study { --fs-action: var(--purple-dark); font-family: var(--font-ui); line-height: 1.55; }
.figure-study [hidden] { display: none; }
.figure-study :is(h2,h3,h4,p) { margin: 0 0 12px; }
.figure-study h2 { font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.25; letter-spacing: -.025em; }
.figure-study h3 { font-size: 1.1rem; }
.figure-study h4 { font-size: .86rem; color: var(--muted); }
.figure-study :is(a,button,summary), .study-paths a { cursor: pointer; }
.figure-study :is(a,button,input,summary):focus-visible, .study-paths a:focus-visible { outline: 3px solid var(--purple-dark); outline-offset: 4px; }
.figure-study :is(h2,h3)[tabindex="-1"]:focus { outline: none; }
.figure-study button:disabled { cursor: default; }
.fs-muted { color: var(--muted); font-size: .9rem; }
.fs-introduction { margin: 28px 0; }
.fs-introduction > [lang="bn"] { font-size: 1.15rem; }
.fs-bangla-title[lang="bn"] { font-family: var(--font-bangla-title); font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 400; line-height: 1.5; }
.fs-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin-bottom: 30px; }
.fs-category { display: flex; gap: 14px; justify-content: space-between; align-items: center; min-height: 104px; padding: 18px 4px; color: var(--ink); border-bottom: 1px solid var(--line); text-decoration: none; }
.fs-category strong { font-size: .96rem; }
.fs-category [lang="bn"] { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.fs-category-count { flex: none; font-size: .7rem; color: var(--fs-action); }
.fs-category:hover strong, .fs-figure:hover strong { color: var(--fs-action); text-decoration: underline; text-underline-offset: 4px; }
.fs-category:active, .fs-figure:active { opacity: .8; }
.fs-search { display: flex; align-items: center; gap: 8px; max-width: 620px; min-height: 48px; margin: 20px 0 12px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fs-search input { flex: 1; min-width: 0; width: 100%; min-height: 48px; border: none; background: transparent; color: var(--ink); font: inherit; font-size: .92rem; }
.fs-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.fs-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fs-action, var(--purple-dark)); font: 650 .9rem var(--font-ui); text-decoration: none; }
.fs-button:hover:not(:disabled) { border-color: var(--purple-dark); }
.fs-button:active:not(:disabled) { background: var(--line); }
.fs-search .fs-button { padding: 8px; border: 0; font-size: .78rem; }
.fs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 18px 0 24px; }
.fs-figure { min-width: 0; display: grid; grid-template-rows: 142px 1fr; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; }
.fs-thumbnail { display: grid; place-items: center; min-width: 0; }
.fs-thumbnail img { display: block; width: 100%; height: 142px; object-fit: contain; }
.fs-figure-copy strong { display: block; font-size: .94rem; line-height: 1.45; }
.fs-figure-copy [lang="bn"] { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }
.fs-empty { grid-column: 1 / -1; padding: 28px 0; }
.fs-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0 0 20px; font-size: .82rem; }
.fs-breadcrumb a { min-height: 44px; display: flex; align-items: center; color: var(--fs-action); }
.fs-breadcrumb [aria-current] { align-self: center; color: var(--muted); }
.fs-lesson { max-width: 900px; margin: 0 auto; }
.fs-lesson-overview { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(0, 1fr); align-items: center; gap: 40px; padding: 24px 0 32px; }
.fs-lesson-media { display: grid; place-items: center; min-height: 200px; }
.fs-lesson-media img.study-figure { display: block; width: 100%; height: 220px; max-width: 320px; margin: 0; object-fit: contain; }
.fs-kicker { color: var(--fs-action); font-size: .76rem; font-weight: 700; }
.fs-explanation, .fs-practice { border-top: 1px solid var(--line); padding: 26px 0; min-height: 160px; }
.fs-explanation-image { display: block; width: 100%; height: auto; max-width: 820px; min-height: 160px; margin: 20px auto 0; border-radius: 10px; }
.fs-example { padding: 20px 0; border-top: 1px solid var(--line); }
.fs-question { font-size: 1.05rem; hyphens: none; -webkit-hyphens: none; overflow-wrap: normal; word-break: normal; }
.fs-answers { display: flex; gap: 10px; margin-top: 14px; }
.fs-answers .fs-button { min-width: 94px; }
.fs-answers .fs-button[aria-pressed="true"] { color: var(--surface); background: var(--fs-action); border-color: var(--fs-action); }
.fs-feedback { min-height: 32px; padding-top: 12px; font-weight: 650; }
.fs-feedback[data-result="review"] { color: var(--ink); }
.fs-example-translation summary, .fs-sources summary { min-height: 44px; padding: 10px 0; color: var(--fs-action); }
.fs-example-translation [lang="bn"] { font-size: var(--text-bangla-support); }
.fs-sources { border-top: 1px solid var(--line); padding: 18px 0; color: var(--muted); font-size: .82rem; }
.fs-sources a { color: var(--fs-action); }
.fs-image-missing { font-size: .82rem; color: var(--muted); }
/* Existing native tokens, never mobile-user-agent styling. */
html.android-webview .figure-study { --fs-action: var(--app-palette-primary-strong); }
html.android-webview body.study-page.study-figures-active { background: var(--app-palette-background); background-image: none; }
html.android-webview .study-paths { gap: 8px; margin-bottom: 20px; }
html.android-webview .study-paths a { border-radius: 18px; background: var(--app-palette-paper); padding: 12px; }
html.android-webview .study-paths a[aria-current] { border-color: var(--app-palette-primary); box-shadow: inset 0 -3px var(--app-palette-primary); }
html.android-webview .fs-lesson { padding: 0 18px; background: var(--app-palette-paper); border-radius: 20px; }
html.android-webview .fs-answers .fs-button { font-size: 1rem; }
@media (max-width: 780px) {
  .fs-categories, .fs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .fs-category { align-items: flex-start; flex-direction: column; gap: 5px; min-height: 112px; }
  .fs-lesson-overview { gap: 22px; }
}
@media (max-width: 480px) {
  .study-paths a { padding: 12px; }
  .study-paths strong { font-size: .82rem; }
  .study-paths [lang="bn"] { font-size: .78rem; }
  .fs-grid { gap: 12px; }
  .fs-figure { grid-template-rows: 112px 1fr; padding: 12px; }
  .fs-thumbnail img { height: 112px; }
  .fs-figure-copy strong { font-size: .82rem; }
  .fs-figure-copy [lang="bn"] { font-size: .83rem; }
  .fs-lesson-overview { grid-template-columns: 1fr; gap: 16px; text-align: center; }
  .fs-lesson-media { min-height: 160px; }
  .fs-lesson-media img.study-figure { height: 176px; }
  .fs-breadcrumb [aria-current] { display: none; }
}
@media (prefers-reduced-motion: reduce) { .figure-study *, .study-paths * { scroll-behavior: auto; transition: none; } }
@media (forced-colors: active) {
  .study-paths a[aria-current], .fs-answers .fs-button[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* Android preview refinement: compact reading rows, one quiet page, no web restyling. */
html.android-webview .study-figures-active .study-main { padding-top: 12px; padding-bottom: 32px; }
html.android-webview .study-figures-active .study-paths { margin-bottom: 16px; }
html.android-webview .study-figures-active .study-paths a { min-height: 56px; gap: 2px; padding: 8px 12px; border-radius: 12px; }
html.android-webview .study-figures-active .study-paths strong { font-family: Inter, Arial, sans-serif; }
html.android-webview .figure-study { --fs-divider: var(--app-palette-divider, #D8D8DC); line-height: 1.5; }
html.android-webview .figure-study :is(h2,h3,h4,p) { hyphens: none; -webkit-hyphens: none; word-break: normal; }
html.android-webview .figure-study h2 { font-size: 1.35rem; line-height: 1.3; margin-bottom: 6px; }
html.android-webview .figure-study h3 { font-size: 1rem; margin-bottom: 8px; }
html.android-webview .fs-introduction { margin: 8px 0 16px; }
html.android-webview .fs-introduction > [lang="bn"] { font-family: var(--font-bangla); font-size: 1rem; margin-bottom: 6px; }
html.android-webview .fs-introduction .fs-muted { font-size: .82rem; margin-bottom: 0; }
html.android-webview .fs-search { max-width: none; margin: 0 0 10px; border-radius: 12px; }
html.android-webview #fs-count:empty { display: none; }
html.android-webview #fs-count { font-size: .78rem; margin: 10px 0; }
html.android-webview .fs-categories { grid-template-columns: 1fr; gap: 0; margin: 0; padding: 0 14px; background: var(--app-palette-paper); border-radius: 14px; }
html.android-webview .fs-category { min-height: 76px; flex-direction: row; align-items: center; gap: 12px; padding: 12px 0; border-bottom-color: var(--fs-divider); }
html.android-webview .fs-category:last-child { border-bottom: 0; }
html.android-webview .fs-category strong { font-size: .94rem; }
html.android-webview .fs-category [lang="bn"] { font-size: .88rem; margin-top: 3px; }
html.android-webview .fs-category-end { flex: none; display: flex; gap: 12px; align-items: center; }
html.android-webview .fs-category-count { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
html.android-webview .fs-chevron { width: 8px; height: 8px; border: solid var(--fs-action); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); margin-right: 3px; }
html.android-webview .fs-grid { grid-template-columns: 1fr; gap: 10px; margin: 8px 0 16px; }
html.android-webview .fs-figure { grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: auto; align-items: center; gap: 14px; padding: 12px; border-color: var(--fs-divider); border-radius: 14px; }
html.android-webview .fs-thumbnail img { height: 84px; width: 88px; }
html.android-webview .fs-figure-copy strong { font-size: .93rem; line-height: 1.4; }
html.android-webview .fs-figure-copy [lang="bn"] { font-size: .92rem; line-height: 1.5; margin-top: 5px; }
@media (hover: none) {
  html.android-webview :is(.fs-figure, .fs-category):hover strong { color: var(--ink); text-decoration: none; }
}
html.android-webview .fs-breadcrumb { gap: 0 14px; padding-bottom: 4px; font-size: .8rem; }
html.android-webview .fs-breadcrumb a { text-decoration: none; }
html.android-webview .fs-breadcrumb [aria-current] { display: none; }
html.android-webview .fs-lesson { padding: 0 16px; border-radius: 16px; }
html.android-webview .fs-lesson-overview { grid-template-columns: 1fr; gap: 12px; padding: 20px 0; text-align: left; }
html.android-webview .fs-lesson-media { min-height: 0; }
html.android-webview .fs-lesson-media img.study-figure { height: 148px; max-width: 250px; }
html.android-webview .fs-lesson-names .fs-kicker { margin-bottom: 4px; font-size: .75rem; }
html.android-webview .fs-lesson-names .fs-bangla-title { font-size: 1.35rem; line-height: 1.6; margin-bottom: 0; }
html.android-webview :is(.fs-meaning,.fs-illustrated,.fs-practice,.fs-sources) { border-top: 1px solid var(--fs-divider); padding: 16px 0; min-height: 0; }
html.android-webview .fs-meaning { font-size: .93rem; }
html.android-webview .fs-meaning [lang="bn"] { color: var(--muted); margin-bottom: 0; }
html.android-webview .fs-illustrated { padding: 0; }
html.android-webview .fs-illustrated > summary { min-height: 48px; padding: 13px 0; color: var(--fs-action); font-size: .9rem; font-weight: 600; }
html.android-webview .fs-explanation { border: 0; padding: 0 0 16px; min-height: 0; }
html.android-webview .fs-explanation-image { margin-top: 0; min-height: 0; }
html.android-webview .fs-caption { color: var(--muted); font-size: .76rem; margin: 10px 0 0; }
html.android-webview .fs-practice > [lang="bn"] { font-size: .93rem; color: var(--muted); }
html.android-webview .fs-practice > .fs-button { width: 100%; }
html.android-webview .fs-example { padding: 16px 0; border-color: var(--fs-divider); }
html.android-webview .fs-example h4 { margin-bottom: 8px; }
html.android-webview .fs-question { font-size: 1rem; }
html.android-webview .fs-answers .fs-button { flex: 1; }
html.android-webview .fs-feedback:empty { display: none; }
html.android-webview .fs-sources { padding: 0; font-size: .76rem; }
html.android-webview .fs-sources > summary { font-size: .78rem; color: var(--muted); }
html.android-webview .fs-sources > a { display: block; padding: 8px 0; }
@media (min-width: 640px) {
  html.android-webview .fs-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  html.android-webview .fs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.android-webview .fs-lesson-overview { grid-template-columns: minmax(160px, .7fr) minmax(0, 1fr); gap: 24px; }
}
