* {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
body {
    margin: 0;
    color: var(--ink);
    background: var(--background);
    font: 16px/1.45 var(--body);
}
a {
    color: var(--primary-deep);
}
button,
input,
select {
    font: inherit;
    color: inherit;
}
button,
input,
select,
.design > span {
    border: 2px solid var(--ink);
    border-radius: var(--r-sm);
}
input,
select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    min-height: 46px;
}
button {
    padding: 12px 20px;
    background: var(--primary);
    color: var(--primary-text);
    cursor: pointer;
    font-weight: 700;
    box-shadow: 3px 3px 0 var(--ink);
}
button:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--ink);
}
:focus-visible {
    outline: 3px solid var(--primary-deep);
    outline-offset: 4px;
}
h1,
h2,
legend,
.label-brand {
    font-family: var(--display);
}
h1 {
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.1;
    margin: 0 0 12px;
}
h2,
legend {
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
    margin: 0 0 12px;
}
p {
    margin: 0 0 12px;
}
.screen {
    max-width: 1060px;
    margin: auto;
    padding: 20px 20px 40px;
}
nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 700;
}
header {
    max-width: 700px;
    margin-bottom: 24px;
}
.eyebrow {
    color: var(--primary-deep);
    font-weight: 700;
    margin-bottom: 8px;
}
.workspace {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: start;
}
.panel {
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: 4px 4px 0 var(--ink);
}
fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 24px;
    min-width: 0;
}
.designs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.design {
    position: relative;
    cursor: pointer;
}
.design input {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    accent-color: var(--primary-deep);
}
.design > span {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    text-align: center;
    background: var(--background);
}
.design svg {
    width: 100%;
    height: 110px;
}
.design strong {
    font-size: 14px;
    line-height: 1.3;
}
.design input:checked + span {
    background: var(--mint);
    box-shadow: 3px 3px 0 var(--ink);
}
.design input:focus-visible {
    outline: none;
}
.design input:focus-visible + span {
    outline: 3px solid var(--primary-deep);
    outline-offset: 3px;
}
label:not(.design) {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}
.field {
    margin-bottom: 20px;
}
.hint,
footer {
    color: var(--muted);
    font-size: 14px;
}
.hint {
    margin: 6px 0 0;
}
.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.preview {
    text-align: center;
}
#preview-label {
    margin: 20px auto;
    width: max-content;
    padding: 8px;
    background: var(--background);
    border-radius: var(--r-sm);
}
#sheet-summary {
    font-weight: 700;
}
#print {
    margin-top: 20px;
    width: 100%;
}
.instructions {
    grid-column: 1 / -1;
}
.instructions ol {
    padding-left: 22px;
    margin: 0;
}
.instructions li {
    padding: 0 0 12px 6px;
}
.instructions p {
    margin: 0;
}
footer {
    padding-top: 28px;
}
#browser-url {
    overflow-wrap: anywhere;
}
.copy-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.copy-link-row input {
    flex: 1 1 240px;
    min-width: 0;
}
.copy-link-row button {
    flex: 0 0 auto;
}
button.secondary {
    background: var(--surface);
    color: var(--ink);
}
.art-definitions {
    position: absolute;
    overflow: hidden;
}
.sticker {
    position: relative;
    width: 50mm;
    height: 80mm;
    padding: 3mm;
    border: 0.2mm dashed var(--ink);
    background: var(--surface);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    break-inside: avoid;
}
.label-brand {
    font-size: 6mm;
    font-weight: 800;
    line-height: 1.1;
    padding-top: 1mm;
}
.label-art {
    display: block;
    width: 42mm;
    height: 49mm;
    flex: none;
}
.nickname {
    width: 100%;
    height: 10mm;
    font: 700 4mm/1.2 var(--body);
    text-align: center;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
/* Corner ticks sit outside the cut boundary, safely within each 6 mm gap. */
.sticker::before,
.sticker::after {
    content: "";
    position: absolute;
    inset: -1.5mm;
    pointer-events: none;
    border: 0.2mm solid var(--ink);
    clip-path: polygon(
        0 0,
        4mm 0,
        4mm 0.2mm,
        0.2mm 0.2mm,
        0.2mm 4mm,
        0 4mm,
        0 0,
        100% 0,
        100% 4mm,
        calc(100% - 0.2mm) 4mm,
        calc(100% - 0.2mm) 0.2mm,
        calc(100% - 4mm) 0.2mm,
        calc(100% - 4mm) 0
    );
}
.sticker::after {
    transform: rotate(180deg);
}
#print-sheet {
    display: none;
}
@media (max-width: 650px) {
    .screen {
        padding: 12px 16px 28px;
    }
    .workspace {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .panel {
        padding: 18px;
    }
    nav {
        margin-bottom: 16px;
    }
    .design svg {
        height: 100px;
    }
}
@media print {
    html,
    body {
        margin: 0;
        padding: 0;
        background: var(--surface);
    }
    .screen {
        display: none !important;
    }
    #print-sheet:not([hidden]) {
        display: block;
        width: 162mm;
        margin: 0 auto;
        padding: 0;
        max-width: none;
        transform: none;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    .print-heading {
        margin: 0 0 5mm;
        font-size: 3mm;
        line-height: 1.3;
    }
    .print-heading p {
        margin: 1mm 0 0;
    }
    #label-grid {
        display: grid;
        grid-template-columns: repeat(3, 50mm);
        grid-auto-rows: 80mm;
        gap: 6mm;
    }
    .sticker {
        box-shadow: none;
        margin: 0;
        transform: none;
        max-width: none;
        border-radius: 0;
    }
    .calibration {
        display: flex;
        gap: 5mm;
        align-items: center;
        margin-top: 7mm;
        break-inside: avoid;
    }
    #calibration-box {
        width: 25.4mm;
        height: 25.4mm;
        flex: 0 0 25.4mm;
        border: 0.3mm solid var(--ink);
    }
    .calibration p {
        margin: 0;
        font-size: 3mm;
        line-height: 1.4;
    }
}
