:root {
  --bg: #fbfaf8;
  --panel: #ffffff;
  --ink: #1c1b19;
  --muted: #6f6b64;
  --line: #e6e2dc;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --ok: #2f7a4f;
  --bad: #b4453a;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14140f;
    --panel: #1c1c17;
    --ink: #f0ede6;
    --muted: #9a958b;
    --line: #2c2c25;
    --accent: #7fb6a3;
    --accent-ink: #10201a;
    --ok: #7bc38f;
    --bad: #e08a7f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 2.85rem); }
h2 { font-size: 1.15rem; margin-top: 2.2em; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.center { text-align: center; }

header.site {
  max-width: 940px; margin: 0 auto; padding: 26px 22px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.brand { font-weight: 600; letter-spacing: -0.02em; text-decoration: none; font-size: 1.05rem; }
.nav { display: flex; gap: 18px; font-size: 0.9rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

main { max-width: 940px; margin: 0 auto; padding: 18px 22px 64px; }
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 18px; display: flex; gap: 8px; }
.crumbs a { text-decoration: none; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 62ch; margin-bottom: 30px; }

.tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.lbl { display: block; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.area, .input {
  width: 100%; padding: 11px 13px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 0.95rem;
}
.area { resize: vertical; min-height: 120px; }
.input.tiny { width: 5.5rem; }
.input:focus, .area:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.btn {
  appearance: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font: inherit; font-size: 0.92rem; font-weight: 500;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 1.35rem; font-weight: 500; }
.stat span { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; }
.result { font-size: 1.5rem; font-weight: 500; margin: 10px 0 0; }
.big { font-size: clamp(2.4rem, 8vw, 4rem); font-weight: 300; text-align: center; letter-spacing: -0.03em; margin: 22px 0 6px; }
.timer { font-size: clamp(3.4rem, 14vw, 6rem); font-weight: 200; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: 4px 0 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }

.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 8px 0 0; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.tbl td:last-child { text-align: right; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list a { text-decoration: none; font-weight: 500; }
.list a:hover { text-decoration: underline; }

.below { margin: 22px 0; }
.ad { min-height: 90px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.content { max-width: 68ch; }
.content p { color: var(--muted); }
.related { margin-top: 46px; }

.pad { border: 1px solid var(--line); border-radius: var(--radius); padding: 46px 24px; text-align: center; cursor: pointer; user-select: none; transition: background 0.12s ease; }
.pad.wait { background: #b4453a; color: #fff; }
.pad.go { background: #2f7a4f; color: #fff; }
.pad h3 { font-size: 1.3rem; margin-bottom: 6px; }

.typing { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; line-height: 1.9; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 4px 0 14px; min-height: 120px; }
.typing .ok { color: var(--ok); }
.typing .bad { color: var(--bad); text-decoration: underline; }
.typing span { color: var(--muted); }

/* hub */
.hub h1 { margin-bottom: 10px; }
.search { max-width: 420px; margin: 6px 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { cursor: pointer; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.85rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.grid .card { margin: 0; text-decoration: none; display: block; transition: border-color 0.15s ease, transform 0.15s ease; }
.grid .card:hover { border-color: var(--accent); transform: translateY(-1px); }
.grid .card h3 { margin: 8px 0 6px; font-size: 1.02rem; }
.grid .card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.tag { font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }

footer.site { max-width: 940px; margin: 0 auto; padding: 28px 22px 56px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
footer.site p { margin: 0 0 6px; }
footer.site a { text-decoration: none; }

@media (max-width: 620px) {
  header.site { padding-top: 18px; }
  .nav { display: none; }
  .tool { padding: 16px; }
  .row { gap: 10px; }
  .field { flex: 1 1 100%; }
}
