:root {
    --ink: #25263a;
    --muted: #6f7080;
    --paper: #fffdf8;
    --cream: #fff5df;
    --line: rgba(37, 38, 58, 0.12);
    --coral: #ed6a5a;
    --coral-dark: #c94f43;
    --mint: #2a9d8f;
    --yellow: #f2b134;
    --purple: #7b5ea7;
    --shadow-soft: 0 18px 55px rgba(43, 38, 58, 0.10);
    --shadow-card: 0 9px 24px rgba(43, 38, 58, 0.08);
    --radius-xl: 32px;
    --radius-lg: 23px;
    --radius-md: 16px;
    color-scheme: light;
    font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: #fbf7ee;
    min-height: 100vh;
    line-height: 1.5;
}

button, input { font: inherit; }

button { color: inherit; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(42, 157, 143, 0.35);
    outline-offset: 3px;
}

[hidden] { display: none !important; }

.site-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    padding: 24px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px 16px 16px 6px;
    background: var(--coral);
    box-shadow: 0 8px 18px rgba(237, 106, 90, 0.24);
    font-size: 21px;
    transform: rotate(-4deg);
}

.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 18px; letter-spacing: -0.02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.tiny-promise { color: var(--muted); font-size: 13px; font-weight: 700; }

.private-badge,
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.private-badge span,
.live-pill i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #36b37e;
    box-shadow: 0 0 0 4px rgba(54, 179, 126, 0.12);
}

.quiet-button {
    padding: 9px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}
.quiet-button:hover { background: rgba(37, 38, 58, 0.06); color: var(--ink); }

.configurator {
    position: relative;
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    padding: 56px 0 44px;
}

.intro { width: min(800px, 100%); margin-bottom: 43px; }
.eyebrow {
    margin: 0 0 12px;
    color: var(--coral-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.intro h1,
.login-art h1 {
    margin: 0;
    font-size: clamp(43px, 5.3vw, 78px);
    line-height: 0.99;
    letter-spacing: -0.055em;
}

.intro h1 em {
    color: var(--coral);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

.intro > p:last-child {
    max-width: 650px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(380px, 0.84fr);
    align-items: start;
    gap: 28px;
}

.control-panel,
.preview-card,
.downloads-card {
    border: 1px solid rgba(37, 38, 58, 0.08);
    border-radius: var(--radius-xl);
    background: rgba(255, 253, 248, 0.94);
    box-shadow: var(--shadow-soft);
}

.control-panel { overflow: hidden; }

.control-section { padding: 29px 31px 32px; }
.control-section + .control-section { border-top: 1px solid var(--line); }

.section-title {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 22px;
}

.section-title > span {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 11px 11px 11px 4px;
    background: var(--ink);
    color: white;
    font-size: 13px;
    font-weight: 900;
}

.section-title h2 { margin: 0; font-size: 19px; line-height: 1.2; letter-spacing: -0.02em; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.model-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.model-card {
    position: relative;
    display: grid;
    justify-items: center;
    min-height: 112px;
    padding: 12px 8px 10px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: white;
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.model-card:hover { transform: translateY(-3px) rotate(-0.4deg); border-color: rgba(237, 106, 90, 0.45); box-shadow: var(--shadow-card); }
.model-card.is-selected { border-color: var(--coral); background: #fff5f0; box-shadow: 0 0 0 2px rgba(237, 106, 90, 0.12); }

.model-icon {
    display: grid;
    place-items: center;
    width: 47px;
    height: 47px;
    border-radius: 16px;
    background: var(--cream);
    font-size: 25px;
    line-height: 1;
}
.model-card:nth-child(3n+2) .model-icon { background: #e7f5f1; }
.model-card:nth-child(3n+3) .model-icon { background: #eee8f7; }

.model-label { display: grid; justify-items: center; margin-top: 7px; line-height: 1.1; }
.model-label strong { font-size: 12px; }
.model-label small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.08em; }
.tested-dot { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--mint); color: white; font-size: 10px; font-weight: 900; }

.text-field { display: grid; gap: 8px; }
.text-field > span:first-child,
.choice-field legend,
.color-field label { color: var(--ink); font-size: 12px; font-weight: 850; }

.name-input-wrap { position: relative; display: block; }
.text-field input {
    width: 100%;
    height: 58px;
    padding: 0 84px 0 17px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
    color: var(--ink);
    font-size: 20px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.text-field input:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(237, 106, 90, 0.11); outline: 0; }
.name-input-wrap output { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; font-weight: 800; }

.choice-field { min-width: 0; margin: 19px 0 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 8px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 6px; border-radius: 17px; background: rgba(37, 38, 58, 0.055); }
.segmented--two { grid-template-columns: repeat(2, 1fr); }
.segmented button { min-height: 48px; padding: 7px 11px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 850; }
.segmented button small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 650; }
.segmented button.is-selected { background: white; box-shadow: 0 5px 14px rgba(43, 38, 58, 0.09); color: var(--coral-dark); }

.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.field-heading output { color: var(--muted); font-family: Consolas, monospace; font-size: 10px; font-weight: 700; }
.color-row { display: flex; align-items: center; gap: 10px; min-height: 53px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.color-input { flex: 0 0 auto; width: 35px; height: 35px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: pointer; overflow: hidden; }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 9px; }
.swatches { display: flex; align-items: center; gap: 5px; }
.swatch { width: 24px; height: 24px; padding: 0; border: 2px solid white; border-radius: 50%; background: #ddd; box-shadow: 0 0 0 1px rgba(37, 38, 58, 0.11); cursor: pointer; transition: transform 120ms ease; }
.swatch:hover { transform: scale(1.14); }
.swatch[data-color="#ED6A5A"] { background: #ed6a5a; }
.swatch[data-color="#2A9D8F"] { background: #2a9d8f; }
.swatch[data-color="#457B9D"] { background: #457b9d; }
.swatch[data-color="#7B5EA7"] { background: #7b5ea7; }
.swatch[data-color="#F2B134"] { background: #f2b134; }
.swatch[data-color="#FFF8E7"] { background: #fff8e7; }
.swatch[data-color="#F7A9A8"] { background: #f7a9a8; }
.swatch[data-color="#BDE0FE"] { background: #bde0fe; }
.swatch[data-color="#FDE68A"] { background: #fde68a; }
.swatch[data-color="#242733"] { background: #242733; }

.admin-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-options .choice-field { margin-top: 0; }
.context-note { margin: 15px 0 0; padding: 11px 13px; border-radius: 12px; background: #f2f7f5; color: #527069; font-size: 11px; }

.preview-panel { position: sticky; top: 24px; display: grid; gap: 18px; }
.preview-card { padding: 19px; }
.preview-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 3px 15px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: capitalize; }

.preview-stage {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    border-radius: 22px;
    background:
        radial-gradient(circle at 18% 18%, rgba(237, 106, 90, 0.12), transparent 25%),
        radial-gradient(circle at 84% 80%, rgba(42, 157, 143, 0.12), transparent 25%),
        #f7eddb;
    user-select: none;
}

.preview-stage canvas { display: none; width: 100%; height: 100%; object-fit: contain; }
.preview-stage.has-preview canvas { display: block; }
.preview-stage.has-preview .preview-placeholder { display: none; }

.preview-placeholder,
.preview-loader { display: grid; place-items: center; text-align: center; padding: 40px; }
.preview-loader {
    position: absolute;
    z-index: 4;
    inset: 0;
    align-content: center;
    background: rgba(247, 237, 219, 0.82);
    backdrop-filter: blur(5px);
}
.preview-placeholder strong,
.preview-loader strong { margin-top: 12px; font-size: 16px; }
.preview-placeholder small,
.preview-loader small { max-width: 270px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.placeholder-paw { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 30px 30px 30px 10px; background: white; box-shadow: var(--shadow-card); font-size: 37px; transform: rotate(-5deg); }
.placeholder-orbit { position: absolute; border: 1px dashed rgba(37, 38, 58, 0.13); border-radius: 50%; }
.orbit-one { width: 280px; height: 280px; }
.orbit-two { width: 370px; height: 370px; }

.preview-loader span { width: 46px; height: 46px; border: 4px solid rgba(237, 106, 90, 0.18); border-top-color: var(--coral); border-radius: 50%; animation: spin 750ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.preview-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-top: 15px; }
.primary-button,
.secondary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 17px;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}
.primary-button { justify-content: space-between; background: var(--coral); color: white; box-shadow: 0 10px 22px rgba(237, 106, 90, 0.25); }
.primary-button b { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: rgba(255, 255, 255, 0.18); }
.secondary-button { background: rgba(37, 38, 58, 0.07); }
.secondary-button--dark { background: var(--ink); color: white; }
.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) { transform: translateY(-2px); }
.primary-button:disabled,
.secondary-button:disabled { cursor: not-allowed; opacity: 0.52; box-shadow: none; }

.status-message { min-height: 21px; padding: 9px 3px 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.status-message.is-error { color: #b63636; }
.status-message.is-success { color: #2c7a61; }

.customer-note { display: flex; gap: 12px; align-items: center; padding: 15px 18px; border: 1px solid rgba(42, 157, 143, 0.16); border-radius: 18px; background: rgba(232, 247, 242, 0.74); }
.customer-note > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; background: var(--mint); color: white; }
.customer-note p { margin: 0; color: #56746c; font-size: 11px; }
.customer-note strong { display: block; color: #31584e; font-size: 12px; }

.downloads-card { padding: 23px; }
.downloads-card h2 { margin: 0; font-size: 21px; }
.downloads-card div > p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.download-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 17px; }
.download-link { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); text-decoration: none; }
.download-link:hover { border-color: var(--purple); background: #faf7ff; }
.download-extension { display: grid; place-items: center; width: 37px; height: 37px; flex: 0 0 auto; border-radius: 11px; background: #eee8f7; color: var(--purple); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.download-link span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 750; }
.download-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; }

.collection-note { display: flex; align-items: center; gap: 16px; margin-top: 25px; padding: 0 10px; color: var(--muted); font-size: 11px; }
.collection-note span { flex: 0 0 auto; color: #2c7a61; font-weight: 850; }
.collection-note p { margin: 0; }

.login-shell { display: grid; grid-template-columns: 1.08fr 0.92fr; min-height: 100vh; }
.login-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 48px 6vw 65px; background: var(--ink); color: white; }
.login-brand { position: relative; z-index: 2; }
.login-brand .brand-copy small { color: rgba(255,255,255,.58); }
.login-art h1 { position: relative; z-index: 2; font-size: clamp(47px, 5vw, 76px); }
.login-art .eyebrow { color: #f7b9af; }
.giant-paw { position: absolute; top: 46%; left: 50%; font-size: min(31vw, 410px); opacity: 0.065; transform: translate(-50%, -50%) rotate(-12deg); }
.floating-tag { position: absolute; z-index: 1; padding: 10px 19px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.07); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.tag-one { top: 25%; right: 14%; transform: rotate(8deg); }
.tag-two { top: 43%; left: 13%; transform: rotate(-8deg); }
.tag-three { right: 23%; bottom: 30%; transform: rotate(-3deg); }
.login-panel { display: grid; place-items: center; padding: 36px; background: #fbf7ee; }
.login-card { width: min(430px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 29px; background: white; box-shadow: var(--shadow-soft); }
.login-icon { display: grid; place-items: center; width: 49px; height: 49px; margin-bottom: 22px; border-radius: 17px 17px 17px 6px; background: var(--coral); color: white; font-size: 20px; }
.login-card h2 { margin: 0; font-size: 31px; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow) { margin: 10px 0 25px; color: var(--muted); font-size: 13px; }
.login-card .text-field input { padding-right: 17px; text-transform: none; letter-spacing: 0; }
.login-card .primary-button { width: 100%; margin-top: 17px; }

@media (max-width: 1080px) {
    .workspace { grid-template-columns: 1fr; }
    .preview-panel { position: static; grid-row: 1; }
    .preview-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(290px, .9fr); column-gap: 18px; }
    .preview-topline { grid-column: 1 / -1; }
    .preview-stage { grid-row: span 3; }
    .preview-actions { align-content: end; grid-template-columns: 1fr; }
    .status-message { align-self: start; }
    .customer-note { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .site-header,
    .configurator { width: min(100% - 28px, 1400px); }
    .site-header { padding: 17px 0; }
    .brand-copy small,
    .tiny-promise,
    .private-badge { display: none; }
    .configurator { padding-top: 34px; }
    .intro { margin-bottom: 30px; }
    .intro h1 { font-size: clamp(39px, 12vw, 59px); }
    .intro > p:last-child { font-size: 15px; }
    .preview-card { display: block; padding: 13px; border-radius: 24px; }
    .preview-actions { grid-template-columns: 1fr; }
    .control-section { padding: 24px 17px 26px; }
    .model-grid { grid-template-columns: repeat(2, 1fr); }
    .model-card { min-height: 94px; grid-template-columns: 42px 1fr; justify-items: start; align-items: center; text-align: left; }
    .model-label { justify-items: start; margin: 0 0 0 9px; }
    .color-grid,
    .admin-options { grid-template-columns: 1fr; }
    .collection-note { display: block; }
    .collection-note p { margin-top: 5px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-art { min-height: 34vh; padding: 31px 28px; }
    .login-art h1 { margin-top: 50px; font-size: 43px; }
    .login-panel { padding: 22px 14px; }
    .login-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
