/* CAS · Deep Dive: Attention — The Mathematics */
.topnav { position: fixed; top: 0; left: 0; right: 0; z-index: 130; display: flex; align-items: center; gap: 1.4rem; padding: 0.55rem clamp(1rem, 3vw, 2rem); background: rgba(5, 8, 14, 0.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topnav-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); flex: none; }
.topnav-brand img { width: 2.1rem; height: 2.1rem; border-radius: 7px; }
.topnav-brand .tb-txt { display: flex; flex-direction: column; line-height: 1.1; }
.topnav-brand .tb-txt strong { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.05em; }
.topnav-brand .tb-txt small { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.14em; color: var(--text-3); text-transform: uppercase; }
.topnav-links { display: flex; gap: 0.2rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-links a { font-size: 0.82rem; font-weight: 500; color: var(--text-2); text-decoration: none; padding: 0.35rem 0.65rem; border-radius: 7px; white-space: nowrap; transition: color 0.15s, background 0.15s; }
.topnav-links a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topnav-links a.active { color: var(--teal); }
.topnav-back { flex: none; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid var(--line-2); border-radius: 8px; padding: 0.4rem 0.8rem; color: var(--text); text-decoration: none; transition: border-color 0.2s, color 0.2s; }
.topnav-back:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
@media (max-width: 900px) { .topnav-links { display: none; } }
main { padding-top: 3.2rem; }
.scroll-progress { top: 3.2rem; }
.rail-toggle { top: 4.4rem; }
.rail { padding-top: 4.6rem; }
.sec-hero { text-align: center; padding-top: clamp(3rem, 8vh, 5.5rem); }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--teal); border: 1px solid rgba(94, 234, 212, 0.35); border-radius: 999px; padding: 0.42rem 1.1rem; background: rgba(94, 234, 212, 0.06); margin-bottom: 1.6rem; }
.sec-hero .hero-title { margin-inline: auto; }
.sec-hero .hero-sub { margin-inline: auto; text-align: center; }
.flow-strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.45rem; max-width: 1000px; margin: 2rem auto 1.6rem; }
.fs-step { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0.42rem 0.8rem; background: rgba(8, 13, 24, 0.55); }
.fs-hl { color: var(--teal); border-color: rgba(94, 234, 212, 0.4); background: rgba(94, 234, 212, 0.06); }
.fs-model { color: #05231f; background: var(--teal); border-color: var(--teal); font-weight: 700; }
.fs-arw { color: var(--text-3); font-size: 0.8rem; }
.tok-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.pn-presets { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.7rem; }
.pn-preset { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.32rem 0.75rem; background: rgba(8, 13, 24, 0.45); cursor: pointer; transition: all 0.15s; }
.pn-preset:hover { color: var(--teal); border-color: rgba(94, 234, 212, 0.4); }
.pn-preset.on { color: #05231f; background: var(--teal); border-color: var(--teal); font-weight: 700; }
.range-wrap { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 1.1rem; }
.range-header { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--text-2); }
.range-val { color: var(--teal); font-weight: 700; }
.range-wrap input[type="range"] { width: 100%; accent-color: var(--teal); }
.tok-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 0.8rem; margin-top: 1.1rem; }
.qk-row { display: grid; grid-template-columns: minmax(5.4rem, 9rem) minmax(6rem, 1fr); gap: 0.8rem; align-items: center; padding: 0.26rem 0.5rem; border-bottom: 1px dashed var(--line); }
.qk-row:last-child { border-bottom: 0; }
.qk-row.win { background: rgba(94, 234, 212, 0.05); border-radius: 6px; }
.qk-tok { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text); }
.qk-w { display: flex; align-items: center; gap: 0.5rem; }
.qk-w i { display: block; height: 10px; border-radius: 5px; flex: 1; max-width: calc(100% - 7rem); min-width: 3px; background: linear-gradient(90deg, rgba(94, 234, 212, 0.4), rgba(94, 234, 212, 0.9)); }
.qk-w b { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text); min-width: 6.6rem; text-align: right; }
.math-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 880px) { .math-grid { grid-template-columns: 1fr; } }
.mv { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text); background: rgba(8, 13, 24, 0.55); border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.6rem; display: inline-block; }
.mv b { font-weight: 500; }
.mv b.on { color: var(--amber); font-weight: 700; }
.mv-s { border-color: rgba(94, 234, 212, 0.45); }
.mv-h { border-color: rgba(56, 189, 248, 0.4); }
.mv-t { border-color: rgba(148, 163, 184, 0.4); }
.mv-a { border-color: rgba(251, 191, 36, 0.45); }
.mv-c { border-color: rgba(52, 211, 153, 0.45); }
.mv-line { margin: 0; }
.su-row { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.45rem; }
.su-row .hl-mono { min-width: 6rem; }
.wa-table { display: flex; flex-direction: column; gap: 0.3rem; }
.wa-row { display: grid; grid-template-columns: minmax(8rem, 12rem) repeat(3, 1fr); gap: 0.6rem; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: rgba(8, 13, 24, 0.45); padding: 0.35rem 0.7rem; }
.wa-row.head { background: none; border-color: transparent; }
.wa-row.head b { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; }
.wa-row span { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-2); }
.wa-row i { font-style: normal; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text); }
.wa-row.sum { background: none; border-color: transparent; padding-bottom: 0; color: var(--text-3); font-size: 0.72rem; }
.tn-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 880px) { .tn-grid { grid-template-columns: 1fr; } }
#tnCanvas { display: block; border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.6); }
.cx-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.cx-row { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 7px; background: rgba(8, 13, 24, 0.45); padding: 0.4rem 0.7rem; }
.cx-x { color: var(--text-3); font-family: var(--font-mono); }
.ms-stage { border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); padding: 1.1rem 1.2rem; min-height: 9rem; }
.ms-stage p { line-height: 1.75; }
.recap-card { border: 1px solid rgba(94, 234, 212, 0.35); border-radius: var(--radius); background: rgba(94, 234, 212, 0.04); padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 0.65rem; }
.rc-row { display: flex; gap: 1rem; align-items: baseline; }
.rc-row b { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--teal); border: 1px solid rgba(94, 234, 212, 0.45); }
.rc-row p { margin: 0; font-size: 0.92rem; color: var(--text-2); line-height: 1.6; }
.rc-row p b { color: var(--teal); font-family: var(--font-mono); font-size: 0.84rem; }
.urdu-inline { font-family: 'Noto Nastaliq Urdu', serif; }
.cite-note { font-size: 0.8rem; color: var(--text-3); max-width: 70ch; line-height: 1.6; }
.sec-head .kicker { gap: 0.4rem; letter-spacing: 0.22em; }
.sec-head .kicker .knum { display: inline; border: 0; background: none; padding: 0; min-width: 0; height: auto; border-radius: 0; white-space: nowrap; }
.sec-head .kicker .knum::before { content: "— SECTION "; }
.sec-head .kicker .knum::after { content: " ·"; }
html.static .mv, html.static .wa-row { animation: none; transition: none; }

.wa-mat { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-2); word-break: break-all; }

/* why-cards: intuition before arithmetic */
.why-card {
  border: 1px solid rgba(94, 234, 212, 0.4); border-left: 3px solid var(--teal);
  border-radius: var(--radius-s); background: rgba(94, 234, 212, 0.05);
  padding: 1rem 1.2rem 0.9rem; margin-bottom: 1.1rem;
}
.why-card .mini { color: var(--teal); letter-spacing: 0.16em; }
.why-card p { margin: 0.45rem 0 0; font-size: 0.94rem; color: var(--text-2); line-height: 1.7; }
.why-card p strong, .why-card p b { color: var(--text); }
.why-card p.micro { font-size: 0.8rem; color: var(--text-3); }
.ms-why {
  font-size: 0.98rem; color: var(--teal); font-style: italic;
  border-left: 2px solid rgba(94, 234, 212, 0.5); padding-left: 0.8rem;
  margin: 0.6rem 0 0;
}


/* ================= self-attention page ================= */
.sa-steps { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem; max-width: 1100px; margin: 2rem auto 1rem; }
.sa-step { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0.4rem 0.75rem; background: rgba(8, 13, 24, 0.55); }
.sa-model { color: #05231f; background: var(--teal); border-color: var(--teal); font-weight: 700; }
.sa-arw { color: var(--text-3); font-size: 0.75rem; }
.lo-card { margin-top: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); padding: 1.1rem 1.2rem; }
.lo-word { margin: 0.3rem 0 0; font-family: var(--font-display); font-size: 2.4rem; color: var(--amber); }
.lo-reads { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.lo-reads span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--rose); border: 1px dashed rgba(251, 113, 133, 0.45); border-radius: 7px; padding: 0.3rem 0.6rem; }
.lo-note { margin: 0.8rem 0 0; font-size: 0.9rem; color: var(--text-2); line-height: 1.6; }
.ro-chip { cursor: pointer; }
.ro-qcard { border: 1px solid rgba(94, 234, 212, 0.4); border-left: 3px solid var(--teal); border-radius: var(--radius-s); background: rgba(94, 234, 212, 0.05); padding: 0.9rem 1.1rem; }
.ro-q { margin: 0.3rem 0 0; font-family: var(--font-display); font-size: 1.25rem; color: var(--teal); }
.ro-labels { border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); padding: 0.9rem 1rem; max-height: 20rem; overflow-y: auto; }
.ro-offer { display: grid; grid-template-columns: minmax(5rem, 7rem) 1fr; gap: 0.9rem; padding: 0.3rem 0.2rem; border-bottom: 1px dashed var(--line); font-size: 0.84rem; color: var(--text-2); align-items: baseline; }
.ro-offer:last-child { border-bottom: 0; }
.ma-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ma-arc { fill: none; stroke: var(--sky); }
.ma-arc.strong { stroke: var(--teal); }
.ma-chip { cursor: pointer; }
.ma-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(260px, 1fr); gap: 1.4rem; }
@media (max-width: 820px) { .ma-grid { grid-template-columns: 1fr; } }
.bl-row { display: grid; grid-template-columns: minmax(5rem, 7rem) minmax(6rem, 1fr); gap: 0.8rem; align-items: center; padding: 0.26rem 0.4rem; }
.bl-donor { font-family: var(--font-mono); font-size: 0.84rem; }
.qk-row { display: grid; grid-template-columns: minmax(5rem, 7rem) minmax(6rem, 1fr); gap: 0.8rem; align-items: center; padding: 0.24rem 0.4rem; border-bottom: 1px dashed var(--line); }
.qk-row:last-child { border-bottom: 0; }
.qk-row.win { background: rgba(94, 234, 212, 0.05); border-radius: 6px; }
.qk-tok { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text); }
.qk-w { display: flex; align-items: center; gap: 0.5rem; }
.qk-w i { display: block; height: 10px; border-radius: 5px; flex: 1; max-width: calc(100% - 4rem); min-width: 3px; background: linear-gradient(90deg, rgba(94, 234, 212, 0.4), rgba(94, 234, 212, 0.9)); }
.qk-w b { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text); min-width: 3.6rem; text-align: right; }
.bl-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 1.4rem; }
@media (max-width: 820px) { .bl-grid { grid-template-columns: 1fr; } }
.bl-slice { display: flex; height: 26px; border-radius: 13px; overflow: hidden; border: 1px solid var(--line-2); }
.bl-slice-wrap { border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); padding: 1rem; }
.bl-beforeafter { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.bl-beforeafter > div { flex: 1; min-width: 140px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.7rem 0.9rem; background: rgba(8, 13, 24, 0.45); }
.bl-beforeafter .mini { margin: 0 0 0.25rem; }
.bl-word { margin: 0; font-family: var(--font-display); font-size: 1.15rem; color: var(--text-2); }
.bl-word.after { color: var(--teal); }
.bl-arrow { font-size: 1.4rem; color: var(--text-3); }
.rnd-wrap { display: flex; justify-content: center; }
.rd-svg { width: 100%; max-width: 560px; display: block; }
.rd-lv { fill: rgba(8, 13, 24, 0.5); stroke: var(--line-2); }
.rd-lv.done { stroke: rgba(94, 234, 212, 0.4); }
.rd-lv.on { stroke: var(--teal); stroke-width: 2; fill: rgba(94, 234, 212, 0.07); }
.rd-lt { font-family: var(--font-mono); font-size: 10px; fill: var(--text-2); }
.rd-up { stroke: #5b7290; stroke-width: 1.5; }
.rd-up.on { stroke: var(--teal); stroke-width: 2; }
.rv-btns { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.rv-btn {
  --rc: var(--teal);
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em;
  padding: 0.45rem 0.85rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-2); background: rgba(8, 13, 24, 0.45); cursor: pointer;
  border-left: 3px solid var(--rc); transition: all 0.15s;
}
.rv-btn:hover { color: var(--text); border-color: var(--line-2); }
.rv-btn.on { border-color: var(--rc); color: var(--rc); font-weight: 700; background: rgba(8, 13, 24, 0.8); }
.rv-detail { margin-top: 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); padding: 0.9rem 1rem; min-height: 4.2rem; }
.rv-name { margin: 0; font-family: var(--font-mono); font-size: 0.95rem; font-weight: 700; }
.rv-fx { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.rv-chip { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: 6px; padding: 0.2rem 0.5rem; transition: all 0.15s; }
.rv-chip.on { color: var(--rc); border-color: var(--rc); font-weight: 700; }
.recap-card { border: 1px solid rgba(94, 234, 212, 0.35); border-radius: var(--radius); background: rgba(94, 234, 212, 0.04); padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 0.65rem; }
.rc-row { display: flex; gap: 1rem; align-items: baseline; }
.rc-row b { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--teal); border: 1px solid rgba(94, 234, 212, 0.45); }
.rc-row p { margin: 0; font-size: 0.92rem; color: var(--text-2); line-height: 1.6; }
.tok-chip.qsel { border-color: var(--teal); background: rgba(94, 234, 212, 0.18); color: var(--teal); font-weight: 700; }
.tok-chip.neg { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.5); color: var(--rose); }
.tok-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.tok-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tok-chip { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text); background: rgba(94, 234, 212, 0.08); border: 1px solid rgba(94, 234, 212, 0.35); border-radius: 8px; padding: 0.42rem 0.6rem 0.3rem; }
.pn-presets { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.7rem; }
.pn-preset { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.32rem 0.75rem; background: rgba(8, 13, 24, 0.45); cursor: pointer; transition: all 0.15s; }
.pn-preset:hover { color: var(--teal); border-color: rgba(94, 234, 212, 0.4); }
.bn-row-wrap { position: relative; padding-top: 8px; }
.bn-attn { padding-top: 46px; }
.cite-note { font-size: 0.8rem; color: var(--text-3); max-width: 70ch; line-height: 1.6; }
.sec-head .kicker { gap: 0.4rem; letter-spacing: 0.22em; }
.sec-head .kicker .knum { display: inline; border: 0; background: none; padding: 0; min-width: 0; height: auto; border-radius: 0; white-space: nowrap; }
.sec-head .kicker .knum::before { content: "\2014 SECTION "; }
.sec-head .kicker .knum::after { content: " \00b7"; }


/* ================= multihead-attention page ================= */
.mh-strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35rem; max-width: 1200px; margin: 2rem auto 1rem; }
.mh-chip { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0.38rem 0.7rem; background: rgba(8, 13, 24, 0.55); }
.mh-chip.mh-hl { color: var(--teal); border-color: rgba(94, 234, 212, 0.4); background: rgba(94, 234, 212, 0.06); }
.mh-chip.mh-model { color: #05231f; background: var(--teal); border-color: var(--teal); font-weight: 700; }
.mh-arw { color: var(--text-3); font-size: 0.72rem; }
.msh { font-family: var(--font-mono); font-size: 0.68rem; color: var(--mc); border: 1px solid var(--mc); border-radius: 6px; padding: 0.1rem 0.45rem; white-space: nowrap; }
.mh-mat { display: flex; flex-direction: column; gap: 2.5px; align-items: center; }
.mh-mline { display: flex; gap: 2.5px; align-items: center; }
.mh-mline em { font-style: normal; font-family: var(--font-mono); font-size: 0.56rem; color: var(--text-3); width: 2.6rem; text-align: right; margin-right: 0.3rem; }
.mh-mline i { font-style: normal; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text); background: rgba(8, 13, 24, 0.6); border: 1px solid var(--line); border-radius: 4px; padding: 0.18rem 0.32rem; min-width: 2.1rem; text-align: center; }
.mh-mat.mh-q .mh-mline i { border-color: rgba(94, 234, 212, 0.4); }
.mh-mat.mh-k .mh-mline i { border-color: rgba(56, 189, 248, 0.4); }
.mh-mat.mh-v .mh-mline i { border-color: rgba(167, 139, 250, 0.4); }
.mh-mat.mh-s .mh-mline i { border-color: rgba(251, 191, 36, 0.35); }
.mh-mat.mh-a .mh-mline i { border-color: rgba(52, 211, 153, 0.4); color: var(--green); }
.mh-mat.mh-o .mh-mline i { border-color: rgba(52, 211, 153, 0.5); }
.mh-mat.mh-cat .mh-mline i:nth-child(-n+4) { border-color: rgba(94, 234, 212, 0.4); }
.mh-mat.mh-cat .mh-mline i:nth-child(n+5) { border-color: rgba(167, 139, 250, 0.4); }
.mh-mat.mh-x .mh-mline i { border-color: rgba(148, 163, 184, 0.4); }
.fl-shapeline { margin: 0.35rem 0 0; text-align: center; }
.fl-toks { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.fl-tri { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 1rem; }
.fl-mcell { border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); padding: 0.8rem 0.9rem; display: flex; flex-direction: column; align-items: center; }
.fl-mcell .mini { text-align: center; }
.fl-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .fl-split { grid-template-columns: 1fr; } }
.mh-dgwrap { border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(5, 8, 14, 0.5); padding: 0.8rem; display: flex; justify-content: center; }
.mh-svg { width: 100%; max-width: 540px; height: auto; font-family: var(--font-mono); }
.mh-r { fill: rgba(8, 13, 24, 0.6); stroke: var(--line-2); stroke-width: 1.3; }
.mh-t { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; fill: var(--text); }
.mh-s { font-size: 8.5px; fill: var(--text-3); white-space: pre-line; }
.mh-a { stroke: #5b7290; stroke-width: 1.5; fill: none; }
.mh-shape { font-size: 8.5px; fill: var(--teal); }
.mh-cap { font-size: 10px; letter-spacing: 0.16em; fill: var(--text-3); }
.mh-blk { cursor: pointer; }
.mh-blk.lin .mh-r { stroke: rgba(94, 234, 212, 0.5); fill: rgba(94, 234, 212, 0.06); }
.mh-blk.lin .mh-t { fill: var(--teal); }
.mh-blk.att .mh-r { stroke: rgba(56, 189, 248, 0.5); fill: rgba(56, 189, 248, 0.06); }
.mh-blk.att .mh-t { fill: var(--sky); }
.mh-blk.cat .mh-r { stroke: rgba(251, 191, 36, 0.5); fill: rgba(251, 191, 36, 0.05); }
.mh-blk.cat .mh-t { fill: var(--amber); }
.mh-blk.out .mh-r { stroke: rgba(52, 211, 153, 0.5); fill: rgba(52, 211, 153, 0.05); }
.mh-blk.out .mh-t { fill: var(--green); }
.mh-blk.io .mh-r { fill: rgba(5, 8, 14, 0.7); }
.mh-loop { stroke: var(--amber); stroke-width: 1.8; }
.cs-row { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(5.5rem, auto) 1fr; gap: 1rem; align-items: center; border-bottom: 1px dashed var(--line); padding: 0.5rem 0.2rem; }
.cs-row:last-child { border-bottom: 0; }
.cs-row b { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); }
.cs-row .hl-mono { color: var(--teal); }
.cs-note { font-size: 0.8rem; color: var(--text-3); line-height: 1.5; }
.cs-controls { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: flex-end; }
.op-rows { display: flex; flex-direction: column; }
.op-row { display: grid; grid-template-columns: minmax(11rem, 16rem) minmax(7rem, auto) auto; gap: 1rem; align-items: center; border-bottom: 1px dashed var(--line); padding: 0.5rem 0.2rem; }
.op-row:last-child { border-bottom: 0; }
.op-stage { font-size: 0.84rem; color: var(--text-2); }
.op-nm { color: var(--text); }
.op-row.fin { border-bottom: 0; background: rgba(52, 211, 153, 0.05); border-radius: 6px; }

/* ============ 03 qkv in pictures — DataCamp-style pastel card ============ */
.dc-card{background:#fdfdfa;border:1px solid rgba(255,255,255,.16);border-radius:20px;padding:1.2rem 1.3rem 1.1rem;color:#232838;box-shadow:0 18px 50px rgba(0,0,0,.35);}
.dc-lead{margin:0 0 .7rem;font-size:.95rem;line-height:1.5;color:#3a4152;}
.dc-words{display:flex;flex-wrap:wrap;gap:.5rem;margin:.1rem 0 .9rem;}
.dc-words .pn-preset{background:#fff;border:1.5px solid #d8d5ca;color:#3a4152;}
.dc-words .pn-preset.on{background:#232838;border-color:#232838;color:#fff;}
.dc-dgwrap{width:100%;}
.dc-dgwrap svg{width:100%;height:auto;display:block;}
.dc-h{font:700 15px/1 var(--sans, sans-serif);fill:#232838;}
.dc-sub{font:500 11.5px/1.25 var(--sans, sans-serif);fill:#7a7f8e;}
.dc-num{font:600 13.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;fill:#232838;}
.dc-var{font:italic 700 15px/1 Georgia, serif;fill:#9a5b63;}
.dc-emb{fill:#ffffff;stroke:#22242c;stroke-width:1.6;}
.dc-pill{fill:#ffffff;stroke:#22242c;stroke-width:1.4;}
.dc-blktxt{font:700 15.5px/1 var(--sans, sans-serif);fill:#2b2f3c;}
.dc-blk{cursor:pointer;}
.dc-blk rect{transition:stroke .15s, filter .15s;}
.dc-blk:hover rect,.dc-blk:focus-visible rect{stroke:#0e7f94;stroke-width:2.6;filter:drop-shadow(0 3px 8px rgba(14,127,148,.35));}
.dc-arrow{stroke:#22242c;stroke-width:1.7;fill:none;}
.dc-job{font:600 11.5px/1 var(--sans, sans-serif);fill:#7a7f8e;letter-spacing:.04em;}
.dc-ftxt{font:italic 700 21px/1 Georgia, 'Times New Roman', serif;fill:#232838;}
.dc-fblk{font:700 17px/1 var(--sans, sans-serif);fill:#2b2f3c;}
.dc-fsub{font:500 11.5px/1 var(--sans, sans-serif);fill:#7a7f8e;}
.dc-caption{margin-top:.9rem;border-top:1px dashed #d9d5c8;padding-top:.85rem;font-size:.94rem;line-height:1.58;color:#2c3242;min-height:5.4rem;}
.dc-caption b{color:#10151f;}
.dc-hint{color:#8a8f9c;font-size:.85rem;}
/* stepper */
.sd-strip{display:flex;align-items:center;gap:.45rem;margin-top:.9rem;flex-wrap:wrap;}
.sd-chip{display:inline-block;padding:.28rem .8rem;border-radius:999px;border:1.5px solid #d8d5ca;background:#fff;font-weight:600;font-size:.9rem;color:#3a4152;}
.sd-chip.on{background:#f2b04c;border-color:#d99a33;color:#231a08;}
.sd-note{font-size:.86rem;color:#7a7f8e;margin-left:.35rem;}
.sd-controls{display:flex;align-items:center;gap:.8rem;margin-top:.9rem;}
.sd-controls .btn{background:#232838;border-color:#232838;color:#fff;}
.sd-controls .btn:hover{background:#0e7f94;border-color:#0e7f94;}
.sd-row{display:flex;flex-wrap:wrap;gap:.6rem;align-items:flex-end;}
.sd-pill{display:inline-flex;flex-direction:column;gap:.3rem;min-width:92px;padding:.5rem .7rem .55rem;border-radius:14px;border:1.5px solid #22242c;background:#fff;}
.sd-pill em{font-style:normal;font-size:.78rem;font-weight:700;letter-spacing:.05em;color:#7a7f8e;}
.sd-pill b{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:1.12rem;color:#232838;}
.sd-pill i{display:block;height:5px;border-radius:3px;background:#f2b04c;min-width:6px;}
.sd-pill.hot{border-color:#0e7f94;box-shadow:0 0 0 3px rgba(14,127,148,.15);}
.sd-score .sd-pill b{color:#8a4a52;}
.sd-scaled .sd-pill b{color:#33618f;}
.sd-alpha .sd-pill b{color:#a04a52;}
.sd-blend .sd-pill{border-color:#5d9a56;background:#f2faf0;}
.sd-blend .sd-pill b{color:#2f6b2a;}
.dc-fbig{font:400 44px/1 Georgia, serif;fill:#232838;}
