/* Nogai Tili: CURRENT visual design. Edit this file for colors, layout, cards, typography.
   Foundational instructional styles are in assets/css/base.css.
   Order matters: design.css loads AFTER base.css so it wins the cascade. */

/* Approved compact study-first design, 2026-11-04.
   Visual presentation only; preserve the existing lessons, quizzes and sign-in. */
:root{
  --bg:#f8f6f2;
  --surface:#fffefa;
  --ink:#263249;
  --muted:#647087;
  --border:#e6e3ec;
  --violet:#5b4bb9;
  --violet-soft:#f0edfc;
  --shadow:0 7px 24px rgba(50,47,85,.045);
}

/* NOGAILAB DESIGN TOKENS — single shared contract for all screens.
   Change theme colors and type roles here, never individual lesson labels.
   Legacy CSS sources consume these variables; the dark variant follows below. */
:root{
  --nl-font-family-ui:Inter,"Segoe UI",Arial,sans-serif;
  --nl-font-family-brand:Georgia,serif;
  --nl-font-family-code:ui-monospace,SFMono-Regular,Consolas,monospace;
  --nl-type-caption:12px;
  --nl-type-small:14px;
  --nl-type-body:16px;
  --nl-type-lesson:18px;
  --nl-type-section:20px;
  --nl-type-heading:24px;
  --nl-type-8:8px;
  --nl-type-9:9px;
  --nl-type-10:10px;
  --nl-type-11:11px;
  --nl-type-12:var(--nl-type-caption);
  --nl-type-13:13px;
  --nl-type-14:var(--nl-type-small);
  --nl-type-15:15px;
  --nl-type-16:var(--nl-type-body);
  --nl-type-17:17px;
  --nl-type-18:var(--nl-type-lesson);
  --nl-type-19:19px;
  --nl-type-20:var(--nl-type-section);
  --nl-type-21:21px;
  --nl-type-22:22px;
  --nl-type-23:23px;
  --nl-type-24:var(--nl-type-heading);
  --nl-type-25:25px;
  --nl-type-26:26px;
  --nl-type-27:27px;
  --nl-type-28:28px;
  --nl-type-29:29px;
  --nl-type-30:30px;
  --nl-type-31:31px;
  --nl-type-32:32px;
  --nl-type-33:33px;
  --nl-type-34:34px;
  --nl-type-35:35px;
  --nl-type-36:36px;
  --nl-type-40:40px;
  --nl-radius-control:12px;
  --nl-radius-card:16px;
  --nl-radius-panel:24px;
  --nl-radius-8:8px;
  --nl-radius-9:9px;
  --nl-radius-10:10px;
  --nl-radius-11:11px;
  --nl-radius-12:var(--nl-radius-control);
  --nl-radius-13:13px;
  --nl-radius-14:14px;
  --nl-radius-15:15px;
  --nl-radius-16:var(--nl-radius-card);
  --nl-radius-17:17px;
  --nl-radius-18:18px;
  --nl-radius-19:19px;
  --nl-radius-20:20px;
  --nl-radius-21:21px;
  --nl-radius-22:22px;
  --nl-radius-24:var(--nl-radius-panel);
  --nl-radius-30:30px;
  --nl-radius-99:99px;
  --nl-radius-999:999px;
  --nl-text-primary:var(--ink);
  --nl-text-heading:var(--ink);
  --nl-text-secondary:#475672;
  --nl-text-muted:var(--muted);
  --nl-text-accent:var(--violet);
  --nl-text-accent-soft:#6551b4;
  --nl-text-on-accent:#fff;
  --nl-text-success:var(--green);
  --nl-text-danger:var(--red);
  --nl-bg-card:var(--surface);
  --nl-bg-soft:var(--violet-soft);
  --nl-bg-subtle:#f8f6fd;
  --nl-bg-control:#f4f0ff;
  --nl-bg-selected:#f1effc;
  --nl-bg-action:var(--violet);
  --nl-bg-action-hover:#4d3bac;
  --nl-bg-success:var(--green-soft);
  --nl-bg-danger:var(--red-soft);
  --nl-border-base:var(--border);
  --nl-border-control:#e7e1ed;
  --nl-border-accent:#c5b9ed;
  --nl-border-success:#85bca0;
  --nl-border-danger:#e4a3a5;
}

/* Dark counterparts of the same semantic design tokens. */
:root[data-theme="dark"]{
  --nl-text-primary:var(--ink);
  --nl-text-heading:#f0edff;
  --nl-text-secondary:#d1d9e8;
  --nl-text-muted:#cbd5e5;
  --nl-text-accent:var(--violet);
  --nl-text-accent-soft:#d1c5ff;
  --nl-text-on-accent:#fff;
  --nl-text-success:#a8ebcd;
  --nl-text-danger:#ffd3d9;
  --nl-bg-card:#1d293c;
  --nl-bg-soft:#342f56;
  --nl-bg-subtle:#243249;
  --nl-bg-control:#28364f;
  --nl-bg-selected:#342f56;
  --nl-bg-action:#7564d4;
  --nl-bg-action-hover:#8575e8;
  --nl-bg-success:#183e38;
  --nl-bg-danger:#4b2936;
  --nl-border-base:#38465e;
  --nl-border-control:#4a5a78;
  --nl-border-accent:#7c6bbd;
  --nl-border-success:#3f9a79;
  --nl-border-danger:#c3788a;
}

html{scroll-padding-top:155px}
body{background:var(--bg);color:var(--ink)}
.site-header{position:sticky;top:0;z-index:55;background:var(--nl-bg-card);border-bottom:1px solid #e8e5ef;box-shadow:0 3px 16px rgba(44,37,74,.045)}
.site-header .top{
  display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;
  max-width:1172px;padding:11px 22px 12px;column-gap:20px;row-gap:10px;
  align-items:center;
}
.site-header .brand{grid-row:1;grid-column:1;min-width:0}
.site-header .logo{display:block;flex:none;width:42px;height:42px;border-radius:var(--nl-radius-12);background:transparent;object-fit:cover;box-shadow:none;outline:none}
.site-header .brandstrong{font-size:var(--nl-type-20);letter-spacing:-.45px;color:var(--nl-text-primary)}
.site-header .brandcap{font-size:var(--nl-type-10);letter-spacing:.7px}
.site-header .header-right{grid-row:1;grid-column:2;min-width:0}
.site-header .tag{display:none}
.site-header .auth-account-btn{min-height:40px;background:var(--nl-bg-control);border-color:#e7ddff;color:var(--nl-text-accent);border-radius:var(--nl-radius-11)}
.site-nav-wrap .theory-switch,
body .site-nav-wrap .theory-switch,
body.learning-mode .site-nav-wrap .theory-switch{
  grid-row:2;grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  margin:0;gap:9px;min-width:0;
}
body .site-nav-wrap .theory-switch button,
body.learning-mode .site-nav-wrap .theory-switch button{
  display:flex;align-items:center;justify-content:center;gap:5px;
  margin:0;min-height:43px;padding:9px 11px;
  border:1px solid var(--nl-border-base);border-radius:var(--nl-radius-11);
  background:var(--nl-bg-subtle);color:var(--nl-text-accent);font-size:var(--nl-type-14);font-weight:750;
  line-height:1.3;box-shadow:none;transition:background .15s,border-color .15s;
}
body .site-nav-wrap .theory-switch button:hover{border-color:var(--nl-border-accent);background:#efecfa}
body .site-nav-wrap .theory-switch button.active,
body.learning-mode .site-nav-wrap .theory-switch button.active{
  border-color:var(--violet);background:var(--violet);color:var(--nl-text-on-accent);box-shadow:0 3px 9px rgba(91,75,185,.13)
}
body.learning-lesson-mode .site-nav-wrap .theory-switch{display:none!important}
body .shell,body.learning-mode .shell{
  max-width:1160px;margin:16px auto 28px;padding:0 20px
}
.program-view .course-heading{
  background:var(--nl-bg-card);border:1px solid var(--nl-border-base);border-radius:var(--nl-radius-17);
  padding:22px 25px;margin-bottom:14px;
  box-shadow:0 3px 13px rgba(56,43,90,.025)
}
.program-view .course-heading .eyebrow{font-size:var(--nl-type-11);letter-spacing:.8px;color:var(--nl-text-accent-soft)}
.program-view .course-heading h1{font-size:clamp(var(--nl-type-24),2.5vw,var(--nl-type-30));line-height:1.19;letter-spacing:-.6px;margin:6px 0 7px;color:var(--nl-text-primary)}
.program-view .course-heading p{max-width:800px;margin:0;color:var(--nl-text-secondary);font-size:var(--nl-type-14);line-height:1.55}
.program-view .course-stats{margin:13px 0 0;gap:7px}
.program-view .course-stats span{background:#f6f3fb;border:1px solid #eae5f2;box-shadow:none;border-radius:var(--nl-radius-9);padding:6px 11px;font-size:var(--nl-type-12);color:var(--nl-text-accent-soft)}
.course-learning-pulse{
  border-radius:var(--nl-radius-15);background:linear-gradient(110deg,#f1edfc,#fffdfc);
  border:1px solid #e6dff6;padding:15px 20px;margin-bottom:13px;
  box-shadow:none
}
.course-learning-pulse-copy strong{color:var(--nl-text-accent)}
.program-view .course-learning-pulse .course-open-lesson{min-height:40px}
.learning-level-tabs{gap:9px;margin:11px 0 17px}
.learning-level-tab{border:1px solid var(--nl-border-control);border-radius:var(--nl-radius-12);min-height:67px;padding:11px 12px;background:var(--nl-bg-card);box-shadow:none}
.learning-level-tab.is-selected{border:1.5px solid var(--nl-border-accent);background:var(--nl-bg-selected);box-shadow:none}
.learning-level-tab strong{font-size:var(--nl-type-14)}
.learning-level-tab small{font-size:var(--nl-type-12)}
.level-emoji{font-size:var(--nl-type-20)}
.program-view .course-level-body>p:first-child{text-align:left;margin:10px 0 15px;color:var(--nl-text-secondary);font-size:var(--nl-type-14)}
.program-view .course-module-grid{
  max-width:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0
}
.program-view .course-module,
.program-view .course-module.has-lesson{
  border:1px solid var(--nl-border-base);background:var(--nl-bg-card);border-radius:var(--nl-radius-16);
  padding:17px 18px 18px;margin:0;min-height:175px;
  box-shadow:0 4px 17px rgba(56,42,89,.028)
}
.program-view .course-module:before{
  float:right;position:static;display:grid;place-items:center;
  width:31px;height:31px;border-radius:var(--nl-radius-10);
  background:var(--nl-bg-soft);color:var(--nl-text-accent);font-size:var(--nl-type-14);content:attr(data-lesson-number);
  margin-left:10px
}
.program-view .course-module.has-lesson:before{content:'✓';background:var(--nl-bg-success);color:var(--nl-text-success)}
.program-view .course-module:after{display:none}
.program-view .course-module .course-num{font-size:var(--nl-type-11);letter-spacing:.7px}
.program-view .course-module h3{font-size:var(--nl-type-18);line-height:1.28;margin:9px 0;color:var(--nl-text-primary)}
.program-view .course-module .course-module-description{font-size:var(--nl-type-13);line-height:1.5;margin:7px 0;color:var(--nl-text-secondary)}
.program-view .course-module .module-status{font-size:var(--nl-type-12)}
.program-view .course-module .course-open-lesson{
  padding:9px 14px;font-size:var(--nl-type-13);min-height:39px;margin:12px 6px 0 0;
  border-radius:var(--nl-radius-10);box-shadow:none
}
.program-view .course-module .course-open-lesson:hover{background:var(--nl-bg-action-hover)}
#practiceView .quiz,#theoryView .theory-section,#profileView.profile-panel{
  border:1px solid #e6e2ec;box-shadow:0 4px 16px rgba(46,42,80,.03)
}
body .theory-index button.active{background:var(--violet);color:var(--nl-text-on-accent)}
@media(max-width:760px){
  .program-view .course-module-grid{grid-template-columns:1fr}
  .program-view .course-module,.program-view .course-module.has-lesson{min-height:0}
}
@media(max-width:660px){
  html{scroll-padding-top:175px}
  .site-header .top{padding:9px 12px 11px;gap:8px 10px}
  .site-header .logo{width:35px;height:35px;border-radius:var(--nl-radius-10)}
  .site-header .brand{gap:10px}
  .site-header .brandstrong{font-size:var(--nl-type-18)}
  .site-header .brandcap{font-size:var(--nl-type-9);letter-spacing:.25px}
  .site-header .auth-account-btn{min-height:36px;max-width:131px;padding:6px 8px}
  body .site-nav-wrap .theory-switch,
  body.learning-mode .site-nav-wrap .theory-switch{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  body .site-nav-wrap .theory-switch button,
  body.learning-mode .site-nav-wrap .theory-switch button{min-height:39px;padding:8px 5px;font-size:var(--nl-type-12);border-radius:var(--nl-radius-9)}
  body .shell,body.learning-mode .shell{margin:12px auto;padding:0 12px}
  .program-view .course-heading{padding:16px 17px;border-radius:var(--nl-radius-14)}
  .program-view .course-heading h1{font-size:var(--nl-type-23)}
  .program-view .course-heading p{font-size:var(--nl-type-13)}
  .course-learning-pulse{padding:14px}
  .learning-level-tab{min-height:62px;gap:5px;padding:8px 5px}
  .learning-level-tab strong{font-size:var(--nl-type-12)}
  .learning-level-tab small{font-size:var(--nl-type-10)}
  .level-emoji{font-size:var(--nl-type-19)}
  .program-view .course-module{padding:16px}
}
@media(prefers-reduced-motion:reduce){
  .site-header .theory-switch button{transition:none!important}
}

/* Learning card text: keep long Russian and Nogai titles inside every card.
   Shared across lessons; the typography is intentionally smaller on phones. */
#courseLessonView .learning-letter-grid,
#courseLessonView .course-theory-sections,
#theoryView .theory-grid,
#programView .course-module-grid{
  min-width:0;
}
#courseLessonView .learning-letter-grid>div,
#courseLessonView .course-theory-section,
#courseLessonView .learning-theory-explanation,
#theoryView .theory-card,
#theoryView .theory-example,
#programView .course-module,
#practiceView .quiz,
#profileView .profile-tile{
  min-width:0;
  max-width:100%;
  overflow-wrap:anywhere;
}
#courseLessonView .learning-letter-grid>div strong{
  display:block;
  min-width:0;
  max-width:100%;
  font-size:clamp(var(--nl-type-18),2vw + var(--nl-type-8),var(--nl-type-24));
  line-height:1.25;
  overflow-wrap:anywhere;
  word-break:normal;
}
#courseLessonView .learning-letter-grid>div span,
#courseLessonView .learning-letter-grid>div small,
#courseLessonView .course-theory-section :is(h2,h3,h4,p,li),
#theoryView .theory-card :is(h2,h3,h4,p,li),
#programView .course-module :is(h2,h3,h4,p,li){
  min-width:0;
  max-width:100%;
  overflow-wrap:anywhere;
}
@media(max-width:640px){
  #courseLessonView .learning-letter-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  #courseLessonView .learning-letter-grid>div{
    padding:16px 10px;
    height:auto;
  }
  #courseLessonView .learning-letter-grid>div strong{
    font-size:clamp(var(--nl-type-17),4.5vw,var(--nl-type-20));
    line-height:1.3;
  }
  #courseLessonView .learning-letter-grid>div span{font-size:var(--nl-type-15);line-height:1.4}
  #courseLessonView .learning-letter-grid>div small{font-size:var(--nl-type-13);line-height:1.45}
}


/* Guided chunks for longer grammar lessons: reuse the approved light violet design. */
#courseLessonView .course-part-navigation{
  margin:20px 0 14px;padding:16px 18px;
  border:1px solid #e6def5;border-radius:var(--nl-radius-14);background:#faf8ff;
}
#courseLessonView .course-part-navigation[hidden],
#courseLessonView .course-part-review[hidden],
#courseLessonView .course-part-actions[hidden],
#courseLessonView .learning-intro-actions[hidden]{display:none!important}
#courseLessonView .course-part-heading{
  display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;
}
#courseLessonView .course-part-position{
  font-size:var(--nl-type-12);font-weight:800;color:var(--nl-text-accent);letter-spacing:.35px;
}
#courseLessonView .course-part-progress{font-size:var(--nl-type-12);color:var(--nl-text-secondary)}
#courseLessonView .course-part-navigation h3{
  font-size:var(--nl-type-19);line-height:1.4;margin:8px 0 12px;color:var(--nl-text-accent);
}
#courseLessonView .course-part-tabs{
  display:flex;flex-wrap:wrap;gap:8px;
}
#courseLessonView .course-part-tab{
  min-height:39px;border:1px solid #ded7f0;background:var(--nl-bg-card);color:var(--nl-text-accent-soft);
  font:inherit;font-size:var(--nl-type-13);font-weight:750;padding:8px 12px;border-radius:var(--nl-radius-10);
  cursor:pointer;
}
#courseLessonView .course-part-tab:hover{background:#f0ecfb;border-color:#b4a5e5}
#courseLessonView .course-part-tab.is-active{
  background:var(--nl-bg-action);border-color:#5b4bb9;color:var(--nl-text-on-accent);
}
#courseLessonView .course-part-review{
  margin:18px 0 14px;border:1px solid #ded5f4;border-radius:var(--nl-radius-16);
  padding:18px 20px;background:#f8f5ff;
}
#courseLessonView .course-part-review-eyebrow{
  font-size:var(--nl-type-12);font-weight:800;color:var(--nl-text-accent);margin-bottom:7px;
}
#courseLessonView .course-part-review h3{
  font-size:var(--nl-type-19);line-height:1.45;color:var(--nl-text-primary);margin:0 0 13px;
}
#courseLessonView .course-part-review-answers{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;
}
#courseLessonView .course-part-answer{
  background:var(--nl-bg-card);border:1px solid #e0daed;border-radius:var(--nl-radius-11);min-height:48px;
  padding:11px 13px;text-align:left;color:var(--nl-text-primary);font:inherit;
  font-size:var(--nl-type-15);line-height:1.5;overflow-wrap:anywhere;cursor:pointer;
}
#courseLessonView .course-part-answer:not(:disabled):hover{
  background:#f1edfd;border-color:#a69add;
}
#courseLessonView .course-part-answer.is-correct{
  background:var(--nl-bg-success);border-color:var(--nl-border-success);color:var(--nl-text-success);
}
#courseLessonView .course-part-answer.is-wrong{
  background:var(--nl-bg-danger);border-color:var(--nl-border-danger);color:var(--nl-text-danger);
}
#courseLessonView .course-part-review-feedback{
  padding:12px 14px;margin:14px 0 0;border-radius:var(--nl-radius-10);
  background:var(--nl-bg-card);color:var(--nl-text-primary);border:1px solid #e7e2f3;
  font-size:var(--nl-type-15);line-height:1.65;overflow-wrap:break-word;
}
#courseLessonView .course-part-review-feedback[hidden]{display:none!important}
#courseLessonView .course-part-actions{
  display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;
  margin:14px 0 24px;
}
#courseLessonView .course-part-actions button{
  min-height:43px;border-radius:var(--nl-radius-11);padding:10px 15px;font-size:var(--nl-type-14);
}
#courseLessonView .course-part-actions button:disabled{opacity:.5;cursor:not-allowed}
#courseLessonView .course-part-actions .learning-secondary-button{
  background:var(--nl-bg-card);border:1px solid #d9d3e9;color:var(--nl-text-accent);
}
#courseLessonView .course-part-tabs button:focus-visible,
#courseLessonView .course-part-answer:focus-visible,
#courseLessonView .course-part-actions button:focus-visible{
  outline:3px solid #c4b5fd;outline-offset:2px;
}
@media(max-width:640px){
  #courseLessonView .course-part-navigation{padding:13px;margin:17px 0 12px}
  #courseLessonView .course-part-navigation h3{font-size:var(--nl-type-17)}
  #courseLessonView .course-part-tab{flex:1 1 90px;text-align:center;padding:8px 6px}
  #courseLessonView .course-part-review{padding:14px}
  #courseLessonView .course-part-review h3{font-size:var(--nl-type-17)}
  #courseLessonView .course-part-review-answers{grid-template-columns:1fr}
  #courseLessonView .course-part-actions button{flex:1 1 145px}
}

/* Contact footer: one compact, unobtrusive horizontal line.
   Keep both headings, heading symbols, four links/buttons and accessible labels. */
.contact-footer{
  width:min(100% - 24px,860px);max-width:860px;
  display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);
  align-items:center;gap:0;
  margin:10px auto 18px;padding:7px 11px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--nl-radius-12);box-shadow:none;
}
.contact-footer .contact-column{
  min-width:0;display:flex;flex-direction:row;
  align-items:center;justify-content:center;flex-wrap:nowrap;
  gap:9px;min-height:34px;
}
.contact-footer .contact-column-author{padding-right:11px}
.contact-footer .contact-column-channel{
  padding-left:11px;border-left:1px solid var(--border);
}
.contact-footer .contact-community-buttons{gap:5px}
.contact-footer .contact-whatsapp{color:var(--nl-text-success)}
html[data-theme="dark"] .contact-footer .contact-whatsapp{color:var(--nl-text-success)!important}
.contact-footer .contact-footer-label{
  display:inline-flex;align-items:center;gap:5px;flex:none;
  margin:0;color:var(--nl-text-secondary);
  font-size:var(--nl-type-12);font-weight:750;line-height:1.2;
  letter-spacing:0;white-space:nowrap;
}
.contact-footer .contact-heading-icon{
  width:14px;height:14px;flex:none;color:var(--nl-text-secondary);
}
.contact-footer .contact-buttons{
  display:inline-flex;align-items:center;gap:5px;
  flex:none;flex-wrap:nowrap;
}
.contact-footer .contact-button,
.contact-footer .contact-channel-link{
  display:grid;place-items:center;flex:none;
  width:30px;height:30px;min-height:30px;
  padding:0;margin:0;border:1px solid var(--border);
  border-radius:var(--nl-radius-9);background:var(--nl-bg-subtle);
  color:var(--nl-text-accent-soft);box-shadow:none;
  text-decoration:none;transition:background .15s,border-color .15s;
}
.contact-footer .contact-button-icon{width:17px;height:17px;flex:none}
.contact-footer .contact-button>span{
  /* Retain label in DOM; aria-label names every icon-only action. */
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}
.contact-footer .contact-button:hover,
.contact-footer .contact-button:focus-visible{
  transform:none;background:var(--nl-bg-selected);
  border-color:var(--nl-border-accent);color:var(--nl-text-accent-soft);
}
html[data-theme="dark"] .contact-footer{
  background:var(--surface)!important;
  border-color:var(--border)!important;box-shadow:none!important;
}
html[data-theme="dark"] .contact-footer .contact-button{
  background:var(--nl-bg-control)!important;
  border-color:var(--nl-border-control)!important;
  color:var(--nl-text-accent-soft)!important;
}
html[data-theme="dark"] .contact-footer .contact-button:hover,
html[data-theme="dark"] .contact-footer .contact-button:focus-visible{
  background:var(--nl-bg-selected)!important;
}
@media(max-width:740px){
  .contact-footer{margin-bottom:calc(90px + env(safe-area-inset-bottom))}
}
@media(max-width:420px){
  .contact-footer{
    grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);
    padding:5px 6px;
  }
  .contact-footer .contact-column{gap:3px;min-height:28px}
  .contact-footer .contact-column-author{padding-right:4px}
  .contact-footer .contact-column-channel{padding-left:4px}
  .contact-footer .contact-footer-label{
    font-size:var(--nl-type-10);gap:3px;letter-spacing:-.1px;
  }
  .contact-footer .contact-heading-icon{width:11px;height:11px}
  .contact-footer .contact-buttons{gap:3px}
  .contact-footer .contact-community-buttons{gap:3px}
  .contact-footer .contact-button,.contact-footer .contact-channel-link{
    width:24px;height:27px;min-height:27px;
    border-radius:var(--nl-radius-8);
  }
  .contact-footer .contact-button-icon{width:14px;height:14px}
}

/* Lesson parts live inside each module and use the same table in the lesson. */
.program-view .course-module-parts{margin:14px 0 2px;min-width:0}
.program-view .course-module-parts-title{
  margin:0 0 7px;font-size:var(--nl-type-13);font-weight:800;color:var(--nl-text-accent)
}
#courseLessonView .course-part-tabs{display:block;min-width:0}
.course-part-table{
  width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;
  border:1px solid #e3ddf1;border-radius:var(--nl-radius-11);overflow:hidden;
  background:var(--nl-bg-card);font-size:var(--nl-type-13);color:var(--nl-text-primary);
}
.course-part-table th{
  background:var(--nl-bg-selected);color:var(--nl-text-accent-soft);text-align:left;
  font-size:var(--nl-type-11);font-weight:800;padding:9px 10px;
  border-bottom:1px solid #e3ddf1
}
.course-part-table th:last-child{width:102px}
.course-part-table td{
  padding:0;border-bottom:1px solid #eeeaf5;vertical-align:middle;
}
.course-part-table tr:last-child td{border-bottom:0}
.course-part-table tbody tr.is-current{background:var(--nl-bg-control)}
.course-part-table tbody tr:hover{background:#f8f6ff}
.course-part-table .course-part-link{
  display:block;width:100%;min-height:39px;text-align:left;
  padding:9px 10px;border:0;border-radius:0;background:transparent;
  font:inherit;font-weight:700;line-height:1.45;color:var(--nl-text-accent);
  white-space:normal;overflow-wrap:anywhere;cursor:pointer
}
.course-part-table .course-part-link:hover{text-decoration:underline}
.course-part-table .course-part-link:focus-visible{
  outline:3px solid #b6a3ef;outline-offset:-3px;
}
.course-part-table .course-part-state{
  padding:8px 8px 8px 4px;text-align:left;font-size:var(--nl-type-11);
  color:var(--nl-text-secondary);line-height:1.4;overflow-wrap:anywhere;
}
.course-part-table .course-part-state.is-done{color:var(--nl-text-success);font-weight:800}
@media(max-width:640px){
  .course-part-table th:last-child{width:83px}
  .course-part-table th{padding:8px;font-size:var(--nl-type-11)}
  .course-part-table .course-part-link{padding:9px 8px;font-size:var(--nl-type-12)}
  .course-part-table .course-part-state{font-size:var(--nl-type-10);padding-right:5px}
  .program-view .course-module-parts{margin-top:12px}
}

/* Numbered mini-lessons share the familiar purple module 5 action style. */
.program-view .course-module .course-open-lesson[hidden]{display:none!important}
.program-view .course-module-parts .course-part-link{
  margin:5px 6px;width:calc(100% - 12px);min-height:44px;
  padding:10px 11px;border-radius:var(--nl-radius-9);background:var(--violet);color:var(--nl-text-on-accent);
  font-size:var(--nl-type-12);line-height:1.45;
}
.program-view .course-module-parts .course-part-link:hover{
  background:#4e3ea7;color:var(--nl-text-on-accent);text-decoration:none;
}
.program-view .course-module-parts .course-part-link:focus-visible{
  outline:3px solid #b6a3ef;outline-offset:1px;
}

/* Program closing messages: a single calm, aligned reading column. */
.program-view .course-checkpoint,
.program-view .course-last-note{
  box-sizing:border-box;
  width:100%;
  max-width:940px;
  margin-left:auto;
  margin-right:auto;
  padding:15px 19px;
  border-radius:var(--nl-radius-13);
  font-size:var(--nl-type-14);
  font-weight:450;
  line-height:1.65;
  letter-spacing:0;
  text-align:left;
  overflow-wrap:anywhere;
  box-shadow:none;
}
.program-view .course-checkpoint{
  margin:18px auto 0!important;
  border:1px solid #dcebe3;
  border-left:3px solid #9bc5ae;
  background:#f5f9f7;
  color:var(--nl-text-success)!important;
}
.program-view .course-last-note{
  margin:20px auto 10px;
  border:1px solid #e5e3ef;
  border-left:3px solid #b8afe0;
  background:var(--nl-bg-card);
  color:var(--nl-text-secondary);
}
/* Quiet, centered site description instead of a stray left-aligned line. */
body .foot{
  box-sizing:border-box;
  width:calc(100% - 32px);
  max-width:940px;
  margin:22px auto 12px;
  padding:14px 16px 0;
  border-top:1px solid #e7e4ec;
  text-align:center;
  font-size:var(--nl-type-12);
  line-height:1.6;
  color:var(--nl-text-secondary);
}
@media(max-width:660px){
  .program-view .course-checkpoint,
  .program-view .course-last-note{
    padding:12px 14px;
    font-size:var(--nl-type-13);
    line-height:1.65;
  }
  body .foot{
    margin:18px auto 10px;
    padding:12px 8px 0;
    font-size:var(--nl-type-12);
  }
}

/* PWA installation invite: small, dismissible and separate from lesson UI. */
.pwa-install-card{
  position:fixed;bottom:calc(14px + env(safe-area-inset-bottom, 0px));
  left:50%;transform:translateX(-50%);z-index:120;
  width:min(430px, calc(100vw - 28px));padding:15px 16px;
  border:1px solid #e0dbea;border-radius:var(--nl-radius-18);background:var(--nl-bg-card);
  box-shadow:0 12px 42px rgba(37,29,63,.20);color:var(--ink);
}
.pwa-install-heading{display:flex;align-items:center;gap:11px}
.pwa-install-icon{flex:none;object-fit:contain;border-radius:var(--nl-radius-11)}
.pwa-install-copy{flex:1;min-width:0}
.pwa-install-copy strong{display:block;font-size:var(--nl-type-15);line-height:1.3}
.pwa-install-copy p{font-size:var(--nl-type-13);line-height:1.45;color:var(--muted);margin:4px 0 0}
.pwa-install-close{align-self:flex-start;flex:none;border:0;background:transparent;
  color:var(--nl-text-secondary);font-size:var(--nl-type-25);line-height:1;padding:0 4px}
.pwa-install-actions{display:flex;gap:9px;margin:13px 0 0}
.pwa-install-primary{background:var(--nl-bg-action);border:1px solid #5b4bb9;color:white;
  border-radius:var(--nl-radius-11);font-weight:750;padding:10px 15px;flex:1}
.pwa-install-later{background:var(--nl-bg-card);border:1px solid #ded9e9;border-radius:var(--nl-radius-11);
  color:var(--nl-text-secondary);font-weight:700;padding:10px 16px}
.pwa-install-steps{margin:12px 0 0;font-size:var(--nl-type-13);line-height:1.6;
  background:#f5f2ff;border-radius:var(--nl-radius-11);padding:11px;color:var(--nl-text-primary)}
.pwa-install-footer{display:inline-block;margin:9px 0 0;padding:8px 11px;
  border:1px solid #ded9ed;border-radius:var(--nl-radius-10);background:#f8f6ff;
  color:var(--nl-text-accent);font-size:var(--nl-type-13);font-weight:700}
@media(max-width:380px){
  .pwa-install-card{padding:12px}
  .pwa-install-copy strong{font-size:var(--nl-type-14)}
  .pwa-install-primary,.pwa-install-later{padding:10px}
}

/* Compact right-side navigation; old tabs stay as the single JS navigation source. */
.site-header .header-right{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.site-header .sections-menu{position:relative;flex:none}
.site-header .sections-menu-button{
  display:flex;align-items:center;justify-content:center;gap:9px;
  min-height:40px;padding:7px 12px;border-radius:var(--nl-radius-11);
  border:1px solid #ded8f2;background:var(--nl-bg-control);color:var(--nl-text-accent);
  font-weight:750;font-size:var(--nl-type-14);line-height:1.3
}
.site-header .sections-menu-button:hover,
.site-header .sections-menu-button[aria-expanded="true"]{
  border-color:#c4b8ed;background:#ebe5ff
}
.site-header .sections-menu-icon{font-size:var(--nl-type-22);line-height:1}
.site-header .sections-menu-panel{
  position:absolute;right:0;top:calc(100% + 9px);z-index:140;
  width:min(310px,calc(100vw - 24px));
  padding:11px;border:1px solid #e1dbef;border-radius:var(--nl-radius-16);
  background:var(--nl-bg-card);box-shadow:0 17px 42px rgba(39,30,74,.16);
  display:grid;gap:5px
}
.site-header .sections-menu-panel[hidden]{display:none!important}
.site-header .sections-menu-heading{
  font-size:var(--nl-type-12);font-weight:850;color:var(--nl-text-secondary);
  letter-spacing:.6px;text-transform:uppercase;padding:7px 9px 5px
}
.site-header .sections-menu-link{
  display:flex;align-items:center;gap:10px;text-align:left;width:100%;
  min-height:47px;padding:10px 12px;border:1px solid transparent;
  border-radius:var(--nl-radius-10);background:transparent;color:var(--nl-text-primary);
  font-size:var(--nl-type-14);font-weight:700;line-height:1.4
}
.site-header .sections-menu-link:hover{background:#f3efff;border-color:#e8e0fc}
.site-header .sections-menu-link.is-current,
.site-header .sections-menu-link[aria-current="page"]{
  background:#ede8fc;border-color:#d8cef8;color:var(--nl-text-accent)
}
.site-header .sections-menu-link.is-current:after{
  content:'✓';margin-left:auto;color:var(--nl-text-accent);font-weight:850
}
/* Keep the logo/account/menu bar sticky, not the section tabs underneath. */
body .site-header{position:sticky;top:0;z-index:75}
body .site-nav-wrap .theory-switch,
body.learning-mode .site-nav-wrap .theory-switch,
body.learning-lesson-mode .site-nav-wrap .theory-switch{display:grid!important}
@media(max-width:460px){
  .site-header .header-right{gap:7px}
  .site-header .auth-account-btn{min-width:39px;min-height:39px;padding:5px;justify-content:center}
  .site-header .auth-quick-label,.site-header .auth-chevron{display:none}
  .site-header .sections-menu-button{width:41px;min-height:39px;padding:6px}
  .site-header .sections-menu-label{display:none}
}

/* Only the logo + account + menu row stays on screen while scrolling. */
.site-header .top{
  grid-template-rows:auto;
  padding-bottom:11px;
  row-gap:0
}
.site-nav-wrap{
  background:var(--nl-bg-card);
  border-bottom:1px solid #e8e5ef;
}
body .site-nav-wrap .theory-switch,
body.learning-mode .site-nav-wrap .theory-switch,
body.learning-lesson-mode .site-nav-wrap .theory-switch{
  display:grid!important;
  width:100%;max-width:1172px;
  padding:0 22px 11px;
  margin:0 auto;
  gap:9px;
}
@media(max-width:660px){
  .site-header .top{padding-bottom:10px}
  body .site-nav-wrap .theory-switch,
  body.learning-mode .site-nav-wrap .theory-switch,
  body.learning-lesson-mode .site-nav-wrap .theory-switch{
    padding:0 12px 10px;
    gap:6px;
  }
}

/* ===== NOGAILAB DARK MODE =====
   Light mode is unchanged. Only :root[data-theme="dark"] activates these
   accessibility-minded overrides. Keep alongside the approved design. */
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#101725;
  --surface:#1b2537;
  --ink:#e9edf8;
  --muted:#b4c0d4;
  --border:#38465e;
  --violet:#b7a7ff;
  --violet-soft:#332d51;
  --green:#74dab4;
  --green-soft:#203e39;
  --red:#ff9eac;
  --red-soft:#492b38;
  --shadow:0 12px 32px rgba(0,0,0,.22);
  --nl-lesson-ink:#e9edf8;
  --nl-lesson-text:#c5cde0;
  --nl-lesson-purple:#c4b6ff;
  --nl-lesson-soft:#232f45;
  --nl-lesson-border:#3b4961;
}
html[data-theme="dark"],
html[data-theme="dark"] body{
  background:var(--bg)!important;
  color:var(--ink)!important;
}
html[data-theme="dark"] a{color:var(--nl-text-accent-soft)}
html[data-theme="dark"] :is(.site-header,.site-nav-wrap,.foot){
  background:var(--nl-bg-card)!important;
  color:var(--ink)!important;
  border-color:var(--border)!important;
}
html[data-theme="dark"] :is(.site-header .brandstrong,.site-header .brandcap){
  color:var(--nl-text-accent-soft)!important;
}
html[data-theme="dark"] :is(.site-header .auth-account-btn,
  .site-header .sections-menu-button,.site-header .theme-toggle){
  background:var(--nl-bg-control)!important;
  color:var(--nl-text-accent-soft)!important;
  border-color:var(--nl-border-control)!important;
}
html[data-theme="dark"] :is(.site-header .auth-account-btn:hover,
  .site-header .sections-menu-button:hover,
  .site-header .sections-menu-button[aria-expanded="true"],
  .site-header .theme-toggle:hover){
  background:var(--nl-bg-selected)!important;
}
html[data-theme="dark"] :is(.site-header .auth-avatar,.site-header .sections-menu-panel,
  .site-header .auth-widget .auth-box,.auth-box){
  background:var(--nl-bg-card)!important;
  color:var(--ink)!important;
  border-color:var(--border)!important;
}
html[data-theme="dark"] :is(.site-header .sections-menu-heading,
  .site-header .auth-widget .auth-box p){color:var(--muted)!important}
html[data-theme="dark"] .site-header .sections-menu-link{
  color:var(--ink)!important;background:transparent!important;
}
html[data-theme="dark"] .site-header .sections-menu-link:hover{
  color:var(--nl-text-accent-soft)!important;background:var(--nl-bg-selected)!important;
}
html[data-theme="dark"] :is(.site-header .sections-menu-link.is-current,
  .site-header .sections-menu-link[aria-current="page"]){
  color:var(--nl-text-accent-soft)!important;background:var(--nl-bg-selected)!important;
  border-color:#605389!important;
}
html[data-theme="dark"] .site-header .sections-menu-link.is-current::after{
  color:var(--nl-text-accent-soft)!important;
}
html[data-theme="dark"] body .site-nav-wrap .theory-switch button{
  background:var(--nl-bg-control)!important;color:var(--nl-text-muted)!important;
  border-color:#3f506a!important;
}
html[data-theme="dark"] body .site-nav-wrap .theory-switch button:hover{
  background:#32425e!important;
}
html[data-theme="dark"] body .site-nav-wrap .theory-switch button.active{
  background:var(--nl-bg-action)!important;color:var(--nl-text-on-accent)!important;
  border-color:#9282f6!important;
}
html[data-theme="dark"] :is(.panel,.sidebar,.info,.refcard,.quiz,.modal,
  .theory-section,.theory-card,.theory-example,.learning-theory-card,
  .learning-question-card,.learning-theory-explanation,.course-theory-section,
  .course-lesson-article,.course-lesson-header,.learning-lesson-intro,
  .learning-lesson-topbar,.learning-intro,.learning-focus,
  .learning-mistake-summary,.learning-quiz-stage,.course-heading,
  .program-view .course-heading,.program-view .course-module,.course-level,
  .course-learning-pulse,.course-checkpoint,.course-last-note,
  .profile-panel,.profile-tile,.achievements,.badge,.points-card,
  .stat,.stats,.site-stats-panel,.site-stats-item,.save-progress-notice,
  .case-question-table,.nogai-alpha,.nogai-letter,.nogai-sound,.nogai-word,
  .nogai-note,.learning-letter-grid>div,.practice-session,
  .practice-builder,.practice-builder-chosen,.practice-typed,
  .contact-footer,.course-part-navigation,.course-part-review,
  .pwa-install-card,.pwa-install-steps,.pwa-install-footer){
  background:var(--nl-bg-card)!important;
  border-color:var(--border)!important;
  color:var(--ink)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] :is(.learning-letter-grid>div,.course-theory-section,
  .theory-example,.theory-card,.nogai-sound,.nogai-word,.nogai-note,
  .nogai-alpha,.nogai-letter,.site-stats-item,.practice-builder-chosen,
  .course-part-review,.learning-mistake-summary){
  background:var(--nl-bg-subtle)!important;
}
html[data-theme="dark"] :is(.course-level>summary,.course-level-body,
  .course-part-table,.course-part-table th,.course-part-table td,
  .course-part-table tr,.topic-btn,.learning-level-tab,.stat,.site-stats-panel){
  background-color:var(--nl-bg-card)!important;
  color:var(--ink)!important;
  border-color:var(--border)!important;
}
html[data-theme="dark"] :is(.program-view .course-level-title,
  .program-view .course-heading h1,.program-view .course-module h3,
  .learning-theory-card h2,.learning-question-card h2,
  .course-theory-section h3,.theory-section h2,.theory-section h3,
  .learning-intro h1,.learning-lesson-intro h1,
  .profile-panel h2,.site-stats-heading h3,.pwa-install-copy strong,
  .course-part-review h3,.course-part-navigation h3,
  .learning-focus h3,.intro h1,.q-title,.foot){
  color:var(--nl-text-accent-soft)!important;
}
html[data-theme="dark"] :is(.program-view .course-heading p,
  .program-view .course-module-description,.course-level-body>p,
  .learning-theory-card>p,.course-theory-section p,.theory-section p,
  .learning-theory-explanation p,.theory-card p,.learning-focus p,
  .learning-lead,.learning-answer-feedback,.feedback p,
  .course-part-review-feedback,.practice-session p,.profile-tile,
  .pwa-install-copy p,.pwa-install-steps,
  .contact-footer-label,.foot,.stat-label,.stat-sub,
  .site-stats-explain,.course-learning-pulse p,.learning-letter-grid small,
  .profile-panel p,.save-progress-notice-copy span){
  color:var(--nl-text-muted)!important;
}
html[data-theme="dark"] :is(.program-view .course-stats span,
  .course-level-tag,.learning-step-label,.course-num,.pill,
  .topic-count,.learning-question-kicker,.course-part-position,
  .badge-notice,.nogai-alpha-count,.learning-level-tab small,
  .program-view .course-module .module-status){
  background:var(--nl-bg-control)!important;
  color:var(--nl-text-accent-soft)!important;
  border-color:var(--nl-border-control)!important;
}
html[data-theme="dark"] :is(.program-view .course-module-parts-title,
  .learning-level-tab strong,.program-view .course-module li,
  .theory-section li,.course-theory-section li,
  .nogai-letter strong,.nogai-letter small,
  .learning-letter-grid strong,.learning-letter-grid span,
  .learning-letter-grid small){
  color:var(--nl-text-muted)!important;
}
html[data-theme="dark"] :is(.learning-level-tab.is-selected,
  .topic-btn.active,.course-part-table tbody tr.is-current,
  .course-part-tab.is-active){
  background:var(--nl-bg-selected)!important;
  color:var(--nl-text-accent-soft)!important;
  border-color:var(--nl-border-accent)!important;
}
html[data-theme="dark"] :is(.course-part-table th,
  .course-part-table .course-part-state,.site-stats-item>span){
  color:var(--nl-text-muted)!important;
}
html[data-theme="dark"] :is(.course-part-table .course-part-link,
  .theory-index button,.refcard button){
  color:var(--nl-text-accent-soft)!important;
}
html[data-theme="dark"] :is(.course-part-table .course-part-link:hover,
  .course-part-table tbody tr:hover,.course-part-tab:hover){
  background:var(--nl-bg-selected)!important;
}
html[data-theme="dark"] :is(.learning-answer-list>button,
  .course-part-answer,.option,.tab,.secondary,.practice-builder .builder-tile,
  .practice-builder-actions button,.practice-typed button,
  .course-part-tab,.pwa-install-later,.contact-email,
  .theory-index button,.refcard button,.levelselect,.topic-btn){
  background:var(--nl-bg-control)!important;
  color:var(--nl-text-muted)!important;
  border-color:var(--nl-border-control)!important;
}
html[data-theme="dark"] :is(.learning-answer-list>button:hover,
  .option:not(:disabled):hover,.course-part-answer:not(:disabled):hover,
  .practice-builder .builder-tile:hover:not(:disabled)){
  background:var(--nl-bg-selected)!important;
}
html[data-theme="dark"] :is(.course-primary,.learning-main-button,
  .program-view .course-open-lesson,.course-open-lesson,
  .course-module-parts .course-part-link,.practice-builder-actions .builder-submit,
  .pwa-install-primary,.site-header #authLogin,.next){
  background:var(--nl-bg-action)!important;
  color:var(--nl-text-on-accent)!important;
  border-color:#9383f8!important;
}
html[data-theme="dark"] :is(.learning-answer-list>button.is-correct,
  .course-part-answer.is-correct,.option.correct){
  background:var(--nl-bg-success)!important;color:var(--nl-text-success)!important;
  border-color:var(--nl-border-success)!important;
}
html[data-theme="dark"] :is(.learning-answer-list>button.is-wrong,
  .course-part-answer.is-wrong,.option.wrong){
  background:var(--nl-bg-danger)!important;color:var(--nl-text-danger)!important;
  border-color:var(--nl-border-danger)!important;
}
html[data-theme="dark"] :is(.feedback.is-wrong,.feedback-student-answer){
  background:var(--nl-bg-danger)!important;color:var(--nl-text-danger)!important;
  border-color:#915a70!important;
}
html[data-theme="dark"] :is(.learning-answer-list>button:disabled,
  .course-part-answer:disabled,.learning-main-button:disabled){
  opacity:.7;
}
html[data-theme="dark"] :is(input,select,textarea,.practice-typed input,.modal textarea){
  color:var(--nl-text-muted)!important;
  background:var(--nl-bg-control)!important;
  border-color:#53627c!important;
}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--nl-text-secondary)!important}
html[data-theme="dark"] :is(.course-part-review-feedback,
  .feedback,.learning-answer-feedback,.course-part-table,
  .contact-footer,.pwa-install-steps,.pwa-install-footer){
  border-color:#45536d!important;
}
html[data-theme="dark"] :is(.program-view .course-checkpoint){
  background:var(--nl-bg-success)!important;
  border-color:#497c6b!important;
  color:var(--nl-text-success)!important;
}
html[data-theme="dark"] :is(.program-view .course-last-note){
  background:var(--nl-bg-control)!important;color:var(--nl-text-muted)!important;
  border-color:#555e83!important;
}
html[data-theme="dark"] :is(.pwa-install-close,.auth-status,.muted-text){
  color:var(--nl-text-muted)!important;
}
html[data-theme="dark"] :is(button,a,input,select,textarea):focus-visible{
  outline-color:#cbbaff!important;
}

/* Theme button shares the compact header with account and section controls. */
.site-header .theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  flex:none;min-height:40px;padding:7px 12px;
  border:1px solid #ded8f2;border-radius:var(--nl-radius-11);
  background:var(--nl-bg-control);color:var(--nl-text-accent);
  font-size:var(--nl-type-14);font-weight:750;line-height:1.3;
}
.site-header .theme-toggle:hover{background:#ebe5ff;border-color:#c4b8ed}
.site-header .theme-toggle-icon{font-size:var(--nl-type-19);line-height:1}
@media(max-width:660px){
  .site-header .top{column-gap:9px}
  .site-header .header-right{gap:6px}
  .site-header .theme-toggle{min-width:39px;width:39px;min-height:39px;padding:5px}
  .site-header .theme-toggle-label{display:none}
}
@media(max-width:380px){
  .site-header .top{padding-left:9px;padding-right:9px;column-gap:6px}
  .site-header .header-right{gap:5px}
  .site-header .theme-toggle,.site-header .sections-menu-button{width:37px;min-width:37px}
}

/* Dark text contrast: all accents and secondary labels must remain readable.
   A few original lesson rules use fixed dark-purple or gray colors from the
   light theme. Override those at the shared component level, not per lesson. */
:root[data-theme="dark"]{
  --muted:#cbd5e5;
  --nl-lesson-text:#d1d9e8;
  --nl-lesson-purple:#ddd2ff;
}
html[data-theme="dark"] :is(
  #courseLessonView .learning-theory-card strong,
  #courseLessonView .course-theory-section strong,
  #courseLessonView .learning-theory-explanation strong,
  #courseLessonView .nogai-section strong,
  #courseLessonView .nogai-sound>strong,
  #courseLessonView .nogai-word strong,
  #courseLessonView .course-part-review strong,
  #theoryView .theory-section strong,
  #theoryView .theory-card strong,
  #theoryView .theory-example strong,
  #theoryView .case-question-table strong
){
  color:var(--nl-text-accent-soft)!important;
}
html[data-theme="dark"] :is(
  #courseLessonView .course-part-progress,
  #courseLessonView .course-part-review-eyebrow,
  #courseLessonView .course-part-table .course-part-state,
  #courseLessonView .learning-lesson-breadcrumb,
  #courseLessonView .learning-progress-label,
  #programView .course-level-count,
  #programView .course-module-parts-title,
  #theoryView .theory-note,
  #profileView .stat-sub
){
  color:var(--nl-text-muted)!important;
}
html[data-theme="dark"] #courseLessonView .course-part-table .course-part-state.is-done{
  color:var(--nl-text-success)!important;
}
/* Emphasized lesson labels should stay violet rather than inheriting body gray. */
html[data-theme="dark"] :is(
  #courseLessonView .course-part-position,
  #courseLessonView .course-part-review-eyebrow
){
  color:var(--nl-text-accent-soft)!important;
}

/* Dark-mode text contrast: older alphabet blocks use <b> and hard-coded
   light-theme label colors. Scope the fixes to lessons so light mode and
   unrelated screens keep their approved appearance. */
html[data-theme="dark"] #courseLessonView :is(
  .learning-theory-card>p,.course-theory-section p,
  .learning-theory-explanation p,.nogai-section p,
  .nogai-sound p,.nogai-note,.nogai-recap
) :is(b,strong){
  color:var(--nl-text-accent-soft)!important;
}
html[data-theme="dark"] #courseLessonView :is(
  .nogai-sound h4,.nogai-alpha-head h3,.nogai-section h3
){
  color:var(--nl-text-accent-soft)!important;
}
html[data-theme="dark"] #courseLessonView :is(
  .nogai-word span,.nogai-word small,.nogai-alpha-note,
  .nogai-recap ul,.nogai-section p,.nogai-sound p,.nogai-sound span
){
  color:var(--nl-text-muted)!important;
}
html[data-theme="dark"] #courseLessonView :is(
  .nogai-letter.special strong,.nogai-letter.special small
){
  color:var(--nl-text-accent-soft)!important;
}


/* ================================================================
   NOGAILAB · COZY STUDY V3 (approved full-site layout, 2026-11-06)
   Layout is shared by real course screens; no lesson/test data duplicated.
   Palette, type, and corner shapes are driven by existing design tokens.
   ================================================================ */
:root{
  --bg:#f7f5f0;
  --surface:#fffefa;
  --ink:#26283c;
  --muted:#68728a;
  --border:#e8e3e5;
  --violet:#6648b8;
  --violet-soft:#f0ebff;
  --nl-text-secondary:#525c73;
  --nl-text-accent-soft:#604aa6;
  --nl-bg-subtle:#f8f5ff;
  --nl-home-accent:#f0e8ff;
  --nl-home-warm:#fff0e0;
  --nl-home-warm-strong:#f7d8ab;
  --nl-nav-idle:#f6f3f8;
  --nl-nav-active:#efe8ff;
  --nl-home-shadow:0 12px 34px rgba(68,48,91,.065);
  --nl-home-line:#e8e2ef;
}
:root[data-theme="dark"]{
  --bg:#101725;
  --surface:#1b2537;
  --ink:#e9edf8;
  --muted:#c1cbdc;
  --border:#38465e;
  --violet:#c0b0ff;
  --violet-soft:#332d51;
  --nl-home-accent:#2d2a4e;
  --nl-home-warm:#372e39;
  --nl-home-warm-strong:#6b4f46;
  --nl-nav-idle:#1e2b40;
  --nl-nav-active:#342f56;
  --nl-home-shadow:0 12px 32px rgba(0,0,0,.12);
  --nl-home-line:#3d4960;
}
html{scroll-padding-top:100px}
body{background:var(--bg);color:var(--ink);font-family:var(--nl-font-family-ui)}
button, input, select, textarea{font-family:inherit}
[hidden]{display:none!important}
.site-header{background:var(--surface);border-color:var(--border)}
.site-header .top{
  max-width:1392px;grid-template-rows:auto;grid-template-columns:minmax(0,1fr) auto;
  padding:13px 26px;gap:16px;
}
.site-header .brand{align-items:center}
.site-header .logo{width:46px;height:46px}
.site-header .brandstrong{font-size:var(--nl-type-21);font-weight:850}
.site-header .brandcap{font-size:var(--nl-type-11);letter-spacing:.25px}
.site-header .header-right{gap:10px}
.site-header .sections-menu-button,.site-header .theme-toggle,
.site-header .auth-account-btn{min-height:42px;border-radius:var(--nl-radius-12)}
.site-header .sections-menu-button{min-width:44px}
.nl-workspace{
  display:grid;grid-template-columns:218px minmax(0,1fr);
  align-items:start;column-gap:26px;
  width:min(100% - 38px,1350px);
  margin:22px auto 30px;
}
.nl-workspace>.site-nav-wrap{
  position:sticky;top:101px;align-self:start;
  min-width:0;padding:13px;border:1px solid var(--border);
  border-radius:var(--nl-radius-20);background:var(--surface);
  box-shadow:var(--nl-home-shadow);
}
.nl-workspace .nl-nav-label{
  display:block;margin:8px 10px 13px;font-size:var(--nl-type-11);
  letter-spacing:.12em;font-weight:850;color:var(--nl-text-muted);
}
body .nl-workspace .site-nav-wrap .theory-switch,
body.learning-mode .nl-workspace .site-nav-wrap .theory-switch,
body.learning-lesson-mode .nl-workspace .site-nav-wrap .theory-switch{
  display:flex!important;flex-direction:column;gap:5px;padding:0;
  width:100%;max-width:none;margin:0;
}
body .nl-workspace .site-nav-wrap .theory-switch button,
body.learning-mode .nl-workspace .site-nav-wrap .theory-switch button,
body.learning-lesson-mode .nl-workspace .site-nav-wrap .theory-switch button{
  display:flex;align-items:center;justify-content:flex-start;
  min-height:47px;padding:9px 11px;gap:12px;margin:0;
  border:1px solid transparent;border-radius:var(--nl-radius-12);
  background:transparent;color:var(--nl-text-secondary);
  box-shadow:none;text-align:left;font-size:var(--nl-type-14);font-weight:750;
}
body .nl-workspace .site-nav-wrap .theory-switch button:hover{
  background:var(--nl-nav-idle);border-color:var(--nl-home-line)
}
body .nl-workspace .site-nav-wrap .theory-switch button.active,
body.learning-mode .nl-workspace .site-nav-wrap .theory-switch button.active,
body.learning-lesson-mode .nl-workspace .site-nav-wrap .theory-switch button.active{
  background:var(--nl-nav-active);border-color:var(--nl-home-line);
  color:var(--nl-text-accent-soft);box-shadow:none;
}
.nl-nav-icon{
  display:grid;place-items:center;flex:none;
  width:26px;height:26px;font-size:var(--nl-type-22);line-height:1;
}
.nl-nav-text{min-width:0;overflow-wrap:anywhere}
.nl-sidebar-note{
  background:linear-gradient(145deg,var(--nl-home-accent),var(--nl-home-warm));
  margin:22px 0 1px;padding:18px 13px;border-radius:var(--nl-radius-16);
  color:var(--ink);
}
.nl-sidebar-note .nl-nav-label{margin:0 0 10px}
.nl-sidebar-note strong{display:block;font-size:var(--nl-type-15);line-height:1.35}
.nl-sidebar-note p{font-size:var(--nl-type-13);line-height:1.5;margin:7px 0 0;color:var(--nl-text-secondary)}
body .nl-workspace>.shell,
body.learning-mode .nl-workspace>.shell{
  display:block;min-width:0;width:100%;max-width:none;
  margin:0;padding:0;
}
.nl-workspace>.shell>main{min-width:0;width:100%}
.nl-workspace>.shell>.right{display:none}
.nl-workspace :is(.panel,.quiz,.theory-section,.course-module,.course-level){
  box-shadow:none;
}
.nl-workspace h1,.nl-workspace h2,.nl-workspace h3{
  overflow-wrap:anywhere;letter-spacing:-.018em;
}
.nl-kicker{
  display:block;font-size:var(--nl-type-11);font-weight:850;
  letter-spacing:.12em;text-transform:uppercase;color:var(--nl-text-accent-soft);
}
.nl-home-view{display:grid;gap:23px;min-width:0}
.nl-home-hero{
  display:grid;grid-template-columns:minmax(0,1fr) 188px;align-items:center;
  gap:16px;min-height:285px;padding:40px clamp(22px,4vw,50px);
  border:1px solid var(--nl-home-line);border-radius:var(--nl-radius-24);
  background:radial-gradient(ellipse at 91% 6%,var(--nl-home-warm-strong),transparent 42%),
    linear-gradient(120deg,var(--nl-home-accent),var(--nl-home-warm));
  overflow:hidden;
}
.nl-hero-copy{min-width:0;position:relative;z-index:1}
.nl-home-hero h1{
  max-width:660px;font-size:clamp(var(--nl-type-29),3.6vw,var(--nl-type-40));
  line-height:1.16;margin:12px 0 16px;color:var(--ink);
}
.nl-home-hero p{
  max-width:550px;line-height:1.68;font-size:var(--nl-type-16);
  margin:0 0 22px;color:var(--nl-text-secondary);
}
/* One Nogai-language grammar illustration; change its palette, not the drawing. */
.nl-home-ornament{
  display:grid;place-items:center;width:188px;max-width:100%;aspect-ratio:1;
  border:0;background:transparent;opacity:1;transform:none
}
.nl-home-ornament img{
  display:block;width:100%;height:auto;object-fit:contain
}
html[data-theme="dark"] .nl-home-ornament img{
  filter:invert(1) hue-rotate(180deg) brightness(1.12) contrast(1.05) saturate(1.1)
}
.nl-primary-action,.nl-home-view .nl-primary-action,
.nl-workspace .nl-primary-action{
  display:inline-flex;justify-content:center;align-items:center;
  min-height:47px;padding:12px 23px;
  font-weight:800;font-size:var(--nl-type-14);
  border:1px solid var(--nl-bg-action);border-radius:var(--nl-radius-12);
  color:var(--nl-text-on-accent);background:var(--nl-bg-action);
}
.nl-hero-footnote{
  display:block;margin-top:14px;
  font-size:var(--nl-type-12);color:var(--nl-text-secondary);
}
.nl-home-summary{display:grid;grid-template-columns:1.15fr .85fr;gap:14px}
.nl-home-card{
  min-width:0;background:var(--surface);border:1px solid var(--border);
  box-shadow:var(--nl-home-shadow);border-radius:var(--nl-radius-20);
  padding:24px;
}
.nl-home-card h2{font-size:var(--nl-type-20);margin:0}
.nl-card-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.nl-home-chip{
  border-radius:var(--nl-radius-99);background:var(--nl-bg-soft);
  padding:6px 10px;font-size:var(--nl-type-12);color:var(--nl-text-accent-soft);
}
.nl-steps{display:grid;gap:11px;margin:21px 0}
.nl-steps>div{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}
.nl-steps strong{min-width:140px;font-size:var(--nl-type-11);color:var(--nl-text-accent-soft);letter-spacing:.05em}
.nl-steps span{font-size:var(--nl-type-14);color:var(--nl-text-secondary)}
.nl-quiet-action{
  background:transparent;border:0;padding:6px 0;min-height:36px;
  color:var(--nl-text-accent-soft);font-size:var(--nl-type-14);
  font-weight:800;text-align:left;
}
.nl-home-progress{background:linear-gradient(125deg,var(--surface),var(--nl-home-accent))}
.nl-home-progress h2{margin:10px 0 21px}
.nl-home-progress>strong{
  display:block;font-size:var(--nl-type-19);overflow-wrap:anywhere;
}
.nl-home-progress>p{font-size:var(--nl-type-13);line-height:1.6;color:var(--nl-text-secondary)}
.nl-home-progress-track{
  width:100%;height:9px;border-radius:var(--nl-radius-99);
  background:var(--nl-home-line);overflow:hidden;margin:16px 0 10px;
}
.nl-home-progress-track span{
  display:block;width:0;height:100%;border-radius:inherit;
  background:var(--nl-bg-action);transition:width .2s;
}
.nl-home-route-head h2{font-size:var(--nl-type-24);margin:9px 0 6px}
.nl-home-route-head p{margin:0;color:var(--nl-text-secondary);font-size:var(--nl-type-14)}
.nl-home-route{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.nl-home-route>button{
  display:flex;align-items:center;gap:14px;text-align:left;
  padding:20px;border:1px solid var(--border);
  background:var(--surface);border-radius:var(--nl-radius-16);
  min-height:92px;color:var(--ink);
}
.nl-home-route>button:hover,.nl-home-quick>button:hover{
  border-color:var(--nl-border-accent);background:var(--nl-bg-subtle)
}
.nl-route-number{
  display:grid;place-items:center;flex:none;width:44px;height:44px;
  font-size:var(--nl-type-15);font-weight:850;border-radius:var(--nl-radius-12);
  background:var(--nl-bg-soft);color:var(--nl-text-accent-soft);
}
.nl-home-route>button>span:nth-child(2){flex:1;min-width:0}
.nl-home-route strong{display:block;font-size:var(--nl-type-15);line-height:1.35}
.nl-home-route small{display:block;font-size:var(--nl-type-12);line-height:1.6;color:var(--nl-text-secondary)}
.nl-home-route>button>span:last-child{color:var(--nl-text-accent-soft)}
.nl-home-quick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.nl-home-quick>button{
  text-align:left;padding:16px 18px;min-width:0;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--nl-radius-16);color:var(--ink);
}
.nl-home-quick>button>span{display:inline-grid;place-items:center;
  width:32px;height:32px;background:var(--nl-bg-soft);
  border-radius:var(--nl-radius-10);font-size:var(--nl-type-21);color:var(--nl-text-accent-soft)}
.nl-home-quick strong{display:block;font-size:var(--nl-type-15);margin-top:10px}
.nl-home-quick small{display:block;font-size:var(--nl-type-12);color:var(--nl-text-secondary);margin-top:4px}
.nl-program-search{
  display:grid;gap:7px;margin:12px 0 16px;
}
.nl-program-search label{
  justify-self:start;display:block;padding:3px 0 3px 11px;
  border-left:3px solid var(--nl-bg-action);
  font-size:var(--nl-type-15);font-weight:800;line-height:1.4;
  letter-spacing:.1px;color:var(--nl-text-heading)
}
.nl-program-search-field{position:relative;width:100%;max-width:560px}
.nl-program-search-icon{
  position:absolute;left:16px;top:50%;transform:translateY(-50%);
  display:flex;align-items:center;justify-content:center;
  color:var(--nl-text-muted);pointer-events:none
}
.nl-program-search-icon svg{display:block;width:20px;height:20px}
.nl-program-search input{
  width:100%;min-height:46px;padding:10px 15px 10px 46px;
  background:var(--surface);border:1px solid var(--nl-border-control);
  color:var(--ink);border-radius:var(--nl-radius-12);
}
.nl-program-search input::placeholder{color:var(--muted)}
#programView .course-heading{
  background:linear-gradient(118deg,var(--nl-home-accent),var(--nl-home-warm));
  padding:26px 30px;border-color:var(--nl-home-line);border-radius:var(--nl-radius-20);
}
#programView .course-heading h1{color:var(--ink);font-size:clamp(var(--nl-type-24),3vw,var(--nl-type-32))}
#programView .course-learning-pulse{background:var(--surface);border-color:var(--border);border-radius:var(--nl-radius-16)}
#programView .course-module-grid{gap:13px}
#programView .course-module{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--nl-radius-16);min-height:0;padding:20px;
}
#programView .course-module h3{font-size:var(--nl-type-18);color:var(--ink)}
#programView .course-module ol{font-size:var(--nl-type-13);line-height:1.55}
#programView .course-module .course-module-description{font-size:var(--nl-type-14)}
#programView .course-level{background:var(--surface);border-color:var(--border);border-radius:var(--nl-radius-16)}
#programView .course-level[open]>summary{border-bottom:1px solid var(--border)}
#programView .course-open-lesson{margin-top:12px}
#theoryView .theory-section{
  display:block;background:var(--surface);border:1px solid var(--border);
  border-radius:var(--nl-radius-20);padding:26px 28px;
}
#theoryView .theory-section>h2{font-size:var(--nl-type-27);margin:8px 0 8px}
#theoryView .theory-section>p{font-size:var(--nl-type-15);line-height:1.7;color:var(--nl-text-secondary)}
#theoryView .nl-reference-topics{
  padding:18px 0;margin:12px 0 20px;
}
#theoryView .nl-reference-topics>h3{margin:0 0 4px;font-size:var(--nl-type-19);color:var(--ink)}
#theoryView .nl-reference-topics>p{margin:0 0 14px;font-size:var(--nl-type-13);color:var(--nl-text-secondary)}
#theoryView #theoryIndex{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  width:100%;gap:9px;margin:0;padding:0;
}
#theoryView #theoryIndex button,
html[data-theme="dark"] #theoryView #theoryIndex button{
  display:flex;align-items:center;justify-content:center;
  width:100%;min-height:54px;padding:12px 10px;
  border:1px solid var(--nl-border-control);
  border-radius:var(--nl-radius-12);background:var(--nl-bg-subtle);
  color:var(--nl-text-secondary)!important;font-size:var(--nl-type-13);
  line-height:1.45;text-align:center;font-weight:750;overflow-wrap:anywhere;
}
#theoryView #theoryIndex button:hover{border-color:var(--nl-border-accent)}
#theoryView #theoryIndex button.active,
html[data-theme="dark"] #theoryView #theoryIndex button.active{
  background:var(--nl-nav-active)!important;color:var(--nl-text-accent-soft)!important;
  border-color:var(--nl-border-accent)!important;
}
#theoryView #theoryContent{
  min-width:0;width:100%;padding:22px 25px;
  border:1px solid var(--nl-home-line);border-radius:var(--nl-radius-16);
  background:var(--nl-bg-subtle);
}
#theoryView #theoryContent h2{font-size:var(--nl-type-23);margin:0 0 15px;color:var(--ink)}
#theoryView #theoryContent p{line-height:1.8;overflow-wrap:anywhere}
#theoryView #theoryContent :is(table,.case-scroll){max-width:100%;overflow-x:auto}
#courseLessonView .learning-lesson-topbar,
#courseLessonView .learning-lesson-intro,
#courseLessonView .learning-quiz-stage{max-width:100%}
#courseLessonView .learning-lesson-intro{
  padding:clamp(16px,3vw,26px);border:1px solid var(--border);
  background:var(--surface);border-radius:var(--nl-radius-20);
}
#courseLessonView .learning-theory-card.nogai-unified-lesson{
  padding:clamp(16px,3vw,28px);background:var(--surface);
  border:1px solid var(--border);border-radius:var(--nl-radius-16);
}
#courseLessonView .learning-theory-card>h2{font-size:clamp(var(--nl-type-23),2.6vw,var(--nl-type-29))}
#courseLessonView .course-theory-section,
#courseLessonView .learning-theory-explanation{
  background:var(--nl-bg-subtle);border-color:var(--nl-home-line);
  padding:20px 22px;
}
#courseLessonView .learning-letter-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
}
#courseLessonView .learning-letter-grid>div{
  padding:17px 13px;border-color:var(--nl-home-line);
}
#courseLessonView .course-part-table{font-size:var(--nl-type-13)}
#practiceView .quiz,
#practiceView .practice-session,
#profileView.profile-panel{
  background:var(--surface);border-color:var(--border);
  border-radius:var(--nl-radius-20);
  padding:clamp(18px,3vw,28px);
}
#practiceView .q-title{font-size:clamp(var(--nl-type-22),2.6vw,var(--nl-type-29))}
#practiceView .answers{gap:10px}
#practiceView .option{min-height:60px;border-radius:var(--nl-radius-12)}
#profileView.profile-panel h2{font-size:var(--nl-type-24)}
#profileView .profile-grid{gap:12px}
#profileView .profile-tile{border-radius:var(--nl-radius-16)}
html[data-theme="dark"] .nl-workspace .site-nav-wrap .theory-switch button{
  background:transparent!important;color:var(--nl-text-secondary)!important;
}
html[data-theme="dark"] .nl-workspace .site-nav-wrap .theory-switch button.active{
  background:var(--nl-nav-active)!important;color:var(--nl-text-accent-soft)!important;
  border-color:var(--nl-border-accent)!important;
}
html[data-theme="dark"] .nl-workspace .site-nav-wrap .theory-switch button:hover{
  background:var(--nl-nav-active)!important;
}
html[data-theme="dark"] #theoryView #theoryContent{
  background:var(--nl-bg-subtle);color:var(--ink);
}
@media(max-width:900px){
  .nl-workspace{grid-template-columns:180px minmax(0,1fr);column-gap:14px;width:min(100% - 24px,1350px)}
  .nl-home-hero{grid-template-columns:minmax(0,1fr) 122px;padding:28px}
  .nl-home-ornament{width:120px}
  #theoryView #theoryIndex{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:740px){
  html{scroll-padding-top:74px}
  .site-header .top{padding:10px 13px}
  .site-header .logo{width:38px;height:38px}
  .site-header .brandstrong{font-size:var(--nl-type-18)}
  .site-header .brandcap{font-size:var(--nl-type-9)}
  .nl-workspace{display:block;width:100%;margin:0}
  .nl-workspace>.site-nav-wrap{
    position:fixed;inset:auto 0 0;top:auto;z-index:65;
    padding:7px 5px calc(7px + env(safe-area-inset-bottom));
    border-radius:var(--nl-radius-16) var(--nl-radius-16) 0 0;
    border-bottom:0;border-left:0;border-right:0;
    background:var(--surface);
  }
  .nl-workspace .nl-nav-label,.nl-sidebar-note{display:none}
  body .nl-workspace .site-nav-wrap .theory-switch,
  body.learning-mode .nl-workspace .site-nav-wrap .theory-switch,
  body.learning-lesson-mode .nl-workspace .site-nav-wrap .theory-switch{
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));
    gap:0;margin:0;max-width:none;padding:0;
  }
  body .nl-workspace .site-nav-wrap .theory-switch button,
  body.learning-mode .nl-workspace .site-nav-wrap .theory-switch button,
  body.learning-lesson-mode .nl-workspace .site-nav-wrap .theory-switch button{
    display:flex;flex-direction:column;justify-content:center;align-items:center;
    min-width:0;min-height:52px;gap:3px;padding:5px 1px;
    font-size:var(--nl-type-10);line-height:1.2;
  }
  .nl-nav-icon{width:24px;height:24px;font-size:var(--nl-type-22)}
  .nl-nav-text{max-width:100%;overflow-wrap:anywhere;text-align:center}
  body .nl-workspace>.shell,
  body.learning-mode .nl-workspace>.shell{
    width:100%;margin:0;padding:16px 12px calc(93px + env(safe-area-inset-bottom));
  }
  .nl-home-hero{min-height:0;grid-template-columns:1fr;padding:26px 20px;border-radius:var(--nl-radius-20)}
  .nl-home-hero h1{font-size:clamp(var(--nl-type-27),7vw,var(--nl-type-34))}
  .nl-home-hero p{font-size:var(--nl-type-14)}
  .nl-home-ornament{display:none}
  .nl-home-summary{grid-template-columns:1fr}
  .nl-home-card{padding:20px}
  .nl-home-route{grid-template-columns:1fr}
  .nl-home-route>button{min-height:80px;padding:13px}
  .nl-home-quick{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .nl-home-quick>button{padding:12px 9px}
  .nl-home-quick strong{font-size:var(--nl-type-13)}
  .nl-home-quick small{font-size:var(--nl-type-11)}
  #theoryView .theory-section{padding:20px 14px}
  #theoryView #theoryIndex{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #theoryView #theoryIndex button{min-height:62px;padding:9px 7px;font-size:var(--nl-type-12)}
  #theoryView #theoryContent{padding:18px 14px}
  #programView .course-heading{padding:20px 17px}
  #programView .course-module-grid{grid-template-columns:1fr}
  #courseLessonView .learning-letter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  #practiceView .answers{grid-template-columns:1fr}
  .foot,.contact-footer{margin-bottom:calc(80px + env(safe-area-inset-bottom))}
}
@media(max-width:380px){
  .nl-home-quick{grid-template-columns:1fr}
  .nl-home-quick>button{display:flex;align-items:center;gap:12px}
  .nl-home-quick strong{margin:0}
  #theoryView #theoryIndex button{font-size:var(--nl-type-11)}
}
@media(prefers-reduced-motion:reduce){
  .nl-home-progress-track span{transition:none}
}


/* Keep the account popover inside the phone viewport.
   The avatar is not the right-most header control: anchoring a 365px box to it
   used to send the dialog off the left edge on 320–375px screens. Desktop keeps
   the existing button-anchored dropdown; only phones use viewport centering. */
@media (max-width:740px){
  .site-header .auth-widget .auth-box{
    position:fixed;
    top:96px;
    left:50%;
    right:auto;
    transform:translateX(-50%);
    width:calc(100vw - 24px);
    max-width:365px;
    box-sizing:border-box;
    margin:0;
    max-height:calc(100vh - 112px);
    max-height:calc(100dvh - 112px);
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
}

/* The learning homepage shows the student's actual next lesson,
   populated from the existing saved progress, not from a second tracker. */
.nl-home-next-topic{display:grid;gap:8px;margin:18px 0 12px}
.nl-home-next-topic h3{
  margin:0;font-size:var(--nl-type-20);line-height:1.35;
  color:var(--nl-text-heading);overflow-wrap:anywhere;
}
.nl-home-next-topic p{
  margin:0;font-size:var(--nl-type-14);line-height:1.65;
  color:var(--nl-text-secondary);
}
.nl-home-study .nl-steps{margin:16px 0 18px}


/* Program cards: a module number marks the module; only saved achievements
   mark it as completed. Avoid green "available" checkmarks. */
#programView .course-module:before,
#programView .course-module.has-lesson:before{
  content:attr(data-lesson-number);
  background:var(--nl-bg-soft);
  color:var(--nl-text-accent-soft);
}
#programView .course-module .module-status{
  display:block;
  margin:2px 0 0;
  color:var(--nl-text-muted);
  font-size:var(--nl-type-12);
  font-weight:650;
}
#programView .course-module-progress{
  display:inline-flex;align-items:center;max-width:100%;
  margin:10px 0 4px;padding:6px 11px;
  border:1px solid var(--nl-border-control);
  border-radius:var(--nl-radius-99);
  background:var(--nl-bg-subtle);
  color:var(--nl-text-secondary);
  font-size:var(--nl-type-12);
  font-weight:750;line-height:1.35;
}
#programView .course-module-progress[data-state="in-progress"]{
  background:var(--nl-bg-selected);
  border-color:var(--nl-border-accent);
  color:var(--nl-text-accent-soft);
}
#programView .course-module-progress[data-state="completed"]{
  background:var(--nl-bg-success);
  border-color:var(--nl-border-success);
  color:var(--nl-text-success);
}
#programView .course-module-outline{
  margin:15px 0 0;padding:11px 0 0;
  border-top:1px solid var(--nl-border-base);
}
#programView .course-module-outline summary{
  cursor:pointer;list-style-position:inside;
  color:var(--nl-text-accent-soft);
  font-size:var(--nl-type-13);font-weight:750;
  line-height:1.5;padding:3px 0;
}
#programView .course-module-outline summary:hover{text-decoration:underline}
#programView .course-module-outline summary:focus-visible{
  outline:2px solid var(--nl-text-accent);
  outline-offset:3px;border-radius:var(--nl-radius-8);
}
#programView .course-module-outline ol{
  display:block;margin:10px 0 0;
  padding-left:25px;color:var(--nl-text-secondary);
  font-size:var(--nl-type-13);line-height:1.65;
}
#programView .course-module-outline li{margin:4px 0;overflow-wrap:anywhere}
#programView .course-open-lesson{min-height:44px}


/* Quiet reading layout for every published grammar lesson.
   One readable paper surface, clear heading rhythm and generous phone targets. */
#courseLessonView .learning-lesson-topbar{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:9px 16px;
  padding:0 0 14px;margin:3px 0 18px;
  border-bottom:1px solid var(--nl-border-base);
}
#courseLessonView .learning-lesson-breadcrumb{
  min-width:0;margin:0;text-align:center;
  color:var(--nl-text-muted);
  font-size:var(--nl-type-11);letter-spacing:.03em;line-height:1.5;
  overflow-wrap:anywhere;
}
#courseLessonView .learning-lesson-switcher{
  justify-self:end;margin:0;min-width:0;gap:7px;
}
#courseLessonView .course-lesson-back,
#courseLessonView .learning-lesson-arrow{
  min-height:44px;min-width:44px;
  border:1px solid var(--nl-border-control);
  background:var(--nl-bg-card);color:var(--nl-text-accent-soft);
}
#courseLessonView .course-lesson-back:hover,
#courseLessonView .learning-lesson-arrow:hover:not(:disabled){
  background:var(--nl-bg-selected);border-color:var(--nl-border-accent);
}
#courseLessonView :is(.course-lesson-back,.learning-lesson-arrow,
  .course-part-tab,.course-part-link,.learning-main-button,
  .learning-secondary-button,.learning-answer-list>button):focus-visible{
  outline:3px solid var(--nl-text-accent);
  outline-offset:2px;
}
#courseLessonView .learning-lesson-intro{
  padding:9px 0 0;
  background:transparent;border:0;border-radius:0;
  text-align:left;
}
#courseLessonView .learning-intro-icon{display:none}
#courseLessonView .learning-lesson-intro .learning-step-label{
  display:inline-flex;align-items:center;
  padding:7px 11px;margin:0 0 10px;
  border-radius:var(--nl-radius-99);
  font-size:var(--nl-type-12);line-height:1.35;
}
#courseLessonView .learning-lesson-intro>.eyebrow{margin:5px 0 8px}
#courseLessonView .learning-lesson-intro>h1{
  margin:0 0 12px;max-width:30ch;
  font-size:clamp(var(--nl-type-29),3vw,var(--nl-type-36));
  line-height:1.2;color:var(--nl-text-heading);
}
#courseLessonView .learning-lead{
  margin:0 0 20px;max-width:68ch;
  color:var(--nl-text-secondary);
  font-size:var(--nl-type-16);line-height:1.75;
}
#courseLessonView .learning-theory-card.nogai-unified-lesson{
  background:var(--nl-bg-card);border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-20);
  box-shadow:var(--nl-home-shadow);
}
#courseLessonView .learning-theory-card>h2{
  font-size:clamp(var(--nl-type-22),2.5vw,var(--nl-type-27));
  line-height:1.32;margin:0 0 14px;
  overflow-wrap:anywhere;
}
#courseLessonView :is(.learning-theory-card>p,.course-theory-section p,
  .learning-theory-explanation p,.nogai-section>p){
  max-width:74ch;line-height:1.78;overflow-wrap:anywhere;
}
#courseLessonView :is(.course-theory-section,.learning-theory-explanation){
  border-left:3px solid var(--nl-border-accent);
  border-radius:var(--nl-radius-12);
  padding:18px 20px;margin:13px 0;
}
#courseLessonView .course-theory-section h3{
  line-height:1.4;overflow-wrap:anywhere;
}
#courseLessonView :is(.course-part-tab,.course-part-link,
  .course-part-actions button){
  min-height:44px;
}
#courseLessonView .learning-quiz-stage .learning-question-card{
  background:var(--nl-bg-card);border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-20);
  box-shadow:var(--nl-home-shadow);
}
#courseLessonView .learning-question-card h2{
  min-height:0;max-width:38ch;line-height:1.35;
}
#courseLessonView .learning-answer-list>button{
  min-height:58px;padding:14px 16px;
  border:1px solid var(--nl-border-control);
  border-radius:var(--nl-radius-12);
  color:var(--nl-text-primary);background:var(--nl-bg-card);
  font-size:var(--nl-type-16);line-height:1.55;
  overflow-wrap:anywhere;
}
#courseLessonView .learning-answer-list>button:not(:disabled):hover{
  border-color:var(--nl-border-accent);background:var(--nl-bg-subtle);
}
#courseLessonView .learning-answer-feedback:not(:empty){
  border:1px solid var(--nl-border-base);
  background:var(--nl-bg-subtle);
  font-size:var(--nl-type-16);line-height:1.75;
}
@media(max-width:1100px){
  #courseLessonView .learning-lesson-topbar{
    grid-template-columns:minmax(0,1fr) auto;
  }
  #courseLessonView .learning-lesson-breadcrumb{
    grid-column:1/-1;grid-row:2;text-align:left;
  }
  #courseLessonView .learning-lesson-switcher{grid-column:2;grid-row:1}
}
@media(max-width:740px){
  #courseLessonView .learning-lesson-topbar{
    grid-template-columns:minmax(0,1fr);gap:8px;
  }
  #courseLessonView .course-lesson-back{
    grid-column:1;grid-row:1;justify-self:start;
  }
  #courseLessonView .learning-lesson-switcher{
    grid-column:1;grid-row:2;justify-self:start;
  }
  #courseLessonView .learning-lesson-breadcrumb{
    grid-column:1;grid-row:3;text-align:left;
  }
  #courseLessonView .learning-lesson-intro{padding:4px 0 0}
  #courseLessonView .learning-lead{margin-bottom:15px}
  #courseLessonView .learning-theory-card.nogai-unified-lesson{
    padding:18px 16px;
  }
  #courseLessonView :is(.course-theory-section,.learning-theory-explanation){
    padding:15px 14px;
  }
  #courseLessonView .learning-quiz-stage .learning-question-card{
    padding:18px 16px;
  }
}
html[data-theme="dark"] #courseLessonView :is(.course-theory-section,
 .learning-theory-explanation){
  border-left-color:var(--nl-border-accent)!important;
}

/* Book-grounded reference rules: keep the established card palette and typography. */
#theoryView #theoryIndex{display:block}
#theoryView .nl-reference-group{display:flex;flex-wrap:wrap;gap:8px;padding:12px 0;border-top:1px solid var(--border)}
#theoryView .nl-reference-group:first-child{border-top:0;padding-top:0}
#theoryView .nl-reference-group>h4{flex:0 0 100%;margin:0 0 4px;font-size:var(--nl-type-15);font-weight:750;color:var(--ink)}
#theoryView .nl-reference-group button{min-height:44px}
#theoryView .nl-reference-rule-list{margin:0 0 16px;padding-left:24px;line-height:1.7;color:var(--ink)}
#theoryView .nl-reference-rule-list li+li{margin-top:6px}
#theoryView #theoryContent{scroll-margin-top:110px}


/* NogaiLab unified study surfaces: Practice, Rules and Profile.
   Shared theme tokens only; never override lesson data or generator behavior. */
#practiceView{
  display:grid;
  grid-template-columns:minmax(210px,242px) minmax(0,1fr);
  grid-template-areas:
    "heading heading"
    "filters session"
    "filters quiz"
    "filters review";
  gap:16px 20px;align-items:start;min-width:0;
}
#practiceView>*{min-width:0;box-sizing:border-box}
#practiceView>.intro{
  grid-area:heading;display:block;margin:0;padding:23px 27px;
  background:var(--nl-bg-card);border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-20);
}
#practiceView>.intro h1{
  font-size:clamp(var(--nl-type-25),2.5vw,var(--nl-type-31));
  margin:7px 0 10px;line-height:1.25;overflow-wrap:anywhere;
}
#practiceView>.intro p{
  max-width:70ch;font-size:var(--nl-type-15);line-height:1.7;
  color:var(--nl-text-secondary);
}
#practiceView>.intro .intro-art{display:none}
#practiceView>.sidebar{
  grid-area:filters;position:sticky;top:100px;align-self:start;
  margin:0;padding:15px;border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-16);background:var(--nl-bg-card);
  box-shadow:none;
}
#practiceView>.sidebar .side-heading{
  display:block;margin:0 0 7px;padding:0;
  color:var(--nl-text-secondary);font-size:var(--nl-type-13);
  font-weight:750;letter-spacing:0;text-transform:none;
}
#practiceView>.sidebar>.topics{
  display:grid;grid-template-columns:minmax(0,1fr);
  gap:3px;max-height:360px;overflow-y:auto;overflow-x:hidden;
  margin:0 0 10px;padding:2px;
}
#practiceView>.sidebar .topic-btn{
  width:100%;min-height:44px;margin:0;padding:10px 12px;
  border-radius:var(--nl-radius-10);font-size:var(--nl-type-14);
  line-height:1.45;overflow-wrap:anywhere;
}
#practiceView>.sidebar .level-row{
  display:grid;grid-template-columns:minmax(0,1fr);
  gap:6px;margin:12px 0 0;min-width:0;
}
#practiceView>.sidebar .level-row .levelselect{
  width:100%;max-width:100%;min-width:0;min-height:44px;
  margin:0;padding:9px 11px;box-sizing:border-box;
  background:var(--nl-bg-card);color:var(--nl-text-primary);
  border:1px solid var(--nl-border-control);
  border-radius:var(--nl-radius-10);
}
#practiceView>.sidebar .side-note{
  display:block;margin:15px 0 0;padding:12px 0 0;
  border-top:1px solid var(--nl-border-base);
  font-size:var(--nl-type-13);line-height:1.6;
  color:var(--nl-text-muted);
}
#practiceView>.practice-session{
  grid-area:session;max-width:none;width:100%;margin:0;
  border:1px solid var(--nl-border-base);
}
#practiceView>.practice-session h3{
  font-size:var(--nl-type-20);line-height:1.4;
  color:var(--nl-text-heading);
}
#practiceView>.quiz{
  grid-area:quiz;max-width:none;width:100%;margin:0;
  border:1px solid var(--nl-border-base);
}
#practiceView>.quiz .q-title{
  margin-top:14px;max-width:50ch;line-height:1.35;
  color:var(--nl-text-heading);
}
#practiceView>.quiz .option{
  min-height:54px;border-radius:var(--nl-radius-12);
  overflow-wrap:anywhere;
}
#practiceView>.quiz :is(button,select,input):focus-visible,
#practiceView>.sidebar :is(button,select):focus-visible{
  outline:3px solid var(--nl-text-accent);outline-offset:2px;
}
#practiceView>.quiz .q-footer{gap:11px}
#practiceView>.practice-review-settings{
  grid-area:review;margin:0;padding:13px 16px;
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-12);
  background:var(--nl-bg-subtle);
}
#practiceView>.points-card{
  grid-area:points;margin:0;min-width:0;width:100%;
  padding:16px 17px;border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-16);
  background:var(--nl-bg-card);
}
#practiceView>.stats{
  grid-area:stats;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  margin:0;gap:11px;
}
#practiceView>.stats .stat{
  min-width:0;background:var(--nl-bg-card);
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-14);
  box-shadow:none;
}
#practiceView>.stats .stat-num{
  color:var(--nl-text-heading);
}
#theoryView .theory-section{
  background:transparent;border:0;border-radius:0;
  box-shadow:none;padding:0;margin:0;
}
#theoryView .theory-section>.nl-kicker{margin-bottom:6px}
#theoryView .theory-section>h2{
  margin:0 0 9px;line-height:1.25;
  font-size:clamp(var(--nl-type-24),2.5vw,var(--nl-type-30));
  color:var(--nl-text-heading);
}
#theoryView .theory-section>p{
  margin:0;max-width:68ch;line-height:1.65;
  color:var(--nl-text-secondary);
}
#theoryView .nl-reference-topics{
  margin:20px 0 16px;padding:20px 23px;
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-20);
  background:var(--nl-bg-card);
}
#theoryView .nl-reference-topics>h3{
  margin:0 0 5px;font-size:var(--nl-type-19);
  color:var(--nl-text-heading);
}
#theoryView .nl-reference-topics>p{
  margin:0 0 14px;line-height:1.5;
  color:var(--nl-text-secondary);
}
#theoryView .nl-reference-group{
  gap:8px 9px;border-color:var(--nl-border-base);
}
#theoryView .nl-reference-group>h4{
  color:var(--nl-text-heading);font-weight:800;
}
#theoryView #theoryIndex .nl-reference-group button{
  width:auto;max-width:100%;min-width:110px;min-height:44px;
  flex:0 1 auto;justify-content:center;
  padding:10px 13px;line-height:1.45;
  border-radius:var(--nl-radius-10);
}
#theoryView #theoryIndex .nl-reference-group button:focus-visible{
  outline:3px solid var(--nl-text-accent);outline-offset:2px;
}
#theoryView #theoryContent{
  width:100%;min-width:0;padding:24px 27px;
  background:var(--nl-bg-card);
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-20);
}
#theoryView #theoryContent h2{
  margin:0 0 15px;color:var(--nl-text-heading);
  font-size:var(--nl-type-23);line-height:1.35;
}
#theoryView #theoryContent :is(p,li){
  max-width:75ch;line-height:1.78;overflow-wrap:anywhere;
}
#profileView.profile-panel{
  max-width:none;width:100%;margin:0;padding:0;
  background:transparent;border:0;border-radius:0;
  box-shadow:none;
}
/* Lifetime results now live on the Progress page, not beneath Practice. */
#profileView>.points-card{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;width:100%;max-width:none;margin:0 0 16px;
}
#profileView>.stats{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;margin:0 0 18px;
}
#profileView>.stats>.stat{min-width:0;}
@media(max-width:740px){
  #profileView>.points-card{grid-template-columns:1fr;}
  #profileView>.stats{grid-template-columns:1fr;}
}
#profileView.profile-panel>.nl-kicker{margin-bottom:5px}
#profileView.profile-panel>h2{
  margin:0 0 7px;line-height:1.2;
  font-size:clamp(var(--nl-type-25),2.5vw,var(--nl-type-31));
  color:var(--nl-text-heading);
}
#profileView .nl-profile-lead{
  max-width:70ch;margin:0 0 20px;
  font-size:var(--nl-type-15);line-height:1.7;
  color:var(--nl-text-secondary);
}
#profileView>.profile-actions{
  margin:0 0 16px;padding:17px 19px;
  background:var(--nl-bg-card);
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-16);
  gap:10px 12px;
}
#profileView>.profile-actions :is(input,select,button){
  min-height:44px;box-sizing:border-box;
  border:1px solid var(--nl-border-control);
  border-radius:var(--nl-radius-10);
  background:var(--nl-bg-card);color:var(--nl-text-primary);
}
#profileView>.profile-actions button{
  padding:10px 16px;font-weight:750;
  background:var(--nl-bg-action);
  color:var(--nl-text-on-accent);
  border-color:var(--nl-border-accent);
}
#profileView>.profile-actions :is(input,select,button):focus-visible,
#profileView #learningFocusBtn:focus-visible{
  outline:3px solid var(--nl-text-accent);outline-offset:2px;
}
#profileView>.profile-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;margin:0 0 23px;
}
#profileView .profile-tile{
  display:flex;flex-direction:column;justify-content:space-between;gap:12px;
  min-height:105px;padding:17px;
  background:var(--nl-bg-card);
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-16);
  color:var(--nl-text-secondary);
}
#profileView .profile-tile>span{
  font-size:var(--nl-type-13);font-weight:700;line-height:1.45;
}
#profileView .profile-tile>strong{
  display:block;margin:0;font-size:clamp(var(--nl-type-24),2.3vw,var(--nl-type-29));
  line-height:1.2;color:var(--nl-text-heading)!important;
}
#profileView>h3{
  margin:22px 0 11px;font-size:var(--nl-type-19);
  line-height:1.35;color:var(--nl-text-heading);
}
#profileView>.topic-bar{
  margin:4px 0 21px!important;
  height:10px;background:var(--nl-bg-control);
}
#profileView>.topic-bar .topic-fill{
  background:var(--nl-bg-action);
}
#profileView #profileTopics{
  margin:0 0 20px;padding:17px 19px;
  background:var(--nl-bg-card);
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-16);
}
#profileView #learningFocus{
  margin:20px 0;padding:18px 20px;
  background:var(--nl-bg-subtle);
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-16);
}
#profileView>.achievements{
  margin:22px 0 0;padding:20px 22px;
  background:var(--nl-bg-card);
  border:1px solid var(--nl-border-base);
  border-radius:var(--nl-radius-16);
}
#profileView>.achievements>h2{
  font-size:var(--nl-type-21);
  color:var(--nl-text-heading);margin:0 0 9px;
}
#profileView>.achievements>p{
  color:var(--nl-text-secondary);line-height:1.65;
}
@media(max-width:1020px){
  #practiceView{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:
      "heading" "filters" "session" "quiz" "review" "stats" "points";
    gap:14px;
  }
  #practiceView>.sidebar{
    position:static;display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px 13px;
  }
  #practiceView>.sidebar>.side-heading,
  #practiceView>.sidebar>.topics,
  #practiceView>.sidebar>.side-note{grid-column:1/-1}
  #practiceView>.sidebar>.topics{
    display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;
    max-height:none;gap:6px;padding:2px 1px 10px;margin:0;
  }
  #practiceView>.sidebar>.topics .topic-btn{
    flex:none;width:auto;min-width:100px;
    white-space:nowrap;
  }
  #practiceView>.sidebar>.level-row{margin:0}
}
@media(max-width:740px){
  #practiceView>.intro{padding:19px 17px}
  #practiceView>.quiz,#practiceView>.practice-session{padding:18px 15px}
  #practiceView>.stats{gap:7px}
  #practiceView>.stats .stat{padding:13px 10px}
  #practiceView>.stats .stat-sub{font-size:var(--nl-type-11);line-height:1.4}
  #theoryView .nl-reference-topics{padding:18px 15px}
  #theoryView #theoryContent{padding:19px 16px}
  #profileView>.profile-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  #profileView .profile-tile{min-height:94px;padding:14px}
  #profileView>.achievements{padding:18px 16px}
}
@media(max-width:420px){
  #practiceView>.sidebar{grid-template-columns:minmax(0,1fr)}
  #practiceView>.sidebar>.level-row{grid-column:1}
  #theoryView #theoryIndex .nl-reference-group button{
    flex:1 1 auto;min-width:min(100%,128px);
  }
}

/* Contextual lesson link beside the existing optional practice shortcut. */
#theoryView .theory-lesson-link{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:left;
  margin-right:10px;
  background:var(--violet-soft);
  border:1px solid var(--violet);
  color:var(--violet);
}
#theoryView .nl-reference-linked-note{
  font-size:var(--nl-type-13);
  margin:8px 0 0;
}

/* Clear login/registration form; respects the existing account popover and theme. */
.site-header .auth-mode-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
 gap:5px;background:var(--nl-bg-soft,#efebfa);padding:5px;border-radius:13px}
.site-header .auth-mode-switch button{min-width:0;min-height:42px;border:0;
 background:transparent;color:var(--nl-text-secondary);font-size:var(--nl-type-14);border-radius:9px}
.site-header .auth-mode-switch button.is-active{background:var(--nl-bg-card,#fff);
 color:var(--nl-text-accent);box-shadow:0 2px 8px #24174b1a}
.site-header .auth-fields .auth-field-label{display:block;margin:4px 0 -4px;
 font-size:var(--nl-type-13);font-weight:750;color:var(--nl-text-heading,var(--nl-text-primary))}
.site-header .auth-password-label{display:flex;align-items:center;
 justify-content:space-between;gap:8px;margin:4px 0 -4px}
.site-header .auth-password-label .auth-field-label{margin:0}
.site-header .auth-fields #authShowPassword{min-height:30px;padding:3px 6px;
 background:none;border:0;color:var(--nl-text-accent);font-size:var(--nl-type-12);font-weight:750}
.site-header .auth-fields input{background:var(--nl-bg-card,#fff);
 color:var(--nl-text-primary);border:1px solid #c9c4dc;border-radius:10px;
 font-size:var(--nl-type-16);min-height:45px}
.site-header .auth-fields input[aria-invalid=true]{border-color:#c22f50;
 box-shadow:0 0 0 2px #e4486633}
.site-header .auth-fields .auth-confirm-wrap{display:grid;gap:7px}
.site-header .auth-fields .auth-confirm-wrap[hidden],.site-header .auth-fields [hidden]{display:none!important}
.site-header .auth-fields .auth-field-error{display:block;color:var(--nl-text-danger);
 font-size:var(--nl-type-12);line-height:1.45;font-weight:700;margin:0}
.site-header .auth-fields .auth-password-hint{font-size:var(--nl-type-12);line-height:1.45;
 margin:-3px 0 0;color:var(--nl-text-secondary)}
.site-header .auth-fields .auth-password-hint[data-ready=true]{color:var(--nl-text-success)}
.site-header #authRegister{background:var(--violet);border-color:var(--violet);color:white}
.site-header #authLogin:disabled,.site-header #authRegister:disabled{opacity:.7;cursor:wait}
.site-header #authStatus{font-size:var(--nl-type-13);line-height:1.5;margin-top:9px}
.site-header #authStatus[data-state=error]{color:var(--nl-text-danger);font-weight:700}
.site-header #authStatus[data-state=success]{color:var(--nl-text-success);font-weight:750}
.site-header #authStatus[data-state=pending]{color:var(--nl-text-secondary)}
html[data-theme=dark] .site-header .auth-mode-switch button.is-active{color:var(--nl-text-primary);background:#4c3d76}
html[data-theme=dark] .site-header .auth-fields .auth-field-error,
html[data-theme=dark] .site-header #authStatus[data-state=error]{color:var(--nl-text-danger)}
html[data-theme=dark] .site-header .auth-fields .auth-password-hint[data-ready=true],
html[data-theme=dark] .site-header #authStatus[data-state=success]{color:var(--nl-text-success)}
@media(max-width:740px){
 .site-header .auth-widget .auth-box{max-height:calc(100dvh - 108px);
 padding:15px;scrollbar-width:thin}
 .site-header .auth-widget .auth-box h2{font-size:var(--nl-type-18)}
 .site-header .auth-fields{gap:7px}
}
