:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --surface-3: #e8eaee;
  --ink: #15171c;
  --muted: #5b6270;
  --line: #e7e9ee;
  --line-strong: #cdd1d9;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #ecf7f5;
  --ok: #15803d;
  --ok-soft: #e3f6ea;
  --partial: #92400e;
  --partial-soft: #fdf1cf;
  --danger: #b91c1c;
  --focus: #0284c7;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  --font-out: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Segoe UI Symbol', 'Segoe UI Historic', 'Noto Sans Math', 'STIX Two Math', 'Cambria Math', 'Apple Symbols', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #111318;
  --surface: #171a20;
  --surface-2: #1d2129;
  --surface-3: #2b313c;
  --ink: #eceef2;
  --muted: #a3abb9;
  --line: #242932;
  --line-strong: #3b4250;
  --accent: #2dd4bf;
  --accent-ink: #042f2e;
  --accent-soft: #11302c;
  --ok: #4ade80;
  --ok-soft: #10301d;
  --partial: #fbbf24;
  --partial-soft: #35280d;
  --danger: #fca5a5;
  --focus: #38bdf8;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111318;
    --surface: #171a20;
    --surface-2: #1d2129;
    --surface-3: #2b313c;
    --ink: #eceef2;
    --muted: #a3abb9;
    --line: #242932;
    --line-strong: #3b4250;
    --accent: #2dd4bf;
    --accent-ink: #042f2e;
    --accent-soft: #11302c;
    --ok: #4ade80;
    --ok-soft: #10301d;
    --partial: #fbbf24;
    --partial-soft: #35280d;
    --danger: #fca5a5;
    --focus: #38bdf8;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::placeholder { color: var(--muted); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 30; border-radius: 8px; }
.skip:focus { left: 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -0.02em; font-size: 1.02rem; flex: none; }
.brand-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font: 800 0.76rem/1 var(--font); letter-spacing: -0.03em; }
.brand b { font-weight: inherit; }
.header-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nav { display: flex; gap: 2px; flex-wrap: nowrap; font-size: 0.9rem; min-width: 0; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transition: background 0.12s, color 0.12s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current='page'] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.theme-btn { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; background: none; color: var(--muted); border-radius: 10px; cursor: pointer; transition: color 0.12s, background 0.12s; }
.theme-btn:hover { color: var(--ink); background: var(--surface-2); }
.theme-btn .ico-moon { display: none; }
.theme-btn[data-current-theme='dark'] .ico-sun { display: none; }
.theme-btn[data-current-theme='dark'] .ico-moon { display: block; }
.disclaimer-bar { max-width: 1120px; margin: 0 auto; font-size: 0.74rem; color: var(--muted); padding: 10px 24px 0; }

/* Page typography */
main { padding: 24px 0 72px; }
main .wrap > h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.1; margin: 0 0 8px; letter-spacing: -0.03em; font-weight: 760; }
.lede { color: var(--muted); margin: 0 0 22px; font-size: 1.02rem; line-height: 1.5; max-width: 64ch; }
h2 { font-size: 1.3rem; margin: 44px 0 10px; letter-spacing: -0.02em; line-height: 1.25; font-weight: 720; }
h3 { font-size: 1.02rem; margin: 20px 0 6px; }
.prose { max-width: 74ch; margin-top: 8px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.prose ol { list-style: none; counter-reset: step; padding-left: 0; display: grid; gap: 10px; }
.prose ol > li { counter-increment: step; position: relative; padding: 1px 0 1px 38px; margin: 0; min-height: 26px; }
.prose ol > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-weight: 650; font-size: 0.84rem; }
.prose code, code.k { font-family: var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
table.data th, table.data td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-weight: 600; font-size: 0.82rem; color: var(--muted); border-bottom-color: var(--line-strong); }
table.data tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.note { font-size: 0.86rem; color: var(--muted); }
.callout { background: var(--surface-2); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }

/* Tool shell: the font generator sits flat on the page, other tools get one quiet frame */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.tool[data-generator] { background: none; border: 0; border-radius: 0; padding: 0; }
.tool-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .tool-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.tool-grid > * { min-width: 0; }
.input-row { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 8px 0; margin-top: -8px; }
.input-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; min-height: 30px; }
.input-head .label { margin: 0; }
.input-head .label, .input-head .btn, .input-head .meter { white-space: nowrap; }
.input-actions { display: flex; align-items: center; gap: 2px; }
textarea.big, input.big { width: 100%; font: 1.08rem/1.4 var(--font); padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); resize: vertical; min-height: 48px; transition: border-color 0.12s, box-shadow 0.12s; }
[data-generator] textarea.big { font-size: 1.2rem; padding: 14px 16px; min-height: 58px; }
textarea.big:hover, input.big:hover { border-color: var(--muted); }
textarea.big:focus, input.big:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.label { display: block; font-weight: 600; font-size: 0.86rem; margin: 0 0 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { flex: none; border: 0; background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 5px 13px; font: 500 0.84rem var(--font); cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; text-decoration: none; transition: background 0.12s, color 0.12s; }
.chip:hover { background: var(--surface-3); }
.chip[aria-pressed='true'], .chip[aria-checked='true'] { background: var(--ink); color: var(--bg); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.meter { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.meter:empty { display: none; }
.meter.over { color: var(--danger); font-weight: 650; }
.search { flex: 1 1 220px; min-width: 0; min-height: 40px; padding: 6px 12px 6px 36px; border: 1px solid transparent; border-radius: 10px; background-color: var(--surface-2); color: var(--ink); font: 0.9rem var(--font); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8291' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; transition: border-color 0.12s, background-color 0.12s; }
.search:focus { border-color: var(--accent); background-color: var(--surface); outline: none; box-shadow: 0 0 0 1px var(--accent); }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 0.84rem; color: var(--muted); }
.toggle input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.select { flex: none; width: 132px; min-width: 0; min-height: 40px; padding: 5px 8px; font: 0.84rem var(--font); border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); color: var(--ink); }
.check-pill { min-height: 40px; padding: 0 4px; cursor: pointer; }
.btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 7px 14px; font: 600 0.88rem var(--font); cursor: pointer; min-height: 38px; transition: border-color 0.12s, background 0.12s; }
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn-sm { min-height: 30px; padding: 3px 9px; font-size: 0.8rem; border-color: transparent; background: none; color: var(--muted); border-radius: 8px; }
.btn-sm:hover { border-color: transparent; color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); border-color: var(--accent); }
.control-box { margin: 12px 0 14px; }
.control-head .label { margin-bottom: 8px; }
.surface-help { font-size: 0.84rem; line-height: 1.45; color: var(--muted); margin: 8px 0 0; max-width: 70ch; }
.surface-help:empty { display: none; }
.filter-bar { margin: 0 0 12px; }
.filter-bar[hidden] { display: none; }
.count-pill { font-size: 0.8rem; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.count-pill:empty { display: none; }

/* Results: a specimen list, sample on the left and its details on the right */
.results { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); container-type: inline-size; }
.row { position: relative; display: flex; align-items: stretch; border-bottom: 1px solid var(--line); transition: background 0.12s; }
.row:hover, .row.is-selected { background: var(--surface-2); }
.row.is-selected { box-shadow: inset 2px 0 0 var(--accent); }
.row.is-copied { background: var(--ok-soft); box-shadow: inset 2px 0 0 var(--ok); }
.row:has(.copy-options[aria-expanded="true"]) { z-index: 1; }
.copy-options { flex: none; width: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 600 1.15rem var(--font); }
.copy-options:hover, .copy-options[aria-expanded="true"] { color: var(--ink); background: var(--surface-2); }
.copy-menu { position: absolute; z-index: 1; inset: calc(100% - 1px) 0 auto auto; width: min(210px, 100%); padding: 4px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.copy-menu button { display: block; width: 100%; padding: 7px 10px; min-height: 38px; text-align: left; color: var(--ink); background: transparent; border: 0; border-radius: 4px; cursor: pointer; font: inherit; }
.copy-menu button:hover, .copy-menu button:focus { background: var(--surface-2); }
.copy-menu [role="group"] { border-top: 1px solid var(--line); margin-top: 3px; }
#df-wrap-label { display: block; padding: 8px 10px 2px; color: var(--muted); font-size: 0.78rem; }
.row[hidden] { display: none; }
.copy { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px 16px; align-items: center; text-align: left; background: none; border: 0; padding: 10px 4px 10px 14px; cursor: pointer; color: var(--ink); min-height: 56px; font: inherit; }
.copy .out { font: 1.22rem/1.3 var(--font-out); overflow-wrap: anywhere; }
.copy .meta { display: flex; gap: 2px 8px; align-items: center; font-size: 0.78rem; color: var(--muted); flex-wrap: wrap; }
.copy .meta .warn:not(.len) { color: var(--muted); font-weight: 400; }
.row.is-copied .copy::after { content: 'Copied'; position: absolute; right: 80px; top: 10px; font: 600 0.78rem var(--font); color: var(--ok); }
@container (min-width: 620px) {
  .copy { grid-template-columns: minmax(0, 1fr) minmax(0, auto) 50px; padding: 10px 0 10px 14px; }
  .copy .out { font-size: 1.32rem; }
  .copy .meta { justify-content: flex-end; text-align: right; max-width: 230px; }
  .copy .meta .warn:not(.len) { flex-basis: 100%; }
  .copy::after, .row.is-copied .copy::after { content: 'Copy'; position: static; font: 600 0.78rem var(--font); color: var(--muted); text-align: right; opacity: 0; transition: opacity 0.12s; }
  .row:hover .copy::after, .copy:focus-visible::after { opacity: 1; }
  .row.is-copied .copy::after { content: 'Copied'; color: var(--ok); opacity: 1; }
}
.dots { display: inline-flex; gap: 3px; align-items: center; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.partial { background: transparent; border: 1.5px solid var(--partial); }
.warn { color: var(--partial); font-weight: 650; }
.len { font-variant-numeric: tabular-nums; }
.len:empty { display: none; }
.len.warn { background: var(--partial-soft); border-radius: 6px; padding: 0 6px; }
.fav { flex: none; width: 44px; border: 0; background: none; color: var(--muted); font-size: 0; cursor: pointer; transition: color 0.12s; }
.fav::before { content: '☆'; font-size: 1.05rem; }
.fav:hover { color: var(--ink); }
.fav[aria-pressed='true'] { color: var(--accent); }
.fav[aria-pressed='true']::before { content: '★'; }
.empty { color: var(--muted); padding: 28px; text-align: center; background: var(--surface-2); border-radius: 12px; margin-top: 12px; }
[data-generator] .tool-grid > div > .note { margin: 12px 0 0; }

/* Preview (neutral simulation, intentionally not Discord's UI) */
.preview { position: sticky; top: 16px; align-self: start; font-size: 0.9rem; }
.pv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.preview h2 { font-size: 0.95rem; margin: 0; letter-spacing: 0; font-weight: 650; }
.pv-tabs { display: flex; gap: 4px; }
.pv-tab { min-height: 28px; padding: 2px 11px; font-size: 0.78rem; }
.pv-active-style { margin: 2px 0 10px; font-size: 0.84rem; color: var(--muted); }
.pv-active-style strong { color: var(--ink); font-weight: 600; }
.pv-stage { --ink: #15171c; --muted: #5b6270; --line: #dfe2e8; --accent: #0f766e; background: #f1f2f5; border-radius: 14px; padding: 4px 0; color: var(--ink); overflow: hidden; }
.pv-phone .pv-stage { max-width: 320px; margin-inline: auto; }
.pv-dark .pv-stage { --ink: #eceef2; --muted: #a3abb9; --line: #2a2f3a; --accent: #2dd4bf; background: #1a1d24; }
.pv { color: var(--ink); padding: 11px 16px 12px 14px; border-left: 2px solid transparent; border-bottom: 1px solid var(--line); transition: border-color 0.15s; }
.pv:last-child { border-bottom: 0; }
.pv .note { color: var(--muted); }
.preview[data-active-surface='message'] .pv[data-pv-card='message'],
.preview[data-active-surface='display-name'] .pv[data-pv-card='display-name'],
.preview[data-active-surface='nickname'] .pv[data-pv-card='nickname'],
.preview[data-active-surface='channel'] .pv[data-pv-card='channel'],
.preview[data-active-surface='role'] .pv[data-pv-card='role'] { border-left-color: var(--accent); }
.pv-lbl { font-size: 0.76rem; color: var(--muted); margin-bottom: 4px; }
.pv-name { font: 650 1.02rem var(--font-out); overflow-wrap: anywhere; }
.pv-msg { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.pv-msg > div:last-child { min-width: 0; }
.pv-av { width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 35%, transparent); display: inline-block; flex: none; }
.pv-text { font-family: var(--font-out); overflow-wrap: anywhere; }
.pv-row { display: flex; gap: 8px; align-items: center; padding: 2px 0; font-family: var(--font-out); overflow-wrap: anywhere; }
.pv-row > span:last-child { min-width: 0; }
.pv-hash { color: var(--muted); font-weight: 700; }
.pv-role { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-family: var(--font-out); overflow-wrap: anywhere; }
.pv-note { margin: 8px 0 0; font-size: 0.78rem; }

/* Toast */
.toast { position: fixed; left: 16px; right: 16px; bottom: 24px; width: fit-content; margin: 0 auto; transform: translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; z-index: 40; font-weight: 550; font-size: 0.92rem; }
.toast.show { opacity: 1; transform: translateY(0); }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); max-width: min(520px, calc(100% - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / 45%); }

/* Markdown preview */
.md { background: #1e1f24; color: #e8e8ea; border-radius: 12px; padding: 14px 16px; min-height: 80px; font: 1rem/1.45 var(--font-out); overflow-wrap: anywhere; }
.md strong { font-weight: 700; }
.md-h1 { font-size: 1.5rem; font-weight: 700; margin: 6px 0 2px; }
.md-h2 { font-size: 1.25rem; font-weight: 700; margin: 6px 0 2px; }
.md-h3 { font-size: 1.05rem; font-weight: 700; margin: 6px 0 2px; }
.md-sub { font-size: 0.78rem; color: #a3a6ad; }
.md-quote { margin: 2px 0; padding-left: 10px; border-left: 4px solid #4e5058; }
.md-pre { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 8px; padding: 10px; font: 0.88rem/1.4 var(--mono); white-space: pre-wrap; margin: 4px 0; }
.md code { font-family: var(--mono); background: #2b2d31; padding: 1px 5px; border-radius: 5px; font-size: 0.9em; }
.md-pre code { background: none; padding: 0; }
.md-spoiler { background: #111214; color: transparent; border-radius: 4px; cursor: pointer; }
.md-spoiler.open, .md-spoiler:focus { background: #3a3c42; color: inherit; }
.md-link { color: #7ab7ff; text-decoration: underline; }
.md-ts { background: #3a3c42; border-radius: 4px; padding: 0 3px; }
.md-list { margin: 2px 0; padding-left: 22px; }
.md-d1 { margin-left: 18px; } .md-d2 { margin-left: 36px; }
.md-blank { height: 0.6em; }
[data-markdown-tool] > .toolbar { gap: 6px; margin: 0 0 16px; }
[data-markdown-tool] > .toolbar .btn { min-height: 36px; padding: 4px 11px; font-size: 0.84rem; border-color: transparent; background: var(--surface-2); }
[data-markdown-tool] > .toolbar .btn:hover { background: var(--surface-3); }

/* ANSI editor */
.ansi-editor { background: #1e1f24; color: #d4d7dc; border-radius: 12px; padding: 14px; font: 0.95rem/1.55 var(--mono); min-height: 150px; white-space: pre-wrap; overflow-wrap: anywhere; border: 2px solid transparent; }
.ansi-editor:focus { border-color: var(--accent); outline: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); cursor: pointer; transition: transform 0.1s; }
.swatch:hover { transform: scale(1.08); }
.swatch:focus-visible { outline-offset: 3px; border-radius: 50%; }
.out-box { width: 100%; font: 0.85rem/1.45 var(--mono); padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); min-height: 90px; }

/* Timestamp */
.ts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.ts-grid label { display: grid; gap: 5px; font-size: 0.86rem; font-weight: 600; }
.ts-grid input, .ts-grid select { font: 1rem var(--font); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); min-height: 42px; min-width: 0; width: 100%; }
.ts-grid input:focus, .ts-grid select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.ts-table { width: 100%; min-width: 42rem; table-layout: fixed; border-collapse: collapse; }
.ts-table th:first-child { width: 28%; }
.ts-table th:nth-child(2) { width: 25%; }
.ts-table th:last-child { width: 5.5rem; }
.ts-table td, .ts-table th { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ts-table th { font-weight: 600; font-size: 0.82rem; color: var(--muted); border-bottom-color: var(--line-strong); }
.ts-table tbody tr:last-child td { border-bottom: 0; }
.ts-table code { font-family: var(--mono); font-size: 0.86rem; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; overflow-wrap: anywhere; }
.ts-table .btn { min-height: 32px; padding: 3px 12px; font-size: 0.82rem; }
#ts-list-format { flex: 0 1 auto; width: auto; max-width: 100%; }
#ts-list { padding: 0; margin: 10px 0; list-style: none; }
#ts-list li { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
#ts-list li span { flex: 1 1 12rem; }
#ts-list li code { overflow-wrap: anywhere; }
#ts-decode-out { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
#ts-decode-out li { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; overflow-wrap: anywhere; }

/* Symbols */
.sym-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.sym { min-width: 44px; min-height: 44px; padding: 6px 12px; font: 1.2rem var(--font-out); border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--ink); cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.sym:hover { border-color: var(--accent); background: var(--accent-soft); }
.sym.is-copied { border-color: var(--ok); background: var(--ok-soft); }

/* Link grids */
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 14px 0; }
.card { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; text-decoration: none; color: var(--ink); transition: border-color 0.12s, background 0.12s; }
.card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.card strong { display: block; font-weight: 600; margin-bottom: 1px; }
.card span { color: var(--muted); font-size: 0.86rem; }
@media (prefers-reduced-motion: reduce) { .toast, .row, .chip, .btn, .nav a, .pv, .card, .swatch, .sym, .copy::after { transition: none; } .swatch:hover { transform: none; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 32px; font-size: 0.88rem; color: var(--muted); }
.site-footer .cols { display: grid; gap: 24px 20px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.site-footer strong { color: var(--ink); font-weight: 600; }
.site-footer a { color: var(--muted); text-decoration-color: transparent; }
.site-footer a:hover { color: var(--ink); text-decoration-color: currentColor; }
.site-footer ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 5px; }
.footer-note { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); max-width: 80ch; font-size: 0.82rem; }
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .site-header .wrap { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding-top: 6px; padding-bottom: 2px; min-height: 0; }
  .header-right { display: contents; }
  .brand { grid-area: 1 / 1; }
  .theme-btn { grid-area: 1 / 2; }
  .nav { grid-area: 2 / 1 / 3 / 3; overflow-x: auto; margin: 0 -10px; padding-bottom: 4px; scrollbar-width: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .disclaimer-bar { font-size: 0.7rem; padding: 8px 16px 0; }
  main { padding: 14px 0 48px; }
  .lede { font-size: 0.94rem; margin-bottom: 16px; }
  h2 { margin-top: 36px; font-size: 1.2rem; }
  .tool { padding: 14px; border-radius: 14px; }
  .tool[data-generator] { padding: 0; }
  .control-box { margin: 8px 0 10px; }
  .control-head { display: none; }
  .surface-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .surface-help { font-size: 0.8rem; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .surface-help:empty { display: none; }
  .search { flex-basis: 100%; }
  .select { flex: 1 1 0; width: auto; }
  .count-pill { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .filter-bar { position: relative; margin-bottom: 10px; }
  .copy { padding-left: 10px; }
  .fav { width: 40px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}
