/* Pikkola WebSocket: a dark console in a paper room, one amber lamp for the wire
   Weights stay between 400 and 700; the corner radius, the accent and the
   workbench layout are this tool's own. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/tools/websocket/fonts/inter.woff2) format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/tools/websocket/fonts/jetbrains-mono.woff2) format("woff2");
}

:root {
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --r: 6px;
  --r-sm: 4px;
}
html[lang="ko"] {
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
}
html[lang="ja"] {
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  word-break: normal;
}

html[data-theme="light"] {
  --bg: #f2f1ec;
  --bg-2: #e9e8e1;
  --surface: #fbfaf6;
  --surface-2: #f3f2ec;
  --ink: #16181a;
  --ink-2: #434649;
  --ink-3: #787b7c;
  --line: #dadad2;
  --line-2: #c6c7bd;
  --accent: #8a5209;
  --accent-ink: #fff8ec;
  --accent-soft: #f1e3cc;
  --hot: #a23a2a;
  --hot-soft: #f3ddd7;
  --ok: #2c6b4b;
  --ok-soft: #dcefe4;
  --shadow: 0 1px 2px rgba(20, 22, 20, .05), 0 18px 40px -28px rgba(20, 22, 20, .35);
  --tk-c: #8c8f8a;
  --tk-t: #8a5209;
  --tk-k: #7a4a0c;
  --tk-s: #8a5a1a;
  --tk-n: #a23a2a;
  --tk-p: #5c4ba8;
}
html[data-theme="dark"] {
  --bg: #0d100f;
  --bg-2: #121614;
  --surface: #151a17;
  --surface-2: #1b211d;
  --ink: #e8e6dc;
  --ink-2: #b4b6ac;
  --ink-3: #858a83;
  --line: #2a312c;
  --line-2: #3c453d;
  --accent: #e5a34a;
  --accent-ink: #1d1405;
  --accent-soft: #33260f;
  --hot: #e2907a;
  --hot-soft: #3b211a;
  --ok: #84d6a8;
  --ok-soft: #14301f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 50px -30px rgba(0, 0, 0, .8);
  --tk-c: #6d7a72;
  --tk-t: #e5a34a;
  --tk-k: #e5a34a;
  --tk-s: #d8b07a;
  --tk-n: #e2907a;
  --tk-p: #b6a6ee;
}

/* ------------------------------------------------------- the workbench kit */
/* Shared by every tool of this batch: a left panel of inputs, a right panel
   that holds the result, and the small pieces either panel is made of. Each
   tool re-skins the surface and the corner radius in its own stylesheet. */

.bench { margin-top: 18px; }
.bench-grid {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  gap: 16px;
  align-items: start;
}
.opts {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}
.opt-group { display: grid; gap: 8px; min-width: 0; }
.opt-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.opt-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 48ch;
}
.field-block { display: grid; gap: 5px; min-width: 0; }
.field-block > span { font-size: 11.5px; color: var(--ink-2); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.text-input {
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  min-width: 0;
}
.text-input::placeholder { color: var(--ink-3); opacity: .8; }
.text-input:hover { border-color: var(--accent); }
.text-input:focus-visible { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea.text-input { resize: vertical; min-height: 96px; }
.text-area {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 9px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.text-area:hover { border-color: var(--accent); }
.text-area:focus-visible { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.opts-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.btn {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-sm);
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.mini {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: calc(var(--r-sm) - 2px);
  font-size: 11.5px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
}
.mini:hover { border-color: var(--accent); color: var(--accent); }
.mini:disabled { opacity: .45; cursor: default; border-color: var(--line); }
.res-facts {
  margin: 0;
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.res-facts div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.res-facts dt { font-size: 12px; color: var(--ink-2); }
.res-facts dd { margin: 0; font-size: 15px; color: var(--ink); font-family: var(--mono); }
.verdict { margin: 0; min-height: 18px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--hot); }
.note-line { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); max-width: 74ch; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc-table th {
  text-align: left;
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  white-space: nowrap;
}
.doc-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.55; }
.doc-table tr:last-child td { border-bottom: 0; }
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 16px 6px;
}
.adv {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 10px 12px 12px;
}
.adv summary { cursor: pointer; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.adv summary:hover { color: var(--accent); }
.adv[open] summary { margin-bottom: 12px; }
.adv .opt-group { gap: 10px; }
.stack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stack {
  text-align: left;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  padding: 8px 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
}
.stack:hover { border-color: var(--accent); color: var(--accent); }
.stack.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.pick { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.chip.pick.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }
.mono { font-family: var(--mono); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 40;
  max-width: min(88vw, 480px);
  text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
pre.code-out {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.66;
  white-space: pre;
  color: var(--ink);
  tab-size: 2;
}
.code-out.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.scroll-y { overflow: auto; min-height: 0; }
.sr-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }


/* ------------------------------------------------------------ the document */

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.022em; line-height: 1.16; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  font-size: 13px;
  text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(10px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--bg); }
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 62px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.brand-mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand-name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.015em; }
.brand-tool {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 2px 6px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 10px;
}
.site-nav a {
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.lang-field { position: relative; display: inline-flex; align-items: center; }
.lang-globe { position: absolute; left: 8px; width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
#langSelect {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 7px;
  font-size: 12px;
  padding: 6px 8px 6px 26px;
  cursor: pointer;
}
#langSelect:hover { border-color: var(--accent); color: var(--ink); }
.icon-btn {
  width: 32px; height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
.ico-sun { display: none; }
html[data-theme="dark"] .ico-sun { display: block; }
html[data-theme="dark"] .ico-moon { display: none; }

/* -------------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 56px;
  align-items: start;
  padding-top: 66px;
  padding-bottom: 58px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: .55;
}
.hero h1 {
  font-size: clamp(2.05rem, 4.05vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: -0.038em;
  max-width: 17ch;
}
.hero-lede {
  margin-top: 20px;
  font-size: 15.5px;
  line-height: 1.66;
  color: var(--ink-2);
  max-width: 52ch;
}
.facts {
  display: flex;
  gap: 30px;
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 440px;
}
.facts dt {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.facts dd {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hero-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-card-head,
.hero-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
}
.hero-card-head { border-bottom: 1px solid var(--line); }
.hero-card-foot { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-card-foot svg { width: 15px; height: 15px; color: var(--accent); }
.hero-card-body {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.72;
  white-space: pre;
  overflow-x: auto;
  color: var(--ink);
}
.tk-c { color: var(--tk-c); font-style: italic; }
.tk-t, .tk-k { color: var(--tk-k); }
.tk-s { color: var(--tk-s); }
.tk-n { color: var(--tk-n); }
.tk-p { color: var(--tk-p); }

/* ------------------------------------------------------------------ section */

.section {
  padding: 62px 0;
  border-top: 1px solid var(--line);
}
.section-head { max-width: 70ch; }
.section-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  letter-spacing: -0.028em;
}
.section-lede {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 66ch;
}
.section-note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 62ch;
}

/* ------------------------------------------------------------------ studio */

.studio { background: var(--bg-2); }
.studio-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.studio-head .eyebrow { margin-bottom: 12px; }
.options {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}
.field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.field select {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12.5px;
  cursor: pointer;
}
.field select:hover { border-color: var(--accent); }
.field.toggle input {
  appearance: none;
  width: 30px; height: 17px;
  border-radius: 999px;
  background: var(--line-2);
  border: 0;
  position: relative;
  cursor: pointer;
  transition: background .16s ease;
  flex: none;
}
.field.toggle input::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .16s ease;
}
.field.toggle input:checked { background: var(--accent); }
.field.toggle input:checked::after { transform: translateX(13px); }
.field.toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 620px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.pane-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.pane-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  background: var(--bg-2);
}
.tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 25, 23, .12);
}
.grow { flex: 1; }
.mini {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 6px;
  font-size: 11.5px;
  padding: 5px 10px;
  cursor: pointer;
}
.mini:hover { border-color: var(--accent); color: var(--accent); }
.mini:disabled { opacity: .45; cursor: default; border-color: var(--line); }

.preset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.ghost { border-style: dashed; color: var(--ink-3); }

.editor-shell {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}
.gutter {
  flex: none;
  width: 48px;
  padding: 14px 6px 14px 0;
  overflow: hidden;
  text-align: right;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 22px;
  color: var(--ink-3);
  user-select: none;
}
.gutter .g-line { display: block; padding-right: 4px; }
.gutter .g-line.err {
  color: var(--hot);
  font-weight: 700;
  box-shadow: inset 2px 0 0 var(--hot);
}
#srcInput,
#auditInput {
  flex: 1;
  min-width: 0;
  min-height: 380px;
  border: 0;
  outline: none;
  resize: none;
  padding: 14px 16px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 22px;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
#srcInput::placeholder,
#auditInput::placeholder { color: var(--ink-3); }
#srcInput:focus-visible,
#auditInput:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }

.pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
  min-height: 36px;
}
.validation-state.ok { color: var(--ok); }
.validation-state.bad { color: var(--hot); }
.hint-text { color: var(--ink-3); text-align: right; }

.out {
  flex: 1;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px 16px;
  background: var(--surface);
}
pre.code {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.68;
  white-space: pre;
  color: var(--ink);
}
.empty {
  color: var(--ink-3);
  font-size: 13px;
  max-width: 48ch;
  line-height: 1.6;
}

.issues-band {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 16px 10px;
}
.issues-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.issues-head h2 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-2);
}
.issue-summary { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.issue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.issue { margin: 0; }
.issue-btn {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  padding: 7px 6px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.issue-btn:hover { background: var(--surface-2); }
.issue-sev {
  flex: none;
  min-width: 54px;
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.issue.error .issue-sev { color: var(--hot); }
.issue.warning .issue-sev { color: var(--tk-s); }
.issue-at { flex: none; min-width: 58px; font-size: 11px; color: var(--ink-3); }
.issue-msg { flex: 1; min-width: 0; }
.issue-ok {
  margin: 10px 0 6px;
  font-size: 13px;
  color: var(--ink-3);
}
.issue-ok.good { color: var(--ok); }

.privacy-strip {
  margin-top: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
}
.privacy-strip svg { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 2px; }
.privacy-strip strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.privacy-strip p { font-size: 12.5px; color: var(--ink-2); max-width: 74ch; }

/* ------------------------------------------------------------------- cards */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 20px 20px 18px;
}
.card .num {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 16px;
}
.card h3 { font-size: 15.5px; margin-bottom: 8px; }
.card p { font-size: 13.5px; color: var(--ink-2); }

/* -------------------------------------------------------------- rule list */

.rule-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.rule {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
}
.rule .sev {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--accent);
  padding-top: 3px;
}
.rule b { font-weight: 600; font-size: 14.5px; display: block; }
.rule .why {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-2);
  max-width: 76ch;
}

/* --------------------------------------------------------------------- faq */

.faq-list { margin-top: 22px; border-top: 1px solid var(--line); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  padding: 15px 0;
  font-size: 15px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  width: 14px;
  flex: none;
}
.faq[open] summary::before { content: "−"; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.faq p {
  margin: 0 0 18px 24px;
  font-size: 13.5px;
  color: var(--ink-2);
  max-width: 78ch;
}

/* ----------------------------------------------------------------- related */

.related {
  padding: 48px 0 62px;
  border-top: 1px solid var(--line);
}
.related-head h2 { font-size: 15px; letter-spacing: -0.01em; }
.related-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.related-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease;
}
.related-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-tag {
  font-size: 9.5px;
  letter-spacing: .12em;
  color: var(--accent);
}
.related-title { display: block; font-size: 14.5px; font-weight: 600; margin: 6px 0 4px; }
.related-body { display: block; font-size: 12.5px; color: var(--ink-2); }

/* ------------------------------------------------------------------ footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 40px 0 44px;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, .6fr));
  gap: 28px 32px;
  align-items: start;
}
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { font-size: 12.5px; color: var(--ink-2); max-width: 40ch; }
.footer-links h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 10px;
}
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-links a { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-note {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------ plain pages */

.doc { max-width: 74ch; padding: 54px 0 70px; }
.doc h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.03em; margin-bottom: 8px; }
.doc .updated {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 22px;
}
.doc-lede { font-size: 16px; color: var(--ink-2); margin-bottom: 26px; }
.doc h2 {
  font-size: 17px;
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.doc p, .doc li { font-size: 14px; color: var(--ink-2); }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.doc a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.doc a:hover { border-bottom-color: var(--accent); }
.doc-foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.doc code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.notfound { padding: 90px 0 110px; max-width: 60ch; }
.notfound h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 12px; }
.notfound p { color: var(--ink-2); font-size: 15px; margin-bottom: 24px; }
.btn {
  display: inline-block;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  border: 1px solid var(--line-2);
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* --------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 48px; }
  .hero h1 { max-width: 22ch; }
  .hero-card { max-width: 620px; }
  .studio-grid { grid-template-columns: 1fr; }
  .pane { height: 520px; }
  .cards { grid-template-columns: 1fr; }
  .related-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .header-inner { height: 56px; gap: 14px; }
  .site-nav { display: none; }
  .section { padding: 46px 0; }
  .hero { padding-top: 36px; padding-bottom: 40px; }
  .hero-lede { font-size: 14.5px; }
  .facts { gap: 22px; }
  .pane { height: 460px; }
  #srcInput,
#auditInput { min-height: 0; font-size: 12px; }
  .gutter { width: 38px; font-size: 11px; }
  .rule { grid-template-columns: 66px minmax(0, 1fr); gap: 12px; }
  .faq p { margin-left: 0; }
  .doc { padding: 36px 0 52px; }
  .footer-inner { grid-template-columns: 1fr; }
  .issue-btn { flex-wrap: wrap; gap: 4px 8px; }
  .issue-msg { flex-basis: 100%; }
  .studio-head { gap: 16px; }
}

/* field guide: long-form reading below the tool */
.fieldguide { padding-top: 64px; padding-bottom: 24px; border-top: 1px solid var(--line); }
.fieldguide .fg-head { max-width: 720px; }
.fieldguide h2 { margin: 10px 0 0; font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.028em; line-height: 1.18; }
.fieldguide .fg-lede { margin: 12px 0 0; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.fieldguide .fg-body { max-width: 760px; margin-top: 22px; }
.fieldguide h3 { margin: 30px 0 0; font-size: 17px; letter-spacing: -0.012em; }
.fieldguide p { margin: 12px 0 0; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.fieldguide ul, .fieldguide ol { margin: 12px 0 0; padding-left: 22px; }
.fieldguide li { margin-top: 8px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.fieldguide code { font-family: var(--mono); font-size: 0.86em; }
.fieldguide .fg-table { margin-top: 16px; overflow-x: auto; }
.fieldguide table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fieldguide th, .fieldguide td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.55; }
.fieldguide th { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.fieldguide .fg-next { margin-top: 28px; font-size: 14.5px; line-height: 1.7; }
@media (max-width: 640px) { .fieldguide { padding-top: 44px; } }


/* the hidden attribute has to win over any display rule a tool sets */
[hidden] { display: none !important; }


/* ------------------------------------------------------------------ skin */

/* the console: a dark bench in a paper room, one amber lamp for the wire */
.ws-bench { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: start; }
 .ws-panel { background: var(--surface); }
.hero-card { background: #0e1310; border-color: #26312b; box-shadow: 0 24px 60px -40px rgba(0, 0, 0, .55); }
.hero-card-head, .hero-card-foot { color: #9fae9f; border-color: #26312b; }
.hc-spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; margin-left: auto; margin-right: 6px; }
.hc-spark i { display: block; width: 3px; background: #d9a25a; opacity: .7; height: 30%; }
.hc-spark i:nth-child(2) { height: 46%; }
.hc-spark i:nth-child(3) { height: 22%; }
.hc-spark i:nth-child(4) { height: 64%; }
.hc-spark i:nth-child(5) { height: 38%; }
.hc-spark i:nth-child(6) { height: 80%; }
.hc-spark i:nth-child(7) { height: 46%; }
.hc-spark i:nth-child(8) { height: 58%; }
.ws-connect { gap: 10px; }
.ws-connect .btn { flex: 1 1 0; }
.ws-send-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ws-send-row .field { margin-left: auto; }
.ws-send-row .field span { max-width: 18ch; line-height: 1.35; }
.ws-state {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 11px;
  justify-content: center;
}
.ws-state::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3);
}
.ws-state.open { color: var(--ok); border-color: var(--ok); }
.ws-state.open::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.ws-state.sim { color: var(--accent); border-color: var(--accent); }
.ws-state.sim::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ws-state.error { color: var(--hot); border-color: var(--hot); }
.ws-state.error::before { background: var(--hot); }
.ws-facts dd { font-size: 13px; }
.ws-pane { height: 620px; }
.ws-filter {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.ws-filter .text-input { flex: 1 1 0; font-family: var(--sans); font-size: 12px; }
.ws-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ws-list {
  list-style: none;
  margin: 0;
  padding: 6px 8px 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.ws-row {
  display: grid;
  grid-template-columns: 84px 18px minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: baseline;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
  border-left: 2px solid transparent;
  font-size: 12px;
}
.ws-row:hover { background: var(--surface-2); }
.ws-row.on { background: var(--accent-soft); border-left-color: var(--accent); }
.ws-row .ws-time { color: var(--ink-3); font-size: 10.5px; font-family: var(--mono); }
.ws-row .ws-arrow { font-family: var(--mono); color: var(--ink-3); text-align: center; }
.ws-row.in .ws-arrow { color: var(--ok); }
.ws-row.out .ws-arrow { color: var(--accent); }
.ws-row.error .ws-arrow { color: var(--hot); }
.ws-row .ws-body { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; color: var(--ink); }
.ws-row .ws-kind {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 4px;
  margin-right: 6px;
}
.ws-row .ws-size { font-family: var(--mono); font-size: 10px; color: var(--ink-3); text-align: right; }
.ws-empty { padding: 18px; }
.ws-raw { padding: 14px 16px; overflow: auto; flex: 1; min-height: 0; }
.ws-raw .meta { display: grid; gap: 4px; margin-bottom: 12px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.ws-raw .meta b { color: var(--ink-3); font-weight: 400; display: inline-block; min-width: 74px; }
.ws-raw pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; line-height: 1.65; }
.ws-count { font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; }
.hc-list { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 10px; background: #101411; }
.hc-list li { display: grid; grid-template-columns: 82px 40px minmax(0, 1fr) 40px; gap: 8px; align-items: baseline; font-size: 11px; }
.hc-list code { font-family: var(--mono); color: #dfe6da; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-list .hc-t { color: #7f8a80; font-size: 10px; }
.hc-list .hc-dir { font-size: 9px; letter-spacing: .1em; color: #d9a25a; }
.hc-list li.hc-recv .hc-dir { color: #7fc79c; }
.hc-list .hc-n { text-align: right; color: #6f7a70; font-size: 9.5px; }
.hc-list li.hc-hb { opacity: .75; }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; background: #7fc79c; box-shadow: 0 0 0 3px rgba(127, 199, 156, .18); }
@media (max-width: 1080px) {
  .ws-bench { grid-template-columns: minmax(0, 1fr); }
  .ws-pane { height: 560px; }
}
@media (max-width: 720px) {
  .ws-pane { height: 480px; }
  .ws-row { grid-template-columns: 68px 14px minmax(0, 1fr); }
  .ws-row .ws-size { display: none; }
}
