/* ============================================================
   Claude Code 活用ガイド — 共有スタイル（パステル版）
   ポータル (../assets/styles.css) と同じ
   「クリーム地 × ティール × オレンジ」のパレットに統一。
   コードブロック（ターミナル表示）だけは黒地を維持する。
   ============================================================ */

:root {
  --bg:       #fff8ec;
  --bg2:      #ffffff;
  --bg3:      #fff6e7;
  --bg4:      #eef3ed;
  --gold:     #c2410c;
  --gold-dim: #9a3b08;
  --cyan:     #0f766e;
  --cyan-dim: #0b5f58;
  --green:    #15803d;
  --red:      #b42318;
  --orange:   #e56b1f;
  --purple:   #2563eb;
  --text:     #18181b;
  --text-soft:#3f3f46;
  --muted:    #62646c;
  --muted-dim:#8a8d97;
  --border:   #dfe4dc;
  --border2:  #c9d2c5;
  --code-bg:  #151719;
  --radius:   12px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Noto Sans JP', sans-serif;
  --maxw: 920px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  background:
    radial-gradient(circle at 84% 0%, rgba(247,177,137,.20), transparent 26rem),
    radial-gradient(circle at 10% 0%, rgba(221,244,239,.85), transparent 24rem),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── TOP NAV ─────────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,248,236,.92);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(201,210,197,.8);
}
.topnav-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .3px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand img {
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--cyan);
  background: #fff;
}
.brand .dot { color: var(--cyan); }
.brand .badge-mini {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .5px;
  color: #fff;
  background: var(--orange);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
}
.navlinks {
  display: flex;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: thin;
  -ms-overflow-style: none;
}
.navlinks::-webkit-scrollbar { height: 4px; }
.navlinks::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.navlinks a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all .15s;
}
.navlinks a:hover { color: var(--cyan-dim); background: #ddf4ef; }
.navlinks a.active { color: #fff; background: var(--cyan); font-weight: 700; }
.navlinks a.ref { color: var(--gold); }
.navlinks a.ref:hover { background: rgba(229,107,31,.12); }

/* ── LAYOUT ──────────────────────────────────────────────── */
main.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 22px 40px;
}
.sec { margin: 56px 0; scroll-margin-top: 76px; }
.sec:first-of-type { margin-top: 36px; }

/* ── EYECATCH (GPT Image 2 generated hero banner) ─────────── */
.guide-eyecatch {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2688 / 1520;
  margin: 4px 0 26px;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(120, 110, 90, 0.14);
}
/* ── IN-ARTICLE FIGURE (GPT Image 2 explanatory illustration) ── */
.guide-figure {
  margin: 24px auto;
  max-width: 100%;
  text-align: center;
}
.guide-figure img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(120, 110, 90, 0.14);
}
.guide-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* Visually-hidden but accessible: the baked-in title carries the heading visually */
.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;
}

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 30px 16px 8px;
  margin-bottom: 8px;
}
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--cyan-dim);
  text-transform: uppercase;
  margin-bottom: 14px;
  padding: 4px 12px;
  border: 1px solid rgba(15,118,110,.3);
  border-radius: 30px;
  background: rgba(15,118,110,.06);
}
.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.25;
  letter-spacing: -.5px;
  font-weight: 700;
  background: linear-gradient(120deg, var(--text) 30%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.9;
}
.hero-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ── HEADINGS ────────────────────────────────────────────── */
h2.sec-title {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.35;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -.3px;
}
.numbadge {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #c2410c);
  box-shadow: 0 4px 14px rgba(229,107,31,.28);
}
.numbadge.cy { background: linear-gradient(135deg, var(--cyan), var(--cyan-dim)); box-shadow: 0 4px 14px rgba(15,118,110,.28); }
h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
h3 .h3ic { font-size: 18px; }
h4 { font-size: 16px; font-weight: 700; margin: 24px 0 8px; color: var(--gold); }
.sec > p, .prose p { margin: 12px 0; color: var(--text-soft); }
.sec a, .prose a { color: var(--cyan-dim); text-decoration: none; border-bottom: 1px dotted rgba(15,118,110,.45); }
.sec a:hover, .prose a:hover { border-bottom-style: solid; }
.lede {
  font-size: 17px;
  color: var(--text);
  border-left: 3px solid var(--cyan);
  padding-left: 16px;
  margin: 16px 0 26px;
  line-height: 1.85;
}
ul, ol { margin: 12px 0 12px 4px; padding-left: 24px; color: var(--text-soft); }
li { margin: 7px 0; }
li::marker { color: var(--cyan); }
strong { color: var(--text); font-weight: 700; }
hr.div { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* inline command / keyword chip */
code, .k {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--gold-dim);
  background: rgba(229,107,31,.10);
  border: 1px solid rgba(229,107,31,.26);
  border-radius: 5px;
  padding: 1px 6px;
  word-break: break-word;
}
.k.cy { color: var(--cyan-dim); background: rgba(15,118,110,.08); border-color: rgba(15,118,110,.28); }
.k.rd { color: var(--red); background: rgba(180,35,24,.07); border-color: rgba(180,35,24,.24); }

/* ── CODE BLOCK + COPY（ターミナル＝黒地を維持）──────────── */
.cmdblock {
  position: relative;
  background: var(--code-bg);
  border: 1px solid #2a2f31;
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(22,22,21,.14);
}
.cmdblock .bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: #1d2124;
}
.cmdblock .bar .dotr { width: 10px; height: 10px; border-radius: 50%; }
.cmdblock .bar .d1 { background: #ff5f56; } .cmdblock .bar .d2 { background: #ffbd2e; } .cmdblock .bar .d3 { background: #27c93f; }
.cmdblock .bar .label { margin-left: 6px; font-family: var(--mono); font-size: 11px; color: #9aa3a8; }
.cmdblock pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #d8fff3;
  background: transparent;
  border: none;
}
.cmdblock pre code { color: inherit; background: transparent; border: none; padding: 0; }
.cmdblock pre .cm { color: #87a7a0; }                 /* comment */
.cmdblock pre .pr { color: #6ee7b7; }                 /* prompt $ > */
.cmdblock pre .fl { color: #fbd38d; }                 /* flag */
.cmdblock pre .sl { color: #7dd3fc; }                 /* slash cmd */
.copy-btn {
  position: absolute;
  top: 7px; right: 9px;
  background: #22272a;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px;
  color: #b7c2c6;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  transition: all .12s;
  z-index: 2;
}
.copy-btn:hover { color: #7dd3c8; border-color: #7dd3c8; }

/* ── CALLOUTS ────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  border-radius: var(--radius);
  padding: 15px 18px;
  margin: 20px 0;
  font-size: 15px;
  line-height: 1.8;
  border: 1px solid var(--border2);
  background: var(--bg2);
}
.callout .ic { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.callout .ct { color: var(--text-soft); }
.callout .ct b, .callout .ct strong { color: var(--text); }
.callout.tip    { border-color: rgba(15,118,110,.35);  background: rgba(15,118,110,.06); }
.callout.info   { border-color: rgba(37,99,235,.3);   background: rgba(37,99,235,.05); }
.callout.good   { border-color: rgba(33,166,122,.4);  background: rgba(33,166,122,.07); }
.callout.warn   { border-color: rgba(229,107,31,.4);  background: rgba(229,107,31,.07); }
.callout.danger { border-color: rgba(180,35,24,.35);  background: rgba(180,35,24,.05); }
.callout.analogy{ border-color: rgba(246,201,69,.6);  background: rgba(246,201,69,.14); }

/* ── CARDS / GRID ────────────────────────────────────────── */
.grid { display: grid; gap: 14px; margin: 18px 0; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(22,22,21,.03);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--border2); box-shadow: 0 8px 24px rgba(22,22,21,.08); }
.card .ci { font-size: 26px; margin-bottom: 8px; }
.card h4 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.7; }

/* ── STEPS (ordered flow) ────────────────────────────────── */
.steps { counter-reset: st; list-style: none; padding: 0; margin: 22px 0; }
.steps > li {
  counter-increment: st;
  position: relative;
  padding: 4px 0 22px 54px;
  border-left: 2px solid var(--border2);
  margin-left: 18px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(st);
  position: absolute;
  left: -19px; top: -2px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  color: #fff;
  background: var(--cyan);
  box-shadow: 0 0 0 5px var(--bg);
}
.steps > li .st-t { font-weight: 700; color: var(--text); font-size: 16px; display: block; margin-bottom: 3px; }
.steps > li .st-d { color: var(--text-soft); font-size: 14.5px; }

/* ── DIAGRAM (mermaid) ───────────────────────────────────── */
.diagram {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 18px 14px 10px;
  margin: 22px 0;
  overflow-x: auto;
}
.diagram pre.mermaid { background: transparent; text-align: center; min-height: 40px; }
.diagram .diagram-cap {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--mono);
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.diagram-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--cyan-dim);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 6px;
}

/* ── CASE STUDY ──────────────────────────────────────────── */
.case {
  background: linear-gradient(180deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 24px;
  margin: 28px 0;
  box-shadow: 0 8px 24px rgba(22,22,21,.05);
}
.case-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.case-no {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  color: var(--orange);
  line-height: 1;
}
.case-head h3 { margin: 0; font-size: 20px; }
.persona {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 14px 0;
  font-size: 14px;
  color: var(--text-soft);
}
.persona .pic { font-size: 30px; }
.case-tag, .badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .3px;
}
.badge.lv1, .lv-beginner { background: #def8eb; color: #07543c; border: 1px solid rgba(33,166,122,.4); }
.badge.lv2, .lv-mid      { background: #fff0d7; color: #a44807; border: 1px solid rgba(229,107,31,.35); }
.badge.lv3, .lv-adv      { background: #e8efff; color: #1d4ed8; border: 1px solid rgba(37,99,235,.3); }
.badge.cy { background: #ddf4ef; color: #0b5f58; border: 1px solid rgba(15,118,110,.3); }
.badge.gd { background: #ffe7d2; color: #9a3b08; border: 1px solid rgba(229,107,31,.3); }

/* ── TABLE ───────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg2); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
table.tbl th {
  background: var(--bg4);
  color: var(--cyan-dim);
  text-align: left;
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-soft); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: rgba(15,118,110,.04); }
table.tbl code { white-space: nowrap; }

/* ── TOC (on hub) ────────────────────────────────────────── */
.toc { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin: 24px 0; }
.toc-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  transition: all .16s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(22,22,21,.03);
}
.toc-card::after {
  content: '→';
  position: absolute; right: 16px; top: 16px;
  color: var(--muted-dim); font-size: 18px; transition: all .16s;
}
.toc-card:hover { border-color: var(--cyan); transform: translateY(-3px); background: #f4faf8; box-shadow: 0 8px 24px rgba(22,22,21,.08); }
.toc-card:hover::after { color: var(--cyan); transform: translateX(3px); }
.toc-card .tnum {
  flex-shrink: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  line-height: 1;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--bg4);
  color: var(--gold);
  border: 1px solid var(--border2);
}
.toc-card .tt { color: var(--text); font-weight: 700; font-size: 16px; margin-bottom: 3px; }
.toc-card .td { color: var(--muted); font-size: 13px; line-height: 1.65; }

/* ── PAGER (prev / next) ─────────────────────────────────── */
.pager {
  display: flex;
  gap: 12px;
  margin: 50px 0 10px;
  flex-wrap: wrap;
}
.pager a {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  text-decoration: none;
  transition: all .15s;
}
.pager a:hover { border-color: var(--cyan); background: #f4faf8; }
.pager a.next { text-align: right; align-items: flex-end; }
.pager .lbl { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.pager .ttl { color: var(--text); font-weight: 700; font-size: 15px; }
.pager a:hover .ttl { color: var(--cyan-dim); }

/* ── FOOTER ──────────────────────────────────────────────── */
footer.foot {
  border-top: 1px solid var(--border);
  margin-top: 50px;
  padding: 30px 22px 60px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  line-height: 1.9;
  background: #f0f3ed;
}
footer.foot a { color: var(--cyan-dim); text-decoration: none; }

/* back to top */
.totop {
  position: fixed;
  bottom: 22px; right: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--cyan);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: none;
  place-items: center;
  z-index: 150;
  box-shadow: 0 6px 18px rgba(15,118,110,.35);
}
.totop.show { display: grid; }

/* progress bar */
.readbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
  z-index: 300;
  transition: width .1s;
}

/* small helpers */
.center { text-align: center; }
.muted { color: var(--muted); }
.mt0 { margin-top: 0; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.kbd {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--text);
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  main.wrap { padding: 24px 16px 30px; }
  .sec { margin: 44px 0; }
  .navlinks a { padding: 6px 9px; font-size: 12px; }
  .steps > li { padding-left: 44px; }
  .case { padding: 18px; }
}

/* ===== v2: scalable nav (compact bar + drawer) ===== */
.nav-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.navbtn {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 8px; padding: 6px 12px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.navbtn:hover { color: var(--cyan-dim); border-color: var(--cyan); }
.navbtn.ref { color: var(--gold); }
.navbtn.ref:hover { color: var(--gold); border-color: var(--orange); }
.navbtn.menubtn { color: #fff; background: var(--cyan); border-color: var(--cyan); }
.navbtn.menubtn:hover { background: var(--cyan-dim); color: #fff; }
@media (max-width: 520px) { .navbtn { padding: 6px 9px; font-size: 12px; } .navbtn .lblx { display: none; } }

.drawer { position: fixed; inset: 0; z-index: 500; display: none; }
.drawer.open { display: block; }
.drawer-bg { position: absolute; inset: 0; background: rgba(22,22,21,.36); backdrop-filter: blur(3px); animation: mfade .18s ease; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(372px, 88vw);
  background: var(--bg2); border-left: 1px solid var(--border2);
  box-shadow: -20px 0 50px rgba(83,66,39,.18); overflow-y: auto; padding: 18px 16px 50px;
  animation: drawerIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes drawerIn { from { transform: translateX(34px); opacity: .3 } to { transform: translateX(0); opacity: 1 } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.drawer-head .dt { font-size: 17px; font-weight: 900; letter-spacing: .5px; color: var(--text); }
.drawer-close { width: 30px; height: 30px; border-radius: 8px; background: var(--bg3); border: 1px solid var(--border); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.drawer-close:hover { color: var(--cyan-dim); border-color: var(--cyan); }
.drawer-sec { margin: 15px 0 4px; }
.drawer-sec-t { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--cyan-dim); margin-bottom: 5px; padding-left: 4px; }
.drawer-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--text-soft); font-size: 13.5px; transition: all .12s; }
.drawer-link:hover { background: var(--bg4); color: var(--cyan-dim); }
.drawer-link.active { background: rgba(15,118,110,.1); color: var(--cyan-dim); font-weight: 700; }
.drawer-link.active::after { content: '● 表示中'; margin-left: auto; font-size: 9px; font-family: var(--mono); color: var(--cyan-dim); }
.drawer-link .di { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.drawer-link.ref { color: var(--gold); }
.drawer-link.ref:hover { background: rgba(229,107,31,.08); }

/* ===== glossary ===== */
.gloss-search { position: relative; margin: 20px 0 8px; }
.gloss-search input {
  width: 100%; background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px;
  color: var(--text); font-size: 15px; padding: 12px 14px 12px 40px; font-family: var(--sans);
}
.gloss-search input:focus { outline: none; border-color: var(--cyan); }
.gloss-search .gi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.gloss-count { font-size: 12px; color: var(--muted); font-family: var(--mono); margin: 4px 0 14px; }
.gloss-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.term-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px; transition: border-color .15s; box-shadow: 0 1px 0 rgba(22,22,21,.03); }
.term-card:hover { border-color: var(--border2); }
.term-card.hidden { display: none; }
.term-card .tw { font-weight: 700; color: var(--gold-dim); font-size: 15px; margin-bottom: 1px; font-family: var(--mono); }
.term-card .tr { font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.term-card .tdsc { font-size: 13.5px; color: var(--text-soft); line-height: 1.75; }
.term-card .tdsc code { font-size: .85em; }
.gloss-empty { text-align: center; color: var(--muted); padding: 46px; display: none; }

/* ===== quiz ===== */
.quiz-q { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin: 16px 0; box-shadow: 0 1px 0 rgba(22,22,21,.03); }
.quiz-q .qn { font-family: var(--mono); font-size: 12px; color: var(--cyan-dim); letter-spacing: 1px; }
.quiz-q .qt { font-weight: 700; font-size: 16px; color: var(--text); margin: 6px 0 13px; line-height: 1.6; }
.quiz-opt {
  display: block; width: 100%; text-align: left; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; margin: 7px 0; color: var(--text-soft); font-size: 14px;
  cursor: pointer; transition: all .12s; font-family: var(--sans); line-height: 1.6;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--cyan); background: #f4faf8; }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.correct { border-color: #21a67a; background: #def8eb; color: #07543c; }
.quiz-opt.wrong { border-color: var(--red); background: #ffe5e1; color: #7c2016; }
.quiz-exp { margin-top: 11px; font-size: 13px; color: var(--text-soft); line-height: 1.75; background: var(--bg4); border-left: 3px solid var(--cyan); border-radius: 8px; padding: 11px 13px; display: none; }
.quiz-exp.show { display: block; }
.quiz-exp code { font-size: .85em; }
.quiz-score {
  position: sticky; bottom: 14px; z-index: 30; background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 30px; padding: 11px 22px; text-align: center; font-weight: 700; color: var(--cyan-dim);
  width: fit-content; margin: 26px auto 0; box-shadow: 0 8px 24px rgba(83,66,39,.18); font-size: 15px;
}
.quiz-reset { margin-left: 12px; font-size: 12px; color: var(--muted); background: none; border: 1px solid var(--border2); border-radius: 16px; padding: 4px 12px; cursor: pointer; }
.quiz-reset:hover { color: var(--cyan-dim); border-color: var(--cyan); }

/* ===== collapsible solution (exercises) ===== */
details.sol { background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px; padding: 0 16px; margin: 12px 0; }
details.sol > summary { cursor: pointer; padding: 13px 0; font-weight: 700; color: var(--cyan-dim); font-size: 14px; list-style: none; }
details.sol > summary::-webkit-details-marker { display: none; }
details.sol > summary::before { content: '▸ '; color: var(--orange); }
details.sol[open] > summary::before { content: '▾ '; }
details.sol .sol-body { padding: 4px 0 16px; border-top: 1px solid var(--border); }
.ex-card { background: linear-gradient(180deg, var(--bg2), var(--bg3)); border: 1px solid var(--border2); border-radius: 14px; padding: 20px 22px; margin: 22px 0; box-shadow: 0 8px 24px rgba(22,22,21,.05); }
.ex-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ex-no { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--cyan); line-height: 1; }
.ex-goal { background: var(--bg4); border-radius: 9px; padding: 10px 14px; font-size: 14px; color: var(--text-soft); margin: 10px 0; border-left: 3px solid var(--orange); }
