:root {
  --paper: #fcfbf8;
  --surface: #ffffff;
  --sidebar: #f5f4ef;
  --ink: #292c27;
  --body-ink: #464942;
  --muted: #6c7166;
  --border: #e7e6de;
  --accent: #aa4328;
  --accent-hover: #973b22;
  --accent-soft: #f5e8e0;
  --code-inline: #eeede6;
  --success: #647c55;
  --reader-size: 18px;
  --header-height: 78px;
  --sidebar-width: 258px;
  --sans: 'DM Sans', 'Noto Sans Bengali', sans-serif;
  --serif: 'Lora', 'Noto Serif Bengali', serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --paper: #1b211e;
  --surface: #222a25;
  --sidebar: #171d1a;
  --ink: #eceee5;
  --body-ink: #c5cbbf;
  --muted: #94a08f;
  --border: #333b33;
  --accent: #ed9b77;
  --accent-hover: #ffb28e;
  --accent-soft: #3a2c24;
  --code-inline: #30382f;
  --success: #a0bc87;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
a { color: inherit; text-decoration: none; }
button { border: 0; }
svg { display: block; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-icon] svg { width: 20px; height: 20px; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 100; padding: 12px 18px; border-radius: 6px; background: var(--accent); color: var(--paper); }
.skip-link:focus { top: 14px; }
.small-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.icon-button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: transparent; color: var(--muted); transition: background .15s, color .15s; }
.icon-button:hover { color: var(--ink); background: var(--code-inline); }
.text-button { padding: 0; display: inline-flex; align-items: center; gap: 6px; background: none; color: var(--muted); font-size: inherit; }
.text-button:hover { color: var(--accent); }
code, kbd { font-family: var(--mono); }
kbd { padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--paper); font-size: 11px; line-height: 1.5; }

.topbar { position: sticky; top: 0; z-index: 30; height: var(--header-height); background: var(--paper); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1600px; height: 100%; margin: auto; padding: 0 28px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; width: 232px; }
.brand-mark { width: 42px; height: 42px; color: var(--ink); }
.brand-mark-center { fill: var(--paper); }
.brand-name { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.7px; line-height: 1.25; }
.brand-bangla { font-family: 'Noto Serif Bengali', serif; font-size: 16px; color: var(--accent); margin-left: 4px; letter-spacing: 0; }
.brand-tagline { display: block; color: var(--muted); font-size: 10px; font-weight: 400; margin-top: 5px; letter-spacing: .1px; }
.header-nav { display: flex; height: 100%; align-items: stretch; gap: 28px; white-space: nowrap; }
.header-link { position: relative; display: inline-flex; align-items: center; padding: 2px 0 0; background: none; font-size: 13px; color: var(--muted); }
.header-link:hover, .header-link.active { color: var(--accent); }
.header-link.active::after { position: absolute; content: ''; height: 2px; bottom: -1px; left: 0; right: 0; background: var(--accent); }
.header-actions { display: flex; gap: 9px; align-items: center; margin-left: auto; min-width: 0; }
.search-trigger { height: 35px; padding: 0 10px; width: 185px; display: flex; align-items: center; gap: 9px; background: var(--sidebar); border: 1px solid var(--border); border-radius: 6px; color: var(--muted); text-align: left; }
.search-trigger:hover { border-color: var(--muted); }
.search-trigger [data-icon] svg { width: 15px; height: 15px; }
.search-trigger-label { flex: 1; font-size: 11px; white-space: nowrap; }
.search-trigger kbd { background: var(--paper); padding: 0 5px; }
.header-divider { width: 1px; height: 19px; background: var(--border); margin: 0 6px; }
.type-icon { font-family: var(--serif); font-size: 17px; letter-spacing: -1px; }
.language-badge { margin-left: 5px; display: flex; gap: 7px; align-items: center; font-size: 12px; font-weight: 500; color: var(--accent); white-space: nowrap; }
.language-badge [lang='en'] { color: var(--muted); font-size: 10px; }
.language-badge [data-icon] svg { height: 12px; width: 12px; color: var(--muted); }
.language-separator { color: var(--border); }
.scroll-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); transition: width .1s linear; }
.mobile-menu-button, .sidebar-close { display: none; }

.book-layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); max-width: 1600px; min-height: calc(100dvh - var(--header-height)); margin: 0 auto; }
.sidebar { position: sticky; top: var(--header-height); display: flex; flex-direction: column; height: calc(100dvh - var(--header-height)); background: var(--sidebar); border-right: 1px solid var(--border); padding: 26px 22px 20px; z-index: 20; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; margin: 0 3px 24px; }
.sidebar-heading-icon { color: var(--muted); }
.sidebar-heading-icon svg { width: 15px; height: 15px; }
.sidebar-scroll { overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--border) transparent; padding: 0 3px 22px; flex: 1; }
.book-title { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.45; letter-spacing: -.25px; }
.edition-label { display: flex; gap: 7px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 10px; }
.edition-label .small-dot { color: var(--success); width: 5px; height: 5px; }
.nav-section-label { margin: 32px 0 16px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.nav-section-label > span { font-size: 9px; }
.chapter-group { margin-bottom: 8px; }
.chapter-header { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 0; }
.chapter-header::-webkit-details-marker { display: none; }
.chapter-number { color: var(--muted); font-family: var(--mono); font-size: 11px; align-self: flex-start; padding-top: 2px; }
.chapter-name { font-size: 12px; font-weight: 600; line-height: 1.55; flex: 1; }
.chapter-header > [data-icon] { color: var(--muted); }
.chapter-header > [data-icon] svg { width: 12px; height: 12px; transition: transform .2s; }
.chapter-group[open] .chapter-header > [data-icon] svg { transform: rotate(180deg); }
.chapter-group.is-current .chapter-number { color: var(--accent); }
.lesson-list { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 3px 0 8px 13px; margin-left: 3px; }
.lesson-list::before { content: ''; position: absolute; top: 8px; bottom: 14px; left: 7px; width: 1px; background: var(--border); }
.lesson-link { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 8px 9px; border-radius: 5px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.lesson-link:hover { background: var(--code-inline); color: var(--ink); }
.lesson-link.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.lesson-status { width: 9px; height: 16px; display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; margin-top: 1px; }
.lesson-status .small-dot { width: 4px; height: 4px; background: var(--border); }
.lesson-link.is-active .lesson-status .small-dot { background: var(--accent); width: 5px; height: 5px; }
.lesson-status svg { width: 12px; height: 12px; color: var(--success); }
.lesson-label { display: block; }
.lesson-label small { color: var(--muted); font-size: 9px; margin-right: 6px; font-weight: 400; }
.book-complete { display: flex; align-items: flex-start; gap: 8px; border-top: 1px solid var(--border); margin-top: 18px; padding-top: 15px; color: var(--muted); font-size: 10px; line-height: 1.9; }
.book-complete > [data-icon] { color: var(--success); padding-top: 3px; }
.book-complete svg { width: 14px; height: 14px; }
.sidebar-bottom { flex-shrink: 0; padding: 19px 3px 0; border-top: 1px solid var(--border); }
.progress-heading { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 9px; }
.progress-heading > :last-child { font-family: 'Noto Sans Bengali', sans-serif; color: var(--accent); }
progress { display: block; width: 100%; height: 3px; border: 0; border-radius: 3px; overflow: hidden; background: var(--border); appearance: none; }
progress::-webkit-progress-bar { background: var(--border); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; transition: width .3s; }
progress::-moz-progress-bar { background: var(--accent); }
.progress-caption { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; color: var(--muted); font-size: 9px; }
.progress-caption [data-icon] svg { width: 12px; height: 12px; }
.resume-link { display: flex; gap: 9px; align-items: center; font-size: 10px; color: var(--accent); padding: 15px 0 10px; }
.resume-link [data-icon] svg { width: 14px; height: 14px; }
.resume-link > :last-child { margin-left: auto; }
.sidebar-credit { color: var(--muted); font-size: 8px; padding-top: 8px; }

.reader-shell { min-width: 0; display: grid; grid-template-columns: minmax(0, 800px) 170px; align-items: start; gap: 48px; justify-content: center; padding: 30px 46px 0; }
.reader { min-width: 0; outline: none; scroll-margin-top: calc(var(--header-height) + 24px); }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 38px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: var(--muted); min-width: 0; font-size: 10px; }
.breadcrumbs [data-icon] svg { width: 13px; height: 13px; }
.breadcrumbs > :last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--body-ink); }
.breadcrumb-slash { color: var(--border); }
.breadcrumbs > span { flex-shrink: 0; }
.breadcrumbs > span:last-child { flex-shrink: 1; }
.reader-toolbar-actions { display: flex; gap: 4px; }
.reader-toolbar-actions .icon-button { width: 29px; height: 29px; }
.reader-toolbar-actions [data-icon] svg { width: 15px; height: 15px; }
.bookmark-button[aria-pressed='true'] { color: var(--accent); background: var(--accent-soft); }
.article-header { margin-bottom: 30px; scroll-margin-top: calc(var(--header-height) + 24px); }
.chapter-label { display: flex; gap: 10px; align-items: center; color: var(--accent); font-size: 10px; font-weight: 600; margin-bottom: 17px; }
.chapter-label .chapter-label-number { font-family: var(--mono); letter-spacing: 1.4px; }
.chapter-label-separator { width: 22px; height: 1px; background: var(--accent); opacity: .45; }
.chapter-label-bangla { font-weight: 500; }
.article-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
article h1 { font-family: var(--serif); font-size: clamp(39px, 4.3vw, 58px); line-height: 1.15; letter-spacing: -2px; font-weight: 500; margin: 0; color: var(--ink); overflow-wrap: break-word; }
.article-subtitle { color: var(--body-ink); font-family: 'Noto Serif Bengali', serif; font-size: 19px; margin: 17px 0 0; line-height: 1.8; }
.hero-illustration { width: 125px; height: 112px; flex-shrink: 0; transform: rotate(-5deg); }
.article-meta { display: flex; gap: 11px; align-items: center; margin-top: 23px; color: var(--muted); font-size: 10px; }
.article-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta svg { width: 13px; height: 13px; }
.article-meta .meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: .5; }
.article-meta .meta-translation { color: var(--accent); }
.article-source-link { display: none; align-items: center; gap: 5px; color: var(--accent); font-size: 9px; }
.article-source-link svg { width: 12px; height: 12px; }
.article-header-rule { width: 42px; height: 2px; background: var(--accent); margin-top: 26px; opacity: .8; }
.article-content { font-size: var(--reader-size); color: var(--body-ink); line-height: 1.95; overflow-wrap: anywhere; }
.article-content p { margin: 18px 0; }
.article-content .lead { margin-top: 0; font-size: calc(var(--reader-size) + 1px); line-height: 1.95; }
.article-content a:not(.learning-card):not(.heading-anchor) { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent), transparent 70%); text-underline-offset: 4px; }
.article-content a:hover { text-decoration-color: var(--accent); }
.article-content strong { color: var(--ink); font-weight: 600; }
.article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 { color: var(--ink); font-family: var(--sans); font-weight: 600; line-height: 1.5; scroll-margin-top: calc(var(--header-height) + 24px); }
.article-content h2 { margin: 42px 0 19px; font-size: 24px; letter-spacing: -.4px; }
.article-content h3 { margin: 34px 0 15px; font-size: 20px; letter-spacing: -.2px; }
.article-content h4 { margin: 28px 0 12px; font-size: 18px; }
.article-content h5, .article-content h6 { margin: 24px 0 12px; font-size: 17px; }
.article-content h2:lang(bn) { font-family: var(--sans); }
.article-content ul, .article-content ol { padding-left: 26px; margin: 18px 0; }
.article-content li { margin-bottom: 9px; padding-left: 3px; }
.article-content li::marker { color: var(--accent); }
.article-content :not(pre) > code, .standard-dialog code { font-size: .82em; font-weight: 400; background: var(--code-inline); border-radius: 4px; padding: 2px 5px; color: var(--ink); overflow-wrap: anywhere; }
.heading-anchor { display: inline-flex; vertical-align: middle; padding: 3px; margin-left: 6px; opacity: 0; color: var(--accent); }
.heading-anchor [data-icon] svg { width: 15px; height: 15px; }
h2:hover > .heading-anchor, h3:hover > .heading-anchor, h4:hover > .heading-anchor, h5:hover > .heading-anchor, h6:hover > .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }
.article-content .note { margin: 26px 0; padding: 15px 21px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; font-size: calc(var(--reader-size) - 1px); }
.article-content .note p { margin: 0; }
.article-content .note p + p { margin-top: 12px; }
.article-content [id] { scroll-margin-top: calc(var(--header-height) + 24px); }

.learning-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 23px; }
.learning-card { position: relative; display: flex; flex-direction: column; padding: 20px 18px 17px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); transition: transform .18s, border-color .18s, box-shadow .18s; }
.learning-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 20px #00000006; }
.learning-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.learning-icon { color: var(--accent); width: 32px; height: 32px; background: var(--accent-soft); border-radius: 7px; }
.learning-icon svg { width: 17px; height: 17px; }
.learning-index { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.article-content .learning-card h3 { font-size: 16px; letter-spacing: -.2px; margin: 0 0 8px; }
.article-content .learning-card p { font-size: 12px; margin: 0 0 19px; line-height: 1.9; flex: 1; }
.card-link { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 10px; font-weight: 500; margin-top: auto; }
.card-link [data-icon] svg { width: 13px; height: 13px; }
.reading-aid { margin-top: 36px; }
.section-label { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 9px; }
.article-content .reading-aid h2 { margin-top: 7px; font-size: 20px; }
.article-content .reading-aid > p { font-size: 14px; margin: 12px 0 17px; }
.code-block { max-width: 100%; overflow: hidden; margin: 23px 0; border: 1px solid #303a32; border-radius: 9px; background: #242c26; color: #e0e5d8; line-height: 1.7; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 16px; border-bottom: 1px solid #364033; background: #2a332c; font-size: 10px; color: #a9b7a2; }
.code-filename { display: flex; align-items: center; gap: 7px; font-family: var(--mono); min-width: 0; }
.code-filename > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-filename svg { height: 13px; width: 13px; opacity: .7; }
.code-toolbar-actions { display: flex; gap: 15px; align-items: center; flex-shrink: 0; }
.code-language { font-size: 8px; letter-spacing: 1.1px; color: #a9b7a2; }
.copy-button { display: flex; align-items: center; gap: 5px; background: none; color: #b5bfae; font-size: 9px; padding: 3px 0 3px 5px; }
.copy-button:hover { color: #f1f2e6; }
.copy-button svg { width: 12px; height: 12px; }
.code-block pre { margin: 0; padding: 19px 20px; overflow: auto; font-family: var(--mono); font-size: 13px; line-height: 1.85; tab-size: 4; scrollbar-width: thin; scrollbar-color: #52614d #242c26; }
.code-block pre code { padding: 0; background: none; border-radius: 0; color: inherit; font-family: inherit; font-size: inherit; white-space: pre; overflow-wrap: normal; }
.token-keyword { color: #efa481; }
.token-string { color: #c0d39a; }
.token-comment { color: #8a9b7f; font-style: italic; }
.token-number { color: #d3b5dd; }
.token-macro { color: #e5c68b; }
.token-type { color: #afcdc7; }
.token-prompt { color: #eca37f; }
.token-section { color: #d9c58e; }
.article-content .code-caption { color: var(--muted); font-size: 12px; line-height: 1.8; margin: -11px 0 26px; }
.reading-aid .code-block { margin-bottom: 0; border-radius: 9px 9px 0 0; }
.code-result { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 10px 18px; border: 1px solid #303a32; border-top-color: #3e4938; border-radius: 0 0 9px 9px; background: #202820; color: #c0d39a; font-size: 12px; }
.result-label { display: flex; align-items: center; gap: 5px; color: #9baa90; font-size: 9px; }
.result-label [data-icon] svg { width: 13px; height: 13px; }
.article-content .code-result > code { background: none; color: #c0d39a; padding: 0; font-size: 11px; }
.result-success { display: flex; align-items: center; gap: 6px; color: #8eaa78; font-size: 9px; margin-left: auto; }
.result-success .small-dot { width: 4px; height: 4px; }
.translation-note { display: flex; gap: 15px; margin: 31px 0 34px; padding: 20px 21px; background: var(--sidebar); border: 1px solid var(--border); border-radius: 7px; }
.translation-note-icon { color: var(--accent); align-self: flex-start; padding-top: 4px; }
.translation-note-icon svg { width: 23px; height: 23px; }
.article-content .translation-note h2 { font-size: 14px; line-height: 1.9; margin: 0 0 7px; letter-spacing: 0; }
.article-content .translation-note p { font-size: 12px; line-height: 1.95; margin: 0; color: var(--muted); }
.table-wrapper { overflow-x: auto; margin: 23px 0; border: 1px solid var(--border); border-radius: 7px; }
.article-content table { border-collapse: collapse; font-size: 14px; min-width: 420px; width: 100%; text-align: left; }
.article-content th { background: var(--sidebar); color: var(--ink); font-weight: 600; }
.article-content th, .article-content td { padding: 11px 15px; border-bottom: 1px solid var(--border); }
.article-content tr:last-child td { border-bottom: 0; }
.article-content td code { white-space: nowrap; }
.article-content figure { margin: 25px 0; }
.article-content figure.listing .code-block { margin: 0 0 12px; }
.article-content img { display: block; max-width: 100%; height: auto; margin: 20px auto; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 7px; }
.article-content figcaption { font-size: 12px; color: var(--muted); line-height: 1.9; margin: 10px 0; }
.article-content .filename { display: block; font-family: var(--mono); font-size: 11px; margin-bottom: 8px; color: var(--muted); }
.article-content .footnote-definition { font-size: 13px; padding-top: 15px; margin-top: 25px; border-top: 1px solid var(--border); }
.book-end { justify-content: flex-end; text-align: right; }

.reading-finish { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 22px 0; margin-top: 40px; border-top: 1px solid var(--border); }
.finish-copy { display: flex; align-items: center; gap: 11px; color: var(--muted); }
.finish-copy > [data-icon] svg { width: 22px; height: 22px; }
.finish-copy strong { display: block; font-size: 12px; font-weight: 500; color: var(--body-ink); }
.finish-copy div > span { display: block; font-size: 10px; margin-top: 3px; }
.complete-button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--accent-soft); color: var(--accent); border-radius: 5px; font-size: 10px; white-space: nowrap; }
.complete-button:hover { background: var(--accent); color: var(--paper); }
.complete-button[aria-pressed='true'] { color: var(--success); background: var(--sidebar); border: 1px solid var(--border); }
.complete-button svg { width: 14px; height: 14px; }
.reading-finish.is-complete .finish-copy > [data-icon] { color: var(--success); }
.lesson-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 5px 0 32px; }
.pagination-link { display: flex; gap: 14px; align-items: center; min-height: 92px; border: 1px solid var(--border); padding: 16px 18px; border-radius: 7px; background: var(--surface); }
.pagination-link:hover { border-color: var(--accent); }
.pagination-link > svg { width: 18px; height: 18px; color: var(--muted); }
.pagination-link.next { justify-content: flex-end; text-align: right; }
.pagination-label { display: block; color: var(--muted); font-size: 9px; margin-bottom: 4px; }
.pagination-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.6; color: var(--ink); }
.pagination-link.next .pagination-title, .pagination-link.next > [data-icon] { color: var(--accent); }
.pagination-start { display: flex; align-items: center; gap: 9px; font-size: 10px; color: var(--muted); padding: 16px 0; }
.pagination-start [data-icon] svg { width: 15px; height: 15px; }
.reader-footer { border-top: 1px solid var(--border); padding: 25px 0 28px; color: var(--muted); }
.footer-brand { display: flex; align-items: center; gap: 7px; color: var(--body-ink); font-size: 10px; margin-bottom: 10px; }
.footer-brand .small-dot { color: var(--accent); width: 4px; height: 4px; }
.reader-footer p { max-width: 530px; font-size: 9px; line-height: 1.9; margin: 0 0 12px; }
.reader-footer p > a { color: var(--body-ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-links { display: flex; gap: 10px; align-items: center; font-size: 9px; }
.footer-links a:hover { color: var(--accent); }

.page-aside { position: sticky; top: 116px; padding-top: 10px; }
.toc-title { font-size: 10px; font-weight: 600; margin-bottom: 17px; }
.toc-links { display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.toc-link { position: relative; display: block; padding: 7px 0 7px 14px; color: var(--muted); font-size: 10px; line-height: 1.8; transition: color .15s; }
.toc-link.is-subsection { padding-left: 23px; font-size: 9px; }
.toc-link:hover, .toc-link.is-active { color: var(--accent); }
.toc-link.is-active::before { content: ''; position: absolute; left: -1px; top: 7px; bottom: 7px; width: 2px; background: var(--accent); }
.toc-links.is-long { max-height: 40dvh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.aside-note { margin: 35px 0 23px; padding: 20px 17px; border: 1px solid var(--border); border-radius: 7px; background: var(--sidebar); }
.aside-note-symbol { color: var(--accent); margin-bottom: 12px; }
.aside-note-symbol svg { width: 22px; height: 22px; }
.aside-note strong { display: block; color: var(--body-ink); font-family: 'Noto Serif Bengali', serif; font-size: 16px; font-weight: 500; line-height: 1.9; }
.aside-note p { font-size: 10px; line-height: 1.9; color: var(--muted); margin: 10px 0 16px; }
.aside-note-line { display: block; width: 26px; height: 2px; background: var(--accent); opacity: .6; }
.original-link { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.original-link:hover { color: var(--accent); }
.original-link [data-icon] svg { width: 13px; height: 13px; }
.shortcut-hint { display: flex; align-items: center; gap: 6px; background: none; padding: 0; color: var(--muted); font-size: 8px; margin-top: 18px; }
.shortcut-hint [data-icon] svg { width: 13px; height: 13px; }
.shortcut-hint kbd { margin-left: auto; font-size: 9px; }
.not-found { padding: 50px 0; }
.not-found h1 { font-size: 40px; }
.not-found p { color: var(--muted); margin: 25px 0; }
.not-found a { display: inline-flex; gap: 8px; align-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 12px 18px; }

dialog { border: 1px solid var(--border); color: var(--ink); background: var(--paper); padding: 0; border-radius: 12px; box-shadow: 0 24px 100px #00000030; max-width: calc(100vw - 32px); max-height: calc(100dvh - 60px); }
dialog::backdrop { background: #18201868; backdrop-filter: blur(4px); }
body.dialog-open { overflow: hidden; }
.dialog-close { color: var(--muted); background: none; flex-shrink: 0; }
.dialog-close:hover { color: var(--accent); }
.standard-dialog { width: 540px; padding: 37px; }
.standard-dialog > .dialog-close { position: absolute; right: 15px; top: 15px; }
.dialog-eyebrow { font-size: 9px; letter-spacing: 1px; color: var(--accent); margin: 0 0 12px; }
.standard-dialog h2 { font-family: 'Noto Serif Bengali', serif; font-size: 27px; font-weight: 500; margin: 0 0 13px; line-height: 1.6; }
.standard-dialog p { color: var(--body-ink); font-size: 13px; line-height: 2; }
.dialog-description { font-size: 12px !important; color: var(--muted) !important; margin: 0 0 24px; }
.standard-dialog a { color: var(--accent); }
.standard-dialog p a { text-decoration: underline; text-underline-offset: 3px; }
.contents-dialog { width: 660px; }
.contents-chapter { margin: 23px 0; }
.contents-chapter h3 { display: flex; gap: 12px; align-items: baseline; font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.contents-chapter h3 > span { color: var(--accent); font-family: var(--mono); font-size: 11px; }
.contents-lesson { display: flex; align-items: center; gap: 10px; color: var(--body-ink) !important; padding: 11px 12px; border-top: 1px solid var(--border); font-size: 12px; }
.contents-lesson:hover { background: var(--accent-soft); color: var(--accent) !important; }
.contents-lesson.is-current { color: var(--accent) !important; }
.contents-lesson svg { width: 14px; height: 14px; }
.contents-lesson > :nth-child(2) { flex: 1; }
.contents-lesson small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.contents-lesson .is-completed { color: var(--success); }
.search-dialog { width: 680px; margin-top: min(14vh, 120px); }
.search-input-row { display: flex; align-items: center; gap: 13px; padding: 21px; border-bottom: 1px solid var(--border); }
.search-input-row > [data-icon] { color: var(--accent); }
.search-input-row > [data-icon] svg { width: 21px; height: 21px; }
.search-input-row input { width: 100%; border: 0; background: none; outline: none; color: var(--ink); font-size: 16px; padding: 0; min-width: 0; }
.search-input-row input::placeholder { color: var(--muted); font-size: 14px; }
.search-input-row input::-webkit-search-cancel-button { cursor: pointer; }
.search-filter-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 19px; }
.search-filters { display: flex; gap: 7px; }
.search-filter { display: flex; align-items: center; gap: 5px; border-radius: 4px; padding: 5px 10px; background: none; color: var(--muted); font-size: 10px; }
.search-filter [data-icon] svg { width: 12px; height: 12px; }
.search-filter.active { background: var(--accent-soft); color: var(--accent); }
#search-result-count { font-size: 10px; color: var(--muted); white-space: nowrap; }
.search-results { max-height: min(52vh, 450px); overflow-y: auto; padding: 0 10px 12px; }
.search-result { display: block; padding: 13px; border-radius: 6px; margin-bottom: 3px; border: 1px solid transparent; }
.search-result:hover, .search-result.is-selected { background: var(--sidebar); border-color: var(--border); }
.search-result-meta { display: flex; gap: 8px; align-items: center; font-size: 9px; color: var(--muted); margin-bottom: 4px; }
.search-result h3 { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 5px; }
.search-result p { font-size: 11px; line-height: 1.9; color: var(--muted); margin: 0; }
mark { background: var(--accent-soft); color: var(--accent); border-radius: 2px; padding: 0 2px; }
.search-empty { padding: 40px 20px 45px; text-align: center; color: var(--muted); }
.search-empty > span { display: inline-flex; justify-content: center; align-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 13px; color: var(--accent); }
.search-empty h3 { color: var(--body-ink); font-size: 15px; font-weight: 500; margin: 0 0 8px; }
.search-empty p { font-size: 11px; line-height: 1.9; margin: 0; }
.search-footer { display: flex; gap: 17px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.search-footer > span { display: inline-flex; align-items: center; gap: 4px; }
.search-footer .search-scope { margin-left: auto; font-size: 8px; }
.setting-label { font-size: 12px; margin: 26px 0 10px; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.theme-options button { display: flex; flex-direction: column; gap: 9px; align-items: center; justify-content: center; padding: 17px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: 11px; }
.theme-options button[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.theme-options [data-icon] svg { width: 23px; height: 23px; }
.font-size-setting { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 12px; font-size: 12px; }
.font-size-setting output { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.font-controls { display: flex; gap: 14px; align-items: center; }
.font-controls .icon-button { border: 1px solid var(--border); }
.font-controls input { width: 100%; accent-color: var(--accent); min-width: 0; }
.font-preview { font-size: var(--reader-size); line-height: 2; padding: 20px; background: var(--sidebar); border: 1px solid var(--border); border-radius: 7px; margin-top: 23px; }
.font-preview code { display: block; margin-top: 6px; background: none; padding: 0; font-size: 13px; }
.reset-preferences { margin-top: 20px; font-size: 11px; }
.reset-preferences [data-icon] svg { width: 13px; height: 13px; }
.about-dialog { width: 640px; }
.about-principle { display: flex; gap: 14px; padding: 18px; background: var(--sidebar); border: 1px solid var(--border); border-radius: 7px; margin: 20px 0; }
.about-principle > [data-icon] { color: var(--accent); align-self: flex-start; margin-top: 3px; }
.about-principle strong { font-size: 13px; font-weight: 600; }
.about-principle p { font-size: 12px; margin: 6px 0 0; }
.about-links { display: flex; gap: 22px; padding-top: 15px; border-top: 1px solid var(--border); margin-top: 20px; }
.about-links a { display: inline-flex; gap: 7px; align-items: center; font-size: 11px; }
.about-links [data-icon] svg { width: 15px; height: 15px; }
.shortcut-list { margin: 18px 0 26px; }
.shortcut-list > div { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.shortcut-list dd { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--muted); font-size: 10px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: 9px; padding: 12px 18px; max-width: calc(100vw - 30px); color: var(--paper); background: var(--ink); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 25px #00000012; font-size: 12px; animation: toast-in .2s ease-out; white-space: nowrap; }
.toast [data-icon] svg { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; margin-bottom: -6px; } to { opacity: 1; margin-bottom: 0; } }

@media (min-width: 1601px) {
  .book-layout { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .reader-shell { padding-left: 64px; padding-right: 64px; gap: 64px; }
}
@media (max-width: 1230px) {
  .topbar-inner { gap: 22px; padding: 0 22px; }
  .brand { width: 220px; }
  .header-nav { gap: 21px; }
  .search-trigger { width: 145px; }
  .reader-shell { padding-left: 37px; padding-right: 32px; gap: 30px; grid-template-columns: minmax(0, 1fr) 150px; }
  .hero-illustration { width: 95px; height: 95px; }
  .learning-card { padding: 17px 14px 15px; }
  .article-content .learning-card h3 { font-size: 14px; }
  .article-content .learning-card p { font-size: 11px; }
}
@media (max-width: 1120px) {
  .header-nav { display: none; }
  .search-trigger { width: 190px; }
  .page-aside { display: none; }
  .article-source-link { display: inline-flex; margin-left: auto; }
  .reader-shell { grid-template-columns: minmax(0, 800px); padding: 30px 45px 0; }
  .hero-illustration { width: 125px; height: 112px; }
}
@media (max-width: 900px) {
  :root { --header-height: 70px; }
  .topbar-inner { gap: 16px; padding: 0 20px; }
  .brand { width: auto; }
  .brand-mark { width: 37px; height: 37px; }
  .brand-name { font-size: 20px; }
  .mobile-menu-button { display: inline-flex; }
  .book-layout { display: block; }
  .sidebar { position: fixed; top: var(--header-height); left: 0; width: 282px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 8px 0 35px #00000010; z-index: 40; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-heading { margin-bottom: 20px; }
  .sidebar-close { display: inline-flex; width: 25px; height: 25px; }
  .sidebar-heading-icon { display: none; }
  .sidebar-backdrop { display: block; position: fixed; top: var(--header-height); left: 0; width: 100%; height: calc(100dvh - var(--header-height)); background: #18201860; z-index: 35; }
  body.sidebar-open { overflow: hidden; }
  .reader-shell { max-width: 860px; margin: 0 auto; padding: 28px 40px 0; }
  .reader-toolbar { margin-bottom: 34px; }
  .breadcrumbs { font-size: 11px; }
  article h1 { font-size: 55px; }
  .article-content .learning-card h3 { font-size: 16px; }
  .article-content .learning-card p { font-size: 12px; }
  .learning-card { padding: 20px 17px 17px; }
}
@media (max-width: 680px) {
  .topbar-inner { padding: 0 17px; gap: 10px; }
  .brand { gap: 9px; }
  .brand-name { font-size: 19px; }
  .brand-bangla { font-size: 14px; margin-left: 3px; }
  .brand-tagline { font-size: 9px; }
  .header-actions { gap: 3px; }
  .search-trigger { width: 33px; height: 33px; border: 0; background: none; padding: 0; justify-content: center; }
  .search-trigger [data-icon] svg { width: 19px; height: 19px; }
  .search-trigger-label, .search-trigger kbd, .header-divider, .language-badge { display: none; }
  .reader-shell { padding: 24px 26px 0; }
  .reader-toolbar { margin-bottom: 28px; }
  .breadcrumbs { gap: 7px; font-size: 9px; }
  .breadcrumbs > [data-icon] { display: none; }
  article h1 { font-size: 47px; letter-spacing: -1.7px; }
  .hero-illustration { width: 100px; height: 95px; }
  .article-subtitle { font-size: 17px; }
  .article-meta { flex-wrap: wrap; font-size: 9px; gap: 8px; }
  .article-content { line-height: 1.9; }
  .article-content h2 { font-size: 22px; margin-top: 35px; }
  .learning-cards { gap: 9px; }
  .learning-card { padding: 16px 12px; }
  .article-content .learning-card h3 { font-size: 14px; }
  .article-content .learning-card p { font-size: 11px; }
  .reading-finish { gap: 9px; }
  .finish-copy > [data-icon] { display: none; }
  .finish-copy strong { font-size: 11px; }
  .finish-copy div > span { font-size: 9px; }
  .complete-button { font-size: 9px; padding: 9px; }
  .pagination-link { padding: 14px; gap: 8px; min-height: 88px; }
  .pagination-title { font-size: 12px; }
  .pagination-start { font-size: 9px; }
  .standard-dialog { padding: 30px 25px; }
  .search-dialog { margin-top: 60px; }
  .search-footer { gap: 12px; }
  .search-footer .search-scope { display: none; }
}
@media (max-width: 480px) {
  :root { --header-height: 66px; }
  .topbar-inner { padding: 0 12px; gap: 6px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 17px; }
  .brand-bangla { font-size: 13px; }
  .brand-tagline { font-size: 8px; margin-top: 4px; }
  .topbar .icon-button { width: 30px; height: 32px; }
  .topbar .icon-button [data-icon] svg { width: 18px; height: 18px; }
  .header-actions { gap: 1px; }
  .reader-shell { padding: 20px 20px 0; }
  .reader-toolbar { margin-bottom: 25px; }
  .reader-toolbar-actions .icon-button { width: 25px; height: 25px; }
  .breadcrumbs { gap: 5px; font-size: 8px; }
  article h1 { font-size: 42px; }
  .hero-illustration { display: none; }
  .article-subtitle { font-size: 16px; }
  .article-header { margin-bottom: 25px; }
  .article-content .lead { font-size: var(--reader-size); }
  .article-content h2 { font-size: 21px; }
  .article-content h3 { font-size: 19px; }
  .learning-cards { grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
  .learning-card { padding: 17px; display: grid; grid-template-columns: 37px minmax(0, 1fr) 18px; column-gap: 13px; }
  .learning-card-top { display: contents; }
  .learning-icon { grid-column: 1; grid-row: 1 / span 2; margin-top: 2px; width: 35px; height: 35px; }
  .learning-index { grid-column: 3; grid-row: 1; text-align: right; }
  .article-content .learning-card h3 { grid-column: 2; grid-row: 1; font-size: 16px; margin-bottom: 4px; }
  .article-content .learning-card p { grid-column: 2 / span 2; grid-row: 2; font-size: 12px; margin-bottom: 10px; }
  .card-link { grid-column: 2 / span 2; grid-row: 3; font-size: 10px; }
  .article-content .reading-aid h2 { font-size: 19px; }
  .code-toolbar { padding: 8px 12px; }
  .code-toolbar-actions { gap: 10px; }
  .code-block pre { padding: 17px 15px; font-size: 12px; }
  .code-result { gap: 12px; padding: 10px 14px; }
  .result-success { display: none; }
  .translation-note { padding: 17px; gap: 11px; }
  .translation-note-icon svg { width: 18px; height: 18px; }
  .article-content .translation-note h2 { font-size: 13px; }
  .article-content .translation-note p { font-size: 11px; }
  .reading-finish { align-items: flex-start; flex-direction: column; padding: 20px 0; margin-top: 28px; gap: 13px; }
  .complete-button { font-size: 10px; }
  .finish-copy strong { font-size: 12px; }
  .pagination-start { align-items: flex-start; line-height: 1.9; }
  .pagination-link { padding: 12px; gap: 7px; }
  .pagination-title { font-size: 11px; }
  .pagination-link > svg { width: 14px; height: 14px; }
  .pagination-label { font-size: 8px; }
  .reader-footer p { font-size: 9px; }
  .standard-dialog { padding: 32px 22px 25px; }
  .standard-dialog h2 { font-size: 24px; }
  .standard-dialog p { font-size: 12px; }
  .search-input-row { padding: 17px 14px; gap: 9px; }
  .search-input-row input { font-size: 16px; }
  .search-input-row input::placeholder { font-size: 11px; }
  .search-input-row > [data-icon] svg { width: 17px; height: 17px; }
  .search-filter-row { padding: 12px; gap: 5px; }
  .search-filter { padding: 5px 7px; font-size: 9px; }
  #search-result-count { font-size: 9px; }
  .search-result h3 { font-size: 13px; }
  .search-result p { font-size: 10px; }
  .search-results { max-height: 54dvh; }
  .about-links { gap: 17px; }
  .about-links a { font-size: 10px; }
  .about-principle { padding: 15px; gap: 11px; }
  .shortcut-list > div { font-size: 11px; }
}
@media (max-width: 359px) {
  .brand-mark { display: none; }
  .reader-shell { padding-left: 16px; padding-right: 16px; }
  article h1 { font-size: 37px; }
  .article-meta .meta-translation { display: none; }
  .article-meta .meta-dot:last-of-type { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .learning-card:hover { transform: none; }
}
@media print {
  :root, :root[data-theme='dark'] { --paper: #fff; --ink: #111; --body-ink: #222; --muted: #555; --border: #ddd; --accent: #111; --code-inline: #f1f1f1; --accent-soft: #f5f5f5; --sidebar: #f7f7f7; --reader-size: 12pt; color-scheme: light; }
  body { background: #fff; overflow: visible !important; }
  .topbar, .sidebar, .page-aside, .reader-toolbar, .reading-finish, .lesson-pagination, .reader-footer, .toast, .skip-link, .heading-anchor, .code-toolbar, dialog { display: none !important; }
  .book-layout, .reader-shell { display: block; border: 0; margin: 0; padding: 0; max-width: none; }
  article h1 { font-size: 32pt; }
  .article-content h2, .article-content h3 { break-after: avoid; }
  .code-block, .code-block pre, .code-result { background: #f6f6f6; color: #111; border-color: #ddd; }
  .code-block pre { white-space: pre-wrap; font-size: 9pt; }
  .code-block pre code { white-space: pre-wrap; }
  .code-block { break-inside: avoid; }
  .code-block [class^='token-'], .article-content .code-result > code, .result-label { color: #222; }
  .learning-card { background: #fff; }
  .article-content a:not(.learning-card) { text-decoration: none; }
}
