/* Layout concept: a calm study desk — soft slate neutrals that are easy on the eyes,
   one steel-blue accent, entities and relations drawn like an ERD, code shown in quiet panels. */
:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EDF1F6;
  --ink: #243142;
  --muted: #5E6C7E;
  --line: #DDE3EB;
  --accent: #2F6B9A;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3EEF7;
  --amber: #8C5A14;
  --amber-soft: #F8EEDC;
  --violet: #5E4F96;
  --violet-soft: #ECE9F6;
  --good: #276E50;
  --good-soft: #E2F2EA;
  --bad: #B23B3B;
  --bad-soft: #F8E5E5;
  --code-bg: #F1F4F8;
  --shadow: 0 1px 2px rgba(36, 49, 66, .05), 0 6px 18px -10px rgba(36, 49, 66, .16);

  --f-display: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  --f-body: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --wrap: 1180px;
  --head-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171C23; --surface: #1E252E; --surface-2: #262E39; --ink: #D8DEE6; --muted: #9AA6B4; --line: #313A46;
    --accent: #86B4DB; --accent-ink: #13202C; --accent-soft: #263848;
    --amber: #D8AA62; --amber-soft: #3A3123; --violet: #B6A9E3; --violet-soft: #312C45;
    --good: #7CC5A1; --good-soft: #1F3A2E; --bad: #E58C8C; --bad-soft: #432728; --code-bg: #1A2028;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 22px -12px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171C23; --surface: #1E252E; --surface-2: #262E39; --ink: #D8DEE6; --muted: #9AA6B4; --line: #313A46;
  --accent: #86B4DB; --accent-ink: #13202C; --accent-soft: #263848;
  --amber: #D8AA62; --amber-soft: #3A3123; --violet: #B6A9E3; --violet-soft: #312C45;
  --good: #7CC5A1; --good-soft: #1F3A2E; --bad: #E58C8C; --bad-soft: #432728; --code-bg: #1A2028;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 22px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.8; font-weight: 400;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: var(--wrap); margin-inline: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.4; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.12rem; }
p { margin: 0; }
b, strong { font-weight: 600; }
code { font-family: var(--f-mono); font-size: .9em; background: var(--code-bg); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.eyebrow { font-size: .9rem; font-weight: 500; color: var(--accent); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}
.head-row { display: flex; align-items: center; gap: var(--s-4); min-height: var(--head-h); flex-wrap: wrap; padding-block: var(--s-2); }
.brand { display: flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--ink); font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; direction: ltr; }
.brand b { color: var(--accent); font-weight: 600; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: var(--s-1); flex: 1; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: .4rem .65rem; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.controls { display: flex; gap: var(--s-2); align-items: center; }
.ctl {
  display: inline-flex; align-items: center; gap: .4rem; font: 500 .88rem var(--f-body);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: .38rem .8rem; cursor: pointer; white-space: nowrap;
}
.ctl:hover { border-color: var(--accent); color: var(--accent); }
.ctl svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 1040px) {
  .nav { order: 3; flex-basis: 100%; }
  .controls { margin-inline-start: auto; }
}
@media (max-width: 720px) { .ctl .ctl-text { display: none; } }

/* ---------- generic ---------- */
main { padding-block: var(--s-6) var(--s-8); min-height: 70vh; }
.section { margin-top: var(--s-8); }
.section-head { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-5); max-width: 64ch; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 62ch; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; cursor: pointer;
  font: 500 .97rem var(--f-body); border-radius: var(--r-md); padding: .65rem 1.15rem; border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: .4rem .8rem; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: default; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 500; line-height: 1.6;
  padding: .15rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--ink); white-space: nowrap; text-decoration: none;
}
a.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chip.lv-entry { background: var(--good-soft); color: var(--good); }
.chip.lv-mid { background: var(--amber-soft); color: var(--amber); }
.chip.lv-adv { background: var(--violet-soft); color: var(--violet); }
.chip.next { background: var(--amber-soft); color: var(--amber); }
.chip.live { background: var(--accent-soft); color: var(--accent); }
.chip.done { background: var(--good-soft); color: var(--good); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.back { display: inline-flex; gap: .4rem; align-items: center; text-decoration: none; color: var(--muted); font-weight: 500; margin-bottom: var(--s-5); }
.back:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s-7); align-items: center; padding-top: var(--s-4); }
.hero-text { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-2); }
.erd { width: 100%; max-width: 100%; height: auto; }
.erd .ent rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.erd .ent .head { fill: var(--surface-2); stroke: none; }
.erd .ent text { fill: var(--ink); font-family: var(--f-mono); font-size: 11.5px; }
.erd .ent text.title { font-weight: 600; font-size: 12px; }
.erd .ent text.pk { fill: var(--accent); }
.erd .rel { stroke: var(--muted); stroke-width: 1.4; fill: none; }
.erd .rel-label { fill: var(--muted); font-family: var(--f-mono); font-size: 10.5px; }
.erd .ent.focus rect:not(.head) { stroke: var(--accent); }
.erd .ent.focus .head { fill: var(--accent-soft); }
.erd .ent.focus text.title { fill: var(--accent); }
.erd-cap { font-size: .88rem; color: var(--muted); text-align: center; margin-top: var(--s-2); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: var(--s-6); } }

/* ---------- module board ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mod {
  display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-lg);
  border: 1px solid var(--line); background: transparent; color: inherit; text-decoration: none; min-width: 0;
}
.mod.live { background: var(--surface); box-shadow: var(--shadow); }
.mod.live:hover { border-color: var(--accent); }
.mod-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.mod-code { font-family: var(--f-mono); font-size: .85rem; color: var(--muted); direction: ltr; }
.mod p { color: var(--muted); font-size: .95rem; }
.mod.soon { border-style: dashed; }
@media (max-width: 560px) { .board { grid-template-columns: 1fr; } }

/* roadmap: a real sequence of phases */
.roadmap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: var(--s-6); }
.phase { padding: var(--s-5) 0 0; padding-inline-end: var(--s-4); position: relative; min-width: 0; border-top: 2px solid var(--line); }
.phase.past { border-top-color: var(--good); }
.phase::before { content: ""; position: absolute; top: -7px; inset-inline-start: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.phase.past::before { background: var(--good); border-color: var(--good); }
.phase.now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.phase .num { font-size: .88rem; color: var(--muted); }
.phase h3 { margin-block: var(--s-1) var(--s-2); }
.phase ul { margin: 0; padding-inline-start: 1.1rem; color: var(--muted); font-size: .94rem; }
.phase li.done { color: var(--ink); }
.phase li.done::marker { content: "✓  "; color: var(--good); }
@media (max-width: 860px) {
  .roadmap { grid-template-columns: 1fr; border-top: 0; border-inline-start: 2px solid var(--line); }
  .roadmap { row-gap: 0; }
  .phase { padding: 0 var(--s-5) var(--s-5); border-top: 0; }
  .phase::before { top: 6px; inset-inline-start: -7px; }
}

.picker { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.picker a { text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: .5rem .9rem; border-radius: var(--r-md); font-weight: 500; }
.picker a:hover { border-color: var(--accent); color: var(--accent); }
.picker .mk { font-family: var(--f-mono); font-size: .78rem; color: var(--muted); }

/* ---------- MIS page ---------- */
.prose { max-width: 68ch; display: flex; flex-direction: column; gap: var(--s-4); font-size: 1.04rem; }
.components { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-4); }
.comp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4) var(--s-3); text-align: center; min-width: 0; }
.comp.mid { border-color: var(--accent); background: var(--accent-soft); }
.comp strong { display: block; font-size: 1.05rem; font-weight: 600; }
.comp span { font-size: .86rem; color: var(--muted); }
.sides { display: flex; justify-content: space-between; gap: var(--s-4); font-size: .86rem; color: var(--muted); margin-top: var(--s-2); }
@media (max-width: 640px) { .components { grid-template-columns: repeat(2, minmax(0, 1fr)); } .comp.mid { grid-column: 1 / -1; order: -1; } }

.courses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.course-col { min-width: 0; }
.course-col h3 { padding-bottom: var(--s-2); border-bottom: 2px solid var(--line); margin-bottom: var(--s-3); }
.course-col.core h3 { border-color: var(--accent); color: var(--accent); }
.course-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.course-col li { padding-inline-start: 1rem; position: relative; }
.course-col li::before { content: ""; position: absolute; inset-inline-start: 0; top: .8em; width: 6px; height: 6px; background: var(--line); border-radius: 50%; }
.course-col.core li::before { background: var(--accent); }
@media (max-width: 760px) { .courses { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.table-wrap.wide table { min-width: 640px; }
th, td { text-align: start; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-weight: 600; background: var(--surface-2); }
thead th.us { color: var(--accent); }
td.us { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
tbody th { font-weight: 500; color: var(--muted); width: 18%; }
tr:last-child th, tr:last-child td { border-bottom: 0; }

.faq { display: flex; flex-direction: column; gap: var(--s-2); max-width: 780px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details[open] summary { color: var(--accent); margin-bottom: var(--s-2); }
.faq p { color: var(--muted); }

/* ---------- careers ---------- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); align-items: center; }
.fbtn { font: 500 .9rem var(--f-body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .35rem .9rem; cursor: pointer; }
.fbtn:hover { border-color: var(--accent); }
.fbtn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.flabel { font-size: .9rem; color: var(--muted); margin-inline-end: var(--s-1); }
.career-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--s-4); }
.career-card {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-4); padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: inherit; text-decoration: none;
}
.career-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.mark {
  grid-row: span 3; width: 52px; height: 52px; border-radius: var(--r-md); background: var(--accent-soft);
  display: grid; place-items: center; font: 600 .82rem var(--f-mono); color: var(--accent);
}
.career-card h3 { align-self: end; }
.career-card .en-sub { font-size: .86rem; color: var(--muted); }
.career-card p { grid-column: 2; color: var(--muted); font-size: .94rem; margin-top: var(--s-1); }
.career-card .foot { grid-column: 2; display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }

.detail-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-5); align-items: center; margin-bottom: var(--s-6); }
.detail-head .mark { width: 72px; height: 72px; font-size: .95rem; grid-row: span 2; }
.detail-head .lead { grid-column: 1 / -1; margin-top: var(--s-3); }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s-6); }
.cols > * { min-width: 0; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.block { display: flex; flex-direction: column; gap: var(--s-3); }
.block + .block { margin-top: var(--s-6); }
.block h2 { font-size: 1.2rem; }
.tasks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s-2); }
.tasks li { display: grid; grid-template-columns: 22px 1fr; gap: var(--s-2); }
.tasks li::before { content: ""; width: 8px; height: 8px; margin-top: .75em; border-radius: 50%; background: var(--accent); justify-self: center; }

.ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.rung { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.rung-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.rung-h .step { font-size: .85rem; color: var(--muted); }
.cert-pill {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; width: 100%;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: var(--r-md);
  padding: .55rem .75rem; cursor: pointer; font: inherit;
}
.cert-pill:hover { border-color: var(--accent); }
.cert-pill b { font-family: var(--f-mono); font-size: .95rem; font-weight: 600; direction: ltr; }
.cert-pill span { font-size: .86rem; color: var(--muted); line-height: 1.55; }
.rung .none { font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) { .ladder { grid-template-columns: 1fr; } }

.progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.progress .stage { background: var(--surface); border: 1px solid var(--line); padding: .45rem .85rem; border-radius: var(--r-md); font-weight: 500; font-size: .95rem; }
.progress .stage:last-child { border-color: var(--accent); color: var(--accent); }
.progress .arrow { color: var(--muted); }

/* ---------- certs ---------- */
.note {
  display: block; padding: var(--s-4); border-radius: var(--r-md); background: var(--amber-soft); color: var(--ink);
  font-size: .95rem; margin-bottom: var(--s-5); max-width: 880px;
}
.note b { color: var(--amber); }
.search {
  width: 100%; max-width: 420px; font: 1rem var(--f-body); padding: .65rem .9rem; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-rows { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-5); }
.count { font-size: .92rem; color: var(--muted); margin-bottom: var(--s-3); }
.cert-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--s-3); }
.cert-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-2); min-width: 0;
}
.cert-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.code-tag { font-family: var(--f-mono); font-weight: 600; font-size: 1rem; color: var(--accent); direction: ltr; }
.cert-card h3 { font-size: 1.02rem; font-weight: 500; }
.cert-card .prov { font-size: .88rem; color: var(--muted); }
.cert-card p.d { font-size: .93rem; color: var(--muted); }
.roles { font-size: .88rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.roles a { text-decoration: none; }
.roles a:hover { text-decoration: underline; }
.cert-card .ext { margin-top: auto; padding-top: var(--s-2); font-size: .92rem; font-weight: 500; }
.empty { padding: var(--s-6); text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-lg); }

.sheet-bg { position: fixed; inset: 0; background: rgba(15, 20, 28, .45); z-index: 40; display: grid; place-items: center; padding: 16px; }
.sheet {
  background: var(--surface); color: var(--ink); border-radius: var(--r-lg); width: min(560px, 100%); max-height: 85vh; overflow: auto;
  padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); box-shadow: 0 20px 60px -20px rgba(0,0,0,.45);
}
.sheet-top { display: flex; justify-content: space-between; align-items: start; gap: var(--s-3); }
.x { border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; flex: none; }

/* ---------- SQL course ---------- */
.course-top { display: grid; grid-template-columns: 1.2fr .8fr; gap: var(--s-6); align-items: start; }
.course-top > * { min-width: 0; }
@media (max-width: 860px) { .course-top { grid-template-columns: 1fr; } }
.meter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.meter .big { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lessons { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.lesson-row { display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: var(--surface-2); }
.lesson-row .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: .9rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.lesson-row.complete .n { background: var(--good-soft); color: var(--good); }
.lesson-row h3 { font-size: 1rem; font-weight: 500; }
.lesson-row p { font-size: .88rem; color: var(--muted); }
.lesson-row > div { min-width: 0; }
@media (max-width: 520px) { .lesson-row { grid-template-columns: 40px 1fr; } .lesson-row .chip { grid-column: 2; justify-self: start; } }

.schema { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--s-3); }
.tbl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; direction: ltr; text-align: left; }
.tbl-h { background: var(--surface-2); padding: .45rem .75rem; display: flex; justify-content: space-between; gap: var(--s-2); align-items: baseline; }
.tbl-h b { font-family: var(--f-mono); font-size: .9rem; }
.tbl-h span { font-size: .82rem; color: var(--muted); font-family: var(--f-body); }
.tbl ul { list-style: none; margin: 0; padding: .4rem .75rem .55rem; font-family: var(--f-mono); font-size: .84rem; line-height: 1.85; }
.tbl li { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-2); }
.tbl li > span:first-child { min-width: 0; }
.tbl .keys { white-space: nowrap; }
.key { font-size: .72rem; font-weight: 600; padding: 0 .35rem; border-radius: 4px; }
.key.pk { background: var(--accent-soft); color: var(--accent); }
.key.fk { background: var(--violet-soft); color: var(--violet); }
.tbl .ref { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; margin-bottom: 2px; }

/* lesson layout */
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "content lab" "ex lab"; gap: var(--s-6); align-items: start; }
.lesson-content { grid-area: content; display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.lesson-ex { grid-area: ex; min-width: 0; }
.lesson-lab { grid-area: lab; position: sticky; top: calc(var(--head-h) + env(safe-area-inset-top, 0px) + 16px); min-width: 0; }
@media (max-width: 1000px) {
  .lesson-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content" "ex" "lab"; }
  .lesson-lab { position: static; }
}
.lesson-content p { max-width: 68ch; }
.lesson-num { font-size: .9rem; color: var(--muted); }
pre.code {
  margin: 0; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); overflow-x: auto; direction: ltr; text-align: left;
  font: 400 .92rem/1.65 var(--f-mono); color: var(--ink);
}
.code-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--code-bg); }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); padding: .35rem .5rem .35rem .9rem; border-bottom: 1px solid var(--line); direction: ltr; }
.code-head > span { font: 500 .78rem var(--f-mono); color: var(--muted); letter-spacing: .06em; }
.code-head .btn { direction: inherit; }
[dir="rtl"] .code-head .btn { direction: rtl; }
.code-wrap pre.code { border: 0; border-radius: 0; }
.kw { color: var(--accent); font-weight: 600; }
.str { color: var(--amber); }
.num { color: var(--violet); }
.cmt { color: var(--muted); font-style: italic; }
.callout { border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-size: .95rem; display: flex; flex-direction: column; gap: var(--s-1); }
.callout .lbl { font-weight: 600; font-size: .88rem; }
.callout.mysql { background: var(--accent-soft); }
.callout.mysql .lbl { color: var(--accent); }
.callout.tip { background: var(--amber-soft); }
.callout.tip .lbl { color: var(--amber); }
.mini td.c { font-family: var(--f-mono); font-size: .88rem; direction: ltr; text-align: left; }
.venns { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-3); }
.venn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3); text-align: center; }
.venn svg { width: 100%; max-width: 150px; height: auto; }
.venn .vb { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.venn .vf { fill: var(--accent); }
.venn .vt { fill: var(--ink); font: 600 11px var(--f-mono); }
.venn b { display: block; font-family: var(--f-mono); font-size: .86rem; direction: ltr; }
.venn span { font-size: .84rem; color: var(--muted); }
.rels { display: flex; flex-direction: column; gap: var(--s-3); }
.relrow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-1); }
.relrow svg { width: 100%; max-width: 420px; height: auto; direction: ltr; }
.relrow .eb { fill: var(--surface-2); stroke: var(--line); }
.relrow .et { fill: var(--ink); font: 500 12px var(--f-mono); }
.relrow .ln { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.relrow .lt { fill: var(--muted); font: 600 11px var(--f-mono); }
.relrow p { font-size: .92rem; color: var(--muted); }
.bad td.rep { background: var(--amber-soft); }
.bad td.multi { background: var(--bad-soft); }

.ex-list { display: flex; flex-direction: column; gap: var(--s-3); }
.ex {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.ex.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ex.solved { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.ex-h { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.ex-h .n { font-size: .88rem; color: var(--muted); font-weight: 500; }
.lesson-nav { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.lesson-nav a { text-decoration: none; display: flex; flex-direction: column; gap: 2px; color: var(--ink); max-width: 48%; }
.lesson-nav a span { font-size: .85rem; color: var(--muted); }
.lesson-nav a.nx { margin-inline-start: auto; text-align: end; }
.lesson-nav a:hover b { color: var(--accent); }

/* playground */
.lab { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.lab-bar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.lab-bar h3 { font-size: 1rem; margin-inline-end: auto; }
.task { background: var(--accent-soft); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); border-bottom: 1px solid var(--line); }
.task .lbl { font-size: .85rem; font-weight: 600; color: var(--accent); }
.task-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.editor {
  width: 100%; min-height: 170px; resize: vertical; border: 0; border-bottom: 1px solid var(--line); margin: 0; display: block;
  background: var(--code-bg); color: var(--ink); font: 400 .95rem/1.65 var(--f-mono);
  padding: var(--s-3) var(--s-4); direction: ltr; text-align: left; tab-size: 2;
}
.editor:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.lab-run { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.lab-run .kbd { font-size: .82rem; color: var(--muted); margin-inline-start: auto; }
.status { padding: var(--s-2) var(--s-4); font-size: .9rem; color: var(--muted); }
.status.err { background: var(--bad-soft); color: var(--bad); }
.status.ok { background: var(--good-soft); color: var(--good); }
.status.warn { background: var(--amber-soft); color: var(--amber); }
.status .detail { display: block; font-family: var(--f-mono); font-size: .84rem; direction: ltr; text-align: left; margin-top: 2px; }
.results { max-height: 340px; overflow: auto; direction: ltr; }
.results table { font-size: .86rem; direction: ltr; text-align: left; }
.results th, .results td { padding: .4rem .7rem; white-space: nowrap; text-align: left; font-family: var(--f-mono); }
.results thead th { position: sticky; top: 0; font-family: var(--f-mono); font-weight: 600; }
.results td.null { color: var(--muted); font-style: italic; }
.results td.n { text-align: right; font-variant-numeric: tabular-nums; }
.schema-mini { border-top: 1px solid var(--line); padding: var(--s-3) var(--s-4); }
.schema-mini summary { cursor: pointer; font-weight: 500; font-size: .92rem; }
.schema-mini .schema { margin-top: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.tbl button.ins { all: unset; cursor: pointer; }
.tbl button.ins:hover, .tbl button.ins:focus-visible { color: var(--accent); text-decoration: underline; }

.lab-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-5); align-items: start; }
.lab-side { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.samples { display: flex; flex-direction: column; gap: var(--s-2); }
.samples button { text-align: start; font: 500 .92rem var(--f-body); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); padding: .55rem .8rem; cursor: pointer; }
.samples button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 900px) { .lab-page { grid-template-columns: minmax(0, 1fr); } }

/* ---------- ERD guide ---------- */
.erd-hero { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: center; padding-top: var(--s-4); }
.erd-hero > * { min-width: 0; }
@media (max-width: 900px) { .erd-hero { grid-template-columns: 1fr; gap: var(--s-6); } }
.demo-fig { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.erd-demo { width: 100%; height: auto; direction: ltr; }
.demo-fig figcaption { font-size: .95rem; color: var(--muted); }
.demo-fig figcaption b { color: var(--ink); }
.parts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); }
.part { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.part b { font-weight: 600; }
.part span { font-size: .82rem; }
.part p { font-size: .9rem; color: var(--muted); margin-top: var(--s-1); }
@media (max-width: 980px) { .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .parts { grid-template-columns: 1fr; } }
.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); max-width: 900px; }
@media (max-width: 640px) { .mk-grid { grid-template-columns: 1fr; } }
.mk-row { display: grid; grid-template-columns: 130px 1fr; gap: var(--s-4); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.mk-row > div { min-width: 0; }
.mk-row p { font-size: .9rem; color: var(--muted); }
.mk-demo { width: 130px; height: 44px; direction: ltr; }
.mk-demo .mk-ent { fill: var(--surface-2); stroke: var(--line); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); max-width: 820px; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: var(--s-3); align-items: start; }
.steps li > div { min-width: 0; }
.step-n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.steps p { color: var(--muted); font-size: .95rem; }
.mistakes { margin: 0; padding-inline-start: 1.2rem; display: flex; flex-direction: column; gap: var(--s-2); max-width: 820px; }
.mistakes li::marker { color: var(--bad); }
.ch-grid, .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-3); }
.ch-card, .tpl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.ch-card p, .tpl-card p { color: var(--muted); font-size: .93rem; }
.ch-card .btn, .tpl-card .btn { align-self: flex-start; margin-top: auto; }

/* ---------- ERD studio ---------- */
.view.studio { padding-bottom: 0; }
body.is-studio main { padding-block: var(--s-4) var(--s-6); max-width: 1440px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.erd-top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.erd-top .back { margin-bottom: var(--s-1); }
.erd-title { font-size: 1.5rem; }
.erd-dname input { font: 500 1rem var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: .45rem .8rem; width: min(360px, 100%); }
.erd-dname { flex: 0 1 360px; min-width: 0; }
.erd-dname input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.erd-toolbar { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; padding: var(--s-2) 0; margin-bottom: var(--s-2); }
.tb-group { display: flex; gap: var(--s-1); align-items: center; flex-wrap: wrap; }
.tb-group + .tb-group { padding-inline-start: var(--s-3); border-inline-start: 1px solid var(--line); }
@media (max-width: 720px) { .tb-group + .tb-group { padding-inline-start: 0; border-inline-start: 0; } }
.icon-btn { padding: .4rem .55rem; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .icon-btn svg { transform: scaleX(-1); }
.btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tb-select { font: 500 .88rem var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: .38rem .6rem; max-width: 100%; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }

.erd-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-3); align-items: stretch; }
.erd-stage { position: relative; height: clamp(440px, 68vh, 780px); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.erd-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; direction: ltr; }
.erd-svg:active { cursor: grabbing; }
.connecting .erd-svg, .connecting .ent { cursor: crosshair; }
.erd-bg { fill: var(--bg); }
.grid-dot { fill: var(--line); }
.erd-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); max-height: clamp(440px, 68vh, 780px); overflow: auto; min-width: 0; }
@media (max-width: 960px) {
  .erd-main { grid-template-columns: minmax(0, 1fr); }
  .erd-stage { height: 62vh; min-height: 380px; }
  .erd-panel { max-height: none; }
}

/* diagram marks (shared with the guide demos) */
.ent { cursor: move; }
.ent-box { fill: var(--surface); stroke: var(--line); stroke-width: 1.3; }
.ent-head { fill: var(--surface-2); }
.ent-sep { stroke: var(--surface-2); stroke-width: 1; }
.ent.sel .ent-box, .ent.src .ent-box { stroke: var(--accent); stroke-width: 2.2; }
.ent.sel .ent-head, .ent.src .ent-head { fill: var(--accent-soft); }
.ent-name { font: 600 13px var(--f-mono); fill: var(--ink); }
.ent.sel .ent-name { fill: var(--accent); }
.a-name { font: 400 12px var(--f-mono); fill: var(--ink); }
.a-name.pkn { text-decoration: underline; text-underline-offset: 2px; }
.a-type { font: 400 11px var(--f-mono); fill: var(--muted); }
.a-key { font: 600 9px var(--f-mono); letter-spacing: .02em; }
.a-key.pk { fill: var(--accent); }
.a-key.fk { fill: var(--violet); }
.a-key.uq { fill: var(--amber); }
.a-empty { fill: var(--muted); font: 12px var(--f-mono); }
.rel-line, .mk { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.mk-o { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.rel-hit { stroke: transparent; stroke-width: 14; fill: none; cursor: pointer; pointer-events: stroke; }
.rel.sel .rel-line, .rel.sel .mk { stroke-width: 2.6; }
.rel:hover .rel-line { stroke-width: 2.2; }
.rel-label { font: 600 11px var(--f-mono); fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.erd-demo .rel-label { stroke: var(--surface); }
.rel.sel .rel-label { fill: var(--accent); }
.tmp-line { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 5; fill: none; pointer-events: none; }

.erd-hud { position: absolute; bottom: 12px; inset-inline-end: 12px; display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); direction: ltr; }
.hud-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; }
.hud-btn:hover { background: var(--surface-2); }
.hud-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hud-z { min-width: 46px; text-align: center; font: 500 .82rem var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.erd-hint { position: absolute; top: 12px; inset-inline: 12px; margin-inline: auto; width: fit-content; max-width: calc(100% - 24px); display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent); border-radius: var(--r-md); padding: .4rem .5rem .4rem .9rem; font-size: .92rem; }
.erd-toast { position: absolute; bottom: 60px; inset-inline: 12px; margin-inline: auto; width: fit-content; max-width: calc(100% - 24px); background: var(--ink); color: var(--bg); border-radius: var(--r-md); padding: .5rem .9rem; font-size: .9rem; box-shadow: var(--shadow); }
.erd-toast code { background: transparent; border-color: color-mix(in srgb, var(--bg) 40%, transparent); color: inherit; }

/* inspector */
.pn-h { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.fld > span:first-child { font-weight: 500; }
.fld input, .fld select, .attr-row input {
  font: 400 .92rem var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .4rem .6rem; min-width: 0; width: 100%;
}
.fld input[data-f], .attr-row input { font-family: var(--f-mono); font-size: .86rem; direction: ltr; text-align: left; }
.fld input:focus, .fld select:focus, .attr-row input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.attrs-h { display: flex; justify-content: space-between; font-weight: 500; font-size: .9rem; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.attr-list { display: flex; flex-direction: column; gap: var(--s-2); }
.attr-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 26px; grid-template-areas: "pk name del" ". type type" ". flags flags"; gap: 4px 6px; align-items: center; padding-bottom: var(--s-2); border-bottom: 1px dashed var(--line); }
.attr-row > .kbx { grid-area: pk; }
.attr-row .an { grid-area: name; }
.attr-row .x-sm, .attr-row .x-sp { grid-area: del; }
.attr-row .at { grid-area: type; }
.attr-row .flags, .attr-row .fk-ref { grid-area: flags; }
.attr-row .at[readonly] { color: var(--muted); }
.flags { display: flex; gap: var(--s-2); }
.kbx { display: inline-flex; align-items: center; gap: 4px; font: 600 .74rem var(--f-mono); color: var(--muted); cursor: pointer; }
.kbx input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.kbx input:disabled + span { opacity: .45; }
.x-sm { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.x-sm:hover { color: var(--bad); border-color: var(--bad); }
.fk-ref { font: 500 .78rem var(--f-mono); color: var(--violet); direction: ltr; text-align: left; overflow-wrap: anywhere; }
.pn-note { font-size: .84rem; color: var(--muted); }
.pn-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tips { margin: 0; padding-inline-start: 1.1rem; font-size: .9rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.legend { display: flex; flex-direction: column; gap: 2px; }
.lg-row { display: flex; align-items: center; gap: var(--s-3); font-size: .88rem; }
.lg-row .mk-demo { width: 92px; height: 32px; flex: none; }

/* bottom tabs */
.erd-bottom { margin-top: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 var(--s-2); overflow-x: auto; }
.tab { font: 500 .92rem var(--f-body); background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: .7rem .9rem; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.badge { font: 600 .72rem var(--f-mono); background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 0 .45rem; }
.badge.err { background: var(--bad-soft); color: var(--bad); }
.tab-body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.sql-bar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.sql-bar .grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; direction: ltr; }
.seg button { font: 500 .86rem var(--f-mono); background: var(--surface); color: var(--muted); border: 0; padding: .38rem .8rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.sql-out { max-height: 420px; overflow: auto; }
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.issues button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 24px 1fr; gap: var(--s-2); width: 100%; padding: .45rem .6rem; border-radius: var(--r-sm); cursor: pointer; font-size: .93rem; }
.issues button:hover, .issues button:focus-visible { background: var(--surface-2); }
.issues .sev { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 .78rem var(--f-mono); }
.issues .err .sev { background: var(--bad-soft); color: var(--bad); }
.issues .warn .sev { background: var(--amber-soft); color: var(--amber); }
.issues .info .sev { background: var(--accent-soft); color: var(--accent); }
.tab-body .editor { min-height: 180px; border: 1px solid var(--line); border-radius: var(--r-md); }
.tab-body .status { border-radius: var(--r-md); }
.tab-body .empty { padding: var(--s-5); }

/* challenge banner */
.ch-banner { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); }
.ch-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ch-result { border-radius: var(--r-md); background: var(--amber-soft); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.ch-result.win { background: var(--good-soft); }
.ch-result.win b { color: var(--good); }
.ch-result ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .93rem; }
.ch-result li.ok { color: var(--good); }
.ch-result li.no { color: var(--ink); }

/* SQL playground: ERD mode banner */
.mode-banner { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; background: var(--accent-soft); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.mode-banner > span { margin-inline-end: auto; }

/* ---------- programming: hub ---------- */
.course-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 760px) { .course-cards { grid-template-columns: 1fr; } }
.course-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; box-shadow: var(--shadow); }
.cc-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.cc-mark { width: 52px; height: 52px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.course-card h2 { font-size: 1.5rem; }
.cmp { display: flex; flex-direction: column; gap: var(--s-2); }
.cmp-label { font-size: .88rem; font-weight: 500; color: var(--muted); }
.cmp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.cmp-grid > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cmp-h { font: 600 .78rem var(--f-mono); color: var(--muted); letter-spacing: .06em; direction: ltr; text-align: left; }
.cmp-grid pre.code { flex: 1; }
@media (max-width: 640px) { .cmp-grid { grid-template-columns: minmax(0, 1fr); } }
.kw { color: var(--accent); font-weight: 600; }
.bi { color: var(--violet); }

/* ---------- python editor + console ---------- */
.code-ed { display: grid; grid-template-columns: auto minmax(0, 1fr); background: var(--code-bg); border-bottom: 1px solid var(--line); direction: ltr; }
.gutter { margin: 0; padding: var(--s-3) .5rem var(--s-3) .75rem; min-width: 2.6rem; text-align: right; font: 400 .95rem/1.65 var(--f-mono); color: var(--muted); opacity: .7; border-right: 1px solid var(--line); overflow: hidden; user-select: none; max-height: 420px; }
.gutter .gl.err { color: var(--bad); font-weight: 700; opacity: 1; }
.code-ed .editor { border: 0; min-height: 220px; max-height: 420px; resize: vertical; tab-size: 4; white-space: pre; overflow: auto; }
.console-h { padding: var(--s-2) var(--s-4) 0; font: 600 .78rem var(--f-mono); color: var(--muted); letter-spacing: .06em; direction: ltr; text-align: left; }
.console { margin: 0; padding: var(--s-2) var(--s-4) var(--s-4); min-height: 90px; max-height: 340px; overflow: auto; font: 400 .92rem/1.6 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; direction: ltr; text-align: left; unicode-bidi: plaintext; color: var(--ink); }
.con-in { font: inherit; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 4px; padding: 0 .4rem; min-width: 10ch; width: min(28ch, 100%); outline: none; }
.con-echo { color: var(--accent); font-weight: 500; }
.status .why { display: block; margin-top: 2px; color: var(--ink); }
.ck-row { font-family: var(--f-body); font-size: .88rem; margin-bottom: var(--s-2); white-space: normal; }
.ck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); white-space: normal; }
.ck-grid > div { min-width: 0; font-family: var(--f-body); font-size: .85rem; }
.ck-grid pre { margin: 4px 0 0; padding: var(--s-2); background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-sm); font: .86rem/1.55 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- java lessons ---------- */
.jlesson-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.jlesson-ex { min-width: 0; }
.jlesson-grid > .lesson-content, .jlesson-grid > .jlesson-ex { grid-area: auto; }
@media (max-width: 1000px) { .jlesson-grid { grid-template-columns: minmax(0, 1fr); } }
.java-out { border-top: 1px solid var(--line); background: var(--surface); padding: var(--s-2) var(--s-4) var(--s-3); direction: ltr; text-align: left; }
.java-out .lbl { font: 600 .74rem var(--f-mono); color: var(--good); letter-spacing: .06em; text-transform: uppercase; }
.java-out pre { margin: 4px 0 0; font: .9rem/1.6 var(--f-mono); white-space: pre-wrap; color: var(--ink); }
.jex pre.code { font-size: .86rem; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.choice { text-align: left; direction: ltr; font: inherit; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); padding: .45rem .7rem; cursor: pointer; min-width: 0; }
.choice pre { margin: 0; font: .88rem/1.5 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.choice.right { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.choice:disabled { cursor: default; }
.fb { font-size: .92rem; border-radius: var(--r-md); padding: var(--s-2) var(--s-3); }
.fb.ok { background: var(--good-soft); }
.fb.no { background: var(--amber-soft); }
.fill-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.fill-in { flex: 1 1 160px; min-width: 0; font: .95rem var(--f-mono); direction: ltr; text-align: left; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .4rem .6rem; }
.fill-in:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

/* ---------- AI page ---------- */
.ai-fig { align-items: center; }
.ai-circles { width: 100%; max-width: 360px; height: auto; }
.ai-c1 { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.ai-c2 { fill: color-mix(in srgb, var(--accent) 22%, var(--surface)); stroke: var(--accent); stroke-width: 1.5; }
.ai-c3 { fill: color-mix(in srgb, var(--violet) 26%, var(--surface)); stroke: var(--violet); stroke-width: 1.5; }
.ai-c4 { fill: color-mix(in srgb, var(--violet) 48%, var(--surface)); stroke: var(--violet); stroke-width: 1.5; }
.ai-ck { font: 600 15px var(--f-mono); fill: var(--ink); }
.ai-cn { font: 500 12px var(--f-body); fill: var(--ink); }
.ai-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); max-width: 960px; }
@media (max-width: 640px) { .ai-list { grid-template-columns: 1fr; } }
.ai-list li { display: grid; grid-template-columns: 16px 1fr; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.ai-list li > div { min-width: 0; }
.ai-list p { color: var(--muted); font-size: .92rem; }
.ai-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: .45em; border: 1.5px solid var(--accent); }
.ai-d1 { background: var(--accent-soft); } .ai-d2 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.ai-d3 { background: color-mix(in srgb, var(--violet) 26%, var(--surface)); border-color: var(--violet); } .ai-d4 { background: color-mix(in srgb, var(--violet) 48%, var(--surface)); border-color: var(--violet); }

.ml-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); max-width: 900px; box-shadow: var(--shadow); }
.ml-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: .88rem; color: var(--muted); }
.ml-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ml-legend i { font-style: normal; display: inline-grid; place-items: center; width: 14px; height: 14px; }
.lg-pass { background: var(--good); border-radius: 50%; }
.lg-fail { color: var(--bad); font-weight: 700; font-size: .8rem; }
.lg-wrong { border: 2px solid var(--amber); border-radius: 50%; }
.ml-plot { overflow-x: auto; direction: ltr; }
.ml-svg { width: 100%; height: auto; display: block; }

.ml-zone { fill: var(--good-soft); }
.ml-axis, .ml-tick { stroke: var(--muted); stroke-width: 1.2; }
.ml-lbl { font: 11px var(--f-mono); fill: var(--muted); }
.ml-pass { fill: var(--good); }
.ml-fail { stroke: var(--bad); stroke-width: 2.4; stroke-linecap: round; }
.ml-wrong { fill: none; stroke: var(--amber); stroke-width: 2; }
.ml-line { stroke: var(--accent); stroke-width: 2.5; }
.ml-t { font: 600 12px var(--f-mono); fill: var(--accent); }
.ml-controls { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; }
.ml-slider { display: flex; align-items: center; gap: var(--s-3); flex: 1 1 260px; font-size: .9rem; color: var(--muted); }
.ml-slider input { flex: 1; accent-color: var(--accent); min-width: 0; direction: ltr; }
.ml-stats { display: flex; flex-direction: column; gap: var(--s-2); }
.ml-rule { font-weight: 500; }
.ml-acc { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.ml-acc b { font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--accent); }
.ai-take { max-width: 72ch; margin-top: var(--s-4); }

.nw-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); max-width: 760px; box-shadow: var(--shadow); }
.nw-sentence { font-size: 1.35rem; font-weight: 500; min-height: 1.6em; }
.nw-caret { color: var(--accent); animation: blink 1s steps(1) infinite; margin-inline-start: 2px; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .nw-caret { animation: none; } }
.nw-opts { display: flex; flex-direction: column; gap: 6px; }
.nw-opt { display: grid; grid-template-columns: minmax(80px, 140px) 1fr 44px; gap: var(--s-3); align-items: center; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: .45rem .75rem; cursor: pointer; text-align: start; }
.nw-opt:hover { border-color: var(--accent); }
.nw-w { font-weight: 500; }
.nw-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.nw-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.nw-p { font-size: .82rem; color: var(--muted); text-align: end; font-variant-numeric: tabular-nums; }
.ai-facts { margin: var(--s-4) 0 0; padding-inline-start: 1.2rem; display: flex; flex-direction: column; gap: var(--s-2); max-width: 780px; }

.ai-biz { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .ai-biz { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .ai-biz { grid-template-columns: 1fr; } }
.ai-study { margin: 0; padding-inline-start: 1.2rem; display: flex; flex-direction: column; gap: var(--s-2); max-width: 780px; }
.prompt-cmp { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--s-3); margin-top: var(--s-3); max-width: 960px; }
@media (max-width: 700px) { .prompt-cmp { grid-template-columns: 1fr; } }
.pr { border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); border: 1px solid var(--line); background: var(--surface); }
.pr.bad { background: var(--bad-soft); border-color: transparent; }
.pr.bad .chip { background: var(--surface); color: var(--bad); align-self: flex-start; }
.pr.good { border-color: var(--good); }
.pr.good .chip { align-self: flex-start; }
.pr p { font-size: .95rem; }
.ai-jobs th { width: 30%; }
.ai-jobs th a { font-weight: 500; }
.risks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); max-width: 960px; }
@media (max-width: 640px) { .risks { grid-template-columns: 1fr; } }
.risk { display: grid; grid-template-columns: 40px 1fr; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.risk > div { min-width: 0; }
.risk p { color: var(--muted); font-size: .92rem; }
.risk-k { width: 36px; height: 36px; border-radius: 50%; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; }
.risk-k svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qz-box { display: flex; flex-direction: column; gap: var(--s-3); max-width: 820px; }
.qz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.qz-opts { display: flex; flex-direction: column; gap: 6px; }
.qz-opt { font: inherit; text-align: start; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: .45rem .8rem; cursor: pointer; }
.qz-opt:hover:not(:disabled) { border-color: var(--accent); }
.qz-opt.right { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.qz-opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.qz-opt:disabled { cursor: default; }
.qz-score { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.ai-certs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); max-width: 960px; }
@media (max-width: 760px) { .ai-certs { grid-template-columns: 1fr; } }

/* ---------- systems analysis: diagrams ---------- */
.dg-fig { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-3); }
.dg-scroll { overflow-x: auto; }
.dg { width: 100%; height: auto; display: block; direction: ltr; }
.dg-fig figcaption { font-size: .88rem; color: var(--muted); margin-top: var(--s-2); }
.dg-box, .dg-proc { fill: var(--surface); stroke: var(--accent); stroke-width: 1.4; }
.dg-in { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
.dg-out { fill: var(--good-soft); stroke: var(--good); stroke-width: 1.4; }
.dg-ext { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.4; }
.dg-storebg { fill: var(--amber-soft); }
.dg-store { fill: none; stroke: var(--amber); stroke-width: 1.4; }
.dg-uc { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.3; }
.dg-sys { fill: none; stroke: var(--muted); stroke-width: 1.3; }
.dg-actor circle, .dg-actor path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.dg-gate { fill: var(--amber-soft); stroke: var(--amber); stroke-width: 1.4; }
.dg-ev { fill: var(--surface); stroke: var(--good); stroke-width: 1.6; }
.dg-ev.end { stroke: var(--bad); stroke-width: 3.5; }
.dg-ev.fill { fill: var(--ink); stroke: var(--ink); }
.dg-dot { fill: var(--ink); }
.dg-ev.end.fill { fill: var(--surface); }
.dg-loop { fill: var(--violet-soft); stroke: none; }
.dg-flow { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.dg-flow.dash { stroke-dasharray: 6 4; }
.dg-head { fill: var(--muted); }
.dg-sep { stroke: var(--line); stroke-width: 1.2; }
.dg-life { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; }
.dg-lane { fill: none; stroke: var(--line); stroke-width: 1.4; }
.dg-lanehd { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.4; }
.dg-t { font: 500 13px var(--f-body); fill: var(--ink); }
.dg-t.dg-sm { font-size: 12px; }
.dg-th { font-weight: 700; }
.dg-mono { font: 500 12px var(--f-mono); fill: var(--ink); }
.dg-mono.b, .dg-cap.b { font-weight: 600; }
.dg-lbl { font: 500 11.5px var(--f-body); fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.dg-cap { font: 500 12.5px var(--f-body); fill: var(--muted); }
.dg-big { font: 700 22px var(--f-mono); fill: var(--accent); }
.callout.case { background: var(--violet-soft); }
.callout.case .lbl { color: var(--violet); }

/* tools inside lessons */
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); box-shadow: var(--shadow); }
.fc-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
@media (max-width: 640px) { .fc-in { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fc-in input { font-family: var(--f-mono); direction: ltr; text-align: left; }
.fc-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.fc-out > div { background: var(--bg); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); display: flex; flex-direction: column; min-width: 0; }
.fc-out span { font-size: .82rem; color: var(--muted); }
.fc-out b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.fc-out b.pos { color: var(--good); } .fc-out b.neg { color: var(--bad); }
@media (max-width: 480px) { .fc-out { grid-template-columns: 1fr; } }
.fc-chart { margin: 0; }
.fc-chart svg { width: 100%; height: auto; direction: ltr; display: block; }
.fc-zero { stroke: var(--muted); stroke-width: 1; }
.fc-pos { fill: var(--good); } .fc-neg { fill: var(--bad); opacity: .8; }
.fc-lbl { font: 11px var(--f-body); fill: var(--muted); }
.fc-val { font: 600 11px var(--f-mono); fill: var(--ink); }
.story-tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); }
@media (max-width: 700px) { .story-tool { grid-template-columns: 1fr; } }
.story-in { display: flex; flex-direction: column; gap: var(--s-2); }
.story-card { background: var(--bg); border: 1px dashed var(--accent); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.story-s { font-size: 1.02rem; }
.story-ck { list-style: none; margin: 0; padding: 0; font-size: .86rem; display: flex; flex-direction: column; gap: 2px; }
.story-ck .ok { color: var(--good); } .story-ck .no { color: var(--bad); }
.gwt { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.gwt-row { display: grid; grid-template-columns: 76px 1fr; gap: var(--s-3); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--line); align-items: baseline; }
.gwt-row:last-child { border-bottom: 0; }
.gwt-k { color: var(--accent); font-weight: 600; direction: ltr; }
.t3 tbody th { width: 22%; color: var(--ink); }
.t3 thead th:first-child { width: 22%; }

/* exercises: ordering & sorting */
.ord { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ord-row { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--s-2); align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: .35rem .5rem; }
.ord-row.ok { border-color: var(--good); background: var(--good-soft); }
.ord-row.no { border-color: var(--amber); }
.ord-n { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .8rem; font-variant-numeric: tabular-nums; }
.ord-t { min-width: 0; font-size: .93rem; }
.ord-b { display: flex; gap: 4px; }
.ord-b .x-sm { font-size: .7rem; }
.ord-b .x-sm:disabled { opacity: .35; cursor: default; }
.srt { display: flex; flex-direction: column; gap: 6px; }
.srt-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; justify-content: space-between; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: .4rem .6rem; }
.srt-row.no { border-color: var(--bad); background: var(--bad-soft); }
.srt-row.ok { border-color: var(--good); }
.srt-t { flex: 1 1 160px; min-width: 0; font-size: .93rem; }
.srt-seg { direction: inherit; }
.srt-seg button { font-family: var(--f-body); }
.srt-seg button + button { border-left: 0; border-inline-start: 1px solid var(--line); }
.calc-in { flex: 1 1 120px; min-width: 0; font: .95rem var(--f-mono); direction: ltr; text-align: left; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .4rem .6rem; }
.calc-in:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.fill-row { align-items: center; }

/* SRS builder */
.srs-bar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-3); }
.srs-bar .grow { flex: 1; }
.srs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s-5); align-items: start; margin-top: var(--s-3); }
@media (max-width: 900px) { .srs-grid { grid-template-columns: minmax(0, 1fr); } }
.srs-form { display: flex; flex-direction: column; gap: var(--s-3); }
.srs-form textarea { font: 400 .93rem/1.6 var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .65rem; resize: vertical; min-width: 0; width: 100%; }
.srs-form input { font: 400 .95rem var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .45rem .65rem; width: 100%; }
.srs-form textarea:focus, .srs-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.srs-doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); box-shadow: var(--shadow); position: sticky; top: calc(var(--head-h) + env(safe-area-inset-top, 0px) + 16px); max-height: calc(100vh - var(--head-h) - 40px); overflow: auto; }
@media (max-width: 900px) { .srs-doc { position: static; max-height: none; } }
.srs-doc header { border-bottom: 2px solid var(--accent); padding-bottom: var(--s-3); margin-bottom: var(--s-2); display: flex; flex-direction: column; gap: 2px; }
.srs-doc h2 { font-size: 1.4rem; }
.srs-doc h3 { font-size: 1.02rem; color: var(--accent); margin-top: var(--s-3); }
.srs-doc ul { margin: 0; padding-inline-start: 1.2rem; display: flex; flex-direction: column; gap: 2px; font-size: .93rem; }
.srs-doc ul.req { list-style: none; padding: 0; }
.srs-doc ul.req li { display: grid; grid-template-columns: 64px 1fr; gap: var(--s-2); padding: 3px 0; border-bottom: 1px dashed var(--line); }
.rid { font-size: .8rem; color: var(--violet); font-weight: 600; direction: ltr; }
.srs-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 480px) { .srs-2 { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: var(--s-5) var(--s-6); color: var(--muted); font-size: .9rem; }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); }

@media (prefers-reduced-motion: no-preference) {
  .view { animation: rise .3s ease-out both; }
  @keyframes rise { from { transform: translateY(5px); } to { transform: none; } }
}

[dir="rtl"] .java-out .lbl, [dir="rtl"] .console-h, [dir="rtl"] .code-head > span { letter-spacing: 0; font-family: var(--f-body); text-transform: none; }

@media (max-width: 600px) { .ml-svg .ml-lbl, .ml-svg .ml-t { font-size: 20px; } .ml-card { padding-inline: var(--s-3); } }

/* ---------- lesson complete → next lesson ---------- */
.done-slot:empty { display: none; }
.done-slot { margin-top: var(--s-4); scroll-margin: calc(var(--head-h) + 24px); }
.done-card { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; background: var(--good-soft); border: 1px solid var(--good); border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); }
.done-ico { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--good); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; }
.done-txt { display: flex; flex-direction: column; flex: 1 1 180px; min-width: 0; line-height: 1.55; }
.done-txt b { color: var(--good); }
.done-txt span { font-size: .9rem; color: var(--ink); }
.nx-btn { white-space: nowrap; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); flex-wrap: wrap; }
.status .nx-btn { flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .done-card { animation: pop .35s ease-out both; }
  @keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- networking diagrams ---------- */
.dg-zone { fill: var(--accent); fill-opacity: .045; stroke: var(--accent); stroke-opacity: .45; stroke-width: 1.3; stroke-dasharray: 6 5; }
.dg-ly { fill: var(--accent); fill-opacity: .07; stroke: var(--accent); stroke-opacity: .5; stroke-width: 1.2; }
.dg-dv { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.dg-dv.acc { fill: var(--accent-soft); stroke: var(--accent); }
.dg-dv.fw { fill: var(--bad-soft); stroke: var(--bad); }
.dg-brick { fill: none; stroke: var(--bad); stroke-width: 1.2; }
.dg-dvs { fill: var(--accent-soft); stroke: none; }
.dg-dot2 { fill: var(--good); }
.dg-port { fill: var(--accent); }
.dg-arw { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dg-wave { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.dg-cloud { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.5; }
.dg-node { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.dg-flow.thin { stroke-width: 1; stroke-opacity: .6; }
.dg-flow.v1 { stroke: var(--accent); stroke-width: 2.4; }
.dg-flow.v2 { stroke: var(--violet); stroke-width: 2.4; }
.dg-flow.v3 { stroke: var(--amber); stroke-width: 2.4; }
.dg-tunnel { fill: none; stroke: var(--good); stroke-width: 3; stroke-dasharray: 9 6; stroke-linecap: round; }
.dg-tri { fill: var(--accent); fill-opacity: .05; stroke: var(--line); stroke-width: 2; }
.dg-lbl.mono { font-family: var(--f-mono); }
.dg-halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.dg-lbl.b { font-weight: 600; fill: var(--good); }
.dg-circ-in { fill: var(--accent-soft); }
.math { align-self: flex-start; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-2) var(--s-4); font-size: 1.05rem; font-weight: 600; color: var(--accent); }
.cert-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s-2); }

/* subnet calculator & IP anatomy */
.sn-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); align-items: end; }
@media (max-width: 560px) { .sn-in { grid-template-columns: 1fr; } }
.fld #sn-ip, .fld #pw-in { font-family: var(--f-mono); direction: ltr; text-align: left; font-size: .95rem; }
.sn-pfx input[type="range"] { accent-color: var(--accent); padding: 0; border: 0; background: none; }
.sn-pfx > span b { color: var(--accent); }
.sn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-2); }
.sn-grid > div { background: var(--bg); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); display: flex; flex-direction: column; min-width: 0; }
.sn-grid span { font-size: .8rem; color: var(--muted); }
.sn-grid b { font-size: 1rem; overflow-wrap: anywhere; }
.sn-grid b.mono { text-align: start; }
[dir="rtl"] .sn-grid b.mono { text-align: right; }
.sn-bitbox { display: flex; flex-direction: column; gap: var(--s-2); }
.sn-bitbox > .muted { font-size: .85rem; }
.sn-bits { display: flex; flex-wrap: wrap; gap: 4px 2px; font: 600 .9rem var(--f-mono); }
.sn-oct { display: inline-flex; border-radius: var(--r-sm); overflow: hidden; }
.sn-bits i, .ipa-oct { font-style: normal; }
.sn-bits i { padding: 3px 2px; min-width: 1.05em; text-align: center; }
.nb { background: var(--accent-soft); color: var(--accent); }
.hb { background: var(--amber-soft); color: var(--amber); }
.sn-dot { padding: 3px 1px; color: var(--muted); }
.sn-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); font-size: .85rem; color: var(--muted); }
.sn-legend .k { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sn-legend .k + * { margin-inline-end: var(--s-2); }
.ipa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.ipa-row { display: flex; align-items: stretch; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ipa-oct { display: flex; flex-direction: column; align-items: center; border-radius: var(--r-md); padding: var(--s-2) var(--s-3); min-width: 92px; }
.ipa-oct b { font: 600 1.5rem var(--f-mono); }
.ipa-oct span { font-size: .8rem; letter-spacing: .04em; }
.ipa-dot { align-self: center; font: 700 1.5rem var(--f-mono); color: var(--muted); }
.ipa-pfx { align-self: center; font-size: 1.3rem; font-weight: 600; color: var(--accent); margin-inline-start: 6px; }
.ipa .sn-legend { justify-content: center; }
@media (max-width: 520px) { .ipa-oct { min-width: 64px; padding: 6px; } .ipa-oct b { font-size: 1.15rem; } .ipa-oct span { font-size: .66rem; letter-spacing: 0; } }

/* request journey */
.jr { gap: var(--s-2); }
.jr-svg { min-width: 520px; }
.jr-e { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.jr-e.on { stroke: var(--accent); stroke-width: 4; stroke-dasharray: 10 7; }
@media (prefers-reduced-motion: no-preference) { .jr-e.on { animation: flow 1s linear infinite; } @keyframes flow { to { stroke-dashoffset: -17; } } }
.jr-glow { fill: none; stroke: var(--good); stroke-width: 2.5; }
.jr-panel { background: var(--bg); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.jr-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-size: .85rem; }
.jr-panel h4 { font-size: 1.08rem; }
.jr-dots { display: flex; gap: 6px; }
.jr-dots i { width: 22px; height: 5px; border-radius: 9px; background: var(--line); }
.jr-dots i.past { background: var(--accent-soft); } .jr-dots i.on { background: var(--accent); }
.jr-btns { display: flex; gap: var(--s-2); justify-content: flex-end; }

/* password checker */
.pw-tool #pw-out { display: flex; flex-direction: column; gap: var(--s-2); }
.pw-tool p { margin: 0; }
.pw-meter { display: flex; align-items: center; gap: var(--s-3); }
.pw-bar { display: flex; gap: 4px; flex: 0 1 260px; }
.pw-bar i { flex: 1; height: 8px; border-radius: 9px; background: var(--surface-2); }
.pw-meter.lv0 .on, .pw-meter.lv1 .on { background: var(--bad); } .pw-meter.lv0 b, .pw-meter.lv1 b { color: var(--bad); }
.pw-meter.lv2 .on { background: var(--amber); } .pw-meter.lv2 b { color: var(--amber); }
.pw-meter.lv3 .on, .pw-meter.lv4 .on { background: var(--good); } .pw-meter.lv3 b, .pw-meter.lv4 b { color: var(--good); }

/* phishing spotter */
.ph { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
@media (max-width: 760px) { .ph { grid-template-columns: 1fr; } }
.ph-mail { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--bg); font-size: .93rem; }
.ph-banner { background: var(--amber-soft); color: var(--amber); font-size: .8rem; font-weight: 600; padding: 4px var(--s-3); }
.ph-head { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.ph-body { padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); }
.ph-body p { margin: 0; }
.ph-spot { font: inherit; color: inherit; text-align: inherit; background: none; border: 0; padding: 0 2px; border-radius: 4px; cursor: pointer; border-bottom: 1px dotted var(--muted); }
.ph-spot:hover { background: var(--amber-soft); }
.ph-spot:focus-visible { outline: 2px solid var(--accent); }
.ph-spot.found { background: var(--bad-soft); color: var(--bad); border-bottom: 2px solid var(--bad); }
.ph-spot[data-ph="link"] { color: var(--accent); text-decoration: underline; direction: ltr; unicode-bidi: isolate; }
.ph-spot[data-ph="link"].found { color: var(--bad); }
.ph-side { display: flex; flex-direction: column; gap: var(--s-2); }
.ph-count { display: flex; flex-direction: column; gap: 6px; }
.ph-tips { margin: 0; padding-inline-start: 1.2rem; font-size: .9rem; display: flex; flex-direction: column; gap: 6px; }
.ph-tips li::marker { color: var(--bad); font-weight: 600; }

/* cloud responsibility */
.resp { font-size: .9rem; }
.resp th, .resp td { text-align: center; }
.resp tbody th { text-align: start; font-weight: 500; }
.resp td.you { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.resp td.prov { background: var(--surface-2); color: var(--muted); }

/* course tool links */
.tool-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s-3); max-width: 960px; }
.tool-link { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); }
.tool-link:hover { border-color: var(--accent); }
.tool-link span { flex: none; min-width: 52px; height: 40px; padding: 0 6px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: .8rem; font-weight: 600; direction: ltr; }
.tool-link b { font-weight: 500; font-size: .95rem; }

/* ---------- courses hub ---------- */
.hub-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-6); align-items: end; }
@media (max-width: 860px) { .hub-head { grid-template-columns: 1fr; gap: var(--s-4); } }
.hub-resume { display: flex; flex-direction: column; gap: var(--s-2); text-decoration: none; color: var(--ink); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); }
.hub-resume b { font-size: 1.05rem; font-weight: 600; line-height: 1.6; }
.hub-resume .bar { background: var(--surface); }
.hub-resume:hover { box-shadow: var(--shadow); }
.hub-go { color: var(--accent); font-weight: 600; font-size: .92rem; }
.hub-group { margin-top: var(--s-6); }
.hub-g { font-size: .78rem; color: var(--accent); font-weight: 600; margin-bottom: -6px; }
.hub-group h2 { font-size: 1.2rem; margin-bottom: var(--s-3); color: var(--muted); font-weight: 500; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-4); }
.hub-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
a.hub-card:hover { border-color: var(--accent); }
.hub-card h3 { font-size: 1.15rem; }
.hub-card h3 a { color: inherit; text-decoration: none; }
.hub-card h3 a:hover { color: var(--accent); }
.hub-card p { font-size: .92rem; flex: 1; }
.hub-card .cc-mark { width: 48px; height: 48px; font-size: .78rem; }
.hub-card.complete .cc-mark { background: var(--good-soft); color: var(--good); }
.hub-card.soon { border-style: dashed; box-shadow: none; background: transparent; }
.hub-card.soon .cc-mark { background: var(--surface-2); color: var(--muted); }
.hub-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.hub-card .chips { margin-top: var(--s-1); }

/* ---------- prompt-writing guide ---------- */
.pp-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); margin-top: var(--s-5); max-width: 960px; box-shadow: var(--shadow); }
.pp-card:hover { background: var(--accent-soft); }
.pp-card.top { margin-top: var(--s-6); }
.pp-card > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pp-card b { font-size: 1.1rem; }
.pp-card p { font-size: .92rem; color: var(--muted); }
.pp-card-ic { width: 52px; height: 52px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; direction: ltr; }
@media (max-width: 600px) { .pp-card { grid-template-columns: auto minmax(0, 1fr); } .pp-card .hub-go { grid-column: 2; } }
.pp-whys li, .pp-bads li { font-size: .98rem; }
/* the six parts share one colour per part */
.pp-ctx { --pc: var(--violet); --ps: var(--violet-soft); }
.pp-task { --pc: var(--accent); --ps: var(--accent-soft); }
.pp-input { --pc: var(--amber); --ps: var(--amber-soft); }
.pp-cons { --pc: var(--bad); --ps: var(--bad-soft); }
.pp-fmt { --pc: var(--good); --ps: var(--good-soft); }
.pp-ex { --pc: var(--muted); --ps: var(--surface-2); }
.pp-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--s-3); max-width: 1000px; }
.pp-part { display: flex; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--pc); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.pp-part p { font-size: .9rem; color: var(--muted); }
.pp-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ps); color: var(--pc); display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.pp-dissect { margin-top: var(--s-4); max-width: 1000px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.pp-dissect p { font-size: 1rem; line-height: 2.1; }
.pp-seg { background: var(--ps); border-bottom: 2px solid var(--pc); padding: 2px 3px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.pp-legend { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pp-key { font-size: .82rem; background: var(--ps); color: var(--pc); border-radius: 99px; padding: 2px 10px; font-weight: 500; }
.pp-build { gap: var(--s-3); }
.pp-bar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.pp-bar .grow { flex: 1; }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
@media (max-width: 860px) { .pp-grid { grid-template-columns: 1fr; } }
.pp-form { display: flex; flex-direction: column; gap: var(--s-2); }
.pp-form textarea { font: 400 .93rem/1.6 var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .45rem .6rem; resize: vertical; width: 100%; min-width: 0; }
.pp-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.pp-out { display: flex; flex-direction: column; gap: var(--s-2); position: sticky; top: calc(var(--head-h) + 16px); }
@media (max-width: 860px) { .pp-out { position: static; } }
.pp-meter { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.pp-meter.lv0 .on, .pp-meter.lv1 .on { background: var(--bad); } .pp-meter.lv0 b, .pp-meter.lv1 b { color: var(--bad); }
.pp-meter.lv2 .on { background: var(--amber); } .pp-meter.lv2 b { color: var(--amber); }
.pp-meter.lv3 .on, .pp-meter.lv4 .on { background: var(--good); } .pp-meter.lv3 b, .pp-meter.lv4 b { color: var(--good); }
.pp-ck .no { color: var(--muted); }
.pp-pre, .pp-txt { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.75 var(--f-body); }
.pp-pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3); min-height: 120px; max-height: 420px; overflow: auto; }
.pp-techs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-3); }
.pp-tech { display: flex; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.pp-tech > span { flex: none; color: var(--accent); font-weight: 600; font-size: .9rem; padding-top: 2px; }
.pp-tech p { font-size: .9rem; color: var(--muted); }
.pp-bas { display: flex; flex-direction: column; gap: var(--s-5); max-width: 1000px; }
.pp-ba h3 { font-size: 1.05rem; margin-bottom: var(--s-2); }
.pp-ba-row { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: var(--s-3); align-items: start; }
@media (max-width: 700px) { .pp-ba-row { grid-template-columns: 1fr; } }
.pp-why { margin-top: var(--s-2); font-size: .9rem; color: var(--muted); }
.pp-why b { color: var(--ink); }
.pp-quiz { max-width: 820px; }
.pq-q { font-size: .98rem; }
.pq-opts { flex-direction: row; flex-wrap: wrap; }
.pq-opts .qz-opt { flex: 1 1 140px; text-align: center; }
.pp-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--s-3); }
.pp-tpl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.pp-tpl-h { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.pp-tpl .pp-txt { font-size: .86rem; color: var(--muted); }

/* ---------- ERP: order-to-cash simulator ---------- */
.es { gap: var(--s-3); }
.es-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.es-step { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px 3px 4px; }
[dir="rtl"] .es-step { padding: 3px 4px 3px 12px; }
.es-step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .78rem; font-weight: 600; }
.es-step.past { color: var(--good); border-color: var(--good); } .es-step.past i { background: var(--good-soft); }
.es-step.on { color: var(--accent); border-color: var(--accent); font-weight: 600; } .es-step.on i { background: var(--accent); color: var(--accent-ink); }
.es-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); align-items: start; }
.es-grid .es-acc { grid-column: 1 / -1; }
@media (max-width: 560px) { .es-grid { grid-template-columns: 1fr; } }
.es-panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3); display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: border-color .2s, box-shadow .2s; }
.es-panel.hit { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.es-h { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.es-panel p { font-size: .85rem; margin: 0; }
.es-line { display: flex; justify-content: space-between; gap: var(--s-2); font-size: .88rem; }
.es-line.tot { border-top: 1px solid var(--line); padding-top: 4px; font-weight: 600; }
.es-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.es-kpis div { background: var(--surface); border-radius: var(--r-sm); padding: 6px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.es-kpis span { font-size: .74rem; color: var(--muted); line-height: 1.4; }
.es-kpis b { font-size: 1.25rem; }
.es-je { font-size: .84rem; width: 100%; }
.es-je th, .es-je td { padding: 4px 6px; text-align: start; }
.es-je td.mono { text-align: end; font-variant-numeric: tabular-nums; }
.es-je tr.first td { border-top: 1px solid var(--line); }
.es-je tr.new td { background: var(--accent-soft); }
.es-note { background: var(--accent-soft); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); font-size: .93rem; margin: 0; }
.erp-steps { margin: 0; padding-inline-start: 1.4rem; display: flex; flex-direction: column; gap: var(--s-2); }
.erp-steps li::marker { color: var(--accent); font-weight: 600; }

/* ---------- course directory ---------- */
.cd-group { margin-top: var(--s-6); }
.cd-group h2 { font-size: 1.2rem; margin-bottom: var(--s-3); }
.cd-group h2 .muted { font-weight: 400; font-size: 1rem; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-3); }
.cd-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.cd-card.t-site { border-color: var(--accent); background: var(--accent-soft); }
.cd-top { display: flex; gap: 6px; flex-wrap: wrap; }
.cd-card h3 { font-size: 1.02rem; font-weight: 600; line-height: 1.55; }
.cd-card .prov { font-size: .85rem; color: var(--muted); }
.cd-card p.d { font-size: .92rem; color: var(--muted); flex: 1; }
.cd-go { margin-top: var(--s-1); }
.t-free .cd-type, .t-audit .cd-type { background: var(--good-soft); color: var(--good); }
.t-yt .cd-type { background: var(--bad-soft); color: var(--bad); }
.t-paid .cd-type { background: var(--amber-soft); color: var(--amber); }
.t-camp .cd-type { background: var(--violet-soft); color: var(--violet); }
.t-site .cd-type { background: var(--accent); color: var(--accent-ink); }

/* ---------- BI: spreadsheet, formula lab, pivot, dashboard ---------- */
.xl-wrap { border: 1px solid var(--line); border-radius: var(--r-md); }
table.xl { font-size: .86rem; border-collapse: collapse; width: 100%; background: var(--surface); }
.xl th, .xl td { border: 1px solid var(--line); padding: 4px 8px; text-align: start; white-space: nowrap; }
.xl th.xl-c, .xl th.xl-r { background: var(--surface-2); color: var(--muted); font: 500 .78rem var(--f-mono); text-align: center; }
.xl th.xl-r { width: 34px; }
.xl td.xl-h { font-weight: 600; background: var(--bg); }
.xl td.num { text-align: right; font-family: var(--f-mono); }
.xl tr.hit td { background: var(--accent-soft); }
.xl tr.hit td.tgt { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.xl-ctl, .pv-ctl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-2); }
.xl-ctl select, .pv-ctl select, .db-f select { font: 400 .9rem var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .35rem .5rem; width: 100%; }
.xl-bar { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; direction: ltr; }
.xl-fx { color: var(--muted); font-style: italic; font-weight: 600; }
.xl-f { flex: 1 1 260px; font: 500 .95rem var(--f-mono); color: var(--accent); background: none; overflow-wrap: anywhere; }
.xl-res { white-space: nowrap; }
.xl-res b { font-size: 1.1rem; color: var(--good); }
.pv-t { font-size: .88rem; }
.pv-t th, .pv-t td { text-align: end; white-space: nowrap; }
.pv-t th:first-child, .pv-t tbody th { text-align: start; }
.pv-t tbody td { background: color-mix(in srgb, var(--accent) calc(var(--h) * 100%), transparent); }
.pv-t .tot, .pv-t tfoot td, .pv-t tfoot th { font-weight: 600; background: var(--surface-2); }
.dg-ch-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.dg-ch-bar { fill: var(--line); stroke: none; }
.dg-ch-hi { fill: var(--accent); stroke: none; }
.dg-ch-dot { fill: var(--accent); fill-opacity: .7; stroke: none; }
.db { gap: var(--s-3); }
.db-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s-3); flex-wrap: wrap; }
.db-f { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.db-f .fld { min-width: 140px; }
.db-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
@media (max-width: 700px) { .db-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.db-card { background: var(--bg); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); display: flex; flex-direction: column; min-width: 0; border-top: 3px solid var(--accent); }
.db-card span { font-size: .8rem; color: var(--muted); }
.db-card b { font-size: 1.25rem; overflow-wrap: anywhere; }
.db-card b small { font-size: .7rem; color: var(--muted); font-weight: 500; }
.db-card em { font-style: normal; font-size: .76rem; }
.db-card em.up { color: var(--good); } .db-card em.down { color: var(--bad); }
.db-grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-3); }
@media (max-width: 760px) { .db-grid2 { grid-template-columns: 1fr; } }
.db-col { display: flex; flex-direction: column; gap: var(--s-3); }
.db-fig { margin: 0; background: var(--bg); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); }
.db-fig figcaption { font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.db-svg { width: 100%; height: auto; display: block; direction: ltr; }
.db-grid { stroke: var(--line); stroke-width: 1; }
.db-ax { font: 11px var(--f-body); fill: var(--muted); }
.db-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.db-pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.db-bars { display: flex; flex-direction: column; gap: 5px; }
.db-bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 52px; gap: 8px; align-items: center; font-size: .82rem; }
.db-bar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-track { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.db-track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.db-bar.dim .db-track i { background: var(--line); }
.db-bar.dim { color: var(--muted); }
.db-bar b { text-align: end; font-size: .8rem; }

/* ---------- career kit ---------- */
.kit-banner { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; text-decoration: none; color: var(--ink); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-5); }
.kit-banner:hover { box-shadow: var(--shadow); }
.kit-role { background: var(--accent-soft); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.kit-role h2 { font-size: 1.2rem; }
.kit-grid { margin-top: var(--s-5); }
.cv-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
@media (max-width: 520px) { .cv-2 { grid-template-columns: 1fr; } }
.srs-form small { font-size: .8rem; line-height: 1.5; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; }
.chip-btn { font: 500 .8rem var(--f-body); color: var(--accent); background: var(--surface); border: 1px dashed var(--accent); border-radius: 99px; padding: 2px 10px; cursor: pointer; }
.chip-btn:hover { background: var(--accent-soft); }
.cv-cert { font: 400 .9rem var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .4rem .6rem; }
.cv-check h3, .srs-form .tool-card h3 { font-size: 1rem; }
.cv-score { display: flex; align-items: center; gap: var(--s-3); }
.cv-score b { font-size: 1.2rem; white-space: nowrap; }
.cv-score .bar { flex: 1; }
.cv-weak-h { font-weight: 600; margin: 0; font-size: .9rem; }
.cv-weak { margin: 0; padding-inline-start: 1.2rem; font-size: .88rem; color: var(--amber); }
.cv-prev { position: sticky; top: calc(var(--head-h) + 16px); }
@media (max-width: 900px) { .cv-prev { position: static; } }
.cv-doc { background: #fff; color: #1d2733; border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px 32px; line-height: 1.6; font-size: 14px; box-shadow: var(--shadow); max-height: calc(100vh - var(--head-h) - 60px); overflow: auto; }
@media (max-width: 900px) { .cv-doc { max-height: none; padding: 20px; } }
.cv-doc header { border-bottom: 2px solid #2F6B9A; padding-bottom: 10px; margin-bottom: 12px; }
.cv-doc h2 { margin: 0; font-size: 24px; color: #1d2733; }
.cv-title { margin: 2px 0 0; font-weight: 600; color: #2F6B9A; }
.cv-contact { margin: 4px 0 0; color: #4b5868; font-size: 13px; overflow-wrap: anywhere; }
.cv-doc h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #2F6B9A; margin: 14px 0 6px; border-bottom: 1px solid #dde3eb; padding-bottom: 3px; }
.cv-doc[dir="rtl"] h3 { letter-spacing: 0; }
.cv-doc p { margin: 0 0 6px; }
.cv-doc ul { margin: 2px 0 6px; padding-inline-start: 20px; }
.cv-item { margin-bottom: 8px; }
.cv-ih { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cv-ih span { color: #4b5868; }
.cv-ih em { font-style: normal; color: #4b5868; margin-inline-start: auto; font-size: 13px; }
@media print {
  body.print-cv * { visibility: hidden !important; }
  body.print-cv #cv-doc, body.print-cv #cv-doc * { visibility: visible !important; }
  html:has(body.print-cv), body.print-cv { background: #fff !important; }
  body.print-cv .cv-prev, body.print-cv .srs-grid, body.print-cv main, body.print-cv .view { position: static !important; animation: none !important; transform: none !important; }
  body.print-cv #cv-doc { position: absolute; top: 0; left: 0; right: 0; max-height: none; overflow: visible; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  @page { margin: 14mm; }
}
.star { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
@media (max-width: 700px) { .star { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.star-s { display: flex; gap: var(--s-2); background: var(--bg); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); }
.star-s > b { font-size: 1.4rem; color: var(--accent); line-height: 1.2; }
.star-s strong { display: block; font-size: .95rem; }
.star-s span { font-size: .84rem; color: var(--muted); }
.iv-top { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.iv-top .bar { flex: 1 1 160px; }
.iv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: var(--s-3); align-items: start; }
.iv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.iv-card.done { border-color: var(--good); }
.iv-card.pick { box-shadow: 0 0 0 3px var(--accent); }
.iv-card h3 { font-size: 1.02rem; font-weight: 600; }
.iv-card details { background: var(--bg); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); }
.iv-card summary { cursor: pointer; font-weight: 500; color: var(--accent); font-size: .92rem; }
.iv-card details p { margin: var(--s-2) 0 0; font-size: .93rem; }
.iv-card .btn { align-self: flex-start; }
.iv-h { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.k-b { background: var(--violet-soft); color: var(--violet); } .chip.k-t { background: var(--accent-soft); color: var(--accent); } .chip.k-c { background: var(--amber-soft); color: var(--amber); }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--s-3); }
.pj-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.pj-card h3 { font-size: 1.08rem; }
.pj-card p { font-size: .92rem; }
.pj-sub { font-size: .88rem; }
.pj-steps { margin: 0; padding-inline-start: 1.3rem; font-size: .9rem; display: flex; flex-direction: column; gap: 2px; }
.pj-tools, .pj-roles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .86rem; }
.pj-roles a { color: var(--accent); }
.pl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--s-3); }
.pl-role { text-align: start; font: inherit; cursor: pointer; }
.pl-head { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); }
.pl-head > div:first-child { display: flex; align-items: center; gap: var(--s-3); flex: 1 1 220px; }
.pl-head .mark, .pl-role .mark { font: 600 .85rem var(--f-mono); color: var(--accent); background: var(--accent-soft); border-radius: var(--r-md); padding: 6px 10px; }
.pl-head h2 { font-size: 1.3rem; }
.pl-meter { display: flex; align-items: center; gap: var(--s-2); flex: 1 1 240px; }
.pl-meter b { font-size: 1.3rem; }
.pl-meter .bar { flex: 1; }
.pl-steps { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); max-width: 900px; }
.pl-sh { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.pl-sh h3 { font-size: 1.05rem; }
.pl-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-size: .85rem; flex: none; }
.pl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-item { display: flex; align-items: center; gap: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); }
.pl-item.done { border-color: var(--good); background: var(--good-soft); }
.pl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .93rem; }
.pl-txt small { font-size: .8rem; }
.pl-check { width: 26px; height: 26px; flex: none; border-radius: 7px; border: 2px solid var(--line); background: var(--surface); color: var(--accent-ink); font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.pl-check.on { background: var(--good); border-color: var(--good); }
.pl-pr { width: 28px; height: 28px; flex: none; }
.pl-pr svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pl-pr circle { fill: none; stroke-width: 4; }
.pl-pr .bg { stroke: var(--surface-2); }
.pl-pr .fg { stroke: var(--good); stroke-linecap: round; }

/* ---------- phase 6: governance diagrams, glossary, graduation hub ---------- */
.dg-rk-l { fill: var(--good-soft); stroke: var(--good); stroke-width: 1; }
.dg-rk-m { fill: var(--amber-soft); stroke: var(--amber); stroke-width: 1; }
.dg-rk-h { fill: var(--bad-soft); stroke: var(--bad); stroke-width: 1; }
.dg-rk-pin { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.dg-rk-pin + text { fill: var(--accent-ink); font-weight: 700; }
.gl-list { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--s-3); }
.gl-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-1); }
.gl-item dt { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--s-2); }
.gl-item dt b { font-size: 1.05rem; }
.gl-alt { color: var(--accent); font-weight: 500; font-size: .92rem; }
.gl-item dd { margin: 0; display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.gl-item dd p { font-size: .92rem; color: var(--muted); flex: 1; }
.gl-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); font-size: .85rem; }
.gl-foot a { color: var(--accent); font-weight: 500; text-decoration: none; }
.gp-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); align-items: end; }
@media (max-width: 560px) { .gp-in { grid-template-columns: 1fr; } }
.gp-in input[type="range"] { accent-color: var(--accent); padding: 0; border: 0; background: none; }
.gp-in .fld b { color: var(--accent); }
.gp-t th, .gp-t td { white-space: nowrap; }
.gp-t tbody th { font-weight: 500; }
.gp-idea .gp-kv { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.gp-kv b { font-size: .82rem; color: var(--accent); }
.gp-kv ul { margin: 0; padding-inline-start: 1.2rem; }
.gp-kv .mono { font-size: .82rem; overflow-wrap: anywhere; }
.gp-report { margin: 0; padding-inline-start: 1.3rem; display: flex; flex-direction: column; gap: 4px; }
.foot-links { display: flex; gap: var(--s-4); }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--accent); }

.lesson-content > .btn { white-space: normal; max-width: 100%; text-align: start; }

/* ---------- phase 7: practical AI tools ---------- */
.ml-promo { max-width: 760px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.rg-grid { stroke: var(--line); stroke-width: 1; }
.rg-ax { font: 12px var(--f-body); fill: var(--muted); }
.rg-res { stroke: var(--amber); stroke-width: 1.6; stroke-dasharray: 3 3; }
.rg-pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.rg-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-2) var(--s-4); }
.rg-sliders .ml-slider span { min-width: 7.5em; }
.cf-zone { fill: var(--bad-soft); }
.cf-f { fill: var(--bad); }
.cf-o { fill: var(--surface); stroke: var(--muted); stroke-width: 1.8; }
.lg-cf-f { background: var(--bad); border-radius: 50%; }
.lg-cf-o { border: 2px solid var(--muted); border-radius: 50%; }
.cf-wrap { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-start; }
.cf-mx { border-collapse: separate; border-spacing: 6px; font-size: .88rem; }
.cf-mx th { font-weight: 500; color: var(--muted); padding: 2px 6px; text-align: center; }
.cf-mx th[scope="row"] { text-align: start; }
.cf-mx td { width: 92px; height: 58px; text-align: center; border-radius: var(--r-md); border: 1px solid var(--line); }
.cf-mx td b { display: block; font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cf-mx td span { font: 600 .75rem var(--f-mono); color: var(--ink); opacity: .8; }
.cf-mx .tp, .cf-mx .tn { background: var(--good-soft); }
.cf-mx .fp { background: var(--amber-soft); }
.cf-mx .fn { background: var(--bad-soft); }
.cf-mets { display: grid; grid-template-columns: repeat(3, minmax(84px, 1fr)); gap: var(--s-2); flex: 1 1 260px; }
.cf-mets div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); display: flex; flex-direction: column; }
.cf-mets span { font-size: .82rem; color: var(--muted); }
.cf-mets b { font-size: 1.4rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.km-p { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.5; }
.km-p.km-c0, .km-dot.km-c0 { fill: var(--accent); stroke: var(--accent); background: var(--accent); }
.km-p.km-c1, .km-dot.km-c1 { fill: var(--amber); stroke: var(--amber); background: var(--amber); }
.km-p.km-c2, .km-dot.km-c2 { fill: var(--violet); stroke: var(--violet); background: var(--violet); }
.km-ctr { stroke-width: 3.2; stroke-linecap: round; }
.km-ring { fill: none; stroke-width: 1.6; }
.km-s0 { stroke: var(--accent); } .km-s1 { stroke: var(--amber); } .km-s2 { stroke: var(--violet); }
.km-segs { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.km-segs li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.km-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
@media (max-width: 520px) { .cf-mx td { width: 72px; } .cf-mets { grid-template-columns: repeat(3, 1fr); } }
.ml-card > .ml-slider { flex: none; }

/* ---------- report a mistake ---------- */
.rp-bar { margin-top: var(--s-7); padding: var(--s-3) var(--s-4); border: 1px dashed var(--line); border-radius: var(--r-md); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); color: var(--muted); font-size: .92rem; }
.rp-bar .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-inline-end: 6px; vertical-align: -2px; }
.rp-dlg { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow); font-family: var(--f-body); }
.rp-dlg::backdrop { background: rgba(20, 28, 38, .45); }
.rp-form { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.rp-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.rp-top h2 { font-size: 1.25rem; }
.rp-where { margin: 0; font-size: .9rem; }
.rp-types { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.rp-types legend { font-size: .9rem; font-weight: 500; margin-bottom: var(--s-2); padding: 0; }
.rp-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.rp-copytext { white-space: pre-wrap; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3); font-size: .85rem; max-height: 180px; overflow: auto; margin: var(--s-2) 0 0; }
.rp-list { display: flex; flex-direction: column; gap: var(--s-3); max-width: 860px; }
.rp-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); }
.rp-item.done { opacity: .6; }
.rp-item h3 { font-size: 1.05rem; }
.rp-item p { margin: 0; white-space: pre-wrap; }
.rp-meta { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; font-size: .85rem; }
.rp-dlg textarea, .rp-dlg input { font-family: var(--f-body); }

/* ---------- project management & cloud tools ---------- */
.cpm-t { font-size: .9rem; }
.cpm-t th[scope="row"] { font-weight: 500; white-space: nowrap; }
.cpm-t tr.crit th[scope="row"] { color: var(--bad); }
.cpm-in { width: 64px; font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); direction: ltr; }
.cpm-chip { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.cpm-k { font: 600 12px var(--f-mono); fill: var(--muted); }
.cpm-bar { fill: var(--accent); }
.cpm-crit { fill: var(--bad); }
.cpm-fl { fill: none; stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1.2; }
.evm-sl { display: grid; gap: var(--s-2); }
.evm-sl .ml-slider span { min-width: 15em; }
.evm-mets { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
.evm-mets b.neg { color: var(--bad); } .evm-mets b.pos { color: var(--good); }
.cc-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-3); }
.cc-out { display: flex; flex-direction: column; gap: 8px; }
.cc-row { display: grid; grid-template-columns: minmax(80px, 120px) 1fr 70px; gap: var(--s-3); align-items: center; font-size: .9rem; }
.cc-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; display: block; }
.cc-bar span { display: block; height: 100%; border-radius: 99px; }
.cc-bar .c1 { background: var(--accent); } .cc-bar .c2 { background: var(--amber); } .cc-bar .c3 { background: var(--violet); }
.cc-row b { text-align: end; }
.av-dup { display: flex; gap: var(--s-2); align-items: center; font-size: .92rem; cursor: pointer; }
.av-dup input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 520px) { .evm-sl .ml-slider { flex-wrap: wrap; } .evm-sl .ml-slider span { min-width: 0; } .evm-mets { grid-template-columns: repeat(2, 1fr); } }

/* ---------- where to start, search, exams, review sheets ---------- */
.ctl-ico { display: inline-grid; place-items: center; padding-inline: 10px; }
.ctl-ico svg { width: 18px; height: 18px; }
.st-list { display: flex; flex-direction: column; gap: var(--s-4); max-width: 860px; }
.st-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); }
.st-q.done { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.st-q p { margin: 0 0 var(--s-3); font-weight: 500; }
.st-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-2); }
.st-opt { font: inherit; text-align: start; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: .6rem .85rem; cursor: pointer; line-height: 1.5; }
.st-opt:hover { border-color: var(--accent); }
.st-opt[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 500; }
.st-left { margin-top: var(--s-4); }
.st-res { margin-top: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4); scroll-margin-top: calc(var(--head-h) + 16px); }
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-4); }
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); box-shadow: var(--shadow); }
.st-card.top { border-color: var(--accent); }
.st-card .mark { font: 600 .85rem var(--f-mono); color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 4px 8px; }
.st-card p { margin: 0; }
.sr-dlg { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); padding: 0; width: min(720px, calc(100vw - 32px)); max-height: min(78dvh, 760px); margin-top: 8vh; box-shadow: var(--shadow); font-family: var(--f-body); display: flex; flex-direction: column; }
.sr-dlg:not([open]) { display: none; }
.sr-dlg::backdrop { background: rgba(20, 28, 38, .45); }
.sr-top { display: flex; gap: var(--s-2); align-items: center; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.sr-top input { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; border: 0; background: transparent; color: var(--ink); padding: .5rem .25rem; outline: none; }
.sr-res { overflow: auto; padding: var(--s-3) var(--s-4) var(--s-4); }
.sr-hint { margin: var(--s-3) 0; }
.sr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sr-item { display: flex; gap: var(--s-3); align-items: flex-start; padding: .6rem .7rem; border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.sr-item:hover, .sr-item:focus-visible, .sr-item.first { background: var(--surface-2); }
.sr-item .chip { flex: none; margin-top: 2px; }
.sr-main { display: flex; flex-direction: column; min-width: 0; }
.sr-snip { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.xm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-4); }
.xm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.xm-card p { margin: 0; font-size: .92rem; }
.xm-box { max-width: 880px; }
.qz-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.xm-q.ok { border-inline-start: 3px solid var(--good); padding-inline-start: var(--s-3); }
.xm-q.no { border-inline-start: 3px solid var(--bad); padding-inline-start: var(--s-3); }
.xm-foot { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-top: var(--s-5); }
.xm-score { border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); max-width: 880px; border: 1px solid var(--line); }
.xm-score b { font-size: 1.4rem; }
.xm-score.pass { background: var(--good-soft); border-color: transparent; }
.xm-score.fail { background: var(--amber-soft); border-color: transparent; }
.rv-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); max-width: 900px; display: flex; flex-direction: column; gap: var(--s-5); }
.rv-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.rv-sheet h2 { font-size: 1.15rem; margin-bottom: var(--s-3); }
.rv-f { margin: 0; padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.rv-terms { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-2) var(--s-5); }
.rv-term dt { font-size: .95rem; }
.rv-term dd { margin: 0 0 var(--s-2); font-size: .88rem; color: var(--muted); }
.rv-track h3 { font-size: 1rem; margin-bottom: var(--s-2); }
.rv-track ol { margin: 0 0 var(--s-3); padding-inline-start: 1.4em; columns: 2 260px; }
.rv-track li { margin-bottom: 4px; }
@media print {
  body:not(.print-cv) .site-head, body:not(.print-cv) .site-foot, body:not(.print-cv) .rp-bar, body:not(.print-cv) .no-print { display: none !important; }
  body:not(.print-cv) { background: #fff !important; color: #111 !important; }
  body:not(.print-cv) .rv-sheet { border: 0; padding: 0; box-shadow: none; max-width: none; }
}
.st-res > .btn { align-self: flex-start; }
.sr-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- about, legal, backup ---------- */
.foot-links { flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.foot-legal { justify-content: flex-start; gap: var(--s-2) var(--s-4); margin-top: var(--s-3); font-size: .85rem; }
.foot-legal a { color: var(--muted); }
.foot-legal a:hover { color: var(--accent); }
.lg-page { max-width: 820px; display: flex; flex-direction: column; gap: var(--s-4); }
.lg-page .section-head { margin-bottom: 0; }
.lg-sec h2 { font-size: 1.2rem; margin-bottom: var(--s-2); }
.lg-sec p { margin: 0 0 var(--s-3); max-width: 72ch; }
.lg-sec ul { margin: 0 0 var(--s-3); padding-inline-start: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.lg-sec .t3 th[scope="row"] { font-weight: 500; }
.ab-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); }
.ab-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; }
.ab-stat b { font-size: 1.7rem; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.3; }
.ab-stat span { font-size: .9rem; color: var(--muted); }
.bk-card { max-width: 760px; }
.bk-file { position: relative; overflow: hidden; cursor: pointer; }
.bk-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.bk-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.bk-pend { display: flex; flex-direction: column; gap: var(--s-2); }
.lg-sec .t3 th[scope="row"] { width: 62%; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


/* ---------- graduation hub (v2): how-to strip, tabs, plan with dated phases ---------- */
.gp-how { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); max-width: 980px; }
.gp-how button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: var(--s-2); width: 100%; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); font-size: .9rem; line-height: 1.5; }
.gp-how button:hover { border-color: var(--accent); }
.gp-how button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gp-how-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
@media (max-width: 760px) { .gp-how { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gp-tabs { padding: 0; margin-bottom: var(--s-5); scroll-margin-top: calc(var(--head-h) + 16px); }
.gp-tabs .tab { font-size: 1rem; padding: .75rem 1rem; }
.gp-sub { font-size: 1.2rem; }
.gp-intro { margin-bottom: var(--s-4); max-width: 72ch; }
.gp-setup { max-width: 900px; }
.gp-setup .fld small { font-size: .82rem; line-height: 1.5; }
.gp-date { display: grid; grid-template-columns: 0.8fr 1.4fr 1fr; gap: 8px; }
.gp-date select { min-height: 40px; min-width: 0; }
.gp-status { display: flex; flex-direction: column; gap: 2px; border-radius: var(--r-md); padding: var(--s-3) var(--s-4); background: var(--surface-2); }
.gp-status b { font-size: 1.02rem; }
.gp-status span { font-size: .9rem; color: var(--muted); }
.gp-status.now { background: var(--accent-soft); }
.gp-status.now b { color: var(--accent); }
.gp-status.done { background: var(--good-soft); }
.gp-phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); max-width: 900px; }
.gp-phase { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.gp-phase.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gp-phase.complete { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.gp-ph-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; }
.gp-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.gp-phase.now .gp-n { background: var(--accent); color: var(--accent-ink); }
.gp-phase.complete .gp-n { background: var(--good-soft); color: var(--good); }
.gp-ph-t { display: flex; flex-direction: column; min-width: 0; }
.gp-ph-t h3 { font-size: 1.05rem; }
.gp-when { font-size: .86rem; color: var(--muted); }
.gp-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gp-tasks li { display: flex; align-items: center; gap: var(--s-3); font-size: .95rem; }
.gp-tasks li.done span { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.gp-tools { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; font-size: .88rem; padding-top: var(--s-2); border-top: 1px dashed var(--line); }
@media (max-width: 520px) { .gp-ph-h { grid-template-columns: auto minmax(0, 1fr); } .gp-ph-h .chip { grid-column: 2; justify-self: start; } }
.rp-btns { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.rp-item.idea { border-inline-start: 3px solid var(--accent); }

/* ---------- careers v2: graduate entry roles grouped by field, with a path inside each ---------- */
.c2-group { margin-top: var(--s-6); }
.c2-gh { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); }
.c2-gh h2 { font-size: 1.2rem; }
.career-card.c2 { grid-template-rows: auto auto auto auto; align-content: start; }
.career-card.c2 .mark { grid-row: 1; }
.c2-main { display: flex; flex-direction: column; min-width: 0; align-self: center; }
.c2-track { font-size: .8rem; font-weight: 500; color: var(--accent); }
.career-card.c2 h3 { align-self: auto; }
.career-card.c2 p { grid-column: 1 / -1; }
.career-card.c2 .foot { grid-column: 1 / -1; }
.c2-path { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; font-size: .86rem; background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); margin-top: var(--s-2); }
.c2-k { font-size: .78rem; font-weight: 600; color: var(--muted); }
.c2-path .arrow { color: var(--muted); }
.c2-hchips { grid-column: 1 / -1; margin-top: var(--s-2); }
.c2-levels { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative; }
.c2-levels li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--s-3); position: relative; padding-bottom: var(--s-4); }
.c2-levels li:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 10px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.c2-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); margin-top: 3px; position: relative; z-index: 1; }
.c2-levels li.now .c2-dot { background: var(--good); border-color: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.c2-lh { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.c2-levels p { color: var(--muted); font-size: .92rem; margin-top: 2px; }

/* ---------- aptitude test v2 ---------- */
.st-intro, .st-run { max-width: 760px; }
.st-prog { display: flex; align-items: center; gap: var(--s-3); }
.st-prog .bar { flex: 1; }
.st-qt { font-size: clamp(1.15rem, 2.4vw, 1.4rem); line-height: 1.6; outline: none; }
.st-opts-1 { grid-template-columns: 1fr; }
.st-opts-1 .st-opt { padding: .8rem 1rem; font-size: 1rem; }
.st-nav { display: flex; justify-content: space-between; min-height: 36px; }
.st-traits { max-width: 900px; }
.st-tr-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-3) var(--s-5); }
.st-tr { display: flex; flex-direction: column; gap: 4px; }
.st-tr-h { display: flex; justify-content: space-between; gap: var(--s-2); font-size: .92rem; }
.st-tr:not(.top) b { font-weight: 500; color: var(--muted); }
.st-tr.top .bar > span { background: var(--accent); }
.st-tr p { font-size: .85rem; margin: 0; }
.st-why { font-size: .86rem; color: var(--accent); margin: 0; }

/* ---------- home v2: compact sections board, save note ---------- */
.save-note { font-size: .82rem; line-height: 1.7; color: var(--muted); max-width: 60ch; border-inline-start: 3px solid var(--line); padding-inline-start: var(--s-3); }
.save-note b { color: var(--ink); font-weight: 600; }
.board2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.bd-group h3 { font-size: .95rem; color: var(--muted); font-weight: 600; margin-bottom: var(--s-2); padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.bd-g2 h3 { border-color: var(--accent); color: var(--accent); }
.bd-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bd-g2 ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-3); }
.bd-item { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: var(--s-2); align-items: start; padding: .5rem .6rem; border-radius: var(--r-md); color: inherit; text-decoration: none; }
.bd-item:hover, .bd-item:focus-visible { background: var(--surface); box-shadow: var(--shadow); }
.bd-code { font: 600 .7rem var(--f-mono); color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 6px; text-align: center; direction: ltr; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-txt { display: flex; flex-direction: column; min-width: 0; }
.bd-txt b { font-size: .95rem; font-weight: 600; line-height: 1.5; }
.bd-txt span { font-size: .82rem; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bd-item:hover .bd-txt span, .bd-item:focus-visible .bd-txt span { -webkit-line-clamp: unset; }
@media (max-width: 1100px) { .board2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .bd-g2 { grid-column: 1 / -1; order: 2; } .bd-g3 { order: 1; } }
@media (max-width: 640px) { .board2 { grid-template-columns: minmax(0, 1fr); } .bd-g2 ul { grid-template-columns: minmax(0, 1fr); } .bd-item { grid-template-columns: 64px minmax(0, 1fr); } }
.picker a { padding: .35rem .7rem; font-size: .9rem; }

/* ---------- prompt library ---------- */
.pl-lib-card { margin-top: var(--s-3); }
.pl-rules { max-width: 900px; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: var(--s-3); align-items: start; }
.pl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.pl-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.pl-card h3 { font-size: 1.05rem; }
.pl-when { font-size: .88rem; margin: 0; }
.pl-when b, .pl-why b { font-weight: 600; }
.pl-prompt { max-height: 260px; overflow: auto; font-size: .88rem; margin: 0; }
.pl-ph { background: var(--amber-soft); color: var(--amber); border-radius: 4px; padding: 0 2px; }
.pl-why { font-size: .84rem; color: var(--good); margin: 0; }

/* ---------- ERD studio v2 ---------- */
.erd-top-r { display: flex; align-items: center; gap: var(--s-2); flex: 0 1 460px; min-width: 0; }
.erd-top-r .erd-dname { flex: 1 1 auto; }
.erd-top-r .erd-dname input { width: 100%; }
.erd-status { flex: none; font: 600 .8rem var(--f-body); border-radius: 99px; padding: .35rem .75rem; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; white-space: nowrap; }
.erd-status.ok { background: var(--good-soft); color: var(--good); border-color: transparent; }
.erd-status.bad { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.erd-status.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.erd-status:hover { border-color: currentColor; }
.erd-toolbar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-2); gap: var(--s-2); position: relative; z-index: 5; }
.tb-group + .tb-group { padding-inline-start: var(--s-2); }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; }
.tb-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tb-key { font: 600 .68rem var(--f-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; line-height: 1.5; }
.tb-grow { flex: 1; }
.tb-menu { position: relative; }
.tb-menu > summary { list-style: none; cursor: pointer; }
.tb-menu > summary::-webkit-details-marker { display: none; }
.tb-menu .caret { font-size: .7rem; color: var(--muted); }
.tb-menu[open] > summary { background: var(--surface-2); }
.mn-pop { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 30; min-width: 220px; max-width: min(340px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; }
.mn-wide { min-width: 280px; }
.mn-item { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; padding: .5rem .7rem; border-radius: var(--r-sm); cursor: pointer; font-size: .92rem; color: var(--ink); }
.mn-item[hidden] { display: none; }
.mn-item small { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.mn-item:hover, .mn-item:focus-visible { background: var(--surface-2); }
kbd { font: 600 .74rem var(--f-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); color: var(--ink); white-space: nowrap; }

.erd-stage { height: clamp(520px, 72vh, 900px); }
.erd-panel { max-height: clamp(520px, 72vh, 900px); }
@media (max-width: 960px) { .erd-stage { height: 64vh; min-height: 400px; } .erd-panel { max-height: none; } }
@media (max-width: 640px) {
  .tb-lbl, .tb-key, .tb-grow { display: none; }
  .erd-top-r { flex-basis: 100%; }
}
@media (hover: none) { .tb-key { display: none; } }

body.erd-full .site-head, body.erd-full .site-foot, body.erd-full .rp-bar, body.erd-full .erd-top-l { display: none; }
body.erd-full main { max-width: none; padding: var(--s-2) var(--s-3) var(--s-4); }
body.erd-full .erd-top { margin-bottom: var(--s-2); }
body.erd-full .erd-stage, body.erd-full .erd-panel { height: calc(100vh - 130px); max-height: none; min-height: 360px; }
@media (max-width: 960px) { body.erd-full .erd-panel { height: auto; } }

.erd-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s-4); pointer-events: none; }
.erd-empty[hidden] { display: none; }
.ee-card { pointer-events: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s-5); max-width: 680px; width: 100%; display: flex; flex-direction: column; gap: var(--s-2); }
.ee-card h2 { font-size: 1.2rem; }
.ee-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-2); }
@media (max-width: 640px) { .ee-opts { grid-template-columns: 1fr; } .ee-card { padding: var(--s-4); max-height: 100%; overflow: auto; } }
.ee-opt { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); cursor: pointer; text-align: start; }
button.ee-opt:hover, button.ee-opt:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.ee-opt svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ee-opt small { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.ee-tpl { cursor: default; }
.ee-tpl .chips { margin-top: 4px; }
.ee-tpl .chip { cursor: pointer; border: 1px solid var(--line); font: inherit; font-size: .8rem; }
.ee-tpl .chip:hover { border-color: var(--accent); color: var(--accent); }

.ent-hd { cursor: crosshair; opacity: 0; transition: opacity .12s; }
.ent-hd circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.ent-hd path { stroke: var(--surface); stroke-width: 2; stroke-linecap: round; fill: none; pointer-events: none; }
.ent:hover .ent-hd, .ent.sel .ent-hd, .ent.src .ent-hd { opacity: 1; }
.ent-hd:hover circle { r: 11; }
@media (hover: none) { .ent.sel .ent-hd circle { r: 12; } }
.ent.tgt .ent-box { stroke: var(--good); stroke-width: 2.6; }
.ent.tgt .ent-head { fill: var(--good-soft); }

.attr-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.row-act { grid-area: del; display: inline-flex; gap: 3px; }
.x-sm.mv { font-size: .82rem; }
.x-sm.mv:hover { color: var(--accent); border-color: var(--accent); }
.x-sm:disabled { opacity: .35; cursor: default; }
.x-sm:disabled:hover { color: var(--muted); border-color: var(--line); }
.pn-tools { display: inline-flex; gap: var(--s-1); }
.pn-lead { font-size: .92rem; }
.pn-tip { font-size: .86rem; background: var(--accent-soft); border-radius: var(--r-md); padding: .5rem .7rem; }
.pn-more { border: 1px solid var(--line); border-radius: var(--r-md); padding: .5rem .7rem; flex: none; }
.pn-more > summary { cursor: pointer; font-weight: 500; font-size: .9rem; }
.pn-more[open] { padding-bottom: var(--s-3); }
.pn-more[open] > summary { margin-bottom: var(--s-2); }
.pn-more > * + * { margin-top: var(--s-2); }
.quick-ta { width: 100%; font: .84rem var(--f-mono); direction: ltr; text-align: left; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .45rem .6rem; resize: vertical; }
.rt-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.rt-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem .3rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
.rt-btn b { font: 700 .95rem var(--f-mono); }
.rt-btn small { font-size: .74rem; color: var(--muted); text-align: center; }
.rt-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.rt-btn[aria-pressed="true"] small { color: var(--accent); }
.rel-read { font-size: .88rem; line-height: 1.8; background: var(--surface-2); border-radius: var(--r-md); padding: .55rem .75rem; }
.ent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; }
.ent-list button { all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; gap: var(--s-2); padding: .35rem .55rem; border-radius: var(--r-sm); cursor: pointer; font-size: .86rem; direction: ltr; }
.ent-list button:hover, .ent-list button:focus-visible { background: var(--surface-2); }
.ent-list b { color: var(--accent); font-weight: 600; }
.keys { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: .86rem; }
.keys li { display: contents; }
.keys kbd { justify-self: start; }
.tab-body .editor.dsl { min-height: 240px; direction: ltr; text-align: left; }

.cert-group + .cert-group { margin-top: var(--s-6); }
.cg-h { font-size: 1.15rem; margin-bottom: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); }
.cg-h .muted { font-weight: 400; font-size: .95rem; }

/* footer credit and contact */
.foot-credit { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.credit-line { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; line-height: 1.5; }
.dev-logo { width: auto; height: 1.45em; color: var(--accent); flex: none; display: block; overflow: visible; }
.credit-x { color: var(--muted); }
.credit-line [dir="ltr"] { color: var(--ink); font-weight: 600; }
.foot-contact { color: var(--muted); }
.foot-mail { color: var(--ink); user-select: all; }
@media (max-width: 640px) { .foot-credit { align-items: flex-start; } }

/* developer page */
.dev-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.dev-link:hover [data-t] { color: var(--accent); text-decoration: underline; }
.dv-page { max-width: 880px; display: flex; flex-direction: column; gap: var(--s-5); }
.dv-hero { display: grid; grid-template-columns: auto 1fr; gap: var(--s-6); align-items: center; padding: var(--s-6); border: 1px solid var(--line); border-radius: 20px;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--surface); }
[dir="ltr"] .dv-hero { background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--surface); }
.dv-mark { width: 168px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 28px; background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px color-mix(in srgb, var(--accent) 55%, transparent); }
.dv-logo { height: 118px; width: auto; color: var(--accent); overflow: visible; }
.dv-logo.sm { height: 1.5em; }
.dv-head { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.dv-head h1 { margin: 0; font-size: clamp(1.9rem, 4.2vw, 2.7rem); line-height: 1.2; }
.dv-role { margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.dv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.dv-chip { font-size: .82rem; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.dv-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.dv-li { display: inline-flex; align-items: center; gap: 8px; }
.dv-li svg { width: 18px; height: 18px; }
.dv-ext { opacity: .8; }
.dv-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-4); }
.dv-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.dv-box h2 { margin: 0; font-size: 1.1rem; }
.dv-box p { margin: 0; line-height: 1.85; }
.dv-more { align-self: flex-start; font-weight: 600; }
.dv-duo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.05rem; }
.dv-duo-mark { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.dv-x { color: var(--muted); }
.dv-duo-ai { font-weight: 700; color: var(--ink); }
.dv-contact { margin: 0; font-size: .92rem; }
.dv-contact bdi { color: var(--ink); }
@media (max-width: 720px) {
  .dv-hero { grid-template-columns: 1fr; padding: var(--s-5); gap: var(--s-4); }
  .dv-mark { width: 116px; border-radius: 22px; } .dv-logo { height: 80px; }
  .dv-grid { grid-template-columns: 1fr; }
}
