@media screen {
    .loto-studio { --loto-bg: #f5f2e9; --loto-surface: #fffdf7; --loto-surface-soft: #eee9dc; --loto-ink: #2c2949; --loto-muted: #666078; --loto-line: #d9d1bd; --loto-violet: #6651b2; --loto-violet-deep: #4a398d; --loto-violet-soft: #ece8fa; --loto-gold: #d59b3b; --loto-gold-soft: #f7e4b8; --loto-sage: #79977a; --loto-sage-soft: #dfe9dc; --loto-danger: #a53f48; --loto-focus: #b76b19; --loto-shadow: 0 20px 48px rgba(44, 41, 73, 0.12); --loto-shadow-soft: 0 8px 24px rgba(44, 41, 73, 0.09); width: min(100%, 1320px); margin-inline: auto; padding: clamp(1rem, 3vw, 2.5rem); color: var(--loto-ink);
        background:
            radial-gradient(circle at 6% 8%, rgba(213, 155, 59, 0.14), transparent 21rem),
            radial-gradient(circle at 94% 4%, rgba(102, 81, 178, 0.12), transparent 24rem),
            var(--loto-bg); border-radius: 28px; font-family: var(--font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif); line-height: 1.55; box-sizing: border-box;
    }

    .loto-studio *,
    .loto-studio *::before,
    .loto-studio *::after { box-sizing: border-box;
    }

    .loto-studio [hidden],
    .loto-studio .hidden { display: none !important;
    }

    .loto-studio :where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--loto-focus); outline-offset: 3px;
    }

    .loto-studio .loto-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; min-height: 330px; padding: clamp(1.5rem, 4vw, 3.5rem); overflow: hidden; color: #fffdf7; background: linear-gradient(135deg, #2c2949 0%, #443875 62%, #6651b2 100%); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 24px; box-shadow: var(--loto-shadow);
    }

    .loto-studio .loto-hero::before { position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px); background-size: 18px 18px; content: ""; opacity: 0.35; pointer-events: none;
    }

    .loto-studio .loto-hero-copy,
    .loto-studio .loto-hero-art { position: relative; z-index: 1; min-width: 0;
    }

    .loto-studio .loto-eyebrow { margin: 0 0 0.65rem; color: var(--loto-violet); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.14em; line-height: 1.35; text-transform: uppercase;
    }

    .loto-studio .loto-hero .loto-eyebrow { color: #f1cd85;
    }

    .loto-studio .loto-hero h1 { max-width: 750px; margin: 0; color: inherit; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.15rem, 5vw, 4.5rem); font-weight: 700; letter-spacing: -0.045em; line-height: 0.98;
    }

    .loto-studio .loto-hero h1 span { color: #f1cd85; font-style: italic;
    }

    .loto-studio .loto-lead { max-width: 650px; margin: 1.25rem 0 0; color: #e9e5f5; font-size: clamp(1rem, 1.8vw, 1.18rem);
    }

    .loto-studio .loto-benefits { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 1.4rem 0 0; padding: 0; list-style: none;
    }

    .loto-studio .loto-benefits li { padding: 0.48rem 0.78rem; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; font-size: 0.86rem; font-weight: 700; backdrop-filter: blur(6px);
    }

    .loto-studio .loto-hero-art { display: grid; place-items: center; min-height: 230px;
    }

    .loto-studio .loto-sample-card { width: min(100%, 285px); padding: 1.15rem; color: #2c2949; background: #fffdf7; border: 3px solid #f1cd85; border-radius: 18px; box-shadow: 0 25px 45px rgba(20, 17, 45, 0.3); transform: rotate(3deg);
    }

    .loto-studio .loto-sample-heading { margin-bottom: 0.8rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.1rem; font-weight: 700; text-align: center;
    }

    .loto-studio .loto-sample-grid,
    .loto-studio .loto-empty-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem;
    }

    .loto-studio .loto-sample-grid span,
    .loto-studio .loto-empty-grid span { aspect-ratio: 1; background: var(--loto-violet-soft); border: 1px solid rgba(102, 81, 178, 0.24); border-radius: 7px;
    }

    .loto-studio .loto-sample-grid span { display: grid; place-items: center; color: #2c2949; font-size: 1.6rem; font-weight: 800; background: #ece8fa;
    }

    .loto-studio .loto-sample-grid span:nth-child(2n) { background: #f7e4b8; border-color: rgba(183, 107, 25, 0.25);
    }

    .loto-studio .loto-sample-caption { margin-top: 0.75rem; color: #666078; font-size: 0.75rem; font-weight: 700; text-align: center;
    }

    .loto-studio .loto-token { position: absolute; width: 58px; aspect-ratio: 1; border: 5px solid rgba(255, 255, 255, 0.65); border-radius: 50%; box-shadow: 0 12px 22px rgba(20, 17, 45, 0.28);
    }

    .loto-studio .loto-token--gold { top: 2%; right: 2%; background: var(--loto-gold);
    }

    .loto-studio .loto-token--sage { bottom: 2%; left: 3%; width: 46px; background: var(--loto-sage);
    }

    .loto-studio .loto-public-reference-context { margin: 0.75rem 0 0; color: var(--loto-muted); font-size: 0.78rem; text-align: right;
    }

    .loto-studio .loto-public-reference-context a,
    .loto-studio .loto-bridge { color: var(--loto-violet-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em;
    }

    .loto-studio .generator-workflow { margin-block: 1rem;
    }

    .loto-studio .loto-workspace { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); gap: clamp(1rem, 2.5vw, 2rem); align-items: start; margin-top: clamp(1.5rem, 3vw, 2.5rem);
    }

    .loto-studio .loto-settings-card,
    .loto-studio .loto-preview-card { min-width: 0; padding: clamp(1.1rem, 2.5vw, 2rem); background: var(--loto-surface); border: 1px solid var(--loto-line); border-radius: 20px; box-shadow: var(--loto-shadow-soft);
    }

    .loto-studio .loto-preview-card { position: sticky; top: 110px;
    }

    .loto-studio #loto-preview { margin-top: 0;
    }

    .loto-studio .loto-card-heading { margin-bottom: 1.4rem; padding-bottom: 1.15rem; border-bottom: 1px solid var(--loto-line);
    }

    .loto-studio .loto-card-heading h2,
    .loto-studio .how-it-works h2,
    .loto-studio .loto-preview-empty h3 { margin: 0; color: var(--loto-ink); font-family: Georgia, "Times New Roman", serif; line-height: 1.15;
    }

    .loto-studio .loto-card-heading h2,
    .loto-studio #loto-preview .loto-card-heading h2 { font-size: clamp(1.65rem, 3vw, 2.15rem);
    }

    .loto-studio .loto-card-heading > p:last-child { margin: 0.55rem 0 0; color: var(--loto-muted);
    }

    .loto-studio .loto-fieldset { min-width: 0; margin: 0 0 1.25rem; padding: 1rem; background: var(--loto-surface-soft); border: 1px solid var(--loto-line); border-radius: 15px;
    }

    .loto-studio .loto-fieldset legend { max-width: 100%; padding: 0 0.55rem; color: var(--loto-ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.02rem; font-weight: 700;
    }

    .loto-studio .loto-step-number { display: inline-grid; place-items: center; width: 30px; aspect-ratio: 1; margin-right: 0.45rem; color: #fff; background: var(--loto-violet); border-radius: 50%; font-family: var(--font-family, system-ui, sans-serif); font-size: 0.82rem;
    }

    .loto-studio .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem;
    }

    .loto-studio .form-group { min-width: 0; margin-bottom: 0.9rem;
    }

    .loto-studio .form-group label { display: block; margin-bottom: 0.38rem; color: var(--loto-ink); font-size: 0.9rem; font-weight: 750;
    }

    .loto-studio :where(select, input:not([type="checkbox"]):not([type="radio"]), textarea) { width: 100%; min-height: 44px; padding: 0.68rem 0.78rem; color: var(--loto-ink); background: var(--loto-surface); border: 1px solid #bdb5a3; border-radius: 10px; font: inherit;
    }

    .loto-studio textarea { min-height: 96px; resize: vertical;
    }

    .loto-studio input[type="text"],
    .loto-studio textarea { color: var(--loto-ink) !important; background: var(--loto-surface) !important; border-color: #bdb5a3 !important;
    }

    .loto-studio input::placeholder,
    .loto-studio textarea::placeholder { color: var(--loto-muted); opacity: 1;
    }

    .loto-studio #loto-learning-context,
    .loto-studio #calculs-choice-help { color: var(--loto-muted); font-size: 0.86rem;
    }

    .loto-studio #loto-learning-context { margin: 0.35rem 0 1rem; padding: 0.8rem 0.9rem; background: var(--loto-sage-soft); border-left: 4px solid var(--loto-sage); border-radius: 4px 10px 10px 4px;
    }

    .loto-studio #calculs-choice-help { margin: 0.35rem 0 0;
    }

    .loto-studio .loto-field-help,
    .loto-studio #mots-count { color: var(--loto-muted); font-size: 0.82rem; line-height: 1.5;
    }

    .loto-studio .loto-field-help { margin: 0.4rem 0 0.7rem;
    }

    .loto-studio .checkbox-group.loto-option { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 0.7rem; align-items: start; min-height: 44px; margin-bottom: 0.65rem; padding: 0.72rem; background: var(--loto-surface); border: 1px solid var(--loto-line); border-radius: 11px;
    }

    .loto-studio .loto-option input { width: 20px; height: 20px; margin: 0.1rem 0 0; accent-color: var(--loto-violet);
    }

    .loto-studio .loto-option label { min-width: 0; cursor: pointer;
    }

    .loto-studio .loto-option label strong,
    .loto-studio .loto-option label span { display: block;
    }

    .loto-studio .loto-option label span { margin-top: 0.15rem; color: var(--loto-muted); font-size: 0.82rem;
    }

    .loto-studio .loto-form-actions,
    .loto-studio .loto-preview-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
    }

    .loto-studio .btn,
    .loto-studio .btn-generate { display: inline-flex; justify-content: center; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0.72rem 1rem; color: var(--loto-ink); background: var(--loto-surface); border: 1px solid var(--loto-line); border-radius: 10px; font: inherit; font-weight: 800; line-height: 1.2; text-align: center; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
    }

    .loto-studio :where(.btn, .btn-generate):disabled { opacity: 0.6; cursor: wait; transform: none;
    }

    .loto-studio #loto-preview-generate.btn-generate { flex: 1 1 220px; color: #fff; background: var(--loto-violet); border-color: var(--loto-violet); box-shadow: 0 8px 18px rgba(102, 81, 178, 0.24);
    }

    .loto-studio #btn-generate.btn-generate { color: var(--loto-ink); background: transparent; border: 2px solid var(--loto-ink);
    }

    .loto-studio :where(.btn, .btn-generate):hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(44, 41, 73, 0.16);
    }

    .loto-studio .loto-vault { margin-top: 1rem; background: var(--loto-surface-soft); border: 1px solid var(--loto-line); border-radius: 12px;
    }

    .loto-studio .loto-vault summary { min-height: 44px; padding: 0.72rem 0.9rem; color: var(--loto-ink); font-weight: 800; cursor: pointer;
    }

    .loto-studio .loto-vault-content { display: flex; flex-wrap: wrap; gap: 0.65rem; padding: 0 0.9rem 0.9rem;
    }

    .loto-studio .loto-vault-content > p { flex-basis: 100%;
    }

    .loto-studio #loto-local-status { margin: 0.7rem 0 0; padding: 0.65rem 0.8rem; color: var(--loto-ink); background: var(--loto-gold-soft); border-radius: 9px; font-size: 0.86rem;
    }

    .loto-studio #loto-local-status:empty { display: none;
    }

    .loto-studio .loto-preview-actions { justify-content: flex-start; margin-bottom: 1rem;
    }

    .loto-studio #loto-preview-pages { width: 100%; max-height: 65vh; padding: clamp(0.6rem, 2vw, 1rem); overflow: auto; background: var(--loto-surface-soft); border: 1px solid var(--loto-line); border-radius: 14px; overscroll-behavior: contain;
    }

    .loto-studio #loto-preview-pages:not([hidden]) + .loto-preview-empty { display: none;
    }

    .loto-studio #loto-preview-pages .loto-print-page { width: 100% !important; max-width: 100% !important; margin: 0 0 1rem !important; padding: clamp(0.65rem, 2vw, 1.15rem) !important; color: #202033; background: #fff; border-radius: 10px; box-shadow: 0 4px 14px rgba(44, 41, 73, 0.1);
    }

    .loto-studio #loto-preview-pages .loto-print-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.75rem !important;
    }

    .loto-studio #loto-preview-pages .loto-print-card { min-width: 0; padding: 0.65rem !important; border-color: #aaa2bb !important;
    }

    .loto-studio #loto-preview-pages :where(table, .loto-print-card) { width: 100% !important; max-width: 100% !important;
    }

    .loto-studio #loto-preview-pages td { overflow-wrap: anywhere;
    }

    .loto-studio .loto-preview-empty { display: grid; place-items: center; min-height: 330px; padding: 2rem; color: var(--loto-muted); background: linear-gradient(145deg, var(--loto-surface-soft), var(--loto-surface)); border: 2px dashed var(--loto-line); border-radius: 15px; text-align: center;
    }

    .loto-studio .loto-preview-empty > * { max-width: 360px;
    }

    .loto-studio .loto-empty-grid { width: 116px; margin-bottom: 1rem; opacity: 0.72;
    }

    .loto-studio .loto-preview-empty h3 { font-size: 1.35rem;
    }

    .loto-studio .loto-preview-empty p { margin: 0.45rem 0 0;
    }

    .loto-studio .how-it-works.loto-play-guide { margin-top: clamp(1.5rem, 3vw, 2.5rem); padding: clamp(1.15rem, 3vw, 2rem); background: var(--loto-sage-soft); border: 1px solid #bdcdb9; border-radius: 20px;
    }

    .loto-studio .how-it-works h2 { font-size: clamp(1.5rem, 3vw, 2rem);
    }

    .loto-studio .how-it-works ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; margin: 1rem 0 0; padding: 0; list-style: none; counter-reset: loto-guide;
    }

    .loto-studio .how-it-works li { position: relative; min-width: 0; padding: 0.8rem 0.75rem 0.8rem 2.9rem; color: var(--loto-ink); background: var(--loto-surface); border-radius: 10px; counter-increment: loto-guide;
    }

    .loto-studio .how-it-works li::before { position: absolute; top: 0.72rem; left: 0.7rem; display: grid; place-items: center; width: 1.7rem; aspect-ratio: 1; color: #fff; background: var(--loto-violet); border-radius: 50%; content: counter(loto-guide); font-size: 0.76rem; font-weight: 800;
    }

    .loto-studio .loto-bridge { display: inline-flex; align-items: center; min-height: 44px; margin-top: 1rem; font-weight: 800;
    }

    html[data-theme="dark"] .loto-studio,
    .loto-studio[data-theme="dark"] { --loto-bg: #171625; --loto-surface: #242237; --loto-surface-soft: #302d43; --loto-ink: #f4f0e7; --loto-muted: #c4bdce; --loto-line: #504b65; --loto-violet: #a995ee; --loto-violet-deep: #c3b5ff; --loto-violet-soft: #40375f; --loto-gold-soft: #513f25; --loto-sage-soft: #2f4438; --loto-focus: #f3b755; --loto-shadow: 0 20px 48px rgba(0, 0, 0, 0.34); --loto-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.24);
    }

    html[data-theme="dark"] .loto-studio .loto-hero,
    .loto-studio[data-theme="dark"] .loto-hero { background: linear-gradient(135deg, #211e3a, #372d60 62%, #554496);
    }

    html[data-theme="dark"] .loto-studio :is(#loto-preview-generate, .loto-step-number),
    .loto-studio[data-theme="dark"] :is(#loto-preview-generate, .loto-step-number),
    html[data-theme="dark"] .loto-studio .how-it-works li::before,
    .loto-studio[data-theme="dark"] .how-it-works li::before { color: #211e3a;
    }

    html[data-theme="dark"] .loto-studio :where(select, input:not([type="checkbox"]):not([type="radio"]), textarea),
    .loto-studio[data-theme="dark"] :where(select, input:not([type="checkbox"]):not([type="radio"]), textarea) { border-color: #625c76; color-scheme: dark;
    }

    @media (max-width: 999px) {
        .loto-studio .loto-workspace { grid-template-columns: minmax(0, 1fr);
        }

        .loto-studio .loto-preview-card { position: static;
        }
    }

    @media (max-width: 720px) {
        .loto-studio { padding: 0.75rem; border-radius: 18px;
        }

        .loto-studio .loto-hero { grid-template-columns: minmax(0, 1fr); min-height: auto; padding: 1.35rem; border-radius: 17px;
        }

        .loto-studio .loto-hero-art { display: none;
        }

        .loto-studio .loto-sample-card { transform: rotate(1.5deg);
        }

        .loto-studio .form-row,
        .loto-studio .how-it-works ol { grid-template-columns: minmax(0, 1fr);
        }

        .loto-studio .loto-preview-actions,
        .loto-studio .loto-vault-content { align-items: stretch; flex-direction: column;
        }

        .loto-studio .loto-preview-actions > *,
        .loto-studio .loto-vault-content > * { width: 100%;
        }

        .loto-studio #loto-preview-pages { max-height: 72vh; padding: 0.45rem;
        }

        .loto-studio #loto-preview-pages .loto-print-cards { grid-template-columns: minmax(0, 1fr) !important;
        }
    }

    @media (max-width: 380px) {
        .loto-studio { padding: 0.5rem;
        }

        .loto-studio .loto-hero,
        .loto-studio .loto-settings-card,
        .loto-studio .loto-preview-card,
        .loto-studio .how-it-works.loto-play-guide { padding: 1rem;
        }

        .loto-studio .loto-hero h1 { font-size: 2rem;
        }

        .loto-studio .loto-fieldset { padding: 0.75rem;
        }

        .loto-studio .loto-benefits li { overflow-wrap: anywhere;
        }
    }

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

        .loto-studio .loto-sample-card,
        .loto-studio :where(.btn, .btn-generate):hover { transform: none;
        }
    }
}
