:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #5b6673;
  --border: #d9dee5;
  --accent: #1558d6;
  --accent-text: #ffffff;
  --accent-soft: #e8f0fe;
  --error: #b3261e;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151a;
    --surface: #1a2027;
    --text: #e8ecf1;
    --muted: #9aa5b1;
    --border: #2e3742;
    --accent: #8ab4f8;
    --accent-text: #0b1a33;
    --accent-soft: #1f2c40;
    --error: #f2b8b5;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .25rem; }
p { margin: 0 0 1rem; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.site-header nav a { margin-inline-start: 16px; text-decoration: none; }
.site-header nav a:first-child { margin-inline-start: 0; }
.brand, .site-header nav a, .site-footer a, .crumbs a, .btn, .copy-btn { display: inline-flex; align-items: center; min-height: 44px; }
.credit a { display: inline-flex; align-items: center; min-height: 44px; }
main { padding: 24px 0 48px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.lead { font-size: 1.08rem; color: var(--muted); }

.tool { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 20px 0 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.field.wide { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn, .copy-btn { cursor: pointer; border-radius: 8px; border: 1px solid var(--accent); }
.btn { margin-top: 16px; padding: 11px 22px; background: var(--accent); color: var(--accent-text); font-weight: 700; }
.copy-btn { padding: 6px 14px; background: transparent; color: var(--accent); }

.results { margin-top: 18px; }
.results:empty { display: none; }
.result-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.result-row.primary { background: var(--accent-soft); border: 0; border-radius: 10px; padding: 14px 16px; margin-bottom: 4px; }
.result-row.primary + .result-row { border-top: 0; }
.result-label { color: var(--muted); }
.result-value { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-row.primary .result-value { font-size: 1.6rem; }
.error { color: var(--error); font-weight: 600; margin: 0; }
.chips-wrap, .copy-wrap, .groups, .result-list { flex-basis: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-list { margin: 4px 0 0; padding-inline-start: 1.4rem; font-weight: 700; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.group h3 { margin: 0 0 4px; }
.group ul { margin: 0; padding-inline-start: 1.2rem; }
.copy-wrap textarea { margin-bottom: 8px; }
.note { font-size: .88rem; color: var(--muted); }

.search { margin: 16px 0 8px; }
.search label { display: block; font-weight: 600; margin-bottom: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--accent); }
.card strong { display: block; color: var(--accent); margin-bottom: 2px; }
.card span { font-size: .92rem; color: var(--muted); }
.category-blurb { color: var(--muted); margin: 0; }

details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-top: 2rem; }
summary { cursor: pointer; font-weight: 600; padding-block: 10px; }
details textarea { margin: 10px 0 8px; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

.downloads { display: grid; gap: 14px; margin: 16px 0 22px; }
.downloads .btn { display: inline-flex; margin: 0 0 4px; text-decoration: none; }
.downloads .note { display: block; margin: 0; }
.preview { margin: 0 0 8px; }
.preview img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0 32px; font-size: .9rem; color: var(--muted); }
.site-footer a { margin-inline-end: 16px; }

body.embed { background: var(--surface); }
body.embed main { padding: 12px 0; }
body.embed .tool { border: 0; padding: 0; margin: 8px 0; }
body.embed h1 { font-size: 1.25rem; }
.credit { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
