* {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font: 16px/1.45 var(--body);
}
main {
    max-width: 1180px;
    margin: auto;
    padding: 20px 24px 48px;
}
a {
    color: var(--primary-deep);
}
nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}
nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 700;
}
h1,
h2,
h3,
legend {
    font-family: var(--display);
    line-height: 1.15;
}
h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4vw, 42px);
}
h2 {
    margin: 0 0 14px;
    font-size: 22px;
}
h3 {
    margin: 0 0 6px;
    font-size: 18px;
}
p {
    margin: 0 0 14px;
}
.intro > p {
    max-width: 790px;
}
.eyebrow {
    font-weight: 700;
    color: var(--primary-deep);
    margin-bottom: 8px;
}
.workspace {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    margin-top: 28px;
}
#editor[hidden] + .preview {
    grid-column: 1 / -1;
    max-width: 780px;
}
.panel,
#agreement {
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: 4px 4px 0 var(--ink);
}
.hint,
.small,
footer {
    font-size: 14px;
    color: var(--muted);
}
fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}
legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}
input,
select,
button {
    font: inherit;
    color: inherit;
    border: 2px solid var(--ink);
    border-radius: var(--r-sm);
    min-height: 46px;
    width: 100%;
    padding: 10px;
}
input,
select {
    background: var(--surface);
    min-width: 0;
}
.field {
    margin-bottom: 16px;
}
button {
    background: var(--primary);
    color: var(--primary-text);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--ink);
    margin-bottom: 14px;
}
button.secondary {
    background: var(--surface);
    color: var(--ink);
    margin: 16px 0 28px;
}
button:disabled {
    opacity: 0.55;
    cursor: default;
    box-shadow: none;
}
:focus-visible {
    outline: 3px solid var(--primary-deep);
    outline-offset: 3px;
}
.error,
[aria-invalid="true"] {
    color: var(--danger);
    border-color: var(--danger);
}
.error {
    font-size: 14px;
    margin: 5px 0 0;
}
#print-correction {
    border: 2px solid var(--danger);
    background: var(--danger-surface);
    padding: 24px;
}
.sheet-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sheet-heading h2 {
    font-size: 32px;
    margin-bottom: 16px;
}
.sheet-heading img {
    object-fit: contain;
    flex-shrink: 0;
}
.needs {
    background: var(--mint);
    border: 1px solid var(--ink);
    border-radius: var(--r-sm);
    padding: 12px;
}
.clothing-row {
    display: flex;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding: 14px 0;
    break-inside: avoid;
}
.row-art {
    width: 136px;
    flex-shrink: 0;
}
.row-art > div {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
.row-art svg {
    width: 44px;
    height: 45px;
}
.row-copy {
    min-width: 0;
    overflow-wrap: anywhere;
}
.row-copy p {
    margin: 0;
}
.rain-rule {
    border: 2px solid var(--ink);
    background: var(--sky);
    padding: 16px;
    border-radius: var(--r-sm);
    break-inside: avoid;
}
.rain-rule p:last-child {
    margin: 0;
}
.rain-art {
    float: right;
    margin: 0 0 8px 10px;
}
.rain-art svg {
    width: 42px;
    height: 44px;
}
footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--ink);
}
.art-definitions {
    position: absolute;
    overflow: hidden;
}
@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 500px) {
    main {
        padding: 12px 16px 32px;
    }
    .panel,
    #agreement {
        padding: 16px;
    }
    .sheet-heading h2 {
        font-size: 26px;
    }
    .sheet-heading img {
        width: 54px;
        height: 70px;
    }
    .clothing-row {
        gap: 10px;
    }
    .row-art {
        width: 64px;
    }
    .row-art svg {
        width: 32px;
        height: 36px;
    }
}
@media print {
    html,
    body {
        background: var(--surface);
        margin: 0;
        padding: 0;
    }
    .screen-only {
        display: none !important;
    }
    main,
    .workspace,
    .preview {
        display: block;
        max-width: none;
        margin: 0;
        padding: 0;
    }
    #agreement {
        padding: 6mm;
        border-radius: 0;
        box-shadow: none;
        font-size: 10.5pt;
        line-height: 1.3;
        break-inside: avoid;
    }
    #agreement p {
        margin-bottom: 2.5mm;
    }
    .sheet-heading h2 {
        font-size: 24pt;
        margin-bottom: 3mm;
    }
    .sheet-heading img {
        width: 18mm;
        height: 22mm;
    }
    .needs {
        padding: 3mm;
    }
    .clothing-row {
        padding: 3mm 0;
        gap: 4mm;
        min-height: 19mm;
    }
    .row-art {
        width: 36mm;
    }
    .row-art svg {
        width: 10mm;
        height: 11mm;
    }
    h3 {
        font-size: 12pt;
    }
    .rain-rule {
        padding: 3mm;
    }
    .rain-art svg {
        width: 10mm;
        height: 11mm;
    }
    .small,
    footer {
        font-size: 9pt;
    }
    footer {
        margin-top: 3mm;
        padding-top: 3mm;
    }
}
