/* Palette, fonts and radii live in tokens.css (loaded first). This file only uses the variables. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.ico { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); } .small { font-size: 12px; } .grow { flex: 1; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
body { overflow: hidden; }
#app { height: 100%; height: 100dvh; display: flex; flex-direction: column; min-height: 0; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--danger); } .btn.small { min-height: 28px; padding: 3px 10px; font-size: 13px; } .btn.big { min-height: 44px; padding: 10px 22px; font-size: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); padding: 0; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn[aria-pressed="true"], .icon-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.icon-btn.small { width: 26px; height: 26px; }
input[type=text], input[type=number], select, textarea { width: 100%; min-height: 32px; padding: 4px 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
input[type=color] { width: 36px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
label.field { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
label.field > :not(span:first-child) { color: var(--text); font-size: 14px; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .stack { display: grid; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slider-row { display: grid; grid-template-columns: 84px 1fr 58px; align-items: center; gap: 8px; font-size: 13px; }
.slider-row input[type=number] { padding: 2px 4px; min-height: 28px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.notice { padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); border: 1px solid transparent; font-size: 13px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); } .notice.error { background: var(--danger-soft); color: var(--danger); } .notice.ok { background: var(--ok-soft); color: var(--ok); }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.toasts { position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(560px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.toast.error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); } .toast.ok { border-color: var(--ok); }

/* pages (start / prepare / lettering) */
.page { flex: 1; overflow: auto; }
.page-bar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: .2px; background: none; border: 0; cursor: pointer; color: var(--text); padding: 4px 6px; border-radius: 6px; }
.brand .logo { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; color: var(--accent-text); font-size: 13px; font-weight: 800; }
.wrap-main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.hero h1 { font-size: 30px; margin: 8px 0 6px; line-height: 1.15; } .hero p { font-size: 16px; color: var(--muted); max-width: 680px; margin: 0 0 8px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: grid; gap: 10px; align-content: start; text-align: left; box-shadow: var(--shadow); }
.card h2 { margin: 0; font-size: 18px; } .card p { margin: 0; color: var(--muted); }
button.card { cursor: pointer; font: inherit; color: inherit; } button.card:hover { border-color: var(--accent); }
.card .badge { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.pricebox { background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; padding: 12px 16px; }
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; color: var(--muted); background: var(--surface-2); }
.stepper li .n { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.stepper li.done { color: var(--ok); } .stepper li.done .n { background: var(--ok-soft); }
.stepper li.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; } .stepper li.current .n { background: var(--accent); color: var(--accent-text); }
.dropzone { border: 2px dashed var(--border); border-radius: 14px; background: var(--surface); padding: 46px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.prep { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.prep-view { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.cmp { display: grid; gap: 10px; grid-template-columns: 1fr; min-height: 300px; align-items: center; }
.cmp.sbs { grid-template-columns: 1fr 1fr; }
.cmp figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.cmp img { display: block; width: auto; height: auto; max-width: 100%; max-height: 62vh; object-fit: contain; min-width: 120px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; border-radius: 6px; }
.cmp figcaption { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 12px; cursor: pointer; min-height: 30px; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; } .seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.panel-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.panel-box h3 { margin: 0; font-size: 14px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: var(--accent); border-radius: 3px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }
.lettering-preview { font-size: 28px; padding: 16px; border-radius: 8px; background: var(--surface-2); text-align: center; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } .prep { grid-template-columns: minmax(0, 1fr); } .cmp.sbs { grid-template-columns: 1fr; } .hero h1 { font-size: 24px; } .wrap-main { padding: 16px 14px 40px; } .page-bar { padding: 8px 12px; } }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* tool-rail buttons must never be squeezed below their size by the scrolling flex rail (WCAG 2.2 target size, measured 20 px before) */
.rail .icon-btn, .rail .feat-btn { flex: 0 0 auto; min-width: 28px; min-height: 28px; }
