:root {
  --wb-accent: hsl(var(--mumu-brand));
  --wb-surface: hsl(var(--mumu-bg));
  --wb-subtle: hsl(var(--mumu-bg-subtle));
  --wb-text: hsl(var(--mumu-text));
  --wb-muted: hsl(var(--mumu-text-secondary));
  --wb-line: hsl(var(--mumu-border));
  --wb-danger: #b42318;
  --wb-success: #067647;
}

* { box-sizing: border-box; }

.wb {
  width: min(100% - 2rem, 80rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 5rem;
  color: var(--wb-text);
}

.wb-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(17rem, 0.55fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--wb-line);
}

.wb-kicker,
.wb-label {
  margin: 0 0 0.8rem;
  color: var(--wb-muted);
  font-family: var(--mumu-font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.wb-title {
  max-width: 13ch;
  margin: 0;
  font-family: var(--mumu-font-serif);
  font-size: clamp(2.7rem, 7vw, 6.2rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.wb-lede {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  color: var(--wb-muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.wb-boundary {
  border: 1px solid var(--wb-line);
  background: var(--wb-subtle);
  padding: 1.25rem;
}

.wb-boundary dl { margin: 0; }
.wb-boundary div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--wb-line);
}
.wb-boundary div:first-child { border-top: 0; padding-top: 0; }
.wb-boundary div:last-child { padding-bottom: 0; }
.wb-boundary dt {
  color: var(--wb-muted);
  font-family: var(--mumu-font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}
.wb-boundary dd { margin: 0; font-size: 0.88rem; line-height: 1.5; }

.wb-statusbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--wb-line);
  color: var(--wb-muted);
  font-family: var(--mumu-font-mono);
  font-size: 0.75rem;
}
.wb-statusbar strong { color: var(--wb-text); }

.wb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 34rem;
  border-bottom: 1px solid var(--wb-line);
}

.wb-panel { min-width: 0; padding: clamp(1.3rem, 3vw, 2.25rem) 0; }
.wb-panel:first-child {
  padding-right: clamp(1.3rem, 3vw, 2.25rem);
  border-right: 1px solid var(--wb-line);
}
.wb-panel:last-child { padding-left: clamp(1.3rem, 3vw, 2.25rem); }

.wb-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1.25rem;
}
.wb-panel h2 { margin: 0; font-size: 1.15rem; }
.wb-count { color: var(--wb-muted); font-family: var(--mumu-font-mono); font-size: 0.73rem; }

.wb-field { display: block; margin-bottom: 1rem; }
.wb-field span {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.84rem;
  font-weight: 750;
}
.wb-field small { color: var(--wb-muted); font-weight: 450; }

.wb textarea,
.wb input,
.wb select {
  width: 100%;
  border: 1px solid var(--wb-line);
  border-radius: 0;
  background: var(--wb-surface);
  color: var(--wb-text);
  padding: 0.8rem 0.9rem;
  line-height: 1.55;
}
.wb textarea { min-height: 18rem; resize: vertical; }
.wb textarea.wb-short { min-height: 6.5rem; }
.wb :where(textarea, input, select):focus {
  border-color: var(--wb-accent);
  outline: 3px solid hsl(var(--mumu-brand) / 0.16);
  outline-offset: 0;
}

.wb-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.wb-button {
  min-height: 2.8rem;
  border: 1px solid var(--wb-text);
  border-radius: 0;
  background: var(--wb-text);
  color: var(--wb-surface);
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, opacity 180ms ease;
}
.wb-button:hover { transform: translateY(-1px); }
.wb-button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.wb-button--secondary {
  border-color: var(--wb-line);
  background: transparent;
  color: var(--wb-text);
}

.wb-output {
  min-height: 22rem;
  border: 1px solid var(--wb-line);
  background: var(--wb-subtle);
  padding: clamp(1rem, 2.5vw, 1.6rem);
}
.wb-empty {
  display: grid;
  min-height: 19rem;
  place-items: center;
  color: var(--wb-muted);
  text-align: center;
}
.wb-empty p { max-width: 24rem; margin: 0; line-height: 1.65; }
.wb-result h3 { margin: 1.35rem 0 0.45rem; font-size: 0.96rem; }
.wb-result h3:first-child { margin-top: 0; }
.wb-result p, .wb-result li { line-height: 1.65; }
.wb-result ul { margin: 0.5rem 0 0; padding-left: 1.15rem; }
.wb-result pre {
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  color: var(--wb-text);
  font-family: var(--mumu-font-sans);
  font-size: 0.91rem;
  line-height: 1.75;
}

.wb-alert {
  margin-bottom: 1rem;
  border-left: 3px solid var(--wb-accent);
  background: hsl(var(--mumu-brand) / 0.08);
  padding: 0.8rem 0.95rem;
  font-size: 0.86rem;
  line-height: 1.55;
}
.wb-alert--error { border-color: var(--wb-danger); background: #b423180c; }
.wb-alert--success { border-color: var(--wb-success); background: #0676470c; }

.wb-table-wrap { overflow-x: auto; }
.wb-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.wb-table th, .wb-table td {
  border-bottom: 1px solid var(--wb-line);
  padding: 0.7rem 0.45rem;
  text-align: left;
  vertical-align: top;
}
.wb-table th {
  color: var(--wb-muted);
  font-family: var(--mumu-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wb-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--wb-line);
}
.wb-proof article { padding: 1.5rem; border-left: 1px solid var(--wb-line); }
.wb-proof article:first-child { border-left: 0; padding-left: 0; }
.wb-proof h2 { margin: 0 0 0.55rem; font-size: 0.96rem; }
.wb-proof p { margin: 0; color: var(--wb-muted); font-size: 0.86rem; line-height: 1.6; }

.wb-related { padding-top: 2rem; }
.wb-related h2 { font-size: 1rem; }
.wb-related-links { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.wb-related a {
  border-bottom: 1px solid var(--wb-line);
  color: var(--wb-text);
  padding: 0.5rem 0;
  text-decoration: none;
}
.wb-related a:hover { border-color: var(--wb-accent); color: var(--wb-accent); }

@media (max-width: 760px) {
  .wb { width: min(100% - 1.25rem, 80rem); padding-top: 2rem; }
  .wb-hero, .wb-grid { grid-template-columns: 1fr; }
  .wb-title { font-size: clamp(2.6rem, 15vw, 4.7rem); }
  .wb-panel:first-child {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--wb-line);
  }
  .wb-panel:last-child { padding-left: 0; }
  .wb textarea { min-height: 14rem; }
  .wb-proof { grid-template-columns: 1fr; }
  .wb-proof article,
  .wb-proof article:first-child {
    padding: 1.25rem 0;
    border-left: 0;
    border-top: 1px solid var(--wb-line);
  }
  .wb-proof article:first-child { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wb-button { transition: none; }
}
