/* "Pattern maker's worksheet": drafting paper, ink, one blue thread. Contrast ratios: research_design.md section E. */
:root {
  color-scheme: light;
  --paper: #F4F5F1; --card: #FFFFFF; --ink: #1C2230; --ink-soft: #4D5563; --thread: #31418F; --thread-deep: #232F6B;
  --tint: #E6E9F7; --edge: #737B8C; --rule: #D5D8DE; --chalk: #D99A20; --error: #962D1F; --error-bg: #FBEDEA;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header, main { max-width: 560px; margin: 0 auto; padding: 0 16px; }
main { padding-bottom: 48px; }
.brand { margin: 0; padding: 14px 0 12px; font-weight: 600; border-bottom: 2px dashed var(--chalk); }
h1, h2, legend { font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif; font-weight: 600; }
h1 { font-size: 26px; line-height: 1.25; margin: 20px 0 10px; }
h1:focus { outline: none; }
h2 { font-size: 19px; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.help { color: var(--ink-soft); font-size: 15px; }
.help:empty { display: none; }
.eyebrow { margin: 20px 0 -12px; color: var(--thread); font-weight: 600; }
.sketch { display: block; width: 100%; height: auto; margin: 4px 0 16px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sketch .paper-line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 7 5; }
.sketch .grain { stroke: var(--ink-soft); stroke-width: 1.5; }
.sketch .tape { stroke: var(--thread); stroke-width: 3; }
.notice { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; margin-bottom: 8px; font-size: 15px; }
.notice ul { margin: 0; padding-left: 20px; }
.notice li { margin-bottom: 6px; }
fieldset { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
legend { font-size: 19px; padding: 0; margin-bottom: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.card { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--card); border: 1.5px solid var(--edge); border-radius: 8px; cursor: pointer; }
.card input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--thread); }
.card:has(input:checked) { background: var(--tint); border-color: var(--thread); box-shadow: 0 0 0 .5px var(--thread), inset 0 0 0 .5px var(--thread); }
.card:has(input:focus-visible) { outline: 3px solid var(--thread); outline-offset: 2px; }
.card span:last-child { min-width: 0; overflow-wrap: break-word; }
.limit { grid-column: 1 / -1; margin: 0 0 8px; padding: 8px 12px; font-size: 15px; background: var(--tint); border: 1.5px solid var(--thread); border-radius: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.5em, 1fr)); gap: 8px; }
.grid .wide { grid-column: 1 / -1; }
.grid .card { margin: 0; padding: 8px 4px; gap: 5px; justify-content: center; text-align: center; font-size: 16px; }
.grid .card input { width: 15px; height: 15px; }
/* Columns are sized by the text, so larger text gets fewer columns instead of broken color names. */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5em), 1fr)); gap: 8px; }
.swatches .card { margin: 0; padding: 8px; gap: 8px; font-size: 15px; line-height: 1.25; }
.chip { flex: none; width: 34px; height: 34px; border-radius: 6px; border: 2px solid #FFFFFF; box-shadow: 0 0 0 1px var(--edge); }
.swatches .card:last-child { grid-column: 1 / -1; }
select, input[type="email"], textarea { width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--edge); border-radius: 8px; }
textarea { resize: vertical; }
.block { display: block; font-weight: 600; margin: 12px 0 6px; }
#email-form .card { margin-top: 10px; }
button { display: block; width: 100%; min-height: 52px; margin-top: 18px; font: inherit; font-weight: 600; border-radius: 8px; cursor: pointer; }
.primary { background: var(--thread); color: #FFFFFF; border: 1.5px solid var(--thread); }
.primary:active { background: var(--thread-deep); }
@media (hover: hover) { .primary:hover { background: var(--thread-deep); } }
.primary:disabled { opacity: .6; cursor: wait; }
.secondary { background: var(--card); color: var(--thread); border: 1.5px solid var(--edge); margin-top: 10px; min-height: 48px; }
button:focus-visible, select:focus-visible, input[type="email"]:focus-visible, textarea:focus-visible { outline: 3px solid var(--thread); outline-offset: 2px; }
.error { margin-top: 14px; padding: 10px 12px; background: var(--error-bg); color: var(--error); border: 1.5px solid var(--error); border-radius: 8px; }
.error::before { content: "! "; font-weight: 700; }
#progress { margin-top: 14px; }
#progress-text { margin: 0 0 6px; font-size: 15px; color: var(--ink-soft); }
.track { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: var(--thread); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
