/* Note Guide Studio — the design system.
 *
 * Tokens first (light, then dark via prefers-color-scheme or [data-theme]),
 * then base elements, components, the student layout, and phone rules.
 * Every colour is a --ng-* custom property; components never hard-code one.
 * teacher.html appends its own section at the end, marked  teacher.
 */

/* ------------------------------------------------------------------ */
/* tokens                                                              */
/* ------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --ng-font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ng-paper: #F7F9FC;
  --ng-surface: #FFFFFF;
  --ng-ink: #1B2A41;
  --ng-ink-2: #4A5A70;          /* secondary text */
  --ng-border: #D9E0EA;
  --ng-underline: #C3CDDB;      /* input underline */
  --ng-chip: #EEF2F8;
  --ng-track: #E4E9F1;
  --ng-empty: #6B7A90;          /* dashed underline for an empty, checked blank */

  --ng-red: #C62E3A;            /* oxygen-rich: lesson answer phrases */
  --ng-red-tint: #FBE3E5;
  --ng-red-ink: #BA2A36;        /* red text on the pink tint (keeps 4.5:1) */
  --ng-red-strong: #A8232E;     /* the play button */
  --ng-blue: #2F5DA8;           /* oxygen-poor: primary actions, correct, progress */
  --ng-blue-tint: #EAF0FA;
  --ng-blue-strong: #1F427D;    /* hover */
  --ng-orange: #B4570B;         /* needs fixing */
  --ng-orange-tint: #FCEFE3;
  --ng-purple: #7D4C8F;

  --ng-on-blue: #FFFFFF;        /* text on a blue fill */
  --ng-on-red: #FFFFFF;
  --ng-focus: #2F5DA8;
  --ng-gradient: linear-gradient(90deg, #2F5DA8, #7D4C8F 60%, #C62E3A);
  --ng-shadow: 0 1px 2px rgba(27, 42, 65, .06), 0 8px 24px rgba(27, 42, 65, .08);
  --ng-scrim: rgba(15, 23, 34, .45);

  --ng-r-panel: 14px;
  --ng-r-btn: 10px;
  --ng-r-input: 8px;
  --ng-touch: 44px;
  --ng-header-h: 68px;
  --ng-gutter: 32px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ng-paper: #0F1722;
    --ng-surface: #162030;
    --ng-ink: #E8EEF5;
    --ng-ink-2: #9FB0C3;
    --ng-border: #26323F;
    --ng-underline: #3A4A5E;
    --ng-chip: #1E2A3A;
    --ng-track: #243041;
    --ng-empty: #8796AA;
    --ng-red: #E0616B;
    --ng-red-tint: rgba(224, 97, 107, .18);
    --ng-red-ink: #EE8A91;
    --ng-red-strong: #A8232E;
    --ng-blue: #7FA3E8;
    --ng-blue-tint: rgba(127, 163, 232, .18);
    --ng-blue-strong: #A9C2F0;
    --ng-orange: #E0923A;
    --ng-orange-tint: rgba(224, 146, 58, .18);
    --ng-purple: #B28AC4;
    --ng-on-blue: #0F1722;
    --ng-focus: #7FA3E8;
    --ng-gradient: linear-gradient(90deg, #7FA3E8, #B28AC4 60%, #E0616B);
    --ng-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --ng-scrim: rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ng-paper: #0F1722;
  --ng-surface: #162030;
  --ng-ink: #E8EEF5;
  --ng-ink-2: #9FB0C3;
  --ng-border: #26323F;
  --ng-underline: #3A4A5E;
  --ng-chip: #1E2A3A;
  --ng-track: #243041;
  --ng-empty: #8796AA;
  --ng-red: #E0616B;
  --ng-red-tint: rgba(224, 97, 107, .18);
  --ng-red-ink: #EE8A91;
  --ng-red-strong: #A8232E;
  --ng-blue: #7FA3E8;
  --ng-blue-tint: rgba(127, 163, 232, .18);
  --ng-blue-strong: #A9C2F0;
  --ng-orange: #E0923A;
  --ng-orange-tint: rgba(224, 146, 58, .18);
  --ng-purple: #B28AC4;
  --ng-on-blue: #0F1722;
  --ng-focus: #7FA3E8;
  --ng-gradient: linear-gradient(90deg, #7FA3E8, #B28AC4 60%, #E0616B);
  --ng-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --ng-scrim: rgba(0, 0, 0, .6);
}

/* ------------------------------------------------------------------ */
/* base                                                                */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--ng-header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ng-paper);
  color: var(--ng-ink);
  font-family: var(--ng-font);
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 19px; }
h4 { font-size: 17px; }
p { margin: 0; }
img { max-width: 100%; height: auto; }
a { color: var(--ng-blue); }
a:hover { color: var(--ng-blue-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--ng-focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.ng-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ng-skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ng-blue); color: var(--ng-on-blue); padding: 10px 16px;
  border-radius: var(--ng-r-btn); font-weight: 700; text-decoration: none;
}
.ng-skip:focus { top: 12px; color: var(--ng-on-blue); }
.ng-muted { color: var(--ng-ink-2); }
.ng-small { font-size: 14px; }
.ng-tiny { font-size: 13px; }
.ng-eyebrow { font-size: 13px; color: var(--ng-ink-2); }
.ng-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ng-grow { flex-grow: 1; }
.ng-stack { display: flex; flex-direction: column; gap: 14px; }
.ng-icon { flex: none; display: inline-block; vertical-align: middle; }

/* ------------------------------------------------------------------ */
/* buttons                                                             */
/* ------------------------------------------------------------------ */
.ng-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--ng-touch); padding: 0 16px;
  border: 1px solid var(--ng-border); border-radius: var(--ng-r-btn);
  background: var(--ng-surface); color: var(--ng-ink);
  text-decoration: none; line-height: 1.2; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.ng-btn:hover { background: var(--ng-chip); color: var(--ng-ink); }
.ng-btn:active { transform: translateY(1px); }
.ng-btn:disabled { opacity: .55; transform: none; }
.ng-btn--primary { font-weight: 700; padding: 0 20px; background: var(--ng-blue); border-color: var(--ng-blue); color: var(--ng-on-blue); }
.ng-btn--primary:hover { background: var(--ng-blue-strong); border-color: var(--ng-blue-strong); color: var(--ng-on-blue); }
.ng-btn--play { font-weight: 700; min-width: 104px; padding: 0 18px; background: var(--ng-red-strong); border-color: var(--ng-red-strong); color: var(--ng-on-red); }
.ng-btn--play:hover { background: #8E1B25; border-color: #8E1B25; color: var(--ng-on-red); }
.ng-btn--ghost { background: transparent; border-color: transparent; }
.ng-btn--ghost:hover { background: var(--ng-chip); }
.ng-btn--icon { width: var(--ng-touch); padding: 0; }
.ng-btn--block { width: 100%; }
.ng-btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.ng-btn[aria-pressed="true"] { background: var(--ng-blue-tint); border-color: var(--ng-blue); color: var(--ng-ink); }
.ng-link-btn { background: none; border: 0; padding: 0; color: var(--ng-blue); text-decoration: underline; min-height: 0; }

/* ------------------------------------------------------------------ */
/* form controls                                                       */
/* ------------------------------------------------------------------ */
.ng-field { display: flex; flex-direction: column; gap: 6px; }
.ng-label { font-weight: 700; font-size: 15px; }
.ng-hint { font-size: 13px; color: var(--ng-ink-2); }
.ng-input, .ng-select, .ng-textarea {
  min-height: var(--ng-touch); width: 100%;
  padding: 10px 12px; border: 1px solid var(--ng-underline); border-radius: var(--ng-r-input);
  background: var(--ng-surface); color: var(--ng-ink);
}
.ng-input:hover, .ng-select:hover, .ng-textarea:hover { border-color: var(--ng-empty); }
.ng-textarea { resize: vertical; line-height: 1.5; }
.ng-select { padding-right: 32px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236B7A90' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.ng-select--sm { min-height: 36px; padding: 4px 30px 4px 10px; font-size: 14px; width: auto; }
.ng-input--code { text-transform: uppercase; letter-spacing: .28em; font-weight: 700; font-size: 22px; text-align: center; }
.ng-check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--ng-touch); font-size: 14px; color: var(--ng-ink-2); cursor: pointer; }
.ng-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ng-blue); }
.ng-error { color: var(--ng-orange); font-weight: 700; font-size: 14px; display: flex; gap: 6px; align-items: flex-start; }

/* inline blanks ---------------------------------------------------- */
.ng-blank {
  position: relative; display: inline-flex; align-items: baseline;
  max-width: 100%; margin: 0 2px; vertical-align: baseline; white-space: nowrap;
}
.ng-blank__input {
  min-width: 4ch; max-width: 100%;
  height: 1.9em; padding: 0 6px; margin: 0;
  border: 0; border-bottom: 2px solid var(--ng-underline); border-radius: 4px 4px 0 0;
  background: transparent; color: var(--ng-ink); line-height: 1.5;
  transition: background-color .2s, border-color .2s;
}
.ng-blank__input:hover { border-bottom-color: var(--ng-empty); }
.ng-blank__input:focus { background: var(--ng-chip); }
.ng-blank__icon { display: none; width: 16px; height: 16px; margin-left: 2px; align-self: center; }
.ng-blank[data-state] .ng-blank__icon { display: inline-block; }
.ng-blank[data-state="correct"] .ng-blank__input { border-bottom-color: var(--ng-blue); background: var(--ng-blue-tint); }
.ng-blank[data-state="correct"] .ng-blank__icon { color: var(--ng-blue); }
.ng-blank[data-state="fix"] .ng-blank__input { border-bottom: 3px double var(--ng-orange); background: var(--ng-orange-tint); }
.ng-blank[data-state="fix"] .ng-blank__icon { color: var(--ng-orange); }
.ng-blank[data-state="blank"] .ng-blank__input { border-bottom: 2px dashed var(--ng-empty); }
.ng-blank[data-state="blank"] .ng-blank__icon { color: var(--ng-empty); }
.ng-blank.is-taught:not([data-state]) .ng-blank__input { border-bottom-color: var(--ng-red); background: var(--ng-red-tint); }
.ng-blank.is-taught { animation: ng-pulse 1.4s ease-out 1; border-radius: 4px; }
@keyframes ng-pulse { 0% { box-shadow: 0 0 0 0 rgba(198, 46, 58, .45); } 100% { box-shadow: 0 0 0 10px rgba(198, 46, 58, 0); } }
.ng-reveal {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px;
  font-size: .82em; line-height: 1.6; font-weight: 700;
  color: var(--ng-blue); background: var(--ng-blue-tint); border: 1px solid var(--ng-blue);
}

/* ------------------------------------------------------------------ */
/* panels, cards, chips, bars                                          */
/* ------------------------------------------------------------------ */
.ng-card { background: var(--ng-surface); border: 1px solid var(--ng-border); border-radius: var(--ng-r-panel); }
.ng-card--pad { padding: 24px; }
.ng-chip { display: inline-block; background: var(--ng-chip); color: var(--ng-ink); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.ng-bar { position: relative; height: 8px; border-radius: 999px; background: var(--ng-track); overflow: hidden; }
.ng-bar > span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ng-blue); border-radius: 999px; transition: width .3s; }
.ng-bar--lesson { height: 12px; }
.ng-bar--lesson > span { background: var(--ng-gradient); border-radius: 0; }
.ng-bar--thin { height: 6px; }
.ng-avatar {
  width: 36px; height: 36px; flex: none; border-radius: 999px; background: var(--ng-chip);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.ng-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; display: inline-block; }
.ng-swatch--correct { background: var(--ng-blue); }
.ng-swatch--fix { background: var(--ng-orange); }
.ng-swatch--blank { border: 1.5px dashed var(--ng-empty); }

/* empty / blank states --------------------------------------------- */
.ng-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 40px 24px; color: var(--ng-ink-2);
}
.ng-empty__art { width: 120px; height: 72px; }
.ng-empty__title { color: var(--ng-ink); font-size: 20px; font-weight: 700; }
.ng-empty p { max-width: 44ch; }
.ng-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--ng-ink); color: var(--ng-paper); padding: 10px 16px; border-radius: var(--ng-r-btn);
  box-shadow: var(--ng-shadow); font-size: 15px; max-width: calc(100vw - 32px);
}

/* ------------------------------------------------------------------ */
/* header                                                              */
/* ------------------------------------------------------------------ */
.ng-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px; min-height: var(--ng-header-h);
  padding: 12px var(--ng-gutter);
  background: var(--ng-surface); border-bottom: 1px solid var(--ng-border);
}
.ng-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ng-ink); text-decoration: none; white-space: nowrap; }
.ng-brand:hover { color: var(--ng-ink); }
.ng-logo { width: 28px; height: 28px; flex: none; color: var(--ng-red); }
.ng-unitname { display: flex; flex-direction: column; min-width: 0; }
.ng-unitname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ng-unitname span { font-size: 13px; color: var(--ng-ink-2); }
.ng-hprogress { display: flex; flex-direction: column; gap: 4px; width: 220px; flex: none; }
.ng-hprogress__top { display: flex; justify-content: space-between; font-size: 13px; }
.ng-save { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ng-ink-2); white-space: nowrap; }
.ng-save svg { color: var(--ng-blue); }
.ng-save[data-state="saving"] svg { color: var(--ng-ink-2); animation: ng-spin 1s linear infinite; }
.ng-save[data-state="offline"] svg, .ng-save[data-state="error"] svg { color: var(--ng-orange); }
@keyframes ng-spin { to { transform: rotate(360deg); } }
.ng-only-phone { display: none !important; }

/* ------------------------------------------------------------------ */
/* the studio layout (student)                                         */
/* ------------------------------------------------------------------ */
.ng-studio {
  max-width: 1440px; margin: 0 auto; padding: 24px var(--ng-gutter) 48px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start;
}
.ng-lesson {
  position: sticky; top: calc(var(--ng-header-h) + 16px);
  display: flex; flex-direction: column; gap: 14px;
  max-height: calc(100vh - var(--ng-header-h) - 32px); overflow-y: auto;
  scrollbar-width: thin; padding: 3px; margin: -3px;
}
.ng-scene { background: var(--ng-surface); border: 1px solid var(--ng-border); border-radius: var(--ng-r-panel); overflow: hidden; container-type: inline-size; }
.ng-scene__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 14px 20px 0; font-size: 13px; color: var(--ng-ink-2); }
.ng-scene__top .ng-chip { color: var(--ng-ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ng-scene__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 8px 20px 16px; min-height: 220px; }
.ng-scene__body.has-art { min-height: 300px; }
.ng-scene__body.has-art { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@container (max-width: 520px) { .ng-scene__body.has-art { grid-template-columns: minmax(0, 1fr); min-height: 0; } .ng-scene__art img { max-height: 200px; } }
.ng-scene__title { margin: 6px 0 4px; font-size: 22px; }
.ng-scene__lines { display: flex; flex-direction: column; gap: 10px; }
.ng-line {
  margin: 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--ng-border);
  opacity: .7; transition: opacity .3s, border-color .3s;
}
.ng-line.is-now { opacity: 1; border-left-color: var(--ng-red); }
.ng-line.is-future { opacity: .12; }
.ng-line .ng-ans, .ng-ans { color: var(--ng-red-ink); background: var(--ng-red-tint); padding: 0 4px; border-radius: 4px; font-weight: 700; }
.ng-line button { all: unset; cursor: pointer; display: block; border-radius: 4px; }
.ng-line button:focus-visible { outline: 3px solid var(--ng-focus); outline-offset: 2px; }
.ng-scene__art { display: flex; align-items: center; justify-content: center; }
.ng-scene__art img { max-height: 280px; object-fit: contain; border-radius: 8px; }
.ng-caption { border-top: 1px solid var(--ng-border); padding: 12px 20px; min-height: 52px; font-size: 15px; }
.ng-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ng-voice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--ng-ink-2); }
.ng-voice__item { display: inline-flex; align-items: center; gap: 8px; }
.ng-lesson > * { flex-shrink: 0; }
.ng-voice .ng-select { max-width: 220px; }
.ng-chapters { background: var(--ng-surface); border: 1px solid var(--ng-border); border-radius: var(--ng-r-panel); padding: 12px; }
.ng-chapters h2 { font-size: 16px; padding: 4px 8px 8px; }
.ng-chapters__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; list-style: none; margin: 0; padding: 0; }
.ng-chapter {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  min-height: 40px; padding: 4px 10px; border-radius: 8px; border: 0; background: transparent;
  color: var(--ng-ink); font-size: 14px; text-align: left; line-height: 1.25;
}
.ng-chapter:hover { background: var(--ng-chip); }
.ng-chapter[aria-current="true"] { background: var(--ng-chip); font-weight: 700; }
.ng-chapter__status { font-size: 12px; color: var(--ng-ink-2); font-weight: 400; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.ng-chapter__status svg { color: var(--ng-blue); }

/* packet ------------------------------------------------------------ */
.ng-packet { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ng-packet__head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ng-packet__head h1 { font-size: 24px; }
.ng-section {
  background: var(--ng-surface); border: 1px solid var(--ng-border); border-radius: var(--ng-r-panel);
  padding: 28px 36px; scroll-margin-top: calc(var(--ng-header-h) + 16px);
  transition: box-shadow .3s, border-color .3s;
}
.ng-section.is-following { border-color: var(--ng-red); box-shadow: 0 0 0 3px var(--ng-red-tint); }
.ng-section__title { margin: 2px 0 18px; font-size: 26px; }
.ng-section__body { display: flex; flex-direction: column; gap: 18px; font-size: 17px; line-height: 2.1; }
.ng-section__body h3, .ng-section__body h4 { margin-top: 10px; line-height: 1.3; }
.ng-section__body .ng-b { font-weight: 700; }
.ng-section__body .ng-i { font-style: italic; }
.ng-section__body ul, .ng-section__body ol { margin: 0; padding-left: 1.6em; }
.ng-section__body ul ul, .ng-section__body .ng-list--sub { padding-left: 3em; }
.ng-section__body li + li { margin-top: 2px; }
.ng-short { display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.ng-short__prompt { font-style: italic; }
.ng-short .ng-textarea { font-style: normal; }
.ng-short--inline { flex-direction: row; align-items: baseline; gap: 8px; }
.ng-short--inline .ng-input { width: auto; flex: 1 1 12ch; max-width: 36ch; min-height: 40px; }
.ng-lines {
  line-height: 2.1em; padding: 0 12px; min-height: calc(2.1em * 3);
  background-image: linear-gradient(to bottom, transparent calc(2.1em - 1px), var(--ng-underline) calc(2.1em - 1px));
  background-size: 100% 2.1em; background-attachment: local;
  border-radius: var(--ng-r-input);
}
.ng-comment {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: var(--ng-r-input);
  background: var(--ng-blue-tint); border-left: 3px solid var(--ng-blue); font-size: 15px; line-height: 1.45; font-style: normal;
}
.ng-comment svg { color: var(--ng-blue); margin-top: 2px; }
.ng-table-wrap { overflow-x: auto; overflow-y: hidden; padding: 5px; margin: -5px; }   /* room for focus rings; no stray vertical scrollbar */
.ng-table { border-collapse: collapse; width: 100%; line-height: 1.9; }
.ng-table th, .ng-table td { border: 1px solid var(--ng-border); padding: 6px 12px; vertical-align: top; text-align: left; }
.ng-table th { background: var(--ng-chip); }
.ng-table .ng-textarea { min-height: 40px; padding: 6px 10px; line-height: 1.4; }
.ng-cellshort { display: flex; gap: 6px; align-items: flex-start; }
.ng-cellshort::before { content: "\2022"; line-height: 40px; }
.ng-cellshort.no-bullet::before { content: none; }
.ng-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ng-flow li { padding: 4px 16px; border-radius: var(--ng-r-input); background: var(--ng-paper); border: 1px solid var(--ng-border); max-width: 100%; }
.ng-flow__arrow { color: var(--ng-red); height: 26px; display: flex; align-items: center; background: none !important; border: 0 !important; }
.ng-bank { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; padding: 12px; background: var(--ng-paper); border: 1px solid var(--ng-border); border-radius: var(--ng-r-input); line-height: 1.4; font-size: 15px; list-style: none; margin: 0; }
.ng-bank b { color: var(--ng-blue); margin-right: 4px; }
.ng-matching { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ng-matching .ng-blank__input { text-align: center; text-transform: uppercase; font-weight: 700; }
.ng-figure { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; line-height: 1.5; }
.ng-figure figcaption { font-size: 14px; color: var(--ng-ink-2); font-style: italic; text-align: center; }
.ng-figure img { max-height: 420px; object-fit: contain; border-radius: 8px; background: #fff; }
.ng-placeholder {
  width: 100%; min-height: 160px; padding: 20px; border: 2px dashed var(--ng-underline); border-radius: var(--ng-r-panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  color: var(--ng-ink-2); background: var(--ng-paper); line-height: 1.4;
}
.ng-placeholder b { color: var(--ng-ink); }
.ng-labels { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; line-height: 1.5; }
.ng-labels__fig { position: relative; display: inline-block; max-width: 100%; justify-self: center; }
.ng-labels__fig img { display: block; max-height: 460px; background: #fff; border-radius: 8px; }
.ng-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 999px; border: 2px solid #fff;
  background: var(--ng-red-strong); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.ng-pin.is-filled { background: #2F5DA8; }
.ng-pinlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ng-pinlist li { display: flex; align-items: center; gap: 10px; }
.ng-pinlist .ng-pin { position: static; transform: none; flex: none; }
.ng-pinlist .ng-select { min-height: 40px; }
.ng-pinlist .ng-blank { margin: 0; flex: 1; }
.ng-pinlist [data-state="correct"] .ng-select { border-color: var(--ng-blue); border-bottom-width: 3px; background-color: var(--ng-blue-tint); }
.ng-pinlist [data-state="fix"] .ng-select { border-color: var(--ng-orange); border-bottom: 3px double var(--ng-orange); background-color: var(--ng-orange-tint); }
.ng-pinlist [data-state="blank"] .ng-select { border-style: dashed; border-color: var(--ng-empty); }
.ng-findlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.ng-section__foot {
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--ng-border);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.ng-summary { display: flex; gap: 14px; flex-wrap: wrap; font-size: 15px; align-items: center; }
.ng-summary span { display: inline-flex; align-items: center; gap: 6px; }
.ng-cheer { width: 100%; font-size: 15px; color: var(--ng-ink-2); }
.ng-phone-nav { display: none; }

/* sections drawer (phone) and lesson sheet --------------------------- */
.ng-drawer { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: min(380px, 88vw); height: 100%; background: var(--ng-surface); color: var(--ng-ink); }
.ng-drawer::backdrop { background: var(--ng-scrim); }
.ng-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--ng-border); position: sticky; top: 0; background: var(--ng-surface); }
.ng-drawer__list { list-style: none; margin: 0; padding: 8px; }
.ng-drawer__list button { display: flex; width: 100%; gap: 10px; align-items: center; justify-content: space-between; text-align: left; min-height: var(--ng-touch); padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; }
.ng-drawer__list button:hover, .ng-drawer__list button[aria-current="true"] { background: var(--ng-chip); }
.ng-drawer__list .ng-chapterlabel { font-size: 12px; color: var(--ng-ink-2); padding: 12px 12px 2px; text-transform: uppercase; letter-spacing: .04em; }

.ng-mini { display: none; }

/* ------------------------------------------------------------------ */
/* front door (index.html)                                             */
/* ------------------------------------------------------------------ */
.ng-door { max-width: 1040px; margin: 0 auto; padding: 40px var(--ng-gutter) 64px; display: flex; flex-direction: column; gap: 28px; }
.ng-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.ng-hero h1 { font-size: 40px; line-height: 1.1; }
.ng-hero p { font-size: 18px; color: var(--ng-ink-2); margin-top: 12px; max-width: 46ch; }
.ng-hero__art { width: 100%; max-width: 380px; justify-self: center; }
.ng-doors { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.ng-door-card { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.ng-door-card h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.ng-door-card form { display: flex; flex-direction: column; gap: 14px; }
.ng-namegrid { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; }
.ng-door-card .ng-badge { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ng-badge--red { background: var(--ng-red-tint); color: var(--ng-red); }
.ng-badge--blue { background: var(--ng-blue-tint); color: var(--ng-blue); }
.ng-welcome { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--ng-r-btn); background: var(--ng-blue-tint); }
.ng-footer { text-align: center; font-size: 14px; color: var(--ng-ink-2); }
.ng-lessonbar-deco { height: 8px; border-radius: 999px; background: var(--ng-gradient); }

/* ------------------------------------------------------------------ */
/* responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1200px) {
  :root { --ng-gutter: 24px; }
  .ng-header { gap: 16px; }
  .ng-hprogress { width: 160px; }
  .ng-section { padding: 24px 26px; }
  .ng-labels { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ng-hero, .ng-doors { grid-template-columns: minmax(0, 1fr); }
  .ng-hero__art { display: none; }
  .ng-hero h1 { font-size: 32px; }
}
@media (max-width: 720px) {
  :root { --ng-gutter: 16px; --ng-header-h: 64px; }
  .ng-only-phone { display: revert !important; }
  .ng-only-wide { display: none !important; }
  .ng-header { gap: 12px; padding: 10px 16px; }
  .ng-header .ng-brand span, .ng-header .ng-hprogress, .ng-header .ng-save--wide, .ng-header .ng-avatar { display: none; }
  .ng-unitname b { font-size: 15px; }
  .ng-unitname span { font-size: 12px; }
  .ng-studio { display: block; padding: 16px 16px 200px; }
  .ng-lesson { display: none; }
  .ng-packet__head { justify-content: flex-end; }
  .ng-packet__head > .ng-grow { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ng-packet { gap: 12px; }
  .ng-section { padding: 18px 16px; border-radius: 12px; }
  .ng-section[data-phone-hidden] { display: none; }
  .ng-section__title { font-size: 22px; margin-bottom: 12px; }
  .ng-section__body { font-size: 16px; line-height: 2.05; gap: 14px; }
  .ng-phone-nav { display: flex; gap: 8px; justify-content: space-between; margin-top: 16px; }
  .ng-phone-nav .ng-btn { flex: 1; }
  .ng-namegrid { grid-template-columns: minmax(0, 1fr) 96px; }
  .ng-door { padding-top: 24px; }
  .ng-door-card { padding: 20px; }
  .ng-hero h1 { font-size: 28px; }
  .ng-table th, .ng-table td { padding: 4px 8px; }
  .ng-table { font-size: 15px; }

  .ng-mini {
    display: flex; flex-direction: column; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    background: var(--ng-surface); border-top: 1px solid var(--ng-border); box-shadow: var(--ng-shadow);
  }
  .ng-mini__line { margin: 0; font-size: 15px; line-height: 1.45; min-height: 2.9em; max-height: 4.4em; overflow: hidden; }
  .ng-mini__controls { display: flex; align-items: center; gap: 8px; }
  .ng-mini__controls .ng-btn--play { flex-grow: 1; }

  /* the full lesson opens as a sheet over the packet */
  body.ng-sheet-open { overflow: hidden; }
  body.ng-sheet-open .ng-lesson {
    display: flex; position: fixed; inset: 0; z-index: 50; top: 0; max-height: none; margin: 0;
    padding: 12px 16px 24px; background: var(--ng-paper); overflow-y: auto;
  }
  .ng-scene__body { padding: 8px 14px 14px; }
  .ng-scene__top { padding: 12px 14px 0; }
  .ng-caption { padding: 10px 14px; }
  .ng-chapters__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ */
/* motion and print                                                    */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .ng-header, .ng-lesson, .ng-mini, .ng-section__foot, .ng-phone-nav, .ng-skip { display: none !important; }
  .ng-studio { display: block; padding: 0; }
  .ng-section { border: 0; padding: 0 0 24px; break-inside: avoid-page; }
  .ng-section[data-phone-hidden] { display: block; }
}
