:root[data-theme] {
  --bg: #fff8f5;
  --surface: #ffffff;
  --ink: #172f32;
  --muted: #526568;
  --line: #dfE5e4;
  --accent: #a63e26;
  --accent-soft: #ffede6;
  --accent-ink: #ffffff;
  --brand: #ff8d6d;
  --amber: #925300;
  --amber-soft: #fff1d9;
  --red: #b3261e;
  --red-soft: #fce9e7;
  --green: #22693c;
  --green-soft: #e5f4e9;
  --display: 'IBM Plex Sans', 'Noto Sans Devanagari', sans-serif;
  --body: 'IBM Plex Sans', 'Noto Sans Devanagari', sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #161b1d; --surface: #202729; --ink: #f1f3f3; --muted: #b0bfc0; --line: #3b484a;
  --accent: #ff8d6d; --accent-soft: #3c2b27; --accent-ink: #161b1d;
  --amber: #f0b25a; --amber-soft: #3a2b10; --red: #f2918a; --red-soft: #3c1a18;
  --green: #7fd39a; --green-soft: #16301f; color-scheme: dark;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); line-height: 1.65; -webkit-text-size-adjust: 100%; }
button, select { font: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
.carez-brand { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-size: 24px; font-weight: 700; line-height: 1.2; }
.carez-brand img { flex: none; }
.carez-brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.carez-settings { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding-block: 14px; border-block: 1px solid var(--line); }
.setting-label { font-size: 14px; font-weight: 500; }
#appearance { border: 1px solid var(--line); border-radius: 6px; min-height: 44px; padding: 6px 10px; color: var(--ink); background: var(--surface); max-width: 150px; }
.wrap { max-width: 1160px; gap: 40px; padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.side { gap: 18px; }
.brand { font-size: 20px; }
.head { border-radius: 0; background: transparent; color: var(--ink); padding: 8px 0 24px; border-bottom: 3px solid var(--brand); }
.head h1 { font-size: 36px; overflow-wrap: anywhere; }
.head p { font-size: 17px; color: var(--muted); opacity: 1; }
:root[data-theme] .chip { background: var(--accent-soft); border-color: var(--line); color: var(--accent); border-radius: 4px; }
.panel { background: transparent; border: 0; border-radius: 0; padding: 16px 0 24px; border-bottom: 1px solid var(--line); }
.panel h2 { font-size: 24px; }
.callout, .two > div, .cards > div, .q, .anim, .cert { border-radius: 8px; }
.cards > div, .q, .two > div { background: var(--surface); }
.label, .callout b.t, .two h4, th { letter-spacing: 0; }
.btn, .lang button, .nav button { min-height: 44px; }
.lang { gap: 0; }
.lang button { border-radius: 0; padding-inline: 5px; }
.lang button:first-child { border-radius: 6px 0 0 6px; }
.lang button:last-child { border-radius: 0 6px 6px 0; }
.course-menu > summary { display: none; cursor: pointer; font-weight: 600; min-height: 44px; }
.q { min-width: 0; }
.q legend { overflow-wrap: anywhere; }
.q input { flex: none; }
.q label { min-height: 44px; }
.check input { min-width: 22px; min-height: 22px; }
.check label { padding-block: 3px; cursor: pointer; }
.two { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.cards { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.anim .stage { overflow: hidden; }
.anim .dots { flex-shrink: 0; }
.library { max-width: 1050px; margin: auto; padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)); }
.library header { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.library .carez-settings { border: 0; padding: 0; }
.library h1 { font-size: 32px; margin: 32px 0 24px; }
.library .lang { display: flex; max-width: 340px; margin-top: 24px; }
.library .lang button { flex: 1; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.library .lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.course-list { display: grid; gap: 0; }
.course-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 24px; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.course-item:hover h2 { color: var(--accent); }
.course-item img { width: 110px; height: 100px; object-fit: cover; border-radius: 6px; }
.course-item h2 { font-size: 22px; margin: 0 0 6px; }
.course-item p { color: var(--muted); margin: 0; }
.course-item .open { color: var(--accent); font-weight: 600; }
@media (max-width: 860px) {
  .wrap { gap: 20px; padding-top: max(16px, env(safe-area-inset-top)); }
  .side { position: static; gap: 12px; }
  .carez-settings { padding-block: 8px; }
  .course-menu { border-block: 1px solid var(--line); padding-block: 4px; }
  .course-menu > summary { display: list-item; padding: 8px 4px; margin-left: 18px; }
  .course-menu .nav { flex-direction: column; }
  .course-menu .nav li { flex: auto; }
  .head h1 { font-size: 28px; }
  .head { padding-top: 0; }
  .tl li { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 8px; padding-left: 10px; }
  .tl .dur { font-size: 12px; }
  .anim figcaption { padding: 12px; }
  .library header { gap: 20px; }
  .course-item { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; }
  .course-item img { width: 76px; height: 88px; }
  .course-item .open { grid-column: 2; }
  .course-item h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }