/* Pizzaiolo — /tools/pizza-maker
   Loaded only on that route (see header.php), before market.css, so rules are
   scoped under .pz-page with enough specificity to keep their look.
   Colour family: saffron (pasta is blueberry). Tokens: ai-design-system.css.
   Phone first: a 390 px wide screen is the main device. */

.pz-page {
    --pz-ink: var(--ink-deep, #0b1b1e);
    --pz-line: rgba(15, 35, 39, 0.16);
    --pz-stage-bg: #14302f;
    --pz-focus: #0f2327;
    padding: var(--space-4) 0 var(--space-12);
}

.pz-page [hidden] { display: none !important; }

.pz-page :focus-visible {
    outline: 3px solid var(--pz-focus);
    outline-offset: 2px;
}

/* ── breadcrumb + header ─────────────────────────────────────────── */

.pz-page .pz-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}
.pz-page .pz-crumbs a { color: var(--text-primary); text-decoration: none; border-bottom: 2px solid var(--border-strong); font-weight: 600; }
.pz-page .pz-crumbs a:hover { border-bottom-color: var(--saffron); }

.pz-page .pz-header {
    background: var(--saffron);
    color: var(--pz-ink);
    border: 1px solid var(--pz-line);
    border-radius: 18px;
    padding: clamp(1rem, 3vw, 1.8rem) clamp(1rem, 3vw, 2rem);
    margin-bottom: var(--space-4);
    box-shadow: var(--lift, 0 10px 26px -14px rgba(11, 27, 30, 0.28));
}
.pz-page .pz-header h1 {
    color: var(--pz-ink);
    font-size: clamp(2.1rem, 7vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0 0 0.6rem;
}
.pz-page .pz-kicker,
.pz-page .pz-result-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
    color: var(--pz-ink);
}
.pz-page .pz-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--tomato);
    box-shadow: 0 0 0 2px var(--pz-ink);
    flex: none;
}
.pz-page .pz-lead {
    max-width: 60ch;
    margin: 0;
    color: var(--pz-ink);
    font-size: clamp(0.95rem, 2.4vw, 1.08rem);
}

/* ── stepper (the steps really are sequential: dough → serve) ─────── */

.pz-page .pz-steps {
    list-style: none;
    margin: 0 0 var(--space-3);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
}
.pz-page .pz-step-btn {
    width: 100%;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 0;
    border: 1px solid var(--pz-line);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.pz-page .pz-step-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1;
}
.pz-page .pz-step-label {
    font-size: clamp(0.6rem, 2.6vw, 0.74rem);
    letter-spacing: -0.01em;
    font-weight: 700;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pz-page .pz-step.is-done .pz-step-btn { background: var(--saffron-soft); }
.pz-page .pz-step.is-active .pz-step-btn { background: var(--pz-ink); color: #fff; border-color: var(--pz-ink); }
.pz-page .pz-step-btn:disabled { color: var(--text-muted); background: var(--bg-tertiary); cursor: not-allowed; }
.pz-page .pz-step-btn:not(:disabled):hover { background: var(--saffron-soft); }
.pz-page .pz-step.is-active .pz-step-btn:hover { background: var(--pz-ink); }

/* ── layout ──────────────────────────────────────────────────────── */

.pz-page .pz-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
}

@media (min-width: 960px) {
    .pz-page .pz-layout {
        grid-template-columns: minmax(0, 1fr) 400px;
        align-items: start;
        gap: var(--space-5);
    }
    .pz-page .pz-stagecol { position: sticky; top: calc(var(--nav-height, 64px) + 12px); }
}

/* ── stage ───────────────────────────────────────────────────────── */

.pz-page .pz-stage {
    position: relative;
    width: 100%;
    height: clamp(300px, 52vh, 620px);
    height: clamp(300px, 52svh, 620px);
    border-radius: 16px;
    overflow: hidden;
    background: var(--pz-stage-bg);
    border: 1px solid var(--pz-line);
    box-shadow: var(--lift-2, 0 18px 34px -16px rgba(11, 27, 30, 0.34));
}
@media (min-width: 960px) {
    .pz-page .pz-stage { height: auto; aspect-ratio: 4 / 3.1; max-height: calc(100vh - 150px); }
}
.pz-page .pz-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
    -webkit-tap-highlight-color: transparent;
}
.pz-page .pz-stage canvas[data-mode="paint"],
.pz-page .pz-stage canvas[data-mode="place"] { cursor: crosshair; }
.pz-page .pz-stage canvas[data-mode="stretch"] { cursor: move; }
.pz-page .pz-stage canvas[data-mode="cut"] { cursor: col-resize; }
.pz-page .pz-stage canvas:focus-visible { outline: 3px solid var(--saffron); outline-offset: -3px; }

.pz-page .pz-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f6efe0;
    font-weight: 600;
}
.pz-page .pz-loading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 40%;
    background: var(--saffron);
    animation: pz-warm 1.3s ease-in-out infinite;
}
@keyframes pz-warm { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.pz-page .pz-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: var(--space-3);
    padding: var(--space-5);
    text-align: center;
    background: var(--saffron-soft);
    color: var(--text-primary);
}
.pz-page .pz-fallback p { margin: 0 auto; max-width: 38ch; color: var(--text-secondary); }
.pz-page .pz-fallback-links { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }

.pz-page .pz-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
}
.pz-page .pz-chip {
    white-space: nowrap;
    background: var(--saffron);
    color: var(--pz-ink);
    font-weight: 800;
    font-size: 0.82rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(11, 27, 30, 0.25);
}
.pz-page .pz-hud-tools { display: flex; gap: 6px; pointer-events: auto; }
.pz-page .pz-viewchip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    padding: 0.2rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(11, 27, 30, 0.62);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
@media (max-width: 480px) {
    .pz-page .pz-sound span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .pz-page .pz-sound { padding: 0.2rem 0.6rem; }
    .pz-page .pz-chip { font-size: 0.76rem; }
}
.pz-page .pz-viewchip:hover { background: rgba(11, 27, 30, 0.82); }
.pz-page .pz-viewchip:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.pz-page .pz-sound[aria-pressed="false"] .pz-sound-wave { opacity: 0.3; }

.pz-page .pz-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    margin: 0;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--pz-ink);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    pointer-events: none;
}

.pz-page .pz-keys {
    margin: var(--space-2) 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.pz-page .pz-keys kbd {
    font-family: inherit;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0 0.35rem;
    border: 1px solid var(--pz-line);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
}
@media (max-width: 959px) {
    .pz-page .pz-keys { display: none; }
}

/* ── control panel ───────────────────────────────────────────────── */

.pz-page .pz-panel {
    background: #fff;
    border: 1px solid var(--pz-line);
    border-radius: 16px;
    box-shadow: var(--lift, 0 10px 26px -14px rgba(11, 27, 30, 0.28));
}
.pz-page .pz-panel-head { padding: 0.9rem 1rem 0; }
.pz-page .pz-panel-head h2 {
    font-size: clamp(1.35rem, 4.6vw, 1.7rem);
    font-weight: 800;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}
.pz-page .pz-panel-head h2:focus { outline: none; }
.pz-page .pz-panel-head h2:focus-visible { outline: 3px solid var(--pz-focus); }
.pz-page .pz-guide { margin: 0; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.45; }
.pz-page .pz-panel-body { padding: 0.8rem 1rem 0.2rem; }

/* choices */
.pz-page .pz-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.pz-page .pz-choices--cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pz-page .pz-choice {
    font: inherit;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.pz-page .pz-choice:hover { background: var(--saffron-soft); }
.pz-page .pz-choice[aria-checked="true"] {
    background: var(--saffron-soft);
    border-color: var(--pz-ink);
    box-shadow: inset 0 0 0 1px var(--pz-ink), 3px 3px 0 var(--pz-ink);
}
.pz-page .pz-choice:disabled { opacity: 0.5; cursor: not-allowed; }
.pz-page .pz-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 58px;
    padding: 0.5rem 0.6rem;
    text-align: left;
}
.pz-page .pz-card-name { font-family: var(--font-display); font-weight: 800; font-size: 1rem; line-height: 1.1; }
.pz-page .pz-card-facts { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }
.pz-page .pz-crust-note { margin: 0.55rem 0 0; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.4; }
.pz-page .pz-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.3rem 0.75rem;
    font-weight: 650;
    font-size: 0.88rem;
}
.pz-page .pz-pill-sub { color: var(--text-secondary); font-weight: 600; font-size: 0.8rem; }
.pz-page .pz-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--sw);
    border: 1px solid rgba(11, 27, 30, 0.35);
    flex: none;
}
.pz-page .pz-swatch.is-none { background: repeating-linear-gradient(135deg, #fff 0 3px, #d3dcd9 3px 5px); }

/* meters */
.pz-page .pz-meter-row { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.75rem; }
.pz-page .pz-meter {
    position: relative;
    flex: 1 1 auto;
    min-width: 90px;
    height: 12px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    overflow: hidden;
    border: 1px solid var(--pz-line);
}
.pz-page .pz-meter-fill {
    position: absolute;
    inset: 0;
    transform-origin: left center;
    transform: scaleX(0);
    background: var(--pz-ink);
    border-radius: 999px;
    transition: transform 120ms linear;
}
.pz-page .pz-meter-band {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--leaf-soft);
    border-left: 2px solid var(--leaf);
    border-right: 2px solid var(--leaf);
}
.pz-page .pz-meter-fill { mix-blend-mode: multiply; opacity: 0.85; }
.pz-page .pz-meter-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--leaf); }
.pz-page .pz-meter-val { flex: 0 1 auto; font-size: 0.85rem; font-weight: 700; color: var(--text-primary); min-width: 9.5rem; }
.pz-page #pzSauceFill { background: var(--tomato); }
.pz-page #pzCheeseFill { background: var(--saffron-deep); }
.pz-page .pz-meter--bake { height: 14px; }
.pz-page .pz-meter-band--gold { background: var(--saffron-soft); border-color: var(--saffron-deep); }
.pz-page .pz-meter-fill--crust { background: linear-gradient(90deg, #e7cf9b 0%, #d99a4a 45%, #9a5a26 75%, #2a1a12 100%); background-size: 100% 100%; opacity: 0.95; mix-blend-mode: normal; }
.pz-page .pz-meter-fill--melt { background: var(--saffron-deep); }
.pz-page .pz-meter-burnt { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(42, 26, 18, 0.25) 0 4px, transparent 4px 8px); }

.pz-page .pz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.8rem; }
.pz-page .pz-actions .btn { min-height: 46px; }
.pz-page .pz-quiet { color: var(--text-secondary); }
.pz-page .pz-warn {
    margin: 0.6rem 0 0;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    background: var(--chili-soft);
    color: var(--chili-deep);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
}
.pz-page .pz-small { margin: 0.6rem 0 0; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.4; }

/* toppings report */
.pz-page .pz-report { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pz-page .pz-report li {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.4rem 0.65rem;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.35;
    background: var(--leaf-soft);
    color: var(--leaf-deep);
    font-weight: 600;
}
.pz-page .pz-report-k { font-weight: 800; color: var(--text-primary); min-width: 3.2rem; }
.pz-page .pz-report li[data-level="full"],
.pz-page .pz-report li[data-level="generous"] { background: var(--saffron-soft); color: var(--saffron-deep); }
.pz-page .pz-report li[data-level="wet"],
.pz-page .pz-report li[data-level="heavy"] { background: var(--chili-soft); color: var(--chili-deep); }
.pz-page .pz-report li[data-level="soggy"],
.pz-page .pz-report li[data-level="avalanche"] { background: var(--tomato-soft); color: var(--tomato-deep); }
.pz-page .pz-tips { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.86rem; color: var(--text-secondary); }
.pz-page .pz-tips li { margin: 0.15rem 0; }

/* bake */
.pz-page .pz-bake { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.8rem; }
.pz-page .pz-bake-clock {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 12px;
    background: var(--pz-ink);
    color: #fff;
    min-width: 5.6rem;
}
.pz-page .pz-clock { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pz-page .pz-clock-label { font-size: 0.7rem; font-weight: 600; color: #e9dfc6; }
.pz-page .pz-bake-meters { flex: 1 1 auto; min-width: 0; }
.pz-page .pz-bake-meters .pz-meter-row { margin-top: 0.3rem; flex-wrap: wrap; gap: 0.15rem 0.6rem; }
.pz-page .pz-bake-meters .pz-meter-val { min-width: 0; font-size: 0.82rem; }
.pz-page .pz-bake-btn { flex: 1 1 100%; font-size: 1.05rem; min-height: 52px; }
.pz-page .pz-bake-btn.is-hot { background: var(--pz-ink); color: #fff; }
.pz-page .pz-bake-btn.is-hot:hover { background: #000; }

/* finish */
.pz-page .pz-slice-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.pz-page .pz-slices { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }

/* ── dock: topping tray + nav (sticks to the bottom of the screen on phones) ── */

.pz-page .pz-dock {
    padding: 0.7rem 1rem 0.8rem;
    border-top: 1px solid var(--pz-line);
    margin-top: 0.8rem;
    background: #fff;
    border-radius: 0 0 16px 16px;
}
@media (max-width: 959px) {
    .pz-page .pz-tool[data-step="toppings"] .pz-dock,
    .pz-page .pz-tool[data-step="finish"] .pz-dock {
        position: sticky;
        bottom: 0;
        z-index: 5;
        box-shadow: 0 -10px 22px -18px rgba(11, 27, 30, 0.5);
        padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
    }
}
.pz-page .pz-tray-tools { display: flex; gap: 6px; margin-bottom: 0.55rem; }
.pz-page .pz-tool-btn { min-height: 40px; padding: 0.3rem 0.8rem; font-size: 0.86rem; }
.pz-page .pz-tray-tools #pzHandful { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz-page .pz-tray-tools #pzHandful span { overflow: hidden; text-overflow: ellipsis; }

.pz-page .pz-tray {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 2px 2px 6px;
    margin: 0 -2px;
    scrollbar-width: thin;
}
.pz-page .pz-tray-group {
    flex: none;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-secondary);
    padding: 0 1px;
    border-left: 2px solid var(--saffron);
}
.pz-page .pz-item {
    position: relative;
    flex: none;
    width: 74px;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    padding: 6px 4px 5px;
    border: 1px solid var(--pz-line);
    border-radius: 14px;
    background: #fbfcfb;
    color: var(--text-primary);
    font: inherit;
    cursor: grab;
    scroll-snap-align: start;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s var(--ease-spring, ease), background-color 0.15s, box-shadow 0.15s;
}
.pz-page .pz-item:hover { background: var(--saffron-soft); }
.pz-page .pz-item:active { cursor: grabbing; }
.pz-page .pz-item[aria-pressed="true"] {
    background: var(--saffron-soft);
    border-color: var(--pz-ink);
    box-shadow: inset 0 0 0 1px var(--pz-ink), 3px 3px 0 var(--pz-ink);
}
.pz-page .pz-item.is-dragging { opacity: 0.45; transform: scale(0.94); }
.pz-page .pz-item.is-suggested { background: var(--leaf-soft); }
.pz-page .pz-item:disabled { opacity: 0.45; cursor: not-allowed; }
.pz-page .pz-item-icon { width: 46px; height: 46px; display: block; pointer-events: none; }
.pz-page .pz-item-icon svg { width: 100%; height: 100%; display: block; }
.pz-page .pz-item-name { font-size: 0.72rem; font-weight: 700; line-height: 1.12; text-align: center; pointer-events: none; }
.pz-page .pz-item-after {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--leaf-deep);
    line-height: 1;
    pointer-events: none;
}
.pz-page .pz-item-count {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--pz-ink);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    pointer-events: none;
}

@media (min-width: 960px) {
    .pz-page .pz-tray {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        overflow: visible;
        max-height: none;
    }
    .pz-page .pz-tray-group {
        grid-column: 1 / -1;
        writing-mode: horizontal-tb;
        transform: none;
        justify-content: flex-start;
        border-left: 0;
        border-bottom: 2px solid var(--saffron);
        padding: 0.35rem 0 0.1rem;
        font-size: 0.75rem;
    }
    .pz-page .pz-item { width: auto; min-height: 86px; touch-action: none; }
}

.pz-page .pz-nav { display: flex; gap: 8px; }
.pz-page .pz-nav .btn { min-height: 48px; }
.pz-page #pzNext { flex: 1 1 auto; font-size: 1rem; }
.pz-page #pzNext.is-blocked { background: #6b7a7d; }
.pz-page .pz-gate { margin: 0.35rem 0 0; min-height: 0; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.35; }
.pz-page .pz-gate:empty { display: none; }
.pz-page .pz-gate.is-nudge { color: var(--tomato-deep); font-weight: 700; animation: pz-nudge 0.4s ease; }
@keyframes pz-nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* steps that need the screen for the pizza keep the panel compact on phones */
@media (max-width: 959px) {
    .pz-page .pz-tool[data-step="toppings"] .pz-panel-body,
    .pz-page .pz-tool[data-step="finish"] .pz-panel-body { padding-top: 0.5rem; }
    .pz-page .pz-tool[data-step="toppings"] .pz-guide,
    .pz-page .pz-tool[data-step="finish"] .pz-guide { font-size: 0.88rem; }
}

/* ── the drag ghost (lives on <body>, outside .pz-page) ──────────── */

.pz-ghost {
    position: fixed;
    left: 0;
    top: 0;
    width: 64px;
    height: 64px;
    z-index: 1000;
    pointer-events: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid #0b1b1e;
    box-shadow: 3px 3px 0 #0b1b1e;
    transition: opacity 0.18s, border-color 0.15s, background-color 0.15s;
    will-change: transform;
}
.pz-ghost svg { width: 100%; height: 100%; display: block; }
.pz-ghost.is-off { opacity: 0.6; border-style: dashed; background: rgba(255, 255, 255, 0.7); }
.pz-ghost.is-rim { border-color: #ee6a12; box-shadow: 3px 3px 0 #ee6a12; }
.pz-ghost.is-dropped { opacity: 0; transition: opacity 0.2s; }
.pz-ghost.is-cancelled { opacity: 0; transition: opacity 0.2s; }
html.pz-dragging, html.pz-dragging body { cursor: grabbing; user-select: none; -webkit-user-select: none; }

/* ── result ──────────────────────────────────────────────────────── */

.pz-page .pz-result { outline: none; }
.pz-page .pz-result:focus-visible { outline: 3px solid var(--pz-focus); outline-offset: 4px; border-radius: 8px; }
.pz-page .pz-verdict {
    font-size: clamp(1.7rem, 6vw, 2.3rem);
    font-weight: 800;
    margin: 0 0 0.2rem;
    color: var(--text-primary);
}
.pz-page .pz-result.is-flawed .pz-verdict { color: var(--tomato-deep); }
.pz-page .pz-stars { margin: 0 0 0.3rem; display: flex; gap: 4px; }
.pz-page .pz-star {
    width: 26px;
    height: 26px;
    display: inline-block;
    background: var(--bg-tertiary);
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.pz-page .pz-star.is-on { background: var(--saffron); box-shadow: inset 0 0 0 30px var(--saffron); }
.pz-page .pz-verdict-tip { margin: 0 0 0.7rem; color: var(--text-secondary); line-height: 1.45; }
.pz-page .pz-parts { list-style: none; margin: 0 0 0.8rem; padding: 0; display: grid; gap: 5px; }
.pz-page .pz-parts li { display: grid; grid-template-columns: 5.4rem 1fr 3rem; align-items: center; gap: 0.5rem; font-size: 0.86rem; }
.pz-page .pz-part-label { font-weight: 700; }
.pz-page .pz-part-bar { position: relative; height: 10px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; }
.pz-page .pz-part-fill { position: absolute; inset: 0; background: var(--saffron-deep); transform-origin: left center; border-radius: 999px; }
.pz-page .pz-part-val { text-align: right; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pz-page .pz-notes-title { font-size: 1rem; font-weight: 800; margin: 0.4rem 0 0.25rem; }
.pz-page .pz-notes { margin: 0 0 0.9rem; padding-left: 1.1rem; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.45; }
.pz-page .pz-notes li { margin: 0.2rem 0; }
.pz-page .pz-name-label,
.pz-page .pz-order-label { display: block; font-weight: 800; font-size: 0.9rem; margin: 0.3rem 0 0.3rem; color: var(--text-primary); }
.pz-page .pz-name {
    width: 100%;
    min-height: 46px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    font-size: 1.05rem;
    background: #fff;
    color: var(--text-primary);
}
.pz-page .pz-name:focus-visible { outline: 3px solid var(--pz-focus); outline-offset: 1px; }
.pz-page .pz-order {
    margin: 0;
    padding: 0.7rem 0.85rem;
    background: var(--saffron-soft);
    border-radius: 12px;
    border-left: 4px solid var(--saffron-deep);
    color: var(--pz-ink);
    line-height: 1.5;
    font-size: 0.95rem;
}
.pz-page .pz-actions--order { align-items: center; }
.pz-page .pz-copied { font-size: 0.85rem; font-weight: 700; color: var(--leaf-deep); }
.pz-page .pz-finder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: 0.9rem;
    font-size: 1.05rem;
    text-align: center;
    text-decoration: none;
}
.pz-page .pz-linkbtn {
    background: none;
    border: 0;
    padding: 0.4rem 0.2rem;
    min-height: 44px;
    font: inherit;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
}

/* the result replaces the dock's tray; keep it readable on the serve step */
.pz-page .pz-tool[data-step="serve"] .pz-panel-body { padding-bottom: 0.4rem; }

/* ── guide + FAQ (crawlable content below the tool) ──────────────── */

.pz-page .pz-guide-content,
.pz-page .pz-faq {
    max-width: 72ch;
    margin: var(--space-8) 0 0;
}
.pz-page .pz-guide-content h2,
.pz-page .pz-faq h2 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; color: var(--text-primary); margin-bottom: 0.6rem; }
.pz-page .pz-guide-content h3 { font-size: clamp(1.2rem, 3.6vw, 1.45rem); font-weight: 800; margin: 1.6rem 0 0.4rem; color: var(--text-primary); }
.pz-page .pz-guide-content p,
.pz-page .pz-guide-content li { color: var(--text-secondary); line-height: 1.65; }
.pz-page .pz-guide-content ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.pz-page .pz-guide-content li { margin: 0.3rem 0; }
.pz-page .pz-guide-content a,
.pz-page .pz-faq a { color: var(--text-primary); font-weight: 700; text-decoration-color: var(--saffron-deep); text-underline-offset: 3px; }
.pz-page .pz-table-wrap { overflow-x: auto; margin: 0 0 1rem; border: 1px solid var(--pz-line); border-radius: 12px; background: #fff; }
.pz-page .pz-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 480px; }
.pz-page .pz-table th,
.pz-page .pz-table td { padding: 0.55rem 0.7rem; text-align: left; border-bottom: 1px solid var(--pz-line); color: var(--text-primary); }
.pz-page .pz-table thead th { background: var(--saffron-soft); font-weight: 800; }
.pz-page .pz-table tbody tr:last-child > * { border-bottom: 0; }
.pz-page .pz-more { margin-top: 1.4rem; }
.pz-page .pz-faq-item { border: 1px solid var(--pz-line); border-radius: 12px; background: #fff; margin: 0 0 0.5rem; }
.pz-page .pz-faq-item summary { cursor: pointer; padding: 0.8rem 1rem; font-weight: 800; color: var(--text-primary); min-height: 44px; }
.pz-page .pz-faq-item p { margin: 0; padding: 0 1rem 0.9rem; color: var(--text-secondary); line-height: 1.6; }
.pz-page .pz-noscript { margin-top: 1rem; padding: 1rem; background: var(--saffron-soft); border-radius: 12px; }

/* tool unavailable: the guide is the experience */
.pz-page .pz-tool.is-unavailable .pz-panel,
.pz-page .pz-tool.is-unavailable .pz-steps,
.pz-page .pz-tool.is-unavailable .pz-hud { display: none; }
.pz-page .pz-tool.is-unavailable .pz-layout { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 380px) {
    .pz-page .pz-step-label { font-size: 0.62rem; }
    .pz-page .pz-card { padding: 0.45rem 0.45rem; }
    .pz-page .pz-card-name { font-size: 0.92rem; }
    .pz-page .pz-meter-val { min-width: 0; }
    .pz-page .pz-bake { gap: 0.6rem; }
    .pz-page .pz-bake-clock { min-width: 4.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pz-page *,
    .pz-ghost { transition: none !important; animation: none !important; }
    .pz-page .pz-loading::after { display: none; }
}
