@font-face { font-family: "Instrument Sans"; src: url("./instrument-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("./instrument-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("./instrument-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --white: #fff;
  --ink: #0e0e10;
  --muted: #58585e;
  --line: #e5e3dc;
  --action: #0e0e10;
  --action-ink: #18181b;
  --chart: #c7c5c0;
  --result: #0e0e10;
  --light-ink: #f7f6f2;
  --light-muted: #c9c8c5;
  --light-border: #4e4d50;
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; color: var(--ink); background: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
button, select, input, textarea { font: inherit; }
textarea { display: block; resize: vertical; }
a { color: var(--action-ink); text-underline-offset: .25em; }
a:hover { text-decoration-thickness: .14em; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #4268a8;
  outline-offset: 3px;
}
button { cursor: pointer; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 5.7vw, 4.8rem); max-width: 21ch; font-weight: 600; letter-spacing: -.065em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.55rem); font-weight: 600; letter-spacing: -.04em; }
h3 { font-size: 1.09rem; font-weight: 600; letter-spacing: -.018em; }
.skip { position: fixed; top: 6px; left: 6px; z-index: 6; transform: translateY(-150%); background: var(--white); padding: 10px 16px; }
.skip:focus { transform: none; }

.masthead { border-bottom: 1px solid var(--line); }
.site-nav, .site-footer {
  max-width: 1264px;
  margin: auto;
  padding: 13px clamp(16px,4vw,56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px,3vw,42px);
}
.brand { flex: 0 0 auto; display: block; }
.site-nav nav, .site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(12px,3vw,32px); }
.site-nav nav a, .site-footer nav a, .nav-action { display: inline-flex; align-items: center; min-height: 42px; gap: 8px; text-decoration: none; font-weight: 600; font-size: .9rem; }
.site-nav nav a:hover, .site-footer nav a:hover, .nav-action:hover { text-decoration: underline; }
.nav-action { border: 1px solid #c5c1b7; padding: 0 15px; border-radius: 7px; }
.page { max-width: 1264px; margin: auto; padding: 0 clamp(16px,4vw,56px) clamp(52px,7vw,100px); }
.breadcrumbs { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; padding-top: 26px; font-size: .85rem; color: var(--muted); }
.breadcrumbs a { font-weight: 600; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: clamp(28px,4.5vw,62px) 0 clamp(22px,3vw,38px); }
.hero p { max-width: 50ch; margin-top: 18px; color: var(--muted); font-size: clamp(1.02rem,2vw,1.22rem); line-height: 1.55; }
.method-link { display: inline-flex; flex-shrink: 0; align-items: center; min-height: 44px; gap: 10px; font-weight: 620; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr); gap: clamp(14px,2vw,24px); align-items: start; }
.inputs, .result { min-width: 0; border-radius: 12px; padding: clamp(19px,3.2vw,35px); }
.inputs { background: var(--white); border: 1px solid var(--line); }
.result { background: var(--result); color: var(--light-ink); min-height: 350px; position: sticky; top: 20px; }
.result:focus { outline: 2px solid #4268a8; outline-offset: 3px; }
.panel-top { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.panel-top h2 { font-size: clamp(1.5rem,3vw,2rem); }
.result .panel-top { border-color: var(--light-border); }
.form-group { padding-top: 20px; }
.form-group + .form-group { margin-top: 3px; }
.form-group h3 { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 16px; }
.field { min-width: 0; }
.span { grid-column: 1 / -1; }
.field label, .message-editor label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .94rem; overflow-wrap: break-word; }
.field small, .privacy { display: block; font-size: .82rem; line-height: 1.4; color: var(--muted); margin-top: 7px; }
.inline-count { padding-top: 6px; color: var(--action-ink); font-size: .85rem; font-weight: 600; }
.field :where(input,textarea,select) {
  width: 100%; min-width: 0; min-height: 44px; border: 1px solid #cbc8bf; border-radius: 6px;
  padding: 9px 11px; color: var(--ink); background: #fff; line-height: 1.5;
}
.field select { padding-right: 7px; }
.number-input { position: relative; }
.number-input span { position: absolute; top: 50%; left: 11px; transform: translateY(-50%); color: var(--muted); font-size: .88rem; pointer-events: none; }
.number-input span + input { padding-left: 26px; }
.number-input input:has(+ span) { padding-right: 28px; }
.number-input input + span { left: auto; right: 10px; }
.field input[type=checkbox], .model-toggle input { display: inline-block; vertical-align: middle; margin: 0 7px 0 0; width: 19px; height: 19px; min-height: 0; accent-color: var(--action); flex-shrink: 0; }
.check-field { grid-column: 1 / -1; }
.check-field label, .model-toggle label { display: flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; }
.model-toggle { background: #f0eee8; border-radius: 8px; padding: 6px 12px; margin-top: 19px; }
.advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 6px; }
.advanced summary { min-height: 44px; font-weight: 600; padding-block: 10px; cursor: pointer; }
.advanced[open] summary { margin-bottom: 8px; }
.form-actions, .result-actions { display: flex; gap: 9px 14px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.primary, .secondary, .text-button {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center; text-align: center;
  gap: 8px; padding: 9px 14px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; font-size: .91rem; line-height: 1.35;
  text-decoration: none;
}
.primary { background: var(--action); color: #fff; }
.primary:hover { background: var(--action-ink); }
.text-button { color: var(--action-ink); background: transparent; padding-inline: 8px; }
.text-button:hover { text-decoration: underline; }
.secondary { border-color: #bbb9b6; color: var(--light-ink); background: transparent; }
.secondary:hover { background: #2f2f34; }
.result .text-button { color: var(--light-ink); border-color: var(--light-border); }
.result .text-button:hover { background: #2f2f34; }
.empty { padding: 42px 0 50px; color: var(--light-muted); }
.empty p { font-weight: 600; font-size: 1.15rem; color: var(--light-ink); margin-bottom: 4px; }
.empty span { display: block; max-width: 30ch; font-size: .91rem; }
.example-note { background: #f0eee8; padding: 9px 12px; margin-top: 12px; color: var(--action-ink); border-radius: 6px; font-size: .86rem; }
.result-status { color: var(--light-muted); font-size: .81rem; }
.error { margin-top: 18px; border: 1px solid #c18378; border-radius: 7px; background: #fff4ef; color: #702d22; padding: 11px; }
.metrics { display: grid; gap: 12px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); padding-top: 20px; }
.metric { min-width: 0; padding-bottom: 12px; border-bottom: 1px solid var(--light-border); }
.metric:first-child { grid-column: 1 / -1; }
.metric dt { font-size: .88rem; font-weight: 600; color: var(--light-muted); }
.metric dd { margin-top: 2px; font-size: clamp(1.33rem,3vw,1.9rem); line-height: 1.13; font-variant-numeric: tabular-nums; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric:first-child dd { font-size: clamp(1.9rem,4.3vw,3.2rem); }
.metric .metric-note, .metric:first-child .metric-note { font-size: .81rem; margin-top: 6px; color: var(--light-muted); letter-spacing: 0; line-height: 1.45; }
.chart { padding: 17px 0 0; }
.chart figcaption { font-size: .9rem; font-weight: 600; margin-bottom: 12px; }
.chart-row { margin-bottom: 9px; }
.chart-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--light-muted); }
.chart-label strong { flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--light-ink); }
.bar-track { height: 5px; background: #45444a; border-radius: 20px; position: relative; margin-top: 4px; overflow: hidden; }
.bar { position: absolute; height: 100%; background: var(--chart); }
.bar.negative { background: #ed9b8a; }
.result-note, .message-count { margin: 15px 0 10px; color: var(--light-muted); font-size: .84rem; }
.message-editor { padding-top: 17px; }
.message-editor textarea { width: 100%; min-height: 140px; padding: 12px; border: 1px solid #bbb9b6; border-radius: 7px; background: #fff; color: var(--ink); line-height: 1.45; }
.guide, .directory-section { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.65fr); gap: clamp(18px,7vw,100px); border-top: 1px solid var(--line); padding-top: 32px; margin-top: clamp(48px,7vw,94px); }
.guide p, .directory-intro p, .closing p { color: var(--muted); max-width: 65ch; margin-top: 9px; }
.guide section + section { margin-top: 24px; }
.references { padding-left: 21px; }
.references li + li { margin-top: 5px; }
.related { border-top: 1px solid var(--line); margin-top: 55px; padding-top: 28px; }
.related > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.directory-link { min-width: 0; display: flex; gap: 14px; align-items: start; justify-content: space-between; padding: 16px; border: 1px solid var(--line); background: var(--white); border-radius: 7px; text-decoration: none; }
.directory-link:hover { border-color: #777579; background: #f0eee8; }
.directory-link strong { display: block; line-height: 1.24; margin-bottom: 5px; font-size: 1.05rem; }
.directory-link > span > span { display: block; font-size: .88rem; color: var(--muted); line-height: 1.43; }
.arrow { font-size: 1.12rem; }
.directory-section { margin-top: 0; padding-block: 28px; }
.directory-section .directory-link + .directory-link { margin-top: 8px; }
.closing { margin-top: 50px; padding: clamp(18px,4vw,35px); border-radius: 10px; background: #eeece6; display: flex; gap: 12px 25px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.closing h2 { font-size: clamp(1.5rem,3vw,2rem); }
.closing .primary { flex-shrink: 0; }
footer { border-top: 1px solid var(--line); }
.site-footer { padding-block: 20px; }

@media (max-width: 860px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .result { position: static; min-height: 236px; }
  .hero { align-items: start; flex-direction: column; gap: 12px; }
  .guide, .directory-section { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 520px) {
  .site-nav { padding-block: 8px; }
  .site-nav > nav { margin-left: auto; gap: 10px; }
  .nav-action { display: none; }
  .form-grid, .related > div { grid-template-columns: minmax(0,1fr); }
  .hero h1 { overflow-wrap: break-word; }
  .form-actions .primary { max-width: 100%; }
  .closing .primary { flex-shrink: 1; }
}
@media (max-width: 360px) {
  .metric:not(:first-child) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 9px; align-items: baseline; }
  .metric:not(:first-child) .metric-note { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
