/* Wordformat. All colors and fonts are tokens on :root; dark mode redefines tokens only. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --ink: #151a23;
  --muted: #5a6372;
  --line: #dde1e8;
  --line-strong: #c3c9d3;
  --mark: #ffe14d; /* highlighter */
  --mark-soft: #fff3b0;
  --on-mark: #151a23;
  --accent: #2448c9; /* links + focus */
  --danger: #b3261e;
  --good: #1e7f55;
  --warn: #b66a00;
  --del-bg: #fdecec;
  --del-strong: #f6b8b8;
  --del-ink: #a3201a;
  --add-bg: #e7f6ec;
  --add-strong: #a9e2bd;
  --add-ink: #17693f;

  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgb(21 26 35 / 0.05), 0 6px 24px -12px rgb(21 26 35 / 0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1217;
    --surface: #171b22;
    --surface-2: #1d222b;
    --ink: #e9ecf1;
    --muted: #9aa3b2;
    --line: #272d37;
    --line-strong: #394150;
    --mark: #f2d13a;
    --mark-soft: #3a3417;
    --on-mark: #151a23;
    --accent: #8aa8ff;
    --danger: #ff8a80;
    --good: #5fd39c;
    --warn: #f0b35a;
    --del-bg: #3a1d1f;
    --del-strong: #7a2f33;
    --del-ink: #ff9d97;
    --add-bg: #173024;
    --add-strong: #2b6a45;
    --add-ink: #7fe0a8;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f1217;
  --surface: #171b22;
  --surface-2: #1d222b;
  --ink: #e9ecf1;
  --muted: #9aa3b2;
  --line: #272d37;
  --line-strong: #394150;
  --mark: #f2d13a;
  --mark-soft: #3a3417;
  --on-mark: #151a23;
  --accent: #8aa8ff;
  --danger: #ff8a80;
  --good: #5fd39c;
  --warn: #f0b35a;
  --del-bg: #3a1d1f;
  --del-strong: #7a2f33;
  --del-ink: #ff9d97;
  --add-bg: #173024;
  --add-strong: #2b6a45;
  --add-ink: #7fe0a8;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px -12px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--mark);
  color: var(--on-mark);
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}
p {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.skip:focus {
  top: 12px;
}
.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}
.mono,
code {
  font-family: var(--font-mono);
}
code {
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--mark);
  color: var(--on-mark);
  font: 800 15px/1 var(--font-display);
  letter-spacing: -0.02em;
}
.brand-name {
  font: 800 21px/1 var(--font-display);
  letter-spacing: -0.03em;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.bar-end {
  display: flex;
  gap: 4px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.menu-btn {
  display: none;
}

@media (max-width: 820px) {
  .menu-btn {
    display: grid;
  }
  .bar-end {
    margin-left: auto;
  }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    gap: 0;
    padding: 8px 12px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 10px 8px;
    font-size: 16px;
  }
}

/* ---------- buttons & fields ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}
.btn:hover {
  border-color: var(--ink);
}
.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.btn.primary:hover {
  background: color-mix(in srgb, var(--ink) 85%, var(--bg));
}
.btn.ghost {
  border-color: transparent;
  background: none;
  color: var(--muted);
}
.btn.ghost:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.btn.flash,
.btn.flash:hover {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--on-mark);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

textarea {
  display: block;
  width: 100%;
  min-height: 240px;
  padding: 16px 18px;
  border: 0;
  background: var(--surface);
  resize: vertical;
  font-size: 16px;
  line-height: 1.6;
}
textarea:focus {
  outline: none;
}
textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
textarea.mono {
  font-family: var(--font-mono);
  font-size: 15px;
  word-spacing: 0.1em;
}
textarea.tall {
  min-height: 360px;
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.opt-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.opt-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field.grow {
  flex: 1 1 220px;
}
.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.field input[type='text'],
.field input[type='number'],
.field select {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
}
.field input[type='number'] {
  width: 90px;
}
.field input[type='range'] {
  width: 100%;
  accent-color: var(--ink);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
}
.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--ink);
  margin: 0;
}

/* ---------- home hero & editor ---------- */

.hero {
  padding-block: 44px 26px;
  max-width: 760px;
}
.hero h1,
.tool-head h1 {
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hl {
  background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 92%, transparent 92%);
  padding-inline: 2px;
}
.lede {
  margin-top: 14px;
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 62ch;
}

.editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.editor:focus-within {
  border-color: var(--line-strong);
}
.statbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font: 500 12px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.statbar b {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-right: 3px;
}
#home-input {
  min-height: 300px;
  font-size: 17px;
  padding: 20px 22px;
}
.editor-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
}
.casebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-btn {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}
.case-btn:hover {
  background: var(--mark-soft);
  border-color: var(--mark);
}
.case-btn[aria-pressed='true'] {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--on-mark);
}
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- directory ---------- */

.directory {
  padding-block: 64px 8px;
}
.directory > h2,
.guide > h2,
.related > h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.cat {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px 32px;
  padding-block: 26px;
  border-top: 1px solid var(--line);
}
.cat:first-of-type {
  margin-top: 18px;
}
.cat-head h3 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.cat-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}
.tool-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s, transform 0.12s;
}
.tool-card:hover {
  border-color: var(--ink);
}
.tool-card:hover .tool-name {
  background: linear-gradient(transparent 60%, var(--mark) 60%);
}
.tool-name {
  font-weight: 600;
  align-self: flex-start;
}
.tool-short {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 760px) {
  .cat {
    grid-template-columns: 1fr;
  }
}

/* ---------- case guide ---------- */

.guide {
  padding-block: 56px;
}
.guide-intro {
  color: var(--muted);
  margin-bottom: 20px;
}
.guide-list {
  margin: 0;
  border-top: 1px solid var(--line);
}
.guide-row {
  display: grid;
  grid-template-columns: 200px 1fr 260px;
  gap: 6px 24px;
  align-items: baseline;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}
.guide-row dt a {
  font-weight: 600;
  color: var(--ink);
}
.guide-row dd {
  margin: 0;
}
.guide-sample {
  font-family: var(--font-mono);
  font-size: 14.5px;
  overflow-wrap: anywhere;
}
.guide-desc {
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 860px) {
  .guide-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- FAQ ---------- */

.faq {
  padding-block: 0 72px;
  max-width: 780px;
}
.faq h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq details:first-of-type {
  border-top: 1px solid var(--line);
}
.faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  list-style-position: outside;
}
.faq details p {
  padding-bottom: 16px;
  color: var(--muted);
  max-width: 68ch;
}

/* ---------- tool pages ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
  font-size: 14px;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
}
.tool-head {
  padding-block: 14px 26px;
  max-width: 780px;
}
.tool-head h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem);
}

.io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 860px) {
  .io {
    grid-template-columns: 1fr;
  }
}
.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pane:focus-within {
  border-color: var(--line-strong);
}
.pane textarea {
  flex: 1;
}
.tool-variants textarea,
.tool-stats textarea {
  min-height: 150px;
}
.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.pane-head label,
.pane-title {
  font: 500 12px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink);
}
.count,
.note {
  font: 400 12.5px/1.4 var(--font-mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.note.error {
  color: var(--danger);
}
.pane-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.foot-spacer {
  flex: 1;
}

/* variants */
.variants-hint {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}
.variants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.variant {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  align-items: center;
  gap: 8px 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.variant-label {
  font: 500 12px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.variant-text {
  font-size: 22px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  user-select: all;
}
.variants.is-sample .variant-text {
  color: var(--muted);
}
@media (max-width: 640px) {
  .variant {
    grid-template-columns: 1fr auto;
  }
  .variant-label {
    grid-column: 1 / -1;
  }
}

/* stats */
.stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.stat {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat dt {
  font-size: 13.5px;
  color: var(--muted);
}
.stat dd {
  margin: 4px 0 0;
  font: 800 1.9rem/1.1 var(--font-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* frequency table */
.freq {
  flex: 1;
  max-height: 420px;
  overflow: auto;
}
.freq table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.freq th {
  position: sticky;
  top: 0;
  background: var(--surface);
  text-align: left;
  font: 500 11.5px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.freq td {
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
}
.freq .num,
.freq .rank {
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 1%;
  white-space: nowrap;
}
.freq .rank {
  color: var(--muted);
}
.freq .word {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.freq .share {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 130px;
}
.freq-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.freq-bar span {
  display: block;
  height: 100%;
  background: var(--mark);
}
.pct {
  font: 400 12.5px/1 var(--font-mono);
  color: var(--muted);
  width: 48px;
  text-align: right;
}
.freq .empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 14px;
}

/* password */
.pw {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pw .opts {
  margin: 4px 0 0;
}
.pw-out {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.pw-text {
  flex: 1 1 320px;
  min-width: 0;
  font: 500 clamp(1.15rem, 0.9rem + 1.2vw, 1.6rem) / 1.35 var(--font-mono);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  user-select: all;
}
.pw-actions {
  display: flex;
  gap: 8px;
}
.pw-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.pw-meter span {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.pw-meter[data-level='1'] span:nth-child(-n + 1) {
  background: var(--danger);
}
.pw-meter[data-level='2'] span:nth-child(-n + 2) {
  background: var(--warn);
}
.pw-meter[data-level='3'] span:nth-child(-n + 3),
.pw-meter[data-level='4'] span {
  background: var(--good);
}
.pw-strength {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- content ---------- */

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  padding-block: 56px 24px;
}
@media (max-width: 900px) {
  .content {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
.prose {
  max-width: 68ch;
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.prose h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.prose p + p {
  margin-top: 12px;
}
.prose ul {
  padding-left: 1.2em;
  margin: 10px 0 0;
}
.prose.page {
  padding-block: 40px 64px;
  gap: 0;
}
.prose.page h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}
.prose.page h2 {
  margin: 30px 0 8px;
}
.prose.page p + p {
  margin-top: 12px;
}
.ex-caption {
  color: var(--muted);
  font-size: 14px;
  margin: -4px 0 10px;
}
.ex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .ex-grid {
    grid-template-columns: 1fr;
  }
}
.ex {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.ex-label {
  display: block;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font: 500 11.5px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.ex pre {
  margin: 0;
  padding: 12px;
  font: 400 14px/1.55 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.privacy-note {
  align-self: start;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--mark-soft);
}
.privacy-note h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.privacy-note p {
  font-size: 14.5px;
}
.related {
  padding-block: 32px 72px;
}
.related > h2 {
  margin-bottom: 16px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 48px 28px;
  font-size: 14px;
}
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 28px 24px;
}
.foot-col h2 {
  font: 500 11.5px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 10px;
}
.foot-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.foot-col a,
.foot-base a {
  color: var(--ink);
  text-decoration: none;
}
.foot-col a:hover,
.foot-base a:hover {
  text-decoration: underline;
}
.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

/* ---------- segmented buttons ---------- */

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg);
}
.seg-btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 14.5px;
  cursor: pointer;
}
.seg-btn:hover {
  color: var(--ink);
}
.seg-btn[aria-pressed='true'] {
  background: var(--mark);
  color: var(--on-mark);
}

/* ---------- diff checker ---------- */

.tool-diff textarea {
  min-height: 220px;
  font-size: 14px;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
.diff-result {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.diff-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.diff-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14.5px;
}
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font: 500 13px/1.4 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.pill.del {
  background: var(--del-bg);
  color: var(--del-ink);
}
.pill.add {
  background: var(--add-bg);
  color: var(--add-ink);
}
.pill.same {
  background: var(--mark);
  color: var(--on-mark);
}
.diff-wrap {
  max-height: 70vh;
  overflow: auto;
}
.diff-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font: 400 13.5px/1.55 var(--font-mono);
}
.diff-table .ln {
  width: 3.4em;
  padding: 1px 8px;
  text-align: right;
  color: var(--muted);
  opacity: 0.8;
  background: var(--surface-2);
  vertical-align: top;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.diff-table.split .ln + .code {
  border-right: 1px solid var(--line);
}
.diff-table .code {
  padding: 1px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.diff-table .code.del {
  background: var(--del-bg);
}
.diff-table .code.add {
  background: var(--add-bg);
}
.diff-table .code.blank {
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 12px);
}
.diff-table mark {
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.diff-table mark.x-del {
  background: var(--del-strong);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--del-ink) 60%, transparent);
}
.diff-table mark.x-add {
  background: var(--add-strong);
}
.diff-table .sign {
  display: inline-block;
  width: 1.2em;
  color: var(--muted);
  user-select: none;
}
.diff-table.unified .code.del .sign {
  color: var(--del-ink);
}
.diff-table.unified .code.add .sign {
  color: var(--add-ink);
}
.diff-table .fold {
  padding: 0;
  background: var(--surface-2);
  border-block: 1px solid var(--line);
}
.fold-btn {
  width: 100%;
  padding: 5px 10px;
  border: 0;
  background: none;
  color: var(--accent);
  font: 500 13px/1.4 var(--font-mono);
  text-align: left;
  cursor: pointer;
}
.fold-btn:hover {
  background: var(--mark-soft);
}

/* ---------- image compare ---------- */

.drops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .drops {
    grid-template-columns: 1fr;
  }
}
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 18px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}
.drop:hover,
.drop.over {
  border-color: var(--ink);
  background: var(--mark-soft);
}
.drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.drop.has-image {
  border-style: solid;
}
.drop-title {
  font: 500 12px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.drop-thumb {
  max-height: 110px;
  max-width: 100%;
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.drop-hint {
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.img-stage {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 18px;
  min-height: 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.img-stage[data-mode='side'] figure {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}
@media (max-width: 640px) {
  .img-stage[data-mode='side'] {
    flex-direction: column;
  }
}
.img-stage img,
.img-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}
.img-stage figcaption {
  margin-top: 6px;
  text-align: center;
  font: 500 12px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.img-empty {
  align-self: center;
  color: var(--muted);
}
.img-stack {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 75vh;
}
.img-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.img-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  background: var(--mark);
  box-shadow: 0 0 0 1px var(--on-mark);
  pointer-events: none;
}
.img-note {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- symbols ---------- */

.sym-tools {
  position: sticky;
  top: 61px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sym-tray {
  display: flex;
  flex: 2 1 320px;
  min-width: 0;
  gap: 8px;
}
@media (max-width: 640px) {
  .sym-tools {
    position: static;
  }
  .sym-tray {
    flex-basis: 100%;
  }
}
.sym-tray input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 20px;
}
.sym-search {
  flex: 1 1 220px;
}
.sym-search input {
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
}
.sym-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.sym-jump a {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
}
.sym-jump a:hover {
  background: var(--mark-soft);
  border-color: var(--mark);
}
.sym-sets {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.sym-set > h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.sym-set > h2 a {
  color: var(--ink);
  text-decoration: none;
}
.sym-set > h2 a:hover {
  text-decoration: underline;
}
.sym-set .sym-group {
  margin-top: 14px;
}
.sym-group > h2,
.sym-group > h3 {
  font: 500 12px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 10px;
}
.sym-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}
.sym-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.sym {
  width: 100%;
  min-height: 58px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 26px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s, transform 0.08s;
}
.sym-grid.wide .sym {
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sym:hover {
  border-color: var(--ink);
  background: var(--mark-soft);
}
.sym:active {
  transform: scale(0.94);
  background: var(--mark);
}
.sym-none {
  color: var(--muted);
  padding: 24px 0;
}
.alt-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.alt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.alt-table th {
  text-align: left;
  font: 500 11.5px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.alt-table td {
  padding: 5px 14px;
  border-bottom: 1px solid var(--line);
}
.alt-table .sym {
  width: 52px;
  min-height: 44px;
  font-size: 22px;
}
.alt-code {
  font-family: var(--font-mono);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.alt-name {
  color: var(--muted);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
