@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}

:root {
  --bg:        oklch(0.11 0.022 148);
  --surface:   oklch(0.145 0.020 148);
  --raised:    oklch(0.175 0.018 148);
  --input:     oklch(0.085 0.015 148);
  --fg:        oklch(0.76 0.090 148);
  --fg-hi:     oklch(0.90 0.070 148);
  --fg-dim:    oklch(0.54 0.065 148);
  --fg-mute:   oklch(0.34 0.045 148);
  --border:    oklch(0.21 0.040 148);
  --border-hi: oklch(0.30 0.055 148);
  --green:     oklch(0.87 0.260 148);
  --green-bg:  oklch(0.18 0.065 148);
  --amber:     oklch(0.82 0.140 80);
  --amber-bg:  oklch(0.18 0.055 80);
  --red:       oklch(0.65 0.200 25);
  --red-bg:    oklch(0.18 0.070 25);
  --cyan:      oklch(0.80 0.100 200);
  --cyan-bg:   oklch(0.18 0.040 200);
  --blue:      oklch(0.72 0.120 245);
  --purple:    oklch(0.72 0.120 295);
  --purple-bg: oklch(0.18 0.045 295);
  --d1: oklch(0.78 0.100 200);
  --d2: oklch(0.87 0.260 148);
  --d3: oklch(0.72 0.120 245);
  --d4: oklch(0.82 0.140 80);
  --d5: oklch(0.68 0.180 30);
  --d6: oklch(0.72 0.120 295);
  --font: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
  --r: 3px; --r-md: 5px; --r-lg: 8px;
}

html,body { height:100%; background:var(--bg); color:var(--fg); font-family:var(--font); font-size:14px; line-height:1.5; -webkit-font-smoothing:antialiased; }

/* ===== LAYOUT ===== */
.app { display:grid; grid-template-rows:auto 1fr; min-height:100vh; }

.topbar {
  display:flex; align-items:center; gap:16px;
  padding:9px 22px; border-bottom:1px solid var(--border);
  background:var(--surface); position:sticky; top:0; z-index:40;
  font-size:12px;
}
.brand { display:flex; align-items:center; gap:0; color:var(--fg-hi); font-weight:700; letter-spacing:0.04em; background:transparent; border:0; padding:0; font:inherit; font-size:22px; cursor:pointer; }
.brand:hover .b-host, .brand:hover .b-path { color:var(--green); }
.brand .b-host { color:var(--green); }
.brand .b-sep  { color:var(--fg-hi); margin:0 2px; font-weight:700; }
.brand .b-path { color:var(--cyan); transition: color 100ms; }
.brand .b-cursor { color:var(--green); animation:blink 1s step-end infinite; margin-left:4px; }

.nav-tabs { display:flex; gap:2px; margin-left:12px; }
.nav-tab {
  background:transparent; border:1px solid transparent; color:var(--fg-dim);
  padding:4px 11px; border-radius:var(--r); font:inherit; font-size:12px;
  cursor:pointer; text-transform:uppercase; letter-spacing:0.08em; transition:all 90ms;
}
.nav-tab:hover { color:var(--fg); border-color:var(--border); }
.nav-tab.active { color:var(--green); border-color:var(--green); background:var(--green-bg); }

.nav-right { margin-left:auto; display:flex; align-items:center; gap:14px; color:var(--fg-mute); }
.streak-badge { color:var(--amber); }
.timer-badge  { color:var(--cyan); font-weight:600; }

main { padding:24px 22px 80px; max-width:1080px; margin:0 auto; width:100%; }

/* ===== TERMINAL WINDOW ===== */
.term-win { background:var(--input); border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; }
.term-bar  { background:var(--surface); border-bottom:1px solid var(--border); padding:5px 12px; display:flex; align-items:center; gap:8px; }
.term-dots { display:flex; gap:5px; }
.term-dot  { width:9px; height:9px; border-radius:50%; }
.term-dot.r{ background:var(--red); opacity:0.7; }
.term-dot.y{ background:var(--amber); opacity:0.7; }
.term-dot.g{ background:var(--green); opacity:0.7; }
.term-bar-title { font-size:11px; color:var(--fg-mute); text-transform:uppercase; letter-spacing:0.08em; }
.term-body { padding:12px 16px; font-size:12.5px; color:var(--fg); white-space:pre; overflow-x:auto; line-height:1.65; }

/* ===== HOME ===== */
.home-header { margin-bottom:24px; }
.home-h1 { font-size:20px; font-weight:700; color:var(--fg-hi); letter-spacing:0.03em; margin-bottom:3px; }
.home-h1 .ps1  { color:var(--green); }
.home-h1 .cmd  { color:var(--fg-hi); }
.home-sub { font-size:12px; color:var(--fg-mute); }

.stats-row { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:22px; }
.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:14px 16px; }
.stat-k { font-size:10px; color:var(--fg-mute); text-transform:uppercase; letter-spacing:0.1em; margin-bottom:5px; }
.stat-v { font-size:24px; font-weight:700; color:var(--fg-hi); line-height:1; }
.stat-v.green  { color:var(--green); }
.stat-v.amber  { color:var(--amber); }
.stat-v.cyan   { color:var(--cyan); }

.sec-label { font-size:10px; color:var(--fg-mute); text-transform:uppercase; letter-spacing:0.1em; margin-bottom:10px; display:flex; align-items:center; gap:8px; }
.sec-label::after { content:""; flex:1; height:1px; background:var(--border); }

.session-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-bottom:24px; }
.session-btn {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md);
  padding:16px 18px; text-align:left; cursor:pointer; font:inherit; color:inherit;
  transition:all 90ms; display:flex; flex-direction:column; gap:4px;
}
.session-btn:hover { border-color:var(--green); background:var(--green-bg); }
.session-btn:hover .sb-title { color:var(--green); }
.sb-icon  { font-size:16px; margin-bottom:4px; color:var(--fg-mute); }
.sb-title { font-size:13px; font-weight:600; color:var(--fg-hi); }
.sb-desc  { font-size:11px; color:var(--fg-dim); }

.domain-list { display:flex; flex-direction:column; gap:7px; }
.domain-row {
  display:grid; grid-template-columns:24px 1fr 90px 44px;
  gap:10px; align-items:center; padding:9px 13px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
  cursor:pointer; transition:border-color 90ms; font-size:12px;
}
.domain-row:hover { border-color:var(--border-hi); }
.dom-num  { color:var(--fg-mute); text-align:center; font-size:11px; }
.dom-name { color:var(--fg); }
.dom-bar  { height:4px; background:var(--border); border-radius:99px; overflow:hidden; }
.dom-fill { height:100%; border-radius:99px; transition:width 400ms; }
.dom-pct  { color:var(--fg-mute); font-size:11px; text-align:right; }

/* ===== QUIZ ===== */
.quiz-layout { display:grid; grid-template-columns:1fr 310px; gap:18px; align-items:start; }

.q-meta { display:flex; align-items:center; justify-content:space-between; font-size:11px; color:var(--fg-mute); margin-bottom:10px; text-transform:uppercase; letter-spacing:0.08em; }
.q-prog  { height:2px; background:var(--border); border-radius:99px; margin-bottom:18px; }
.q-prog-fill { height:100%; background:var(--green); transition:width 300ms; border-radius:99px; }

.q-tags { display:flex; gap:6px; margin-bottom:12px; flex-wrap:wrap; }
.q-stem { font-size:15.5px; color:var(--fg-hi); line-height:1.55; margin-bottom:16px; }
.q-stem code { background:var(--surface); border:1px solid var(--border); padding:1px 5px; border-radius:2px; color:var(--cyan); font-size:0.9em; }
.q-multi-note { font-size:11px; color:var(--amber); margin-bottom:10px; text-transform:uppercase; letter-spacing:0.06em; }

.q-options { display:flex; flex-direction:column; gap:6px; }
.q-opt {
  display:grid; grid-template-columns:26px 1fr; gap:10px; align-items:start;
  padding:10px 13px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r); cursor:pointer; font:inherit; text-align:left;
  color:var(--fg); font-size:13.5px; transition:all 90ms;
}
.q-opt:hover:not(.disabled) { border-color:var(--border-hi); color:var(--fg-hi); }
.q-opt .ltr {
  font-size:11px; font-weight:700; color:var(--fg-mute);
  background:var(--raised); border:1px solid var(--border);
  width:20px; height:20px; display:grid; place-items:center;
  border-radius:2px; flex-shrink:0; margin-top:1px;
}
.q-opt.selected { border-color:var(--cyan); background:var(--cyan-bg); }
.q-opt.selected .ltr { background:var(--cyan); border-color:var(--cyan); color:var(--bg); }
.q-opt.correct  { border-color:var(--green); background:var(--green-bg); }
.q-opt.correct .ltr  { background:var(--green); border-color:var(--green); color:var(--bg); }
.q-opt.wrong    { border-color:var(--red); background:var(--red-bg); }
.q-opt.wrong .ltr    { background:var(--red); border-color:var(--red); color:#fff; }
.q-opt.missed   { border-color:var(--green); border-style:dashed; }
.q-opt.disabled { cursor:default; }

.q-actions { display:flex; gap:8px; margin-top:16px; padding-top:14px; border-top:1px solid var(--border); align-items:center; flex-wrap:wrap; }

.q-feedback { margin-top:14px; padding:13px 15px; border-radius:var(--r-md); border:1px solid var(--border); background:var(--surface); font-size:13px; }
.fb-head { font-size:10px; text-transform:uppercase; letter-spacing:0.1em; margin-bottom:7px; display:flex; align-items:center; gap:5px; }
.fb-head.ok  { color:var(--green); }
.fb-head.bad { color:var(--red); }
.fb-text { color:var(--fg-dim); line-height:1.55; }
.fb-wrong-list { margin-top:10px; display:flex; flex-direction:column; gap:6px; }
.fb-wrong-item { display:grid; grid-template-columns:auto 1fr; gap:8px; font-size:12.5px; color:var(--fg-dim); }
.fb-ltr { color:var(--red); font-weight:700; font-size:10px; padding-top:2px; }

/* FITB */
.fitb-wrap { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.fitb-line { display:flex; align-items:stretch; }
.fitb-prompt { color:var(--green); font-weight:600; background:var(--input); border:1px solid var(--border); border-right:0; padding:7px 10px; border-radius:var(--r) 0 0 var(--r); font:inherit; font-size:12.5px; white-space:nowrap; display:flex; align-items:center; }
.fitb-input { flex:1; background:var(--input); border:1px solid var(--border); border-left:0; padding:7px 10px; border-radius:0 var(--r) var(--r) 0; font:inherit; font-size:12.5px; color:var(--amber); outline:none; }
.fitb-input:focus { border-color:var(--cyan); }
.fitb-input.ok  { border-color:var(--green); color:var(--green); }
.fitb-input.err { border-color:var(--red);   color:var(--red);   }

/* MATCH */
.match-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px; }
.match-col-label { font-size:10px; color:var(--fg-mute); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:6px; }
.match-col { display:flex; flex-direction:column; gap:5px; }
.match-item {
  padding:9px 11px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r); cursor:pointer; font:inherit; font-size:12.5px;
  color:var(--fg); text-align:left; transition:all 90ms;
}
.match-item:hover { border-color:var(--border-hi); }
.match-item.active { border-color:var(--cyan); background:var(--cyan-bg); color:var(--fg-hi); }
.match-item.paired { border-color:var(--green); background:var(--green-bg); cursor:default; opacity:0.75; }
.match-item.paired:hover { border-color:var(--green); }
.match-ltr { color:var(--fg-mute); font-weight:700; font-size:11px; margin-right:5px; }
.match-item.paired .match-ltr { color:var(--green); }
.match-score { font-size:12px; color:var(--fg-mute); margin-top:6px; }

/* ===== HINT PANEL ===== */
.hint-panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:13px; position:sticky; top:68px; max-height:calc(100vh - 88px); display:flex; flex-direction:column; overflow:hidden; }
.hp-head { display:flex; align-items:center; justify-content:space-between; padding-bottom:10px; border-bottom:1px solid var(--border); margin-bottom:10px; flex-shrink:0; }
.hp-title { font-size:11px; color:var(--fg-dim); text-transform:uppercase; letter-spacing:0.1em; }
.hp-pill  { font-size:10px; background:var(--green-bg); color:var(--green); border:1px solid var(--green); padding:2px 7px; border-radius:99px; }
.hints-list { display:flex; flex-direction:column; gap:7px; margin-bottom:10px; flex-shrink:0; }
.hint-item { padding:9px 11px; background:var(--raised); border:1px dashed var(--border-hi); border-radius:var(--r); font-size:12.5px; color:var(--fg-dim); line-height:1.5; }
.hint-num  { font-size:9px; color:var(--amber); text-transform:uppercase; letter-spacing:0.1em; display:block; margin-bottom:3px; }
.hp-reveal { margin-bottom:10px; flex-shrink:0; }

.chat-area { display:flex; flex-direction:column; flex:1; min-height:0; }
.chat-log  { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:7px; padding-bottom:8px; min-height:60px; }
.chat-msg  { font-size:12.5px; line-height:1.5; padding:8px 10px; border-radius:var(--r); border:1px solid var(--border); }
.chat-msg.user { background:var(--cyan-bg); border-color:transparent; color:var(--cyan); align-self:flex-end; max-width:92%; }
.chat-msg.bot  { background:var(--raised); color:var(--fg-dim); }
.chat-msg.thinking { color:var(--fg-mute); font-style:italic; }
.chat-row { display:grid; grid-template-columns:1fr auto; gap:5px; padding-top:8px; border-top:1px solid var(--border); margin-top:8px; flex-shrink:0; }
.chat-in  { background:var(--input); border:1px solid var(--border); color:var(--fg); font:inherit; font-size:12.5px; padding:6px 9px; border-radius:var(--r); resize:none; outline:none; }
.chat-in:focus { border-color:var(--cyan); }

/* ===== RESULTS ===== */
.results-grid { display:grid; grid-template-columns:300px 1fr; gap:20px; align-items:start; }
.score-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:24px; text-align:center; }
.score-pct { font-size:54px; font-weight:700; line-height:1; margin:14px 0 6px; }
.score-pct.pass { color:var(--green); }
.score-pct.fail { color:var(--red); }
.score-verdict { font-size:12px; color:var(--fg-dim); margin-bottom:18px; }
.score-bars { display:flex; flex-direction:column; gap:7px; padding-top:16px; border-top:1px solid var(--border); }
.sb-row { display:grid; grid-template-columns:80px 1fr 34px; gap:8px; align-items:center; font-size:11px; }
.sb-label  { color:var(--fg-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sb-bar    { height:4px; background:var(--border); border-radius:99px; overflow:hidden; }
.sb-fill   { height:100%; border-radius:99px; }
.sb-pct    { color:var(--fg-mute); text-align:right; }

.review-list { display:flex; flex-direction:column; gap:5px; max-height:460px; overflow-y:auto; }
.ri { display:grid; grid-template-columns:12px 1fr auto; gap:10px; align-items:center; padding:9px 12px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r); font-size:12.5px; cursor:pointer; }
.ri:hover { border-color:var(--border-hi); }
.ri-pip { width:8px; height:8px; border-radius:2px; flex-shrink:0; }
.ri-pip.ok  { background:var(--green); }
.ri-pip.bad { background:var(--red); }
.ri-pip.skip { background:var(--fg-mute); }

.cp-block { transition: all 220ms; border-radius:var(--r-md); padding:2px 4px; }
.cp-block-hint {
  background: oklch(0.82 0.14 80 / 0.07);
  border-left: 3px solid var(--amber);
  padding: 8px 12px;
  box-shadow: 0 0 12px oklch(0.82 0.14 80 / 0.15);
  animation: hint-pulse 1.6s ease-out;
}

/* ===== NOTES ===== */
.note-mark {
  background: oklch(0.72 0.12 295 / 0.55) !important;
  color: var(--fg-hi) !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  border-bottom: 2px solid var(--purple) !important;
  cursor: pointer !important;
  transition: background 80ms, box-shadow 80ms;
  box-shadow: 0 0 6px oklch(0.72 0.12 295 / 0.30);
  display: inline;
}
.note-mark:hover {
  background: oklch(0.72 0.12 295 / 0.80) !important;
  box-shadow: 0 0 12px oklch(0.72 0.12 295 / 0.65);
}
.sel-bubble {
  position: fixed;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--green);
  color: var(--bg);
  border-radius: 4px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 14px oklch(0.08 0.02 148 / 0.6);
  animation: bubble-in 140ms ease-out;
  user-select: none;
}
@keyframes bubble-in { from{opacity:0;transform:translate(-50%,6px);} to{opacity:1;transform:translateX(-50%);} }
.note-pop {
  position: fixed;
  transform: translateX(-50%);
  z-index: 66;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: var(--r-md);
  padding: 12px 14px;
  max-width: 360px;
  min-width: 240px;
  box-shadow: 0 10px 28px oklch(0.08 0.02 148 / 0.55);
  animation: bubble-in 160ms ease-out;
}
.notes-list { display:flex; flex-direction:column; gap:8px; }
.notes-item { padding:12px 14px; background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--purple); border-radius:0 var(--r-md) var(--r-md) 0; }
.notes-item-hl { color:var(--purple); font-style:italic; font-size:12.5px; margin-bottom:6px; line-height:1.5; background:oklch(0.72 0.12 295 / 0.15); padding:6px 10px; border-radius:var(--r); }
.notes-item-txt { font-size:13.5px; color:var(--fg-hi); line-height:1.55; margin-bottom:8px; white-space:pre-wrap; }
.notes-item-meta { display:flex; align-items:center; gap:10px; font-size:11px; color:var(--fg-mute); }
.notes-item-topic { color:var(--cyan); cursor:pointer; }
.notes-item-topic:hover { text-decoration:underline; }
@keyframes hint-pulse {
  0%   { background: oklch(0.82 0.14 80 / 0.28); box-shadow: 0 0 24px oklch(0.82 0.14 80 / 0.5); }
  100% { background: oklch(0.82 0.14 80 / 0.07); box-shadow: 0 0 12px oklch(0.82 0.14 80 / 0.15); }
}
@keyframes expand-in {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0); }
}
.osi-row:hover { background:var(--surface)!important; }
.ri-text { color:var(--fg-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ri-dom  { font-size:10px; color:var(--fg-mute); text-transform:uppercase; letter-spacing:0.06em; flex-shrink:0; }

/* ===== LEARN ===== */
.learn-layout { display:grid; grid-template-columns:210px 1fr; gap:18px; align-items:start; }
.learn-sidebar { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; position:sticky; top:68px; max-height:calc(100vh - 88px); overflow-y:auto; }
.ls-dom-hd { padding:7px 13px; font-size:10px; text-transform:uppercase; letter-spacing:0.1em; color:var(--fg-mute); background:var(--raised); border-bottom:1px solid var(--border); cursor:pointer; display:flex; justify-content:space-between; align-items:center; }
.ls-dom-hd:hover { color:var(--fg); }
.ls-topic { display:block; background:transparent; border:0; border-bottom:1px solid var(--border); width:100%; text-align:left; padding:7px 13px 7px 20px; font:inherit; font-size:12.5px; color:var(--fg-dim); cursor:pointer; transition:all 80ms; }
.ls-topic:hover { color:var(--fg); background:var(--raised); }
.ls-topic.active { color:var(--green); background:var(--green-bg); border-left:2px solid var(--green); padding-left:18px; }
.ls-topic.read { color:var(--green); opacity:0.8; }
.ls-topic.read.active { opacity:1; }

.cp-done-row { display:flex; align-items:center; justify-content:space-between; margin-top:36px; padding-top:22px; border-top:1px solid var(--border); }

.concept-page { max-width:740px; }
.cp-eyebrow { font-size:10px; color:var(--fg-mute); text-transform:uppercase; letter-spacing:0.1em; margin-bottom:5px; }
.cp-title   { font-size:22px; font-weight:700; color:var(--fg-hi); letter-spacing:0.02em; margin-bottom:7px; }
.cp-summary { font-size:13.5px; color:var(--fg-dim); line-height:1.65; margin-bottom:20px; padding-bottom:18px; border-bottom:1px solid var(--border); }
.cp-body { display:flex; flex-direction:column; gap:14px; }
.cp-body h2 { font-size:14px; font-weight:600; color:var(--fg-hi); padding-top:6px; border-top:1px solid var(--border); }
.cp-body p  { font-size:13.5px; color:var(--fg-dim); line-height:1.65; }
.cp-body ul { padding-left:16px; display:flex; flex-direction:column; gap:3px; }
.cp-body li { font-size:13.5px; color:var(--fg-dim); line-height:1.55; }

.term { display:inline; cursor:pointer; color:var(--cyan); border-bottom:1px dashed oklch(0.80 0.1 200 / 0.5); font:inherit; background:transparent; transition:all 80ms; padding:0; }
.term:hover { background:var(--cyan-bg); }
.term.active { background:var(--cyan); color:var(--bg); border-bottom-color:transparent; }

.cp-table { width:100%; border-collapse:collapse; font-size:12.5px; margin:4px 0; }
.cp-table th { background:var(--raised); color:var(--fg-dim); text-align:left; padding:7px 10px; border:1px solid var(--border); font-weight:600; font-size:10px; text-transform:uppercase; letter-spacing:0.06em; }
.cp-table td { padding:7px 10px; border:1px solid var(--border); color:var(--fg-dim); vertical-align:top; }
.cp-table tr:nth-child(even) td { background:var(--raised); }

.cp-diagram { background:var(--input); border:1px solid var(--border); border-radius:var(--r-md); padding:16px; }
.cp-diagram svg { width:100%; display:block; }
.diagram-node { transition:opacity 120ms; }
.diagram-node:hover { opacity:0.7; }

/* Term Drawer */
.drawer-overlay { position:fixed; inset:0; z-index:50; background:oklch(0.08 0.02 148 / 0.65); }
.drawer { position:fixed; right:0; top:0; bottom:0; width:min(440px,92vw); background:var(--surface); border-left:1px solid var(--border); z-index:60; display:flex; flex-direction:column; animation:slide-in 150ms ease-out; }
@keyframes slide-in { from{transform:translateX(100%);} to{transform:translateX(0);} }
.dr-head  { padding:15px 18px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:flex-start; flex-shrink:0; }
.dr-eye   { font-size:10px; color:var(--fg-mute); text-transform:uppercase; letter-spacing:0.08em; margin-bottom:4px; }
.dr-title { font-size:16px; font-weight:600; color:var(--fg-hi); }
.dr-body  { flex:1; padding:16px 18px; overflow-y:auto; font-size:13.5px; color:var(--fg-dim); line-height:1.65; }
.dr-body p+p { margin-top:10px; }
.dr-chat  { padding:12px 18px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:7px; flex-shrink:0; max-height:48%; }
.dr-chat .chat-log { max-height:180px; }

/* ===== PROGRESS VIEW ===== */
.progress-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.missed-list { display:flex; flex-direction:column; gap:5px; max-height:380px; overflow-y:auto; }
.missed-item { padding:9px 12px; background:var(--surface); border:1px solid var(--border); border-left:2px solid var(--red); border-radius:0 var(--r) var(--r) 0; font-size:12.5px; color:var(--fg-dim); cursor:pointer; }
.missed-item:hover { border-color:var(--border-hi); color:var(--fg); }

/* ===== BUTTONS ===== */
.btn { background:var(--surface); border:1px solid var(--border); color:var(--fg); padding:7px 13px; border-radius:var(--r); font:inherit; font-size:12px; cursor:pointer; transition:all 80ms; display:inline-flex; align-items:center; gap:5px; text-transform:uppercase; letter-spacing:0.07em; }
.btn:hover { border-color:var(--border-hi); color:var(--fg-hi); }
.btn:active { opacity:0.85; }
.btn:disabled { opacity:0.35; cursor:not-allowed; pointer-events:none; }
.btn-primary { background:var(--green); border-color:var(--green); color:var(--bg); font-weight:700; }
.btn-primary:hover { background:oklch(0.82 0.24 148); border-color:oklch(0.82 0.24 148); color:var(--bg); }
.btn-ghost   { background:transparent; border-color:transparent; }
.btn-ghost:hover { background:var(--raised); border-color:var(--border); }
.btn-danger  { border-color:var(--red); color:var(--red); }
.btn-danger:hover { background:var(--red-bg); }
.btn-sm  { padding:4px 9px; font-size:11px; }
.btn-lg  { padding:10px 18px; font-size:13px; }

/* ===== TAGS / UTILS ===== */
.tag { display:inline-flex; align-items:center; padding:2px 7px; border-radius:var(--r); border:1px solid; font-size:10px; text-transform:uppercase; letter-spacing:0.08em; }
.tag-d1 { color:var(--d1); border-color:var(--d1); background:oklch(0.18 0.04 200); }
.tag-d2 { color:var(--d2); border-color:var(--d2); background:var(--green-bg); }
.tag-d3 { color:var(--d3); border-color:var(--d3); background:oklch(0.18 0.05 245); }
.tag-d4 { color:var(--d4); border-color:var(--d4); background:var(--amber-bg); }
.tag-d5 { color:var(--d5); border-color:var(--d5); background:var(--red-bg); }
.tag-d6 { color:var(--d6); border-color:var(--d6); background:var(--purple-bg); }
.tag-diff-1 { color:var(--green); border-color:var(--green); background:var(--green-bg); }
.tag-diff-2 { color:var(--amber); border-color:var(--amber); background:var(--amber-bg); }
.tag-diff-3 { color:var(--red);   border-color:var(--red);   background:var(--red-bg);   }
.tag-ccnp   { color:var(--purple); border-color:var(--purple); background:var(--purple-bg); }

.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:18px; }
.divider { height:1px; background:var(--border); margin:14px 0; }
.empty-msg { color:var(--fg-mute); font-size:12px; padding:16px; text-align:center; }

@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* ===== RESPONSIVE ===== */
@media(max-width:880px){
  .quiz-layout,.results-grid,.learn-layout{ grid-template-columns:1fr; }
  .stats-row{ grid-template-columns:repeat(2,1fr); }
  .session-grid{ grid-template-columns:1fr; }
  .progress-grid{ grid-template-columns:1fr; }
  .cert-toggle{ grid-template-columns:1fr; }
  .hint-panel{ position:static; max-height:none; }
  .learn-sidebar{ position:static; max-height:none; }
}

/* ===== CERT SELECTION SCREEN ===== */
.cert-select-screen { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; }
.cs-content { max-width: 720px; width: 100%; text-align: center; }
.cs-brand { font-size: 14px; margin-bottom: 32px; letter-spacing: 0.04em; color: var(--fg-hi); display: flex; align-items: center; justify-content: center; }
.cs-title { font-size: 28px; color: var(--fg-hi); margin-bottom: 10px; font-weight: 700; letter-spacing: 0.02em; }
.cs-sub { color: var(--fg-dim); margin-bottom: 36px; font-size: 13.5px; max-width: 460px; margin-left: auto; margin-right: auto; line-height: 1.55; }
.cs-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cs-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-md); padding: 28px 24px; cursor: pointer; transition: all 120ms; font: inherit; text-align: left; color: inherit; display: flex; flex-direction: column; gap: 4px; }
.cs-card:hover { border-color: var(--green); background: var(--green-bg); transform: translateY(-2px); }
.cs-card-label { font-size: 32px; font-weight: 700; color: var(--fg-hi); letter-spacing: 0.04em; }
.cs-card-sub { font-size: 11px; color: var(--green); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; font-weight: 600; }
.cs-card-desc { font-size: 13px; color: var(--fg-dim); line-height: 1.6; }
@media (max-width: 600px) { .cs-options { grid-template-columns: 1fr; } }

.cert-logo {
  font-size: 10px;
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
  padding: 3px 9px;
  border-radius: 3px;
  margin-left: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  font-family: var(--font);
  transition: all 100ms;
  text-transform: uppercase;
}
.cert-logo:hover { background: var(--green); color: var(--bg); border-color: var(--green); }

/* ===== CERT TOGGLE (legacy — kept for the CertPickerModal which is no longer used) ===== */
.cert-toggle { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:4px; }
.cert-opt { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:14px 16px; cursor:pointer; font:inherit; color:var(--fg-dim); text-align:center; transition:all 100ms; display:flex; flex-direction:column; gap:3px; }
.cert-opt:hover { border-color:var(--border-hi); color:var(--fg); }
.cert-opt.active { border-color:var(--green); background:var(--green-bg); color:var(--green); }
.cert-opt-label { font-size:18px; font-weight:700; letter-spacing:0.04em; }
.cert-opt-sub { font-size:11px; opacity:0.75; text-transform:uppercase; letter-spacing:0.06em; }
.cert-opt.active .cert-opt-sub { opacity:1; }

/* ===== TERM (terminal selection-style highlight) ===== */
.term { display:inline; cursor:pointer; background:oklch(0.80 0.10 200 / 0.20); color:oklch(0.88 0.08 200); border-radius:2px; padding:0 3px; border:none; font:inherit; transition:background 80ms; }
.term:hover { background:oklch(0.80 0.10 200 / 0.45); color:var(--fg-hi); }
.term.active { background:var(--cyan); color:var(--bg); }

/* ===== CLI SIMULATOR ===== */
.cli-sim { display:flex; flex-direction:column; gap:10px; }
.cli-task-card { background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--green); border-radius:var(--r-md); padding:14px 16px; }
.cli-task-label { font-size:10px; color:var(--green); text-transform:uppercase; letter-spacing:0.1em; margin-bottom:5px; }
.cli-task-text { font-size:14.5px; color:var(--fg-hi); line-height:1.5; margin-bottom:10px; }
.cli-step-pips { display:flex; gap:4px; }
.cli-pip { width:8px; height:8px; border-radius:2px; background:var(--border); }
.cli-pip.done { background:var(--green); }
.cli-pip.active { background:var(--amber); box-shadow:0 0 5px oklch(0.82 0.14 80 / 0.6); }
.cli-prog { height:2px; background:var(--border); border-radius:99px; overflow:hidden; margin-top:10px; }
.cli-prog-fill { height:100%; background:var(--green); transition:width 300ms; border-radius:99px; }
.cli-terminal { background:var(--input); border:1px solid var(--border); border-radius:var(--r-md); padding:14px 16px; min-height:220px; max-height:420px; overflow-y:auto; cursor:text; font-size:13px; line-height:1.55; }
.cli-boot { color:var(--fg-mute); font-size:11px; margin-bottom:10px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.cli-entry { margin-bottom:2px; }
.cli-cmd-line { display:flex; align-items:flex-start; }
.cli-prompt { color:var(--green); font-weight:600; white-space:nowrap; user-select:none; }
.cli-cmd-text { color:var(--amber); margin-left:2px; }
.cli-cmd-err { color:var(--red); }
.cli-pre { margin:1px 0 6px 0; padding:0; background:transparent; font:inherit; font-size:12px; white-space:pre; }
.cli-pre-err { color:var(--red); opacity:0.8; }
.cli-pre-help { color:var(--cyan); }
.cli-success-line { color:var(--green); margin-top:8px; padding-top:8px; border-top:1px dashed var(--border); }
.cli-input-line { display:flex; align-items:center; margin-top:4px; }
.cli-input-field { background:transparent; border:0; outline:none; color:var(--amber); font:inherit; font-size:13px; caret-color:transparent; margin-left:2px; }
.cli-cursor-block { display:inline-block; width:0.55em; height:1em; background:var(--green); vertical-align:text-bottom; animation:blink 1s step-end infinite; margin-left:1px; opacity:0.9; }

/* ===== YOUTUBE EMBED ===== */
.yt-section { border:1px solid var(--border); border-radius:var(--r-md); overflow:hidden; margin-bottom:6px; }
.yt-bar { display:flex; align-items:center; gap:8px; padding:7px 14px; background:var(--raised); border-bottom:1px solid var(--border); font-size:11px; color:var(--fg-dim); text-transform:uppercase; letter-spacing:0.08em; font-weight:600; }
.yt-bar a { margin-left:auto; color:var(--fg-mute); font-size:11px; text-decoration:none; }
.yt-bar a:hover { color:var(--fg); }
.yt-wrap { position:relative; padding-bottom:56.25%; height:0; overflow:hidden; background:var(--input); }
.yt-iframe { position:absolute; top:0; left:0; width:100%; height:100%; border:0; }
.yt-thumb-link { display:block; position:relative; text-decoration:none; background:var(--input); aspect-ratio:16/9; overflow:hidden; }
.yt-thumb-img { width:100%; height:100%; object-fit:cover; display:block; }
.yt-play-overlay { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; background:oklch(0.10 0.02 148 / 0.55); transition:background 150ms; }
.yt-thumb-link:hover .yt-play-overlay { background:oklch(0.10 0.02 148 / 0.30); }
.yt-play-btn { width:62px; height:62px; background:var(--red); border-radius:50%; display:grid; place-items:center; font-size:22px; color:#fff; padding-left:4px; box-shadow:0 4px 18px oklch(0.10 0.02 148 / 0.4); }
.yt-play-label { color:#fff; font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:0.08em; }

/* ===== MODAL ===== */
.modal-overlay { position:fixed; inset:0; z-index:60; background:oklch(0.08 0.02 148 / 0.7); display:grid; place-items:center; padding:20px; animation:fade-in 140ms ease-out; }
@keyframes fade-in { from{opacity:0;} to{opacity:1;} }
.modal-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:24px 26px; max-width:520px; width:100%; box-shadow:0 18px 50px oklch(0 0 0 / 0.4); }
.modal-title { font-size:14px; color:var(--green); text-transform:uppercase; letter-spacing:0.1em; font-weight:700; margin-bottom:6px; }
.modal-sub { font-size:13px; color:var(--fg-dim); margin-bottom:18px; line-height:1.5; }
