/* Design tokens for the customer-facing pages (studio, sign-in, share page).
   The default values are the Classic theme; another theme overrides them under
   [data-theme=...] on <html>. Stylesheets use only these tokens for colors, radii,
   borders, shadows and fonts, so a theme never needs to touch layout. Served without
   the password: the sign-in and share pages load it before anyone signs in. */
:root{
    --font-body:Arial,"Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic","Noto Sans JP",sans-serif;
    --font-heading:var(--font-body);
    --heading-weight:700;

    /* Page and surfaces */
    --page:#f3f5f8;
    --surface:#fff;
    --surface-soft:#f8fafd;
    --well:#e9edf2;
    --overlay:rgba(233,237,242,.96);
    --viewer:#101722;
    --backdrop:rgba(32,39,53,.45);

    /* Text, darkest to lightest */
    --text:#202735;
    --text-soft:#344458;
    --text-status:#42566f;
    --label:#526174;
    --text-muted:#586779;
    --text-subtle:#637388;
    --tag:#62738a;
    --text-faint:#687889;
    --toggle-text:#697789;
    --toggle-hover-text:#26394f;
    --toggle-pressed-text:#1d3f73;
    --accent-text:#46648a;
    --warning-text:#77551c;
    --checking-text:#626977;
    --error:#b91c1c;

    /* Brand and states */
    --primary:#245ec9;
    --on-primary:#fff;
    --focus:#6da1fb;
    --hover:#edf1f6;
    --hover-soft:#f0f3f7;
    --accent-soft:#e6edf7;
    --accent-hover:#edf3fc;
    --track:#c9d6e8;
    --fab-disabled:#dce4ef;

    /* Lines */
    --border-width:1px;
    --border:#dce1e8;
    --border-strong:#d2dae4;
    --border-dashed:#bccbdc;
    --swatch-border:#ced7e2;
    --texture-border:#a9b7c8;

    /* Corners */
    --radius-preview:1px;
    --radius-tile:3px;
    --radius-thumb:4px;
    --radius-swatch:5px;
    --radius-option:6px;
    --radius-input:7px;
    --radius-button:8px;
    --radius-dialog:12px;
    --radius-card:14px;
    --radius-fab:18px;
    --radius-pill:999px;

    /* Shadows; buttons have none in Classic */
    --shadow-tile:0 2px 4px rgba(32,39,53,.06),0 8px 20px rgba(32,39,53,.04);
    --shadow-card:0 12px 40px #2027350a;
    --shadow-dialog:0 12px 40px rgba(32,39,53,.18);
    --shadow-fab:0 4px 8px rgba(24,53,100,.18),0 10px 24px rgba(24,53,100,.15);
    --shadow-fab-disabled:0 2px 6px rgba(24,53,100,.1);
    --shadow-button:none;
    --shadow-pressed-option:inset 0 0 0 1px var(--track);
    --press-offset:0px;

    /* Lens picker */
    --picker-border:#dce3eb;
    --picker-text:#24354b;
    --picker-shadow:0 24px 90px #14263d38;
    --picker-backdrop:#15223775;
    --picker-subtle:#728093;
    --picker-selection:#53647b;
    --picker-tab-text:#627186;
    --picker-tab-shadow:0 1px 4px #182e4715;
    --selected-text:#244f88;
    --option-border:#e1e6ee;
    --option-text:#33455b;
    --family-text:#546176;
    --family-selected-border:#7095c6;
    --family-selected-bg:#f1f6fc;
    --option-selected:#487ab8;
    --hint:#8490a0;
    --caution:#9a5b2b;
    --caution-soft:#986137;
    --note:#8a643c;
    --divider:#e6ebf1;
    --picker-status:#6a7789;
    --none-swatch:#b7c2d0;
    --radius-picker:18px;
    --radius-picker-card:10px;
    --radius-picker-tab:7px;
    --radius-family:9px;
}

/* ------------------------------------------------------------------
   Playful: cartoony. Thick ink outlines, solid offset "sticker" shadows,
   big rounded corners, rounded fonts and the logo's violet, pink and cyan.
   ------------------------------------------------------------------ */
[data-theme=playful]{
    --ink:#1d1846;
    --font-body:"Nunito","M PLUS Rounded 1c","Hiragino Maru Gothic ProN",sans-serif;
    --font-heading:var(--font-body);
    --heading-weight:800;

    --page:#fff6e8;
    --surface:#fff;
    --surface-soft:#fffaf2;
    --well:#efe8ff;
    --overlay:rgba(239,232,255,.96);
    --viewer:#1d1846;
    --backdrop:rgba(29,24,70,.5);

    --text:#1d1846;
    --text-soft:#1d1846;
    --text-status:#3b3570;
    --label:#1d1846;
    --text-muted:#4d477e;
    --text-subtle:#5d578c;
    --tag:#1d1846;
    --text-faint:#6b6699;
    --toggle-text:#4d477e;
    --toggle-hover-text:#1d1846;
    --toggle-pressed-text:#1d1846;
    --accent-text:#5b3df5;
    --warning-text:#8a4b00;
    --checking-text:#5d578c;

    --primary:#5b3df5;
    --on-primary:#fff;
    --focus:#ff4fa3;
    --hover:#f3eeff;
    --hover-soft:#f3eeff;
    --accent-soft:#ffe3f1;
    --accent-hover:#fff0f7;
    --track:#d9ccff;
    --fab-disabled:#ece8f8;

    --border-width:2.5px;
    --border:#1d1846;
    --border-strong:#1d1846;
    --border-dashed:#8f84c9;
    --swatch-border:#1d1846;
    --texture-border:#1d1846;

    --radius-preview:14px;
    --radius-tile:22px;
    --radius-thumb:12px;
    --radius-swatch:8px;
    --radius-option:12px;
    --radius-input:12px;
    --radius-button:14px;
    --radius-dialog:22px;
    --radius-card:24px;
    --radius-fab:999px;

    --shadow-tile:5px 5px 0 #1d1846;
    --shadow-card:6px 6px 0 #1d1846;
    --shadow-dialog:6px 6px 0 #1d1846;
    --shadow-fab:4px 4px 0 #1d1846;
    --shadow-fab-disabled:3px 3px 0 #c4bde2;
    --shadow-button:3px 3px 0 #1d1846;
    --shadow-pressed-option:inset 0 0 0 2px #1d1846;
    --press-offset:2px;

    --picker-border:#1d1846;
    --picker-text:#1d1846;
    --picker-shadow:8px 8px 0 #1d1846;
    --picker-backdrop:rgba(29,24,70,.5);
    --picker-subtle:#5d578c;
    --picker-selection:#3b3570;
    --picker-tab-text:#4d477e;
    --picker-tab-shadow:2px 2px 0 #1d1846;
    --selected-text:#1d1846;
    --option-border:#1d1846;
    --option-text:#1d1846;
    --family-text:#1d1846;
    --family-selected-border:#1d1846;
    --family-selected-bg:#ffe3f1;
    --option-selected:#ff4fa3;
    --hint:#5d578c;
    --divider:#1d1846;
    --picker-status:#5d578c;
    --none-swatch:#8f84c9;
    --radius-picker:26px;
    --radius-picker-card:14px;
    --radius-picker-tab:10px;
    --radius-family:14px;
}

/* Playful touches beyond the tokens. */
[data-theme=playful] body{background-color:var(--page);background-image:radial-gradient(#f3dfc2 1.2px,transparent 1.3px);background-size:20px 20px}
/* Buttons are outlined stickers that press down when tapped. */
[data-theme=playful] button:not(.mode-toggle):not(.result-button):not(.remove-look){border-color:var(--ink)}
/* Category tabs: only the selected tab is a sticker (selector matches the rule above's weight). */
[data-theme=playful] .lens-categories button:not(.mode-toggle):not(.result-button):not([aria-pressed=true]){border-color:transparent;box-shadow:none}
[data-theme=playful] .language-switch{gap:9px}
[data-theme=playful] button:not(:disabled):active,
[data-theme=playful] .language-switch a:active,
[data-theme=playful] .download:active{transform:translate(var(--press-offset),var(--press-offset));box-shadow:1px 1px 0 var(--ink)}
[data-theme=playful] .mode-toggle:not(:disabled):active,
[data-theme=playful] .result-button:active{transform:none;box-shadow:none}
[data-theme=playful] .language-switch a[aria-current]{border-color:var(--ink)}
/* The generate button wears the logo's gradient, deep enough for white text (4.5:1+). */
[data-theme=playful] .generate-fab:not(:disabled){background:linear-gradient(120deg,#d12f7d,#6d3cf2 55%,#1e6fd9);border-color:var(--ink)}
[data-theme=playful] .generate-fab:disabled{color:var(--text-subtle)}
/* Tags become little pills, the add-look tile a friendly dashed card. */
[data-theme=playful] .tag{padding:4px 9px;border:2px solid var(--ink);border-radius:999px;background:#c8f5ff;letter-spacing:.5px}
[data-theme=playful] .tile.add-look{border:2.5px dashed var(--border-dashed);box-shadow:none}
[data-theme=playful] .add-look-icon{background:#c8f5ff;border:2.5px solid var(--ink);color:var(--ink)}
[data-theme=playful] .history-item{box-shadow:3px 3px 0 var(--ink)}
[data-theme=playful] .history-item.active{border-color:#ff4fa3;box-shadow:3px 3px 0 #ff4fa3}
[data-theme=playful] .generation-progress{height:10px;border:2px solid var(--ink);border-radius:999px}
[data-theme=playful] .generation-progress-fill{background:linear-gradient(90deg,#d12f7d,#6d3cf2,#1e6fd9)}
[data-theme=playful] .lens-option[aria-pressed=true],
[data-theme=playful] .lens-coating[aria-pressed=true]{box-shadow:0 0 0 2px #ff4fa3}
[data-theme=playful] .share-qr{border-radius:16px}
@media(prefers-reduced-motion:no-preference){
    [data-theme=playful] button,[data-theme=playful] .language-switch a{transition:transform .08s ease,box-shadow .08s ease}
}

/* ------------------------------------------------------------------
   Boutique: calm and premium. Ivory and linen, charcoal text, a muted
   champagne-gold accent, hairlines, near-square corners, soft shadows,
   serif headings (Cormorant Garamond / Shippori Mincho) and Jost body text.
   ------------------------------------------------------------------ */
[data-theme=boutique]{
    --gold:#b08d57;
    --font-body:"Jost","Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic","Noto Sans JP",sans-serif;
    --font-heading:"Cormorant Garamond","Shippori Mincho","Hiragino Mincho ProN","Yu Mincho",serif;
    --heading-weight:600;

    --page:#f5f1eb;
    --surface:#fffdf9;
    --surface-soft:#faf6f0;
    --well:#ece6dd;
    --overlay:rgba(236,230,221,.96);
    --viewer:#1f1b18;
    --backdrop:rgba(31,27,24,.45);

    --text:#2b2622;
    --text-soft:#3d3630;
    --text-status:#4f473f;
    --label:#4f473f;
    --text-muted:#6b6259;
    --text-subtle:#6f665d;
    --tag:#8a6a3f;
    --text-faint:#675e55;
    --toggle-text:#6b6259;
    --toggle-hover-text:#2b2622;
    --toggle-pressed-text:#2b2622;
    --accent-text:#7a5c33;
    --warning-text:#8a5a1c;
    --checking-text:#6f665d;
    --error:#9b2c2c;

    --primary:#2b2622;
    --on-primary:#fffdf9;
    --focus:#b08d57;
    --hover:#f1ebe2;
    --hover-soft:#f3eee6;
    --accent-soft:#f0e8db;
    --accent-hover:#f7f1e8;
    --track:#e0d6c8;
    --fab-disabled:#e8e1d7;

    --border-width:1px;
    --border:#e4dcd1;
    --border-strong:#d6ccbf;
    --border-dashed:#cfc3b3;
    --swatch-border:#d6ccbf;
    --texture-border:#b9ab98;

    --radius-preview:0px;
    --radius-tile:2px;
    --radius-thumb:2px;
    --radius-swatch:2px;
    --radius-option:2px;
    --radius-input:2px;
    --radius-button:2px;
    --radius-dialog:4px;
    --radius-card:4px;
    --radius-fab:999px;

    --shadow-tile:0 1px 2px rgba(43,38,34,.04),0 10px 30px rgba(43,38,34,.05);
    --shadow-card:0 20px 50px rgba(43,38,34,.08);
    --shadow-dialog:0 24px 60px rgba(43,38,34,.16);
    --shadow-fab:0 10px 26px rgba(43,38,34,.22);
    --shadow-fab-disabled:none;
    --shadow-button:none;
    --shadow-pressed-option:inset 0 0 0 1px var(--gold);
    --press-offset:0px;

    --picker-border:#e4dcd1;
    --picker-text:#2b2622;
    --picker-shadow:0 30px 80px rgba(31,27,24,.22);
    --picker-backdrop:rgba(31,27,24,.45);
    --picker-subtle:#6f665d;
    --picker-selection:#4f473f;
    --picker-tab-text:#6b6259;
    --picker-tab-shadow:0 1px 3px rgba(43,38,34,.08);
    --selected-text:#2b2622;
    --option-border:#e4dcd1;
    --option-text:#3d3630;
    --family-text:#4f473f;
    --family-selected-border:var(--gold);
    --family-selected-bg:#faf4ea;
    --option-selected:var(--gold);
    --hint:#675e55;
    --caution:#8a4f1c;
    --caution-soft:#8a5a2b;
    --note:#7a5c33;
    --divider:#e4dcd1;
    --picker-status:#6f665d;
    --none-swatch:#cfc3b3;
    --radius-picker:4px;
    --radius-picker-card:2px;
    --radius-picker-tab:2px;
    --radius-family:2px;
}

/* Boutique touches beyond the tokens: larger serif headings, wide-tracked gold
   labels, a gold sparkle and progress line, gold for the selected saved look. */
[data-theme=boutique] .tile-heading h2{font-size:21px;letter-spacing:.2px}
[data-theme=boutique] .saved-heading h2,[data-theme=boutique] .small-dialog h2{font-size:24px}
[data-theme=boutique] .lens-picker h2{font-size:28px;letter-spacing:0}
[data-theme=boutique] .tag{letter-spacing:2px}
[data-theme=boutique] .component-name{letter-spacing:.6px;text-transform:uppercase;font-size:11px;font-weight:500}
[data-theme=boutique] button{letter-spacing:.3px;font-weight:500}
[data-theme=boutique] .generate-fab{letter-spacing:1px}
[data-theme=boutique] .generate-fab:not(:disabled)::before{background:#d9bf8c}
[data-theme=boutique] .generation-progress{height:3px}
[data-theme=boutique] .generation-progress-fill{background:var(--gold)}
[data-theme=boutique] .history-item.active{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold)}
[data-theme=boutique] .language-switch a[aria-current]{border-color:var(--primary)}
/* Small headings read better in the sans as tracked small capitals; the serif is
   kept for sizes where its fine strokes hold up. */
[data-theme=boutique] .lens-picker h3,
[data-theme=boutique] .visit h2{font-family:var(--font-body);font-size:11px;font-weight:500;letter-spacing:1.2px;text-transform:uppercase;color:var(--text-muted)}
[data-theme=boutique] .look h3{font-size:21px}
[data-theme=boutique] main > header h1{font-size:32px}

/* ------------------------------------------------------------------
   Kawaii: cute Japanese pop. Sakura pink, mint, butter and lavender
   pastels with plum text, very round shapes, soft colored outlines,
   jelly buttons with a pressable lip, Zen Maru Gothic body text and
   Mochiy Pop One headings (both cover Japanese and Latin).
   ------------------------------------------------------------------ */
[data-theme=kawaii]{
    --plum:#4a2c4d;
    --sakura:#ff9ebd;
    --sakura-lip:#e57fa5;
    --mint:#b8f0dc;
    --butter:#fff6cc;
    --lavender:#d9ccff;
    --sky:#bfe6ff;
    --font-body:"Zen Maru Gothic","Hiragino Maru Gothic ProN","Hiragino Sans",sans-serif;
    --font-heading:"Mochiy Pop One","Zen Maru Gothic","Hiragino Maru Gothic ProN",sans-serif;
    --heading-weight:400;

    --page:#fff5f8;
    --surface:#fff;
    --surface-soft:#fffafc;
    --well:#f3efff;
    --overlay:rgba(243,239,255,.96);
    --viewer:#3a2240;
    --backdrop:rgba(74,44,77,.4);

    --text:#4a2c4d;
    --text-soft:#5a3d5c;
    --text-status:#6b4a6d;
    --label:#7a4f78;
    --text-muted:#7d5f7f;
    --text-subtle:#7a5c7c;
    --tag:#4a2c4d;
    --text-faint:#7a5c7c;
    --toggle-text:#7d5f7f;
    --toggle-hover-text:#4a2c4d;
    --toggle-pressed-text:#4a2c4d;
    --accent-text:#b0306a;
    --warning-text:#9a5a00;
    --checking-text:#7d5f7f;
    --error:#c0263f;

    --primary:var(--sakura);
    --on-primary:#4a2440;
    --focus:#6cc6ff;
    --hover:#fff0f5;
    --hover-soft:#fff4f8;
    --accent-soft:#ffe3ec;
    --accent-hover:#fff0f5;
    --track:#ffd3e1;
    --fab-disabled:#f3e9ee;

    --border-width:2px;
    --border:#f6c9d9;
    --border-strong:#eeb3c8;
    --border-dashed:#f2a7c3;
    --swatch-border:#eeb3c8;
    --texture-border:#e48fb0;

    --radius-preview:20px;
    --radius-tile:28px;
    --radius-thumb:16px;
    --radius-swatch:10px;
    --radius-option:999px;
    --radius-input:16px;
    --radius-button:999px;
    --radius-dialog:28px;
    --radius-card:32px;
    --radius-fab:999px;

    --shadow-tile:0 6px 0 #f8d7e3,0 14px 28px rgba(240,140,180,.12);
    --shadow-card:0 8px 0 #f8d7e3,0 20px 40px rgba(240,140,180,.16);
    --shadow-dialog:0 8px 0 #f8d7e3,0 22px 44px rgba(200,90,140,.2);
    --shadow-fab:0 5px 0 var(--sakura-lip),0 12px 22px rgba(229,127,165,.3);
    --shadow-fab-disabled:0 3px 0 #eadbe2;
    --shadow-button:0 4px 0 var(--border-strong);
    --shadow-pressed-option:inset 0 0 0 2px var(--sakura);
    --press-offset:3px;

    --picker-border:#f6c9d9;
    --picker-text:#4a2c4d;
    --picker-shadow:0 10px 0 #f8d7e3,0 26px 60px rgba(200,90,140,.22);
    --picker-backdrop:rgba(74,44,77,.4);
    --picker-subtle:#7a5c7c;
    --picker-selection:#6b4a6d;
    --picker-tab-text:#7d5f7f;
    --picker-tab-shadow:0 3px 0 var(--border-strong);
    --selected-text:#4a2c4d;
    --option-border:#f6c9d9;
    --option-text:#5a3d5c;
    --family-text:#5a3d5c;
    --family-selected-border:var(--sakura);
    --family-selected-bg:#ffe3ec;
    --option-selected:var(--sakura);
    --hint:#7a5c7c;
    --caution:#9a4f1c;
    --caution-soft:#9a5a2b;
    --note:#8a5a33;
    --divider:#f6c9d9;
    --picker-status:#7a5c7c;
    --none-swatch:#eeb3c8;
    --radius-picker:32px;
    --radius-picker-card:20px;
    --radius-picker-tab:999px;
    --radius-family:999px;
}

/* Kawaii touches beyond the tokens. */
[data-theme=kawaii] body{background-color:var(--page);background-image:radial-gradient(#ffe1ea 2.2px,transparent 2.4px);background-size:24px 24px}
/* Jelly buttons: pastel fill, plum text and a lip that presses down. */
[data-theme=kawaii] button.secondary{box-shadow:0 4px 0 var(--border)}
[data-theme=kawaii] button:not(.secondary):not(.mode-toggle):not(.result-button):not(.remove-look):not(.lens-family):not(.lens-option):not(.lens-coating):not(.history-item):not(.lens-picker-trigger):not([data-category]){box-shadow:0 4px 0 var(--sakura-lip)}
[data-theme=kawaii] button:not(:disabled):active,
[data-theme=kawaii] .language-switch a:active,
[data-theme=kawaii] .download:active{transform:translateY(var(--press-offset));box-shadow:0 1px 0 var(--border-strong)}
[data-theme=kawaii] .mode-toggle:not(:disabled):active,
[data-theme=kawaii] .result-button:active{transform:none;box-shadow:none}
[data-theme=kawaii] .lens-categories button[aria-pressed=true]{background:var(--surface);box-shadow:0 3px 0 var(--border-strong)}
[data-theme=kawaii] .language-switch{gap:8px}
[data-theme=kawaii] .language-switch a[aria-current]{box-shadow:0 3px 0 var(--sakura-lip)}
/* The generate button is a pastel candy gradient. */
[data-theme=kawaii] .generate-fab:not(:disabled){background:linear-gradient(120deg,#ffb3cc,#d9ccff 55%,#bfe6ff);color:var(--on-primary);box-shadow:var(--shadow-fab)}
[data-theme=kawaii] .generate-fab:disabled{color:var(--text-subtle)}
/* Mint pill tags, a butter add-look button, a sparkle on each tile title. */
[data-theme=kawaii] .tag{padding:4px 10px;border-radius:999px;background:var(--mint);letter-spacing:.5px}
[data-theme=kawaii] .tile-heading h2::after{content:" ✦" / "";color:var(--sakura)}
[data-theme=kawaii] .tile.add-look{border:2.5px dashed var(--border-dashed);box-shadow:none}
[data-theme=kawaii] .add-look-icon{background:var(--butter);border:2px solid #f2d36b;color:var(--plum)}
/* Status messages appear in a speech bubble. */
[data-theme=kawaii] #status:not(:empty){position:relative;margin-top:14px;padding:8px 14px;border:2px solid #f2d36b;border-radius:18px;background:var(--butter);color:var(--plum)}
[data-theme=kawaii] #status:not(:empty)::before{content:"";position:absolute;left:22px;top:-8px;width:12px;height:12px;background:var(--butter);border-left:2px solid #f2d36b;border-top:2px solid #f2d36b;transform:rotate(45deg)}
/* Saved-look cards are buttons but should stay cards, not pills. */
[data-theme=kawaii] .history-item{border-radius:22px;box-shadow:0 4px 0 var(--border)}
[data-theme=kawaii] .history-item.active{border-color:var(--sakura);box-shadow:0 4px 0 var(--sakura-lip)}
[data-theme=kawaii] .generation-progress{height:12px;border:2px solid var(--border-strong);border-radius:999px;background:#fff}
[data-theme=kawaii] .generation-progress-fill{background:linear-gradient(90deg,#ffb3cc,#d9ccff,#bfe6ff)}
[data-theme=kawaii] .lens-option[aria-pressed=true],
[data-theme=kawaii] .lens-coating[aria-pressed=true]{box-shadow:0 0 0 2px var(--sakura)}
[data-theme=kawaii] .share-qr{border-radius:24px}
@media(prefers-reduced-motion:no-preference){
    [data-theme=kawaii] button,[data-theme=kawaii] .language-switch a{transition:transform .08s ease,box-shadow .08s ease}
}
