/* ==========================================
   InkSkipper — Brand System Styles
   Think. Ink. Done.
   Ink on cream paper · wings in family navy ·
   one bright: Wet Ink Blue · gold droplets only
   ========================================== */

:root {
    --bg: #FFFAF5;              /* cream — family paper */
    --surface: #FFFFFF;
    --surface-2: #F8F0E6;
    --border: rgba(10, 37, 64, 0.14);
    --text: #0A2540;            /* deep ink navy */
    --text-muted: #47576B;
    --cream: #FFFAF5;
    --navy: #0A2540;
    --ink: #2458E6;             /* wet ink blue — the one bright */
    --ink-glow: rgba(36, 88, 230, 0.12);
    --ink-dim: #1A44B8;
    --warm-gold: #E89B23;
    --accent-green: #2E9E5B;
    --accent-red: #C93A3A;
    --shadow: 0 2px 18px rgba(10, 37, 64, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-brand: 'Fraunces', Georgia, serif;
    --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ==========================================
   PASSWORD GATE — butterfly hero
   ========================================== */
.gate-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: hidden;
}

.gate-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 20px;
    text-align: center;
}

.gate-mark {
    width: min(250px, 60vw);
    height: auto;
    animation: floatIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(-40px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* The butterfly breathes: gentle float + an ambient wing-flap
   every few seconds; hover (or tap-hold) makes it flutter fast. */
.gate-mark .flap { transform-origin: 240px 100px; }
@media (prefers-reduced-motion: no-preference) {
    .gate-mark { animation: floatIn 1.2s cubic-bezier(0.16,1,0.3,1) both, heroFloat 7s ease-in-out 1.2s infinite; }
    @keyframes heroFloat {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }
    .gate-mark .flap { animation: ambientFlap 6s ease-in-out infinite; }
    .gate-mark:hover .flap, .gate-mark:active .flap { animation: rapidFlap 0.45s ease-in-out infinite; }
    @keyframes ambientFlap {
        0%, 78%, 100% { transform: scaleX(1); }
        85% { transform: scaleX(0.8); }
        91% { transform: scaleX(1.04); }
        96% { transform: scaleX(0.94); }
    }
    @keyframes rapidFlap {
        0%, 100% { transform: scaleX(1); }
        50% { transform: scaleX(0.74); }
    }
}

/* Butterfly part colors (shared by gate + header marks) */
.fw, .hw, .bd { fill: var(--navy); }
.fwdot { fill: var(--cream); }
.dp { fill: var(--warm-gold); }
.ant { stroke: var(--navy); stroke-width: 7; stroke-linecap: round; fill: none; }
.slit { stroke: var(--cream); stroke-width: 5; stroke-linecap: round; }
.hole { fill: var(--cream); }

.gate-wordmark {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: clamp(42px, 10vw, 64px);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-top: 18px;
    animation: fadeUp 1s ease 0.4s both;
}
.gate-wordmark .wm-ink { color: var(--ink); }

/* Tagline under hero */
.hero-tagline {
    margin-top: 16px;
    text-align: center;
    z-index: 2;
    animation: fadeUp 1s ease 0.6s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-tagline .tagline-text {
    font-family: var(--font-brand);
    font-weight: 600;
    font-size: 21px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.hero-tagline .tagline-text .tag-dot { color: var(--warm-gold); }

.hero-tagline .tagline-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--text-muted);
    opacity: 0.65;
    margin-top: 12px;
    text-transform: uppercase;
}

/* Beta login form */
.gate-form {
    margin-top: 36px;
    text-align: center;
    animation: fadeUp 1s ease 0.8s both;
}

.dot { color: var(--warm-gold); }

.gate-sub {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 10px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

#gate-password {
    display: block;
    width: 280px;
    margin: 0 auto 16px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 16px;
    font-family: var(--font);
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

#gate-password:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px var(--ink-glow);
}

#gate-submit {
    display: block;
    width: 280px;
    margin: 0 auto;
    padding: 14px;
    background: var(--ink);
    color: var(--cream);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

#gate-submit:hover { background: var(--ink-dim); box-shadow: 0 4px 16px var(--ink-glow); }

.gate-error {
    color: var(--accent-red);
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

/* ==========================================
   MAIN APP LAYOUT
   ========================================== */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* ==========================================
   HEADER
   ========================================== */
.header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg);
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-mark {
    flex-shrink: 0;
    width: 34px;
    height: auto;
}

.logo {
    font-family: var(--font-brand);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.logo .wm-ink { color: var(--ink); }

.tagline {
    font-family: var(--font-brand);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ==========================================
   CHAT
   ========================================== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.chat-messages {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.6;
    animation: fadeInUp 0.3s ease;
}

.chat-bubble.agent {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-bubble.agent .agent-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
    font-weight: 700;
}

.chat-bubble.user {
    background: var(--ink);
    color: var(--cream);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.chat-bubble .pro-tip {
    display: block;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.chat-bubble .pro-tip strong {
    color: var(--warm-gold);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px 18px;
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--ink);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ==========================================
   SELECTOR PANELS
   ========================================== */
.selector-panel {
    max-width: 680px;
    margin: 8px auto;
    animation: fadeInUp 0.3s ease;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.product-card:hover {
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--ink-glow);
}

.product-card .product-icon {
    font-size: 32px;
}

/* COLOR GRID */
.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.color-swatch {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
}

.color-swatch:hover {
    border-color: var(--ink);
    transform: scale(1.05);
    box-shadow: 0 6px 20px var(--ink-glow);
}

.color-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* STYLE GRID */
.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.style-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.style-card:hover {
    border-color: var(--ink);
    transform: translateY(-1px);
}

.style-card.recommended {
    border-color: var(--warm-gold);
    background: rgba(232, 155, 35, 0.07);
}

.style-name {
    font-size: 14px;
    font-weight: 600;
}

.style-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--warm-gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ==========================================
   DESIGN GALLERY
   ========================================== */
.gallery {
    max-width: 680px;
    margin: 16px auto;
    animation: fadeInUp 0.3s ease;
}

.gallery-title {
    font-family: var(--font-brand);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.design-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.design-card {
    position: relative;
    aspect-ratio: 1;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.design-card:hover {
    border-color: var(--ink);
    transform: scale(1.02);
}

.design-card.selected {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px var(--ink-glow), 0 6px 24px var(--ink-glow);
}

.design-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.design-card .design-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(10, 37, 64, 0.82);
    color: var(--cream);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.design-card .generating-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 13px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.gallery-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Direction chip — names the art direction on each generated design */
.design-card .design-direction {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    background: rgba(10, 37, 64, 0.85);
    color: var(--cream);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* ==========================================
   ORDER PANEL
   ========================================== */
.order-panel {
    max-width: 480px;
    margin: 16px auto;
    animation: fadeInUp 0.3s ease;
}

.order-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.order-summary h3 {
    font-family: var(--font-brand);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.order-preview {
    width: 100%;
    aspect-ratio: 1;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.order-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.order-details {
    margin-bottom: 20px;
}

.order-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.order-row span:first-child {
    color: var(--text-muted);
}

.tier-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.tier-option input { display: none; }

.tier-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.tier-option input:checked + .tier-card {
    border-color: var(--ink);
    background: var(--ink-glow);
}

.tier-price {
    font-family: var(--font-brand);
    font-weight: 700;
    color: var(--ink);
    font-size: 15px;
    margin-top: 4px;
}

.quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
}

.quantity-row input {
    width: 100px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    font-family: var(--font);
    text-align: center;
    outline: none;
}

.quantity-row input:focus {
    border-color: var(--ink);
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 2px solid var(--border);
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-brand);
    margin-bottom: 20px;
}

#order-total {
    color: var(--ink);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn-primary {
    padding: 14px 28px;
    background: var(--ink);
    color: var(--cream);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover { background: var(--ink-dim); box-shadow: 0 4px 16px var(--ink-glow); }

.btn-secondary {
    padding: 14px 28px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    font-size: 15px;
    letter-spacing: 2px;
}

.btn-link {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 12px;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover { color: var(--ink); }

/* ==========================================
   CHAT INPUT BAR
   ========================================== */
.chat-input-bar {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.input-wrapper {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font);
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

#chat-input:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px var(--ink-glow);
}

#chat-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 48px;
    height: 48px;
    background: var(--ink);
    color: var(--cream);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover { background: var(--ink-dim); box-shadow: 0 4px 16px var(--ink-glow); }

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   SCROLLBAR
   ========================================== */
.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-track { background: transparent; }
.chat-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.chat-container::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 600px) {
    .header { padding: 10px 16px; }
    .logo { font-size: 20px; }
    .chat-container { padding: 16px; }
    .chat-input-bar { padding: 12px 16px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .color-grid { grid-template-columns: repeat(4, 1fr); }
    .style-grid { grid-template-columns: 1fr; }
    .design-grid { grid-template-columns: repeat(2, 1fr); }
    .gate-mark { width: min(190px, 55vw); }
    .gate-wordmark { font-size: 40px; }
    .hero-tagline .tagline-text { font-size: 15px; letter-spacing: 3px; }
    .chat-bubble { max-width: 92%; }
    .tier-selector { grid-template-columns: 1fr; }
}

/* ==========================================
   CHECKOUT FORM (beta)
   ========================================== */
.checkout-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-form h4 {
    font-family: var(--font-brand);
    font-size: 16px;
    font-weight: 700;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font);
    outline: none;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px var(--ink-glow);
}

.checkout-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================
   LOGO UPLOAD
   ========================================== */
.attach-btn {
    width: 48px;
    height: 48px;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.attach-btn:hover { border-color: var(--ink); color: var(--ink); }

.logo-chip {
    max-width: 680px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 13px;
}

.logo-chip img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--surface-2);
}

.logo-chip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-chip-note { color: var(--text-muted); font-size: 12px; flex: 1; }

.logo-chip-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.logo-chip-remove:hover { color: var(--accent-red); background: var(--surface-2); }

/* ==========================================
   MULTI-PRINT ORDER PREVIEW + TEXT CHIP
   ========================================== */
#order-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    aspect-ratio: auto;
    background: none;
}

.preview-item {
    position: relative;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-item img { width: 100%; display: block; }

.preview-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(10, 37, 64, 0.85);
    color: var(--cream);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
}

.text-chip-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    min-width: 100px;
}

#text-chip.has-text .text-chip-input { display: none; }
#text-chip .text-chip-preview { display: none; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#text-chip.has-text .text-chip-preview { display: block; }

/* Size selector in order panel */
.size-select {
    width: 100px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font);
    text-align: center;
    outline: none;
}
.size-select:focus { border-color: var(--ink); }

/* Multi-size grid in order panel */
.size-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 10px 0 20px;
}
.size-cell {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
}
.size-cell-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.size-cell input {
    width: 100%;
    padding: 6px 2px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    outline: none;
}
.size-cell input:focus { border-color: var(--ink); }
@media (max-width: 600px) {
    .size-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Header nav links (studio) */
.header-links { margin-left: auto; display: flex; gap: 16px; }
.header-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.header-links a:hover { color: var(--ink); }
@media (max-width: 600px) { .header-links { gap: 10px; } .header-links a { font-size: 12px; } }

/* Exact logo stamp checkbox */
.stamp-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}
.stamp-row input { margin-top: 3px; accent-color: var(--ink); }

/* ==========================================
   PLACEMENT EDITOR MODAL
   ========================================== */
.place-modal {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(10,37,64,0.55);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.place-sheet {
    background: var(--bg); border-radius: var(--radius); padding: 18px;
    width: 100%; max-width: 480px; max-height: 94vh; overflow-y: auto;
}
.place-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.place-head strong { font-family: var(--font-brand); font-size: 18px; }
.place-inches { margin-left: auto; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink); }
.place-x { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); }
.placer-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.preset-chip {
    padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.preset-chip:hover { border-color: var(--ink); color: var(--ink); }
#placer-canvas { width: 100%; border-radius: 10px; touch-action: none; cursor: grab; display: block; }
.placer-sizerow { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.placer-sizerow label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.placer-sizerow input { flex: 1; accent-color: var(--ink); }
.placer-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.adjust-btn {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(10,37,64,0.85); color: var(--cream);
    border: none; border-radius: 8px; padding: 7px 12px;
    font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.adjust-btn:hover { background: var(--ink); }
.preview-item { position: relative; }
