@font-face {
  font-family: 'Noto Sans Myanmar Local';
  src: url('assets/fonts/NotoSansMyanmar-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy-950: #071b2f;
  --navy-900: #102c4c;
  --navy-800: #173c63;
  --navy-100: #e7eef5;
  --gold-500: #c79a42;
  --gold-100: #f5ead3;
  --red-600: #b52a2f;
  --ink: #17202a;
  --muted: #5a6572;
  --paper: #fff;
  --canvas: #f3f5f7;
  --line: #d7dde3;
  --header-height: 112px;
  font-family: 'Noto Sans Myanmar Local', 'Segoe UI', Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--canvas); scroll-behavior: auto; }
html.motion-ok { scroll-behavior: smooth; }
body { margin: 0; min-width: 0; color: var(--ink); background: var(--canvas); overflow-x: clip; }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid #2b7fc3; outline-offset: 3px; }

.skip-link { position: fixed; z-index: 100; top: .5rem; left: .5rem; transform: translateY(-200%); background: #fff; color: var(--navy-900); padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 104px; padding: 1.15rem clamp(1rem, 3vw, 2.5rem); color: #fff; background: var(--navy-900); box-shadow: 0 4px 18px rgb(7 27 47 / 18%); }
.brand-block { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.brand-mark { display: grid; flex: 0 0 3rem; place-items: center; width: 3rem; height: 3rem; color: var(--navy-950); background: var(--gold-500); border-radius: 50%; font-weight: 850; letter-spacing: -.05em; }
.eyebrow { margin: 0 0 .25rem; color: var(--gold-500); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.site-header h1 { max-width: 880px; margin: 0; font-size: clamp(1rem, 2vw, 1.65rem); line-height: 1.24; }
.language-control { display: flex; flex: 0 0 auto; padding: .25rem; border: 1px solid rgb(255 255 255 / 35%); border-radius: 999px; background: rgb(255 255 255 / 8%); }
.language-control button { min-height: 2.6rem; padding: .5rem .85rem; border: 0; border-radius: 999px; color: #fff; background: transparent; }
.language-control button.is-active { color: var(--navy-950); background: var(--gold-500); font-weight: 800; }

.app-layout { display: grid; grid-template-columns: minmax(240px, 290px) minmax(0, 1fr); min-height: calc(100vh - var(--header-height)); }
.lesson-rail { position: sticky; top: var(--header-height); align-self: start; height: calc(100vh - var(--header-height)); overflow-y: auto; color: #fff; background: var(--navy-950); }
.rail-intro { padding: 1.35rem 1.2rem 1rem; color: #d8e2eb; border-bottom: 1px solid rgb(255 255 255 / 10%); }
.rail-intro p:last-child { margin: .35rem 0 0; font-size: .9rem; line-height: 1.55; }
.lesson-navigation { display: flex; flex-direction: column; gap: .15rem; padding: .75rem; }
.lesson-link { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); align-items: center; gap: .55rem; width: 100%; min-height: 3.25rem; padding: .65rem .7rem; border: 1px solid transparent; border-radius: .65rem; color: #dce7f0; background: transparent; text-align: left; }
.lesson-link:hover { background: rgb(255 255 255 / 8%); }
.lesson-link.is-active { color: #fff; border-color: rgb(199 154 66 / 60%); background: var(--navy-800); }
.lesson-order { color: var(--gold-500); font-size: .78rem; font-weight: 850; letter-spacing: .08em; }
.practice-rail-wrap { padding: .75rem; border-top: 1px solid rgb(255 255 255 / 20%); }
.practice-rail-link { display: block; color: #ffe3a4; font-weight: 750; }
.practice-main { min-width: 0; width: 100%; max-width: 1220px; margin: 0 auto; padding: clamp(1rem, 3vw, 2.5rem); }
[hidden] { display: none !important; }
.practice-main > h2 { max-width: 22ch; margin: .4rem 0; color: var(--navy-900); font-size: clamp(1.7rem, 3.3vw, 3rem); line-height: 1.15; }
.practice-main > button { min-height: 2.75rem; margin: .4rem 0 1rem; padding: .55rem .9rem; border: 1px solid var(--navy-800); border-radius: .55rem; color: var(--navy-900); background: #fff; font-weight: 700; }
.practice-shell { min-width: 0; }
.practice-intro { max-width: 72ch; margin: .4rem 0 1.2rem; }
.practice-lead { color: var(--muted); line-height: 1.65; }
.practice-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: practice-step; }
.practice-steps li { min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: .7rem; color: var(--muted); background: #fff; font-size: .9rem; }
.practice-steps li::before { counter-increment: practice-step; content: counter(practice-step) '. '; font-weight: 800; }
.practice-steps .is-current { color: var(--navy-900); border-color: var(--gold-500); background: var(--gold-100); font-weight: 750; }
.practice-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, .85fr); gap: 1rem; align-items: start; }
.practice-primary-column, .practice-side { display: grid; min-width: 0; gap: 1rem; }
.practice-card { min-width: 0; padding: clamp(1rem, 2vw, 1.5rem); border: 1px solid var(--line); border-radius: 1rem; background: #fff; box-shadow: 0 8px 28px rgb(20 40 60 / 6%); }
.practice-card h3 { margin: .2rem 0 .7rem; color: var(--navy-900); font-size: clamp(1.15rem, 2vw, 1.55rem); }
.practice-card h4 { color: var(--navy-900); }
.practice-card p { line-height: 1.6; }
.practice-field { display: grid; gap: .45rem; margin: 1rem 0; }
.practice-field label { color: var(--navy-900); font-weight: 750; }
.practice-field textarea { width: 100%; min-height: 7rem; padding: .8rem; resize: vertical; border: 1px solid #aebbc8; border-radius: .6rem; color: var(--ink); background: #fff; line-height: 1.5; }
.practice-primary, .practice-secondary { min-height: 2.9rem; padding: .65rem 1rem; border: 1px solid var(--navy-900); border-radius: .6rem; font-weight: 750; }
.practice-primary { color: #fff; background: var(--navy-900); }
.practice-secondary { color: var(--navy-900); background: #fff; }
.practice-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.practice-boundary { padding: .8rem 1rem; border-left: .25rem solid var(--gold-500); border-radius: .4rem; background: var(--gold-100); }
.practice-links { display: flex; flex-direction: column; gap: .55rem; margin: 1rem 0; }
.practice-links a { overflow-wrap: anywhere; color: var(--navy-800); font-weight: 750; }
.practice-error { padding: .8rem 1rem; border: 1px solid var(--red-600); border-radius: .65rem; color: #74151a; background: #fff1f1; }
.practice-success { padding: .8rem 1rem; border-radius: .65rem; color: #17553b; background: #e8f6ee; }
.practice-history-item { padding: .8rem 0; border-top: 1px solid var(--line); }
.practice-history-item strong { overflow-wrap: anywhere; }
.practice-history-item pre { max-height: 9rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .88rem; }
.practice-identity p { overflow-wrap: anywhere; }

main { min-width: 0; width: 100%; max-width: 1220px; margin: 0 auto; padding: clamp(1rem, 3vw, 2.5rem); }
.lesson-heading { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(220px, .75fr); gap: 1rem; align-items: stretch; margin-bottom: 1rem; }
.lesson-heading > div:first-child, .lesson-aim, .focus-bar, .source-section, .teaching-drawer { border: 1px solid var(--line); border-radius: 1rem; background: #fff; box-shadow: 0 8px 28px rgb(20 40 60 / 6%); }
.lesson-heading > div:first-child { padding: clamp(1.1rem, 2vw, 1.6rem); }
.lesson-position { margin: 0 0 .5rem; color: var(--red-600); font-size: .8rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.lesson-heading h2 { margin: 0; color: var(--navy-900); font-size: clamp(1.7rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -.035em; }
.lesson-summary { max-width: 70ch; margin: .75rem 0 0; color: var(--muted); line-height: 1.65; }
.lesson-aim { padding: 1.2rem; border-top: .3rem solid var(--gold-500); }
.lesson-aim span { color: var(--navy-800); font-size: .75rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.lesson-aim p { margin: .7rem 0 0; line-height: 1.55; }

.focus-bar, .source-section, .teaching-drawer { margin-top: 1rem; padding: clamp(1rem, 2vw, 1.35rem); }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading-row h3, .teaching-drawer h3 { margin: 0; color: var(--navy-900); font-size: clamp(1.1rem, 2vw, 1.5rem); }
.section-heading-row > p { max-width: 52ch; margin: 0; color: var(--muted); font-size: .9rem; }
.focus-chips { display: flex; gap: .55rem; overflow-x: auto; padding: .2rem .2rem .65rem; scrollbar-color: var(--gold-500) var(--navy-100); }
.focus-chip { flex: 0 0 auto; min-height: 2.65rem; max-width: min(290px, 78vw); padding: .55rem .85rem; border: 1px solid #bcc7d1; border-radius: 999px; color: var(--navy-800); background: #fff; white-space: normal; }
.focus-chip.is-active { color: #fff; border-color: var(--navy-900); background: var(--navy-900); }

.source-section { padding: 0; overflow: hidden; }
.source-section > .section-heading-row { padding: 1.1rem 1.25rem 0; }
.source-reference { overflow-wrap: anywhere; text-align: right; }
.source-content { min-width: 0; padding: clamp(.65rem, 2vw, 1.5rem); background: #e8edf1; }
.document-stage { position: relative; width: min(100%, 950px); margin: 0 auto; background: var(--paper); box-shadow: 0 10px 30px rgb(8 25 40 / 16%); }
.document-stage img { display: block; width: 100%; height: auto; aspect-ratio: 1323 / 1871; object-fit: contain; }
.document-hotspots, .teaching-annotation { position: absolute; inset: 0; }
.document-hotspots { z-index: 2; }
.document-hotspot { position: absolute; min-width: 12px; min-height: 12px; padding: 0; border: 1px solid transparent; border-radius: .25rem; background: transparent; }
.document-hotspot:focus-visible { outline: 3px solid #2b7fc3; outline-offset: 1px; background: rgb(43 127 195 / 10%); }
.teaching-annotation { z-index: 3; pointer-events: none; }
.arrow-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.arrow-line line { stroke: var(--red-600); stroke-width: 3; stroke-linecap: round; }
.focus-marker { position: absolute; display: grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 .35rem; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--red-600); box-shadow: 0 2px 8px rgb(0 0 0 / 35%); font-size: .72rem; font-weight: 900; }
.arrow-head { position: absolute; width: 13px; height: 13px; transform: translate(-50%, -50%) rotate(var(--arrow-angle)); background: var(--red-600); clip-path: polygon(100% 50%, 0 0, 0 100%); filter: drop-shadow(0 1px 1px rgb(0 0 0 / 25%)); }
.margin-bracket { position: absolute; inset: 5% 7%; border-top: 3px solid var(--red-600); border-left: 3px solid var(--red-600); border-radius: .2rem 0 0; }
.image-error { position: absolute; z-index: 5; inset: 0; display: grid; place-content: center; justify-items: center; gap: .75rem; padding: 2rem; color: var(--navy-900); background: #fff; text-align: center; }
.document-stage.has-image-error { aspect-ratio: 1323 / 1871; }
.image-error button, .action-button, .zoom-toolbar button, .zoom-header button { min-height: 2.7rem; padding: .55rem .85rem; border: 0; border-radius: .55rem; color: #fff; background: var(--navy-900); font-weight: 750; }
.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; }
.library-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: .75rem; }
.library-item { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .75rem; align-items: center; min-height: 4.2rem; padding: .8rem; border: 1px solid #c5ced7; border-radius: .75rem; color: var(--navy-900); background: #fff; text-align: left; }
.library-item span { color: var(--red-600); font-size: .8rem; font-weight: 850; }
.library-item.is-active { color: #fff; border-color: var(--navy-900); background: var(--navy-900); }
.library-item.is-active span { color: var(--gold-500); }

.teaching-drawer { display: grid; grid-template-columns: minmax(200px, .7fr) minmax(0, 1.3fr); gap: 1.5rem; border-left: .35rem solid var(--red-600); }
.drawer-meta { margin: .55rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.drawer-copy { min-width: 0; padding: 1rem; border-radius: .75rem; background: var(--gold-100); }
.drawer-label { margin: 0 0 .5rem; color: var(--navy-800); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.drawer-copy > p:not(.drawer-label):not(.drawer-status) { margin: 0; line-height: 1.65; }
.drawer-status { margin: .75rem 0 0; color: var(--muted); font-size: .8rem; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.drawer-details { display: grid; gap: .8rem; margin-top: 1rem; }
.connection-block, .citation-form-card { padding: .9rem; border: 1px solid #d7c68e; border-radius: .7rem; background: #fffdf6; }
.connection-block h4, .citation-form-card h4 { margin: 0 0 .55rem; color: var(--navy-800); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; }
.compact-connection { padding: 0; border: 0; background: transparent; }
.connection-link { min-height: 2.75rem; padding: .6rem .8rem; border: 1px solid var(--navy-700); border-radius: .55rem; color: var(--navy-900); background: #fff; font-weight: 750; text-align: left; }
.connection-link:hover { color: #fff; background: var(--navy-800); }
.citation-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.library-source-reference { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 700; }
.citation-form { margin: 0; overflow-wrap: anywhere; color: #181818; font-family: "Times New Roman", Times, serif; font-size: 1rem; line-height: 1.55; }
.bibliography-form { padding-left: 1.25rem; text-indent: -1.25rem; }
.note-editor-wrap { display: grid; gap: .55rem; margin-top: .75rem; }
.note-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; }
.editor-button { min-height: 2.5rem; padding: .5rem .72rem; border: 1px solid var(--navy-700); border-radius: .5rem; color: var(--navy-900); background: #fff; font-weight: 750; }
.note-editor { width: 100%; min-height: 10rem; resize: vertical; padding: .75rem; border: 2px solid var(--navy-700); border-radius: .6rem; color: var(--ink); background: #fff; font: inherit; line-height: 1.55; }
.drawer-copy mark { padding: .05em .16em; color: inherit; background: #ffe17a; }
.step-navigation { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 0 0; }
.step-navigation button { min-width: 9rem; min-height: 3rem; padding: .65rem 1rem; border: 0; border-radius: .65rem; color: #fff; background: var(--navy-900); font-weight: 750; }

dialog { width: min(96vw, 1200px); height: min(92vh, 1000px); max-height: 92vh; padding: 0; border: 0; border-radius: 1rem; overflow: hidden; color: var(--ink); background: var(--canvas); }
dialog[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
dialog::backdrop { background: rgb(7 27 47 / 76%); }
.zoom-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; color: #fff; background: var(--navy-900); }
.zoom-header h2 { margin: 0; font-size: clamp(1rem, 2vw, 1.3rem); line-height: 1.35; }
.zoom-header button { flex: 0 0 auto; color: var(--navy-950); background: var(--gold-500); }
.zoom-toolbar { display: flex; flex-wrap: wrap; gap: .55rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: #fff; }
.zoom-toolbar button { min-height: 2.35rem; color: var(--navy-900); background: var(--navy-100); }
.zoom-scroll { min-height: 0; overflow: auto; padding: 1rem; touch-action: pan-x pan-y; overscroll-behavior: contain; }
.zoom-page { width: calc(100% * var(--zoom-scale, 1)); min-width: calc(100% * var(--zoom-scale, 1)); margin: 0 auto; }
.zoom-page[data-zoom="fit"] { width: min(100%, 950px); min-width: 0; }
.document-stage-zoom { width: 100%; max-width: none; }

@media (max-width: 760px) {
  :root { --header-height: 132px; }
  .site-header { align-items: flex-start; gap: .65rem; padding: .85rem 1rem; }
  .brand-mark { display: none; }
  .site-header h1 { font-size: .98rem; }
  .eyebrow { font-size: .66rem; }
  .language-control { align-self: center; }
  .language-control button { min-height: 2.35rem; padding: .42rem .6rem; font-size: .82rem; }
  .app-layout { display: block; }
  .lesson-rail { position: sticky; z-index: 15; top: var(--header-height); height: auto; overflow: visible; box-shadow: 0 3px 12px rgb(7 27 47 / 14%); }
  .rail-intro { display: none; }
  .lesson-navigation { flex-direction: row; overflow-x: auto; padding: .55rem; scroll-snap-type: x proximity; }
  .lesson-link { flex: 0 0 min(72vw, 260px); grid-template-columns: 2rem minmax(0, 1fr); min-height: 2.9rem; padding: .5rem .6rem; scroll-snap-align: start; font-size: .88rem; }
  .practice-rail-wrap { padding: .35rem .55rem; }
  .practice-rail-link { min-height: 2.7rem; }
  .practice-main { padding: .85rem; }
  .practice-layout { grid-template-columns: 1fr; }
  .practice-steps li { padding: .55rem; font-size: .75rem; }
  main { padding: .85rem; }
  .lesson-heading, .teaching-drawer { grid-template-columns: 1fr; }
  .lesson-heading h2 { font-size: clamp(1.55rem, 7vw, 2.25rem); }
  .lesson-aim { padding: .9rem 1rem; }
  .section-heading-row { display: block; }
  .section-heading-row > p { margin-top: .45rem; text-align: left; }
  .source-section > .section-heading-row { padding: 1rem 1rem 0; }
  .source-reference { text-align: left; }
  .focus-bar, .teaching-drawer { padding: 1rem; }
  .citation-pair { grid-template-columns: 1fr; }
  .source-content { padding: .55rem; }
  .step-navigation button { min-width: 0; flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
