/* ApparelOps. System fonts, one indigo accent, light theme only. */
:root {
  --bg: #ffffff;
  --panel: #f5f6f9;
  --ink: #1b1d23;
  --muted: #4d525d;
  --line: #d3d6de;
  --accent: #363b96;
  --accent-ink: #ffffff;
  --accent-soft: #eceefa;
  --danger: #9f2418;
  --danger-soft: #fdf0ee;
  --note: #5c4400;
  --note-soft: #fff6dd;
  --note-line: #c9a227;
  --ok-soft: #eef6f1;
  --ok-line: #3b7a57;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 1rem;
  --radius: 4px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.65 var(--sans); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--gutter); top: -4rem; background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem; z-index: 10; }
.skip-link:focus { top: 0.5rem; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 68ch; }
main { display: block; padding-bottom: 3rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { font: 700 1.25rem/1.2 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: 0.01em; }
.brand span { color: var(--accent); }
.nav li, .site-footer li { margin: 0; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.nav a { display: inline-block; padding: 0.45rem 0; color: var(--ink); text-decoration: none; font-size: 0.97rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }

/* Type */
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--ink); margin: 0 0 0.6rem; font-weight: 700; }
h1 { font-size: clamp(1.85rem, 1.2rem + 2.6vw, 2.9rem); letter-spacing: -0.01em; margin-top: 2.25rem; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem); margin-top: 2.75rem; }
h3 { font-size: 1.2rem; margin-top: 1.75rem; }
h4 { font-size: 1rem; margin: 1.25rem 0 0.25rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--ink); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.eyebrow { font: 600 0.82rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 2.25rem 0 -1.4rem; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
kbd { font-family: var(--mono); font-size: 0.9em; border: 1px solid var(--line); border-radius: 3px; padding: 0 0.3em; background: var(--panel); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
li { margin-bottom: 0.3rem; }
.mt { margin-top: 2rem; }

/* Buttons */
.btn { display: inline-block; font: 600 1rem/1.2 var(--sans); padding: 0.8rem 1.25rem; border-radius: var(--radius); border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; }
.btn:hover { background: #2a2e7a; border-color: #2a2e7a; }
.btn-secondary { background: var(--bg); color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-small { padding: 0.5rem 0.8rem; font-size: 0.95rem; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--panel); color: var(--muted); border-color: var(--line); border-style: dashed; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1.25rem 0; }
.panel > :last-child { margin-bottom: 0; }
.panel h2, .panel h3 { margin-top: 0; }
.note { background: var(--note-soft); border-left: 4px solid var(--note-line); color: var(--note); padding: 0.8rem 1rem; margin: 1.25rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.note > :last-child { margin-bottom: 0; }
.note strong { color: inherit; }
.draft-note { font-size: 0.95rem; }
.synthetic { background: var(--accent-soft); border: 2px dashed var(--accent); color: var(--ink); padding: 0.8rem 1rem; margin: 1.25rem 0; border-radius: var(--radius); font-weight: 600; }

.cols { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .cols-2 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3, 1fr); } }
.cols + p { margin-top: 1.25rem; }
.card { border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.15rem 1.15rem; background: var(--bg); display: flex; flex-direction: column; }
.card h2, .card h3 { margin-top: 0.25rem; font-size: 1.2rem; }
.card .price { font: 700 1.6rem/1.1 var(--serif); margin: 0.25rem 0 0.5rem; }
.card .btn, .card .actions { margin-top: auto; }
.card p:last-of-type { margin-bottom: 1rem; }

.check-list, .x-list { list-style: none; padding: 0; }
.check-list li, .x-list li { position: relative; padding-left: 1.6rem; }
.check-list li::before { content: ""; position: absolute; left: 0.1rem; top: 0.5em; width: 0.7rem; height: 0.4rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.x-list li::before { content: "–"; position: absolute; left: 0.2rem; color: var(--muted); font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; }
caption { text-align: left; font-weight: 600; padding: 0 0 0.4rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--panel); border-bottom: 2px solid var(--ink); font-size: 0.9rem; }
table.wide { min-width: 42rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td, tfoot th { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.table-wrap:focus-visible { outline-offset: 0; }

@media (max-width: 40rem) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
  table.stack th, table.stack td { border: 0; padding: 0.1rem 0; display: block; }
  table.stack tbody th, table.stack tfoot th { grid-column: 1; grid-row: 1; }
  table.stack td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--muted); font-size: 0.9rem; }
  table.stack td.num { grid-column: 2; grid-row: 1; text-align: right; }
  table.stack tfoot tr { border-top: 2px solid var(--ink); border-bottom: 0; }
  table.stack tfoot td { border: 0; }
}

/* Forms */
form { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem 0.5rem; margin: 0 0 1.25rem; min-width: 0; }
legend { font: 700 1rem/1.3 var(--sans); padding: 0 0.4rem; }
.field { margin: 0 0 1rem; }
.field label, .label { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.hint { display: block; font-size: 0.9rem; color: var(--muted); margin: 0 0 0.3rem; line-height: 1.4; }
input[type="text"], input[type="email"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; max-width: 26rem; font: inherit; color: var(--ink); background: #fff; padding: 0.6rem 0.7rem; border: 1px solid #7a7f8c; border-radius: var(--radius); min-height: 2.75rem;
}
textarea { max-width: 40rem; min-height: 8rem; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; background: var(--danger-soft); }
.field-error { color: var(--danger); font-weight: 600; font-size: 0.93rem; margin: 0.3rem 0 0; }
.field-error::before { content: "Problem: "; }
.field-row { display: grid; gap: 0 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-row .field { display: flex; flex-direction: column; }
.field-row .field input, .field-row .field select { margin-top: auto; }
.radio-row { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.radio-row label, .check-row label { font-weight: 400; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; }
.check-row label { align-items: flex-start; }
.check-row input { margin-top: 0.2rem; flex: none; }
input[type="radio"], input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 1rem 0; padding: 0.8rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); }
.form-status[hidden] { display: none; }
.form-status.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.form-status.bad { background: var(--danger-soft); border-color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }

/* Tool layout */
.tool { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: 1.5rem; }
@media (min-width: 62rem) { .tool { grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: 2.5rem; } .tool-out { position: sticky; top: 1rem; } }
.tool-out { border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.15rem; background: #fff; min-width: 0; }
.tool-out h2 { margin-top: 0; font-size: 1.3rem; }
.result-lead { font: 700 2rem/1.15 var(--serif); margin: 0.25rem 0; overflow-wrap: anywhere; }
.result-sub { color: var(--muted); margin: 0 0 1rem; }
.metrics { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr; margin: 1rem 0; }
@media (max-width: 26rem) { .metrics { grid-template-columns: 1fr; } }
.metric { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.75rem; }
.metric dt { font-size: 0.85rem; color: var(--muted); margin: 0; }
.metric dd { margin: 0; font: 700 1.3rem/1.25 var(--serif); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric dd small { display: block; font: 400 0.82rem/1.3 var(--sans); color: var(--muted); }
.issue-list { margin: 0.5rem 0 1rem; padding-left: 1.2rem; }
.issue-list.errors { color: var(--danger); font-weight: 600; }
.formula { font-family: var(--mono); font-size: 0.92rem; background: var(--panel); border-left: 4px solid var(--accent); padding: 0.7rem 0.9rem; margin: 1rem 0; overflow-wrap: anywhere; line-height: 1.55; }
.formula p { margin: 0 0 0.4rem; }
.formula p:last-child { margin: 0; }
.row-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.5rem; align-items: end; margin-bottom: 0.6rem; }
.row-line .field { margin: 0; }
.row-line input { max-width: none; }
.print-only { display: none; }
.tool ~ p.small { margin-top: 1.5rem; }

/* Hero + sections */
.hero { padding-bottom: 0.5rem; }
.hero h1 { max-width: 22ch; margin-bottom: 1rem; }
.previews { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); margin: 1.25rem 0; }
.previews figure.narrow { max-width: 26rem; }
.previews figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.previews img { display: block; width: 100%; height: auto; }
.previews figcaption { font-size: 0.88rem; color: var(--muted); padding: 0.5rem 0.7rem; border-top: 1px solid var(--line); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 2.4rem; margin-bottom: 0.9rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0.05rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); font: 700 0.85rem/1.4rem var(--sans); text-align: center; }
details { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 0.5rem; }
.breadcrumb { font-size: 0.92rem; margin: 1.25rem 0 -1.25rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
dl.defs dt { font-weight: 700; margin-top: 0.75rem; }
dl.defs dd { margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 2rem 0 2.5rem; font-size: 0.95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.1rem 1.25rem; }
.site-footer ul a { display: inline-block; padding: 0.3rem 0; }
.site-footer p { margin: 0 0 0.6rem; max-width: 72ch; }

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

@media print {
  .site-header, .site-footer, .skip-link, .no-print, .btn-row, .actions, .breadcrumb { display: none !important; }
  body { font-size: 11pt; color: #000; }
  .print-only { display: block; }
  .tool { display: flex; flex-direction: column; gap: 1rem; }
  .tool-out { order: -1; }
  .tool-out { position: static; border: 1px solid #000; }
  fieldset { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  input[type="text"], input[type="email"], input[type="number"], select, textarea { border: 0; border-bottom: 1px solid #999; border-radius: 0; padding: 0; min-height: 0; background: transparent; max-width: none; }
  select { appearance: none; }
  .field { margin-bottom: 0.5rem; }
  h1 { margin-top: 0; }
}
