/* Shared course theme: dark by default, light by explicit choice. */
.reading-theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex-shrink:0;min-height:44px;padding:8px 12px;border:1px solid var(--border-strong);background:var(--bg-card);color:var(--text-primary);font:600 13px/1.3 Inter,system-ui,sans-serif;cursor:pointer;border-radius:8px}
.reading-theme-toggle[hidden]{display:none}
.reading-theme-toggle small{font-size:9px;letter-spacing:.06em;opacity:.75}
.reading-theme-icon{font-size:20px}
.reading-theme-toggle:focus-visible{outline:3px solid #0071ad;outline-offset:3px}
html[data-theme-preview="1"] .site-header>.container{max-width:1600px;width:min(1600px,calc(100% - 40px));gap:12px}
html[data-theme-preview="1"] .reading-theme-toggle{margin-left:auto}
@media(max-width:1440px){html[data-theme-preview="1"] .site-header .main-nav{display:none}html[data-theme-preview="1"] .site-header .nav-toggle{display:flex}}
html[data-theme="light"]{
  color-scheme:light;
  --bg-primary:#f3f2ee;--bg-secondary:#efeee9;--bg-dark:#f4f3ef;--bg-card:#faf9f6;
  --text-primary:#1e2a36;--text-secondary:#435264;--text-muted:#435264;
  --accent:#00609b;--accent-dark:#004c7c;--accent-glow:rgba(0,96,155,.08);
  --border:#bac5cb;--border-strong:#a9b7bf;--success:#166b45;--error:#a1272a;--warning:#7e4e09;
  --ml-bg:var(--bg-primary);--ml-bg-elevated:var(--bg-secondary);--ml-surface:var(--bg-card);--ml-surface-soft:#f0f3f2;
  --ml-text:var(--text-primary);--ml-text-muted:var(--text-secondary);--ml-text-dim:var(--text-muted);
  --ml-brand:var(--accent);--ml-brand-hover:var(--accent-dark);--ml-brand-soft:var(--accent-glow);
  --ml-line:var(--border);--ml-line-strong:var(--border-strong);--ml-success:var(--success);--ml-danger:var(--error);--ml-warning:var(--warning);
  --ml-shadow:none;--ml-shadow-soft:0 4px 18px rgba(40,52,65,.05);--ml-focus:0 0 0 3px rgba(0,96,155,.22);
}
html[data-theme="light"] body{background:#f3f2ee!important;color:#1e2a36!important}
html[data-theme="light"] .site-header,html[data-theme="light"] .mobile-nav{background:#faf9f6!important;border-color:#bac5cb!important}
html[data-theme="light"] .site-footer{background:#efeee9!important}
html[data-theme="light"] .lesson-wrap{background:transparent!important;box-shadow:none!important}
html[data-theme="light"] .main-content{background:#f3f2ee!important}
html[data-theme="light"] :is(.btn-primary,.logo-mark){background:#00609b!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html[data-theme="light"] .btn-primary:hover{background:#004c7c!important;color:#fff!important}
html[data-theme="light"] :is(a,.lesson-content a,.lesson-teaser a){color:#00609b}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser,.module-page-desc){
  --lc-surface:#faf9f6;--lc-glow:transparent;
  max-width:780px;margin-inline:auto;font-size:18px!important;line-height:1.8!important;
  background:#faf9f6!important;color:#1e2a36!important;overflow-wrap:anywhere;
}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(p,li,td,div){line-height:1.8!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(p,li,td,div){font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(p,li){font-size:18px!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) p{max-width:68ch;margin-inline:auto!important;margin-bottom:1.15em!important;text-align:left!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(h1,h2,h3,h4){color:#1e2a36!important;-webkit-text-fill-color:#1e2a36!important;line-height:1.35!important;text-align:left!important;text-shadow:none!important;background-image:none!important}
html[data-theme="light"] .lc-section-title::after{margin-left:0}
html[data-theme="light"] :is(.lc-card,.lc-callout,.lc-callout-warn){box-shadow:none!important;backdrop-filter:none!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) pre{background:#edf1f3!important;color:#263746!important;border:1px solid #ccd6dc!important;max-width:100%;overflow-x:auto;white-space:pre;line-height:1.6!important;text-align:left!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) pre code{background:transparent!important;color:#263746!important;font-size:14px!important;line-height:1.6!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :not(pre)>code{background:#e9eef1!important;color:#004c7c!important;overflow-wrap:anywhere}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(th,td){border-color:#ccd6dc!important;text-align:left;min-width:0}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) th{background:#e9eef1!important;color:#1e2a36!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) img{background:transparent}
html[data-theme="light"] :is(.reading-theme-toggle,input,select,textarea){background:#faf9f6!important;color:#1e2a36!important;border-color:#a9b7bf!important}
html[data-theme="light"] ::selection{background:#c6e3f2;color:#172b3b}
@media(max-width:760px){
  html[data-theme-preview="1"] .site-header>.container{width:calc(100% - 28px);gap:8px}
  .site-header>.container{gap:8px}
  .reading-theme-toggle{padding:8px;gap:4px;font-size:12px}
  .reading-theme-toggle small{display:none}
  html[data-theme="light"] :is(.lesson-content,.lesson-teaser){font-size:17px!important}
  html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(p,li){font-size:17px!important}
}
@media(max-width:390px){.reading-theme-toggle{max-width:98px}.reading-theme-icon{display:none}html[data-theme-preview="1"] .logo-accent{display:none}}
@media(prefers-reduced-motion:reduce){html[data-theme="light"] .lesson-content.lc-ready{animation:none}}

/* v2: distinct surfaces and semantic accents, with quiet reading paragraphs. */
html[data-theme="light"]{--bg-primary:#f0f4f9;--bg-secondary:#e8eff7;--bg-card:#ffffff;--border:#ccd9e7;--border-strong:#9cb5cf;--ml-surface-soft:#edf4fc}
html[data-theme="light"] body,html[data-theme="light"] .main-content{background:#f0f4f9!important}
html[data-theme="light"] .site-header{background:#fff!important;box-shadow:0 2px 12px rgba(37,69,104,.07)!important}
html[data-theme-preview="1"]{scroll-padding-top:112px}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser){background:#fffefb!important;border-radius:16px;box-shadow:0 4px 24px rgba(37,69,104,.05)!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser)>div{background:transparent!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(h2.lc-section-title,h2:not(.lc-section-nav-title)){
  margin-top:44px!important;margin-bottom:22px!important;padding:16px 20px!important;
  border:1px solid #c5dcef!important;border-left:5px solid #1876b5!important;border-radius:0 12px 12px 0!important;
  background:linear-gradient(110deg,#e5f1fc,#f4f8fc)!important;color:#16466d!important;-webkit-text-fill-color:#16466d!important;
  --reading-inline-color:#16466d!important;--reading-inline--webkit-text-fill-color:#16466d!important;
  font-size:clamp(22px,2.5vw,27px)!important;letter-spacing:-.025em;
}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) h2.lc-section-title::after{display:none}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) h3{margin-top:28px!important;margin-bottom:14px!important;color:#16466d!important;-webkit-text-fill-color:#16466d!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) h2[data-lc-type="praktyka"]{background:#e7f5ed!important;border-color:#b5d9c5!important;border-left-color:#21855d!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) h2[data-lc-type="ostrzezenie"]{background:#fff4dc!important;border-color:#ead2a0!important;border-left-color:#be831e!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-module-badge{background:#e4f0fc!important;color:#125c91!important;border-color:#b2d2ef!important;box-shadow:none!important}

html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav{
  background:linear-gradient(120deg,#e6f1fc,#eef6fe)!important;border:1px solid #bed5ec!important;
  border-top:4px solid #1876b5!important;border-radius:14px!important;padding:22px!important;margin:26px 0 34px!important;
  box-shadow:0 5px 16px rgba(32,87,138,.06)!important;
}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav-title{font-size:14px!important;letter-spacing:.06em;color:#174d79!important;margin-bottom:14px!important;max-width:none}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 14px!important;padding:0!important;margin:0!important;list-style:none!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav-list li{margin:0!important;padding:0!important;font-size:14px!important;min-width:0}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav-list a{display:flex!important;align-items:flex-start;gap:10px;background:rgba(255,255,255,.8)!important;border:1px solid #c9dced!important;border-radius:8px;padding:10px 12px!important;color:#21567e!important;line-height:1.5!important;height:100%;text-decoration:none}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav-list a::before{background:#d3e8fa!important;color:#155784!important;box-shadow:none!important;flex-shrink:0}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav-list a:hover{background:#dceefc!important;border-color:#75aed6!important}

html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is([data-reading-panel],.lc-box,.lc-card,.lc-callout,.lc-timeline){background:#edf4fc!important;border:1px solid #c3d7eb!important;border-left:4px solid #609ccc!important;border-radius:12px!important;box-shadow:0 3px 12px rgba(43,79,117,.045)!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is([data-reading-panel="green"],.lc-box-green,.lc-card-green,.lc-task-box,.lc-summary-box){background:#e9f6ee!important;border-color:#b7dcc7!important;border-left:4px solid #318b62!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is([data-reading-panel="amber"],.lc-box-amber,.lc-card-amber,.lc-callout-warn){background:#fff4de!important;border-color:#e9d2a5!important;border-left:4px solid #c18a26!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is([data-reading-panel="red"],.lc-box-red,.lc-card-red){background:#fff0ed!important;border-color:#e8bdb8!important;border-left:4px solid #c05b52!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is([data-reading-panel="purple"],.lc-box-purple,.lc-card-purple){background:#f4edfc!important;border-color:#d6c5e8!important;border-left:4px solid #9563bc!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is([data-reading-panel="code"],.lc-code-block){background:#eaf1f8!important;border-color:#b6ccdf!important;border-left:4px solid #537ea3!important;color:#243d54!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(.lc-box,.lc-card)::before{background:transparent!important;opacity:0!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) :is(.lc-task-box,.lc-summary-box){padding:22px!important;border-radius:12px!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) [data-reading-shell]{background:transparent!important;border:0!important;box-shadow:none!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) pre{background:#edf3f9!important;border:1px solid #b6ccdf!important;border-top:4px solid #537ea3!important;box-shadow:none!important;tab-size:2}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) pre :is(code,span,div){background:transparent!important;color:#243d54!important;-webkit-text-fill-color:#243d54!important;font-family:Consolas,"SFMono-Regular",monospace!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .code-copy-btn{background:#dbe9f6!important;color:#174d79!important;border:1px solid #a9c7df!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .code-copy-btn.copied{background:#daf0e3!important;color:#166544!important}

.reading-table-hint{display:none}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .reading-table-hint{display:block;font-size:12px!important;font-weight:600;color:#32688e!important;background:#e6f1fc;padding:8px 12px;border-radius:8px 8px 0 0;margin:16px 0 0!important;max-width:none}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;border:1px solid #bfd1e1;border-radius:10px;background:#fff!important;scrollbar-color:#7daccf #e5eef7;scrollbar-width:auto}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-table-scroll:focus-visible{outline:3px solid #1876b5;outline-offset:3px}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table]{display:table!important;width:100%!important;table-layout:auto!important;border-collapse:collapse!important;margin:0!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table="compact"]{min-width:0!important;max-width:100%!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table="wide"]{min-width:var(--reading-table-width)!important;max-width:none!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table] :is(th,td){width:auto!important;max-width:none!important;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;hyphens:auto;padding:12px 14px!important;line-height:1.65!important;font-size:14px!important;border-color:#c9d9e7!important;background:#fff!important;color:#283e52!important;vertical-align:top}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table="wide"] :is(th,td){min-width:112px!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table] th{background:#deebf8!important;color:#174d79!important;font-weight:700!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table] tbody tr:nth-child(even) td{background:#f1f6fc!important}
html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table] td code{white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important}

/* Dashboard has local color variables in addition to the shared palette. */
html[data-theme="light"] .dash-wrap.dash-hub{--dash-surface:#edf4fc!important;--dash-surface-2:#e5eef9!important;--dash-line:#bfd3e7!important;--dash-line-strong:#86afd2!important}
html[data-theme="light"] .dash-wrap.dash-hub::before{background:none!important}
html[data-theme="light"] .dash-hub-head{background:linear-gradient(120deg,#e4f0fd,#f0f7fc 65%,#e9f5f0)!important;border:1px solid #bcd2e9!important;border-top:4px solid #1876b5!important;box-shadow:0 6px 20px rgba(37,69,104,.06)!important}
html[data-theme="light"] .dash-hub-continue{background:#fff!important;border-color:#b1cde5!important;border-left:4px solid #1876b5!important}
html[data-theme="light"] .dash-hub-nav{background:#edf4fc!important;border-color:#bfd3e7!important}
html[data-theme="light"] .dash-hub-links a{background:#fff!important;border-color:#bfd3e7!important;color:#21567e!important}
html[data-theme="light"] .dash-widget{background:#e8f2fd!important;border:1px solid #b7d1e8!important;border-top:4px solid #438dc1!important;box-shadow:0 4px 16px rgba(37,69,104,.05)!important}
html[data-theme="light"] .dash-widget:nth-child(2n){background:#edf7f1!important;border-color:#b7d9c8!important;border-top-color:#388764!important}
html[data-theme="light"] :is(.dash-widget-title,.dash-widget-item-title){color:#243d54!important}
html[data-theme="light"] :is(.dash-widget-lead,.dash-widget-empty,.dash-widget-item-meta){color:#4b6175!important}
html[data-theme="light"] :is(.dash-library-panel,.module-card,.lesson-card,.toc-module){background:#fff!important;border-color:#c4d5e6!important;box-shadow:0 3px 12px rgba(37,69,104,.04)!important}
html[data-theme="light"] .dash-hub-progress .prog-bar-bg{background:#ccdfef!important}
html[data-theme="light"] .dash-hub-progress .prog-bar-fill{background:linear-gradient(90deg,#1876b5,#2a9b83)!important;min-width:3px}
html[data-theme="light"] :is(.dash-since-badge.is-new,.cl-since-badge.is-new,.badge-new){background:#d5efdf!important;color:#176444!important}
html[data-theme="light"] :is(.dash-since-badge.is-upd,.cl-since-badge.is-upd,.badge-free){background:#dcebf9!important;color:#16578a!important}
html[data-theme="light"] .cl-hero{padding:28px 22px;background:linear-gradient(120deg,#e2effc,#edf5fd);border:1px solid #bfd4e9;border-top:4px solid #1876b5;border-radius:16px}
html[data-theme="light"] .cl-since{background:#edf5fd!important;border-color:#b9d2e9!important;border-top:4px solid #1876b5!important}
html[data-theme="light"] .cl-since-list a{background:#fff!important;border-color:#c3d7e9!important;border-left:3px solid #438dc1!important;gap:8px 12px}
html[data-theme="light"] .cl-since-list a:hover{background:#e3f0fc!important}
html[data-theme="light"] .cl-since-title{color:#243d54!important}
html[data-theme="light"] .cl-since-mod{display:block;flex-basis:100%;color:#586e81!important}
html[data-theme="light"] .month-badge{background:#dcebf9!important;color:#16578a!important;border-color:#a8c9e4!important}
html[data-theme="light"] .lesson-entry{background:#fff!important;border-color:#c6d9e9!important}
html[data-theme="light"] .toc-module{padding:20px;border:1px solid #bfd3e7!important;border-radius:16px;background:#fff!important;margin-bottom:26px;box-shadow:0 4px 18px rgba(37,69,104,.04)!important}
html[data-theme="light"] .toc-module-head{padding:16px!important;background:#e8f2fd!important;border-radius:10px!important;border-bottom:0!important}
html[data-theme="light"] .toc-module-label{color:#165c90!important}
html[data-theme="light"] .toc-module-title{color:#213c55!important}
html[data-theme="light"] :is(.lesson-row,.module-lesson-row){background:#f7faff!important;border-color:#c6d9e9!important}
html[data-theme="light"] .lesson-row:hover{background:#e4f1fc!important}
html[data-theme="light"] .lesson-row.free-lesson{border-left:3px solid #318b62!important}
html[data-theme="light"] .lr-title{white-space:normal!important;line-height:1.45!important;color:#213c55!important}
html[data-theme="light"] :is(.lr-num,.module-hub-num,.dash-module-label){color:#165c90!important}
html[data-theme="light"] :is(.toc-module--lab,.module-hub-card--lab,.dash-module--lab){background:#fff5e2!important;border-color:#dfc391!important}
html[data-theme="light"] .toc-module--lab .toc-module-head{background:#f9e9c6!important}
html[data-theme="light"] :is(.toc-module--lab .toc-module-label,.toc-lab-pill,.toc-chip-lab,.module-hub-card--lab .module-hub-num,.dash-module--lab .dash-module-label){background:#fae8c3!important;color:#805614!important;border-color:#d8b87d!important}
html[data-theme="light"] .module-hub-card{background:linear-gradient(130deg,#fff,#eaf3fc)!important;border-color:#bfd3e7!important;border-top:3px solid #438dc1!important;box-shadow:0 4px 16px rgba(37,69,104,.05)!important}
html[data-theme="light"] .module-hub-card--lab{background:linear-gradient(130deg,#fffaf0,#faeccf)!important;border-top-color:#bd862b!important}
html[data-theme="light"] .dash-module-summary{background:#e8f2fd!important;color:#213c55!important}
html[data-theme="light"] .dash-module--lab .dash-module-summary{background:#faeccf!important}
@media(max-width:760px){
  html[data-theme="light"] :is(.lesson-wrap,.lesson-content,.lesson-teaser){overflow-x:clip!important;overflow-y:visible!important}
  html[data-theme="light"] .toc-module{padding:12px}
  html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav{padding:16px!important}
  html[data-theme="light"] :is(.lesson-content,.lesson-teaser) .lc-section-nav-list{grid-template-columns:1fr}
  html[data-theme="light"] :is(.lesson-content,.lesson-teaser) h2.lc-section-title{padding:13px 14px!important;margin-top:34px!important;font-size:22px!important}
  html[data-theme="light"] :is(.lesson-content,.lesson-teaser) table[data-reading-table] :is(th,td){padding:10px!important;font-size:13px!important}
}

.reading-theme-auth-control{display:flex;justify-content:flex-end;padding:12px 20px}

/* Higher contrast for reading, controls and legacy HTML. */
html[data-theme="light"]{--text:#1e2a36;--muted:#435264;--ml-text:#1e2a36;--ml-text-secondary:#435264;--ml-muted:#435264}
html[data-theme="light"] body{color:#1e2a36}
html[data-theme="light"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){border-color:#8094a6!important}
html[data-theme="light"] :is(input,textarea)::placeholder{color:#596b7b!important;opacity:1}
html[data-theme="light"] :is(button,a,input,textarea,select):focus-visible{outline:3px solid #00609b;outline-offset:3px}
html[data-theme="light"] :is(#reading-contrast-override,[data-reading-contrast="ink"]){color:#1e2a36!important;-webkit-text-fill-color:#1e2a36!important;--reading-inline-color:#1e2a36!important;--reading-inline--webkit-text-fill-color:#1e2a36!important}
html[data-theme="light"] :is(#reading-contrast-override,[data-reading-contrast="paper"]){color:#fff!important;-webkit-text-fill-color:#fff!important;--reading-inline-color:#fff!important;--reading-inline--webkit-text-fill-color:#fff!important}
html[data-theme="light"] [data-reading-gradient-text="1"]{background-image:none!important;--reading-inline-background-image:none!important}
