/* ---------- Hero ---------- */

.hero { padding-block: 64px var(--space-section); overflow-x: clip; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 64px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.8rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
}

.hero h1 span { color: var(--sig); }

.hero-lede {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 44ch;
  margin: 0 0 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Join ---------- */
.join {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.join-copy { align-self: start; }

.join-form { align-self: start; }

.join-copy h2 { margin: 0 0 14px; }

.join-copy > p:not(.eyebrow) {
  color: var(--ink-2);
  font-size: 16px;
  max-width: 40ch;
  margin: 0;
}

.join-notes {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.join-notes li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  color: var(--ink-2);
}

.join-notes li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  color: var(--ink-3);
}

/* ---------- Responsive (home) ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-lede { max-width: 56ch; }
  .join { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 768px) {
  .hero { padding-block: 40px 48px; }
}

@media (max-width: 520px) {
  .hero-actions .btn { flex: 1 1 auto; }
}

/* ==================================================================
   Writeups index, member pages, writeup article
   ================================================================== */

/* ---------- Writeups index ---------- */
.wu-groups { display: grid; gap: 64px; }

.wu-eventgroup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
  margin-bottom: 12px;
}
.wu-eventgroup-head h2 { margin: 0; }
.wu-eventgroup-count { margin: 0 0 0 auto; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.wu-list-rows { list-style: none; margin: 0; padding: 0; }
.wu-row { border-top: 1px solid var(--wire); }
.wu-row:first-child { border-top-color: var(--wire-strong); }

.wu-row-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 64px;
  align-items: center;
  gap: 4px 20px;
  padding: 16px 12px;
  margin-inline: -12px;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}
.wu-row-link:hover { background: var(--panel); }

.wu-row-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.wu-row-name { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.wu-row-sub { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.wu-row-pts { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

.wu-row-blurb {
  grid-column: 1 / -1;
  max-width: 88ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.wu-empty { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--ink-3); }

.wu-note {
  margin: 56px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}
.wu-note a { color: var(--ink-2); border-bottom: 1px solid var(--wire-strong); }
.wu-note a:hover { color: var(--ink); }

@media (max-width: 620px) {
  .wu-row-link { grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; }
  .wu-row-title { grid-column: 1 / -1; }
  .wu-row-pts { text-align: left; }
  .wu-eventgroup-count { margin-left: 0; }
}

/* ---------- Member (solo) pages ---------- */
.mp-avatar {
  width: 76px;
  height: 76px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--panel-2);
  filter: saturate(0.9);
}
.mp-tag {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 700;
  border: 1px solid var(--wire-strong);
  border-radius: var(--radius);
  padding: 3px 8px;
}
.mp-links { margin: 0; }
.mp-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  border-bottom: 1px solid var(--wire-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.mp-links a:hover { color: var(--sig); border-color: var(--sig-line); }
.mp-links .icon { width: 12px; height: 12px; }

.mp-event + .mp-event { margin-top: 64px; }
.mp-event-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  margin-bottom: 18px;
}
.mp-event-head h2 { margin: 0; }
.mp-event-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 0;
}
.mp-event-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px 32px;
  margin-bottom: 28px;
}
.mp-event-summary .cert-thumb { order: -1; }
.mp-event-summary .results-scoreline { flex: 1 1 260px; flex-direction: column; gap: 10px; align-self: center; }

.mp-empty {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  border: 1px dashed var(--wire-strong);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

/* ---------- Writeup detail ---------- */
.wu-flagrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wu-flagrow-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.wu-flagrow code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--phos);
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  padding: 5px 9px;
  word-break: break-all;
}

.wu-copy {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: none;
  border: 1px solid var(--wire-strong);
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.wu-copy:hover { color: var(--ink); border-color: var(--sig); }
.wu-copy.is-done { color: var(--phos); border-color: var(--phos-line); }

.wu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; align-items: start; }

.wu-toc { position: sticky; top: calc(var(--nav-h) + 24px); font-family: var(--mono); }
.wu-toc-h { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.wu-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; border-left: 1px solid var(--wire); }
.wu-toc li { padding-left: 14px; margin-left: -1px; border-left: 1px solid transparent; }
.wu-toc a { font-size: 12px; color: var(--ink-3); line-height: 1.4; transition: color 0.2s ease; }
.wu-toc a:hover { color: var(--ink); }
.wu-toc li.is-active { border-left-color: var(--sig); }
.wu-toc li.is-active a { color: var(--ink); }

/* ---------- Writeup prose ---------- */
.wu-article { max-width: 820px; font-size: 15.5px; line-height: 1.72; color: var(--ink); min-width: 0; }
.wu-article > *:first-child { margin-top: 0; }

.wu-article h2, .wu-article h3, .wu-article h4 {
  font-family: var(--mono);
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.25;
  scroll-margin-top: calc(var(--nav-h) + 24px);
  position: relative;
}
.wu-article h2 { font-size: 1.32rem; margin: 44px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--wire); }
.wu-article h3 { font-size: 1.08rem; margin: 32px 0 12px; color: var(--ink); }
.wu-article h4 { font-size: 0.95rem; margin: 24px 0 10px; color: var(--ink-2); }

.wu-anchor {
  position: absolute;
  left: -1.1em;
  color: var(--wire-strong);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.wu-article h2:hover .wu-anchor, .wu-article h3:hover .wu-anchor { opacity: 1; }
.wu-anchor:hover { color: var(--sig); }

.wu-article p { margin: 0 0 16px; }
.wu-article img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  background: var(--panel);
}
.wu-article p > img { display: block; margin: 4px 0; }
.wu-article a { color: var(--ink); border-bottom: 1px solid var(--sig-line); transition: border-color 0.2s ease; }
.wu-article a:hover { border-bottom-color: var(--sig); }
.wu-article strong { color: var(--ink); font-weight: 600; }
.wu-article em { color: var(--ink-2); }

.wu-article ul, .wu-article ol { margin: 0 0 16px; padding-left: 24px; }
.wu-article li { margin: 0 0 7px; }
.wu-article li::marker { color: var(--ink-3); }

.wu-article code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  padding: 1px 5px;
  word-break: break-word;
}

.wu-article pre {
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 12.75px;
  line-height: 1.65;
}
.wu-article pre code { background: none; border: none; padding: 0; font-size: inherit; color: var(--ink-2); white-space: pre; word-break: normal; }

.wu-article blockquote {
  margin: 0 0 20px;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--sig-line);
  color: var(--ink-2);
  font-style: italic;
}
.wu-article blockquote p:last-child { margin-bottom: 0; }

.wu-article hr { border: none; border-top: 1px solid var(--wire); margin: 32px 0; }

.wu-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 0 0 20px;
  display: block;
  overflow-x: auto;
}
.wu-article th, .wu-article td { border: 1px solid var(--wire); padding: 8px 12px; text-align: left; vertical-align: top; }
.wu-article th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); background: var(--panel); }
.wu-article td code { font-size: 0.82em; }

.wu-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 56px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--wire);
}

.wu-pager-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.wu-pager-link:hover { border-color: var(--sig); background: var(--panel-2); }

.wu-pager-dir {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.wu-pager-name {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wu-pager-next { text-align: right; align-items: flex-end; }
.wu-pager-index .wu-pager-name { color: var(--ink-2); }

@media (max-width: 620px) {
  .wu-pager { grid-template-columns: 1fr; }
  .wu-pager-next { text-align: left; align-items: flex-start; }
}

/* ---------- Reading progress ---------- */
.wu-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  z-index: 40;
  pointer-events: none;
}
.wu-progress-bar { height: 100%; width: 0%; background: var(--sig); }

/* ---------- Mobile TOC toggle (base state; @media (max-width: 980px) below
   turns it on - this rule must stay ABOVE that media block so the override
   wins the cascade tie) ---------- */
.wu-toc-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--panel);
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  padding: 11px 14px;
  cursor: pointer;
}
.wu-toc-toggle::after { content: '+'; font-size: 15px; color: var(--ink-3); }
.wu-toc.is-open .wu-toc-toggle::after { content: '\2212'; }
.wu-toc.is-open .wu-toc-toggle { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wu-toc.is-open ol { border: 1px solid var(--wire); border-top: none; padding: 12px 14px; }

@media (max-width: 980px) {
  .wu-layout { grid-template-columns: 1fr; gap: 0; }
  .wu-toc { position: static; order: -1; margin-bottom: 28px; }
  .wu-toc-h { display: none; }
  .wu-toc-toggle { display: flex; }
  .wu-toc ol { max-height: 0; overflow: hidden; }
  .wu-toc.is-open ol { max-height: 60vh; overflow-y: auto; padding-bottom: 2px; }
}

/* ---------- Syntax highlighting (hljs tokens, mapped onto existing tokens) ---------- */
.hljs-comment, .hljs-quote { color: var(--ink-3); font-style: italic; }
.hljs-string, .hljs-doctag, .hljs-addition { color: var(--phos); }
.hljs-number, .hljs-literal { color: var(--amber); }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-section, .hljs-name, .hljs-selector-id { color: #7aa2ff; }
.hljs-keyword, .hljs-built_in, .hljs-type, .hljs-selector-tag { color: var(--ink); font-weight: 600; }
.hljs-symbol, .hljs-variable, .hljs-template-variable, .hljs-attr, .hljs-attribute, .hljs-params { color: var(--ink-2); }
.hljs-meta { color: var(--ink-3); }
.hljs-deletion { color: var(--sig); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ---------- Code figure chrome ---------- */
.wu-article figure.wu-code {
  margin: 0 0 20px;
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.wu-code figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--wire);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 11px;
}
.wu-code-title { color: var(--ink-2); }
.wu-code-lang {
  margin-right: auto;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.wu-code-output .wu-code-lang { color: var(--ink-3); }
.wu-code figcaption .wu-copy { padding: 3px 9px; font-size: 10.5px; }

.wu-code pre {
  margin: 0;
  padding: 14px 0;
  background: none;
  border: none;
  border-radius: 0;
  overflow-x: auto;
}
.wu-code pre code {
  display: block;
  padding: 0;
  font-size: 12.75px;
  line-height: 1.65;
  color: var(--ink-2);
}

.wu-line { display: flex; }
.wu-ln {
  flex: 0 0 auto;
  width: 2.4em;
  padding-right: 1em;
  text-align: right;
  color: var(--wire-strong);
  user-select: none;
}
.wu-lc { flex: 1 1 auto; white-space: pre; }
.wu-code-output pre code { padding: 0 18px; }

.wu-code.is-collapsible pre { max-height: 320px; overflow-y: hidden; position: relative; }
.wu-code.is-collapsible pre::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 56px;
  background: linear-gradient(to bottom, transparent, var(--panel));
  pointer-events: none;
}
.wu-code.is-expanded pre { max-height: none; }
.wu-code.is-expanded pre::after { display: none; }
.wu-code-more {
  display: block;
  width: 100%;
  padding: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: var(--panel-2);
  border: none;
  border-top: 1px solid var(--wire);
  cursor: pointer;
  transition: color 0.2s ease;
}
.wu-code-more:hover { color: var(--ink); }

/* ---------- Annotated code (::: annotate) ---------- */
.wu-annotate { margin: 0 0 20px; display: grid; gap: 12px; }
.wu-annotate .wu-code { margin: 0; }
.wu-line-marked .wu-ln { color: var(--sig); font-weight: 700; }
.wu-line-marked { background: var(--sig-soft); }
.wu-line-marked.is-focused { background: var(--sig-line); }
.wu-annotate-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wu-annotate-note {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.wu-annotate-note:hover, .wu-annotate-note.is-focused { border-color: var(--sig-line); background: var(--panel-2); }
.wu-annotate-ln {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--sig);
  border: 1px solid var(--sig-line);
  background: var(--sig-soft);
  border-radius: var(--radius);
  padding: 1px 6px;
  height: fit-content;
}
.wu-annotate-text { color: var(--ink-2); }
.wu-annotate-text code { font-size: 0.88em; }

/* ---------- Admonitions ---------- */
.wu-admon {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--wire);
  border-left: 3px solid var(--wire-strong);
  border-radius: var(--radius);
  background: var(--panel);
}
.wu-admon-h {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.wu-admon > *:last-child { margin-bottom: 0; }
.wu-admon-insight { border-left-color: var(--phos); }
.wu-admon-insight .wu-admon-h { color: var(--phos); }
.wu-admon-pitfall { border-left-color: var(--sig); }
.wu-admon-pitfall .wu-admon-h { color: var(--sig); }
.wu-admon-note { border-left-color: var(--amber); }
.wu-admon-note .wu-admon-h { color: var(--amber); }

/* ---------- Spoiler ---------- */
.wu-spoiler {
  margin: 0 0 20px;
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0;
}
.wu-spoiler summary {
  cursor: pointer;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wu-spoiler summary::-webkit-details-marker { display: none; }
.wu-spoiler summary::before { content: '\25B8'; color: var(--sig); transition: transform 0.15s ease; }
.wu-spoiler[open] summary::before { transform: rotate(90deg); }
.wu-spoiler summary:hover { color: var(--sig); }
.wu-spoiler-body { padding: 0 16px 16px; }
.wu-spoiler-body > *:first-child { margin-top: 0; }
.wu-spoiler-body > *:last-child { margin-bottom: 0; }

/* ---------- Steps (::: steps) ---------- */
.wu-steps { margin: 0 0 20px; }
.wu-steps-nav { display: none; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.wu-step-dot {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--wire-strong);
  background: var(--panel);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.wu-step-dot:hover { color: var(--ink); }
.wu-step-dot[aria-selected="true"] { color: var(--void); background: var(--sig); border-color: var(--sig); }
.wu-step-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: 1.02rem; }
.wu-step-num { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.wu-steps-controls { display: none; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.wu-step-prev, .wu-step-next, .wu-step-showall {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--wire-strong);
  border-radius: var(--radius);
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.wu-step-prev:hover, .wu-step-next:hover, .wu-step-showall:hover { color: var(--ink); border-color: var(--sig); }
.wu-step-prev:disabled, .wu-step-next:disabled { opacity: 0.4; cursor: default; border-color: var(--wire); color: var(--ink-3); }
html.js .wu-steps.is-enhanced .wu-steps-nav,
html.js .wu-steps.is-enhanced .wu-steps-controls { display: flex; }
html.js .wu-steps.is-enhanced .wu-step:not(.is-current) { display: none; }
html.js .wu-steps.is-enhanced.is-all .wu-step { display: block; }
html.js .wu-steps.is-enhanced.is-all .wu-steps-nav { display: none; }

/* ---------- Tabs (::: tabs) ---------- */
.wu-tabs { margin: 0 0 20px; }
.wu-tabs-nav { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--wire); margin-bottom: 16px; }
.wu-tab {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.wu-tab:hover { color: var(--ink); }
.wu-tabs.is-enhanced .wu-tab.is-current { color: var(--ink); border-bottom-color: var(--sig); }
.wu-tabs.is-enhanced .wu-tabpanel:not(.is-current) { display: none; }
.wu-tabs:not(.is-enhanced) .wu-tabpanel { padding-top: 8px; border-top: 1px dashed var(--wire); margin-top: 8px; }
.wu-tabs:not(.is-enhanced) .wu-tabpanel:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* ---------- Session replay terminal ---------- */
.wu-session {
  margin: 0 0 20px;
  border: 1px solid var(--wire);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.wu-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--wire);
  background: var(--panel-2);
}
.wu-session-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.wu-session-replay {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  background: none;
  border: 1px solid var(--wire-strong);
  border-radius: var(--radius);
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.wu-session-replay:hover { color: var(--ink); border-color: var(--sig); }
html:not(.js) .wu-session-replay { display: none; }
.wu-session-body {
  margin: 0;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 12.75px;
  line-height: 1.7;
  overflow-x: auto;
}
.wu-term-line { display: block; white-space: pre; }
.wu-term-line[data-kind="out"] { color: var(--ink-2); }
.wu-term-prompt { color: var(--amber); margin-right: 8px; }
.wu-term-cmd { color: var(--ink); }
.wu-session.is-replaying .wu-session-body { position: relative; }

/* ---------- Glossary tooltips ---------- */
.wu-gloss {
  font: inherit;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px dotted var(--ink-3);
  padding: 0;
  cursor: help;
  position: relative;
}
.wu-gloss:hover, .wu-gloss:focus-visible { border-bottom-color: var(--sig); color: var(--sig); }
.wu-gloss-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--panel-2);
  border: 1px solid var(--wire-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.wu-gloss[data-open="true"] .wu-gloss-pop,
.wu-gloss:hover .wu-gloss-pop,
.wu-gloss:focus-visible .wu-gloss-pop { opacity: 1; transform: translateY(0); }

@media (max-width: 620px) {
  .wu-steps-controls { flex-wrap: wrap; }
  .wu-code.is-collapsible pre { max-height: 260px; }

  /* A term can sit anywhere in the flowing text, so a fixed-offset floating
     tooltip risks running off either edge of a narrow viewport. Pin it as a
     small sheet along the bottom instead - width is never in question. */
  .wu-gloss-pop {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    top: auto;
    width: auto;
    max-width: none;
    transform: translateY(6px);
  }
  .wu-gloss[data-open="true"] .wu-gloss-pop,
  .wu-gloss:hover .wu-gloss-pop,
  .wu-gloss:focus-visible .wu-gloss-pop { transform: translateY(0); }
}
