/* =========================================================
   PERSONALITY ARTS — upgrade.css (chargé APRÈS style.css)
   Corrections UI/UX, perf GPU, scrollbar, transitions, Aya.
   ========================================================= */

/* ---------- 0a. BASE — Task 1 : scroll & fond unifié ---------- */
html,
body {
    overflow-x: hidden;
    scroll-behavior: smooth;
    background-color: #0d0d0d;
}

/* une seule section montée à la fois : plus de blocs noirs,
   plus de hero fantôme sous Writing/Webtoon */
.section-hidden {
    display: none !important;
}

/* ---------- 0b. SECTIONS — Task 1 ---------- */
.panel {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: #0d0d0d;
    transform: translate3d(0, 0, 0);
    will-change: transform;
    contain: paint;
}

/* rampes de z-index : #hero en dessous, chaque section au-dessus */
#hero.panel { z-index: 1; }
#vertical.panel { z-index: 10; }
#horizontal.panel { z-index: 20; }
#animations.panel { z-index: 30; }
#website.panel { z-index: 40; }
#writing.panel { z-index: 50; }
#webtoon.panel { z-index: 60; }
#services.panel { z-index: 70; background-color: var(--bg-3); }
#contact.panel { z-index: 80; background-color: #121212; }

/* mode navigateur (GSAP présent) : sections fixes superposées,
   une seule visible — le document ne défile plus du tout */
html.pa-nav-mode,
html.pa-nav-mode body {
    overflow: hidden;
}

html.pa-nav-mode body {
    height: 100vh;
    height: 100dvh;
}

html.pa-nav-mode .panel {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
}

/* main ne doit pas créer de contexte d'empilement :
   sinon les panneaux fixes peignent sous le contenu hors-main */
html.pa-nav-mode main {
    position: static;
    will-change: auto;
    transition: none;
}

/* ---------- 0. SCROLLBAR — sombre sur-mesure ultra-thin ---------- */
html {
    scrollbar-width: thin;
    scrollbar-color: #26262e #0a0a0c;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: #0a0a0c;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2c2c34, #17171c);
    border-radius: 99px;
    border: 2px solid #0a0a0c;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-deep), #6d0215);
}

/* ---------- 1. HERO : "PERSONALITY" ne déborde plus ---------- */
.hero-inner {
    container-type: inline-size;
    width: min(50%, 720px);
}

.hero-title {
    font-size: clamp(1.6rem, 4.2vw, 3.6rem);
    font-size: 7cqw;
    letter-spacing: .02em;
    white-space: nowrap;
    line-height: .95;
}

@media (max-width: 960px) {
    .hero-inner { width: 100%; }
}

/* ---------- 2. PERF — promotion GPU des couches animées ---------- */
.hero-art,
.hero-glow,
.section-aura,
.aura-layer {
    will-change: transform, opacity;
}

/* le backdrop-filter se re-blur à chaque frame pendant les transitions :
   on remplace le verre par un fond plus opaque, rendu identique, bien plus fluide */
.card-face {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(14, 14, 18, 0.9);
}

/* ---------- 3. EMPILEMENT carrousel : la carte du milieu passe devant ---------- */
.slider-stage {
    isolation: isolate;
}

.frame {
    z-index: 3;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .65), inset 0 0 40px rgba(0, 0, 0, .55);
}

.stack-peek {
    z-index: 1;
    opacity: .55;
    filter: brightness(.55) saturate(.9);
}

.stack-peek.peek-left {
    left: -78px;
    transform: rotate(-6deg) scale(.88);
}

.stack-peek.peek-right {
    right: -78px;
    transform: rotate(5deg) scale(.88);
}

.stack-peek.peek-horizontal.peek-left { left: -64px; }
.stack-peek.peek-horizontal.peek-right { right: -64px; }

.webtoon-pill {
    position: relative;
    z-index: 4;
}

@media (max-width: 600px) {
    .stack-peek { display: none; }
}

/* ---------- 4. GLOW diffus derrière image + carte de description ---------- */
.section-aura {
    left: 55%;
    width: 150vmin;
    height: 150vmin;
    filter: blur(120px);
    opacity: 1;
}

.aura-layer {
    transform: scale(1.35);
}

@media (max-width: 960px) {
    .section-aura {
        left: 50%;
        width: 120vmin;
        height: 120vmin;
        filter: blur(80px);
    }
    .noise-overlay { display: none; }
}

/* ---------- 5. FORMULAIRES : hauteur auto (calculée en JS), paiement en dernier ---------- */
.card-face.card-back {
    scrollbar-width: none;
}

.card-face.card-back::-webkit-scrollbar {
    display: none;
}

.wiz-btn.pay {
    margin-top: 12px;
}

@media (max-height: 820px) and (min-width: 961px) {
    .wiz-group { margin-bottom: 12px; }
    .wiz-steps { margin: 8px 0 12px; }
    .card-face { padding: 22px 24px; }
    .wiz-textarea { min-height: 64px; }
    .wiz-drop { padding: 10px; }
}

@media (max-width: 960px) {
    .work-section.is-flipped { overflow-y: auto; }
    .work-section.is-flipped .work-slider { display: none; }
    .work-section.is-flipped .work-layout { padding-top: 76px; }
}

.work-section#writing .frame,
.work-section#writing .book-mock {
    min-height: 0;
}

.work-section#writing .book-spread {
    transform: none;
}

/* ---------- 6. CONTACT : la révélation devient la transition Liquid Morph ---------- */
.comic-section {
    transition: none;
    opacity: 1;
    clip-path: none;
}

/* ---------- 7. FOOTER — logos vectoriels officiels ---------- */
.vgen-ico {
    display: block;
    width: 26px;
    height: 26px;
    background: currentColor;
    -webkit-mask: var(--vg) center/contain no-repeat;
    mask: var(--vg) center/contain no-repeat;
}

/* ---------- 8. COUCHES DE TRANSITION ---------- */
#paRing {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #ff2b4d;
    border-radius: 50%;
    box-shadow: 0 0 22px #ff2b4d, inset 0 0 14px #ff2b4d;
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    will-change: transform, opacity;
}

#paCells {
    position: fixed;
    inset: 0;
    z-index: 501;
    display: grid;
    grid-template: repeat(5, 1fr) / repeat(10, 1fr);
    pointer-events: none;
    visibility: hidden;
}

#paCells i {
    background: #050507;
    border: 1px solid #ff2b4d;
    box-shadow: inset 0 0 14px rgba(255, 43, 77, .5);
    transform: scale(0);
    will-change: transform;
}

.pa-shards {
    position: fixed;
    inset: 0;
    z-index: 9990;
    perspective: 1000px;
    cursor: pointer;
}

.pa-shard {
    position: absolute;
    overflow: hidden;
    will-change: transform, opacity;
}

.pa-sent {
    background: #fff;
    color: #111;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 16px 60px rgba(217, 4, 41, .6);
    height: 100%;
}

.pa-sent h3 {
    font-size: 1.9rem;
    color: #D90429;
    margin-bottom: 12px;
}

.pa-sent p {
    font-size: .9rem;
    color: #555;
}

/* ---------- 9. AYA — ancienne UI masquée, mini-téléphone Y2K + plein écran pixel ---------- */
#ayaFab,
#ayaScreen,
#pixelCurtain {
    display: none !important;
}

/* plein écran Aya : sidebar/menu hamburger du site masqués */
body.aya-full .nav-toggle {
    opacity: 0;
    pointer-events: none;
}

body.aya-full .sidebar-backdrop,
body.aya-full .sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-102%);
}

/* mini-téléphone — esthétique rétro Y2K/pixel, position fixe 20px / 20px */
.pa-phone {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9990;
    width: 78px;
    height: 134px;
    border: 3px solid #17122b;
    border-radius: 16px;
    background: linear-gradient(#e2c4f0, #7fdcf8);
    box-shadow: 4px 4px 0 #17122b, 0 0 24px rgba(122, 220, 255, .45);
    cursor: pointer;
    padding: 0;
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .35s ease;
    will-change: transform;
}

.pa-phone:hover,
.pa-phone:focus-visible {
    transform: translateY(-6px);
    box-shadow: 4px 8px 0 #17122b, 0 0 32px rgba(122, 220, 255, .65);
}

.pa-phone::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    width: 22px;
    height: 4px;
    margin-left: -11px;
    background: #17122b;
    border-radius: 2px;
}

.pa-phone img {
    position: absolute;
    left: 50%;
    bottom: 26px;
    width: 62px;
    transform: translateX(-50%);
}

.pa-phone b {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    font: 8px 'Press Start 2P', monospace;
    color: #17122b;
    text-align: center;
}

.pa-phone i {
    position: absolute;
    top: 16px;
    right: 12px;
    width: 9px;
    height: 9px;
    background: #3dff9a;
    border: 2px solid #17122b;
    animation: paPing 2s infinite;
}

@keyframes paPing {
    50% { transform: scale(1.3); opacity: .6; }
}

body.aya-full .pa-phone {
    display: none;
}

@media (max-width: 600px) {
    .pa-phone {
        width: 64px;
        height: 110px;
        right: 14px;
        bottom: 14px;
    }
    .pa-phone img { width: 50px; bottom: 22px; }
}

/* interface terminal complète — palette exacte de la référence Y2K */
#paAya {
    position: fixed;
    inset: 0;
    z-index: 9996;
    display: none;
    flex-direction: column;
    align-items: center;
    font-family: 'Press Start 2P', 'Space Mono', monospace;
    color: #17122b;
    background:
        linear-gradient(rgba(0, 246, 255, .12) 1px, transparent 1px) 0 0 / 8px 8px,
        linear-gradient(90deg, rgba(0, 246, 255, .12) 1px, transparent 1px) 0 0 / 8px 8px,
        linear-gradient(180deg, #e5c4f0 0%, #c9f0ff 45%, #7ee8ff 70%, #f5f8ff 100%);
}

#paAya.on {
    display: flex;
}

.pa-top {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    gap: 10px;
    z-index: 3;
}

.pa-pill {
    font: 10px 'Press Start 2P', monospace;
    color: #fff;
    padding: 12px 16px;
    min-height: 44px;
    border: 3px solid #17122b;
    border-radius: 999px;
    background: linear-gradient(#e24dff, #4db8ff);
    box-shadow: 0 4px 0 #6fd8ff;
    cursor: pointer;
}

.pa-x {
    margin-left: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #17122b;
    background: #fff;
    font-size: 22px;
    cursor: pointer;
}

.pa-stage {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    width: min(580px, 94vw);
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

.pa-hello {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pa-big {
    font-size: clamp(56px, 16vw, 150px);
    color: #fff;
    text-shadow: 6px 6px 0 rgba(23, 18, 43, .25);
    letter-spacing: .04em;
    line-height: 1;
}

.pa-mascot {
    width: clamp(110px, 22vw, 170px);
    margin-top: -8px;
}

#paAya.chatting .pa-hello {
    display: none;
}

.pa-chat {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    background: linear-gradient(#ece6fa, #d6f4ff);
    border: 3px solid #17122b;
    border-radius: 26px;
    overflow: hidden;
    margin-bottom: 14px;
}

#paAya.chatting .pa-chat {
    display: flex;
}

.pa-chat header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 3px solid #17122b;
}

.pa-chat header img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid #5b4a9a;
    object-fit: cover;
    background: #fff;
}

.pa-chat header b {
    font-size: 11px;
    display: block;
    margin-bottom: 5px;
}

.pa-chat header small {
    font-size: 8px;
    color: #12b5e6;
}

.pa-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(91, 74, 154, .5) transparent;
}

.pa-msgs::-webkit-scrollbar {
    width: 8px;
}

.pa-msgs::-webkit-scrollbar-thumb {
    background: rgba(91, 74, 154, .45);
    border-radius: 99px;
    border: none;
}

.pa-m {
    max-width: 82%;
    padding: 12px 14px;
    border: 3px solid #5b4a9a;
    border-radius: 16px;
    font: 11px/1.6 'Space Mono', monospace;
    word-break: break-word;
    box-shadow: 3px 3px 0 rgba(23, 18, 43, .3);
}

.pa-m p {
    margin: 0;
    white-space: pre-wrap;
}

.pa-m img {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 6px;
}

.pa-m.a {
    align-self: flex-start;
    background: #fff;
}

.pa-m.u {
    align-self: flex-end;
    background: #5a7bd6;
    border-color: #2b3f7a;
    color: #0b0b10;
}

.pa-m.typing {
    opacity: .65;
}

.pa-input {
    position: relative;
    z-index: 2;
    width: min(560px, 94vw);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: max(16px, env(safe-area-inset-bottom));
    background: #fff;
    border: 3px solid #5b4a9a;
    border-radius: 24px;
    box-shadow: 0 0 0 8px rgba(111, 216, 255, .5);
}

.pa-input textarea {
    flex: 1;
    border: 0;
    outline: 0;
    resize: none;
    font: 12px 'Space Mono', monospace;
    color: #17122b;
    min-height: 56px;
    background: transparent;
}

.pa-plus,
.pa-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #17122b;
    cursor: pointer;
    font-size: 20px;
    flex: none;
}

.pa-plus { background: #fff; }
.pa-send { background: #17122b; color: #fff; }

.pa-prev {
    position: absolute;
    left: 12px;
    bottom: calc(100% + 10px);
}

.pa-prev img {
    height: 70px;
    border: 3px solid #17122b;
    border-radius: 10px;
    display: block;
}

/* ---------- 10. TASK 5 — écriture/webtoon : le book ne déborde plus ---------- */
.book-mock {
    clear: both;
    min-height: 400px;
}

.work-section#writing .frame,
.work-section#webtoon .frame {
    min-height: 400px;
}

.book-spread {
    position: relative;
    z-index: 2;
    max-height: 100%;
}

/* ---------- 11. TASK 5 — footer slim dans #contact ---------- */
#contact.panel {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#contact .contact-inner {
    flex: 1;
    display: flex;
    align-items: center;
}

#contact .site-footer {
    position: static;
    height: 50px;
    padding: 10px 20px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    background: transparent;
    border-top: 1px solid var(--line);
}

#contact .footer-brand {
    font-size: 1.05rem;
    margin: 0;
    letter-spacing: 2px;
}

#contact .social-links {
    margin: 0;
    gap: 18px;
}

#contact .social-link svg {
    width: 18px;
    height: 18px;
}

#contact .copyright {
    font-size: 0.66rem;
    margin: 0;
}

/* ---------- 12. AYA — widget compact, style Y2K (maquette) ---------- */
#aya-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 540px;
    z-index: 9985;
    display: none;
    flex-direction: column;
    border: 3px solid #17122b;
    border-radius: 22px;
    overflow: hidden;
    background:
        linear-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px) 0 0 / 8px 8px,
        linear-gradient(90deg, rgba(255, 255, 255, .14) 1px, transparent 1px) 0 0 / 8px 8px,
        linear-gradient(180deg, #cbb6ee 0%, #b7c8f4 48%, #9fd4f5 100%);
    box-shadow: 8px 8px 0 rgba(23, 18, 43, .35), 0 0 34px rgba(122, 220, 255, .35);
    font-family: 'Space Mono', 'Press Start 2P', monospace;
    color: #17122b;
}

#aya-widget.open {
    display: flex;
    animation: ayaWidgetIn 0.35s var(--clip-ease);
}

@keyframes ayaWidgetIn {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* le mini-téléphone disparaît quand le widget est ouvert ou en plein écran */
body.aya-widget-open .pa-phone,
body.aya-full .pa-phone,
body.aya-full #aya-widget {
    display: none;
}

/* ----- header blanc façon maquette ----- */
.aya-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 3px solid #17122b;
    flex-shrink: 0;
}

.aya-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid #5b4a9a;
    object-fit: cover;
    background: #e8d4f0;
    flex-shrink: 0;
}

.aya-header-id { min-width: 0; }

.aya-header-id b {
    display: block;
    font: 10px 'Press Start 2P', monospace;
    letter-spacing: 1px;
    color: #17122b;
}

.aya-header-id small {
    font: 7px 'Press Start 2P', monospace;
    color: #00c8ff;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.aya-header-id small .status-dot {
    width: 6px;
    height: 6px;
    background: #00c8ff;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

.aya-tabs {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.aya-tab {
    font: 8px 'Press Start 2P', monospace;
    padding: 8px 10px;
    border: 3px solid #17122b;
    border-radius: 999px;
    background: #fff;
    color: #17122b;
    cursor: pointer;
    transition: filter 0.25s, transform 0.2s;
}

.aya-tab.active {
    background: linear-gradient(180deg, #e24dff, #4db8ff);
    color: #fff;
    text-shadow: 1px 1px 0 #17122b;
}

.aya-tab:hover { filter: brightness(1.06); }
.aya-tab:active { transform: translate(1px, 1px); }

.aya-win {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.aya-wbtn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #17122b;
    background: #fff;
    color: #17122b;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    transition: filter 0.25s, transform 0.2s;
}

.aya-wbtn:hover { filter: brightness(1.05); box-shadow: 0 0 10px rgba(0, 200, 255, 0.55); }
.aya-wbtn:active { transform: translate(1px, 1px); }

/* ----- panneau CHATS ----- */
.aya-chats-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
}

.aya-chats-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aya-chats-list li {
    padding: 10px 12px;
    border: 3px solid #5b4a9a;
    border-radius: 12px;
    background: #f5f8ff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    box-shadow: 3px 3px 0 rgba(23, 18, 43, 0.18);
    transition: border-color 0.25s, background 0.25s;
}

.aya-chats-list li:hover { border-color: #00e8ff; }
.aya-chats-list li.active { border-color: #00e8ff; background: #c9f0ff; }

.aya-chats-list b {
    font: 9px 'Press Start 2P', monospace;
    display: block;
    color: #17122b;
    margin-bottom: 5px;
}

.aya-chats-list small {
    font: 9px 'Space Mono', monospace;
    color: #5f4c8a;
}

.chat-del {
    background: #ff5ec4;
    border: 2px solid #17122b;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.aya-new-chat {
    width: 100%;
    padding: 12px;
    border: 3px solid #17122b;
    border-radius: 12px;
    background: linear-gradient(180deg, #17122b, #252538);
    color: #fff;
    font: 8px 'Press Start 2P', monospace;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(0, 200, 255, 0.45);
}

.aya-new-chat:active { transform: translate(1px, 1px); }

/* ----- fil de messages ----- */
.aya-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(91, 74, 154, 0.5) transparent;
}

/* contrainte stricte des images (spec) + cadre bleu de la maquette */
.aya-messages img {
    max-width: 180px !important;
    max-height: 180px !important;
    object-fit: cover;
    border: 3px solid #2b3f7a;
    border-radius: 12px;
}

#aya-widget .pa-m {
    max-width: 84%;
    padding: 10px 12px;
    border: 3px solid #5b4a9a;
    border-radius: 16px 16px 16px 0;
    font: 11px/1.6 'Space Mono', monospace;
    word-break: break-word;
    box-shadow: 3px 3px 0 rgba(23, 18, 43, 0.25);
}

#aya-widget .pa-m p { margin: 0; white-space: pre-wrap; }

#aya-widget .pa-m .pa-who {
    display: block;
    margin-top: 6px;
    font: 7px 'Press Start 2P', monospace;
    color: #5f4c8a;
}

#aya-widget .pa-m.a {
    align-self: flex-start;
    background: #fff;
    color: #000;
}

#aya-widget .pa-m.u {
    align-self: flex-end;
    background: #5a7fd0;
    border-color: #2b3f7a;
    border-radius: 16px 16px 0 16px;
    color: #0b0b10;
}

#aya-widget .pa-m.typing { opacity: 0.65; }

#aya-widget .pa-m.typing p::after {
    content: '…';
    animation: statusPulse 1s ease-in-out infinite;
}

/* ----- aperçu média au-dessus de la saisie ----- */
.media-preview-container {
    position: relative;
    margin: 0 14px 8px;
    align-self: flex-start;
    flex-shrink: 0;
}

.media-preview-container img {
    height: 70px;
    border-radius: 10px;
    border: 3px solid #2b3f7a;
    display: block;
}

.media-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff5ec4;
    border: 2px solid #17122b;
    color: #fff;
    font-size: 0.62rem;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ----- barre de saisie flottante (maquette) ----- */
.aya-composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 10px 12px 12px;
    padding: 10px 12px;
    background: #fff;
    border: 3px solid #5b4a9a;
    border-radius: 20px;
    box-shadow: 0 0 0 6px rgba(122, 220, 255, 0.5);
    flex-shrink: 0;
}

.attach-btn {
    width: 38px;
    height: 38px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid #17122b;
    background: #fff;
    color: #17122b;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: filter 0.25s, transform 0.2s;
}

.attach-btn:hover { filter: brightness(0.96); }
.attach-btn:active { transform: scale(0.94); }

#aya-text {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #17122b;
    font: 12px/1.5 'Space Mono', monospace;
    padding: 10px 4px;
    resize: none;
    max-height: 90px;
}

#aya-text::placeholder { color: rgba(23, 18, 43, 0.42); }

.aya-send {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    border: 3px solid #17122b;
    background: #17122b;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.25s;
}

.aya-send:hover { box-shadow: 0 0 14px rgba(0, 200, 255, 0.65); }
.aya-send:active { transform: translate(1px, 1px); }

@media (max-width: 480px) {
    #aya-widget {
        width: calc(100vw - 24px);
        height: min(540px, 72dvh);
        right: 12px;
        bottom: 12px;
    }
}

.work-section#writing .frame {
    width: min(100%, 660px);
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 10;
}

.work-section#writing .slider-stage {
    width: min(100%, 660px);
}

.work-section#writing .book-mock {
    min-height: 0;
}

.work-section#writing .book-spread {
    transform: none;
}

/* ---------- 13. AYA plein écran — ajustements maquette ---------- */
.pa-big { font-size: clamp(64px, 18vw, 170px); }
.pa-mascot { width: clamp(120px, 23vw, 180px); margin-top: -14px; }

.pa-msgs .pa-who {
    display: block;
    margin-top: 6px;
    font: 7px 'Press Start 2P', monospace;
    color: #5f4c8a;
}

/* ---------- 14. Webtoon : miniature strictement carrée + nouvelle cover ---------- */
.work-section#webtoon .frame.frame-vertical {
    aspect-ratio: 1 / 1;
    height: auto;
    width: min(64vh, 560px);
}

@media (max-width: 960px) {
    .work-section#webtoon .frame.frame-vertical {
        width: min(78vw, 400px);
    }
}

/* ---------- 15. Wizard — email facturation (Lemon Squeezy) ---------- */
.wiz-field-note {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.5;
}

.wiz-invoice-note {
    font-family: var(--mono);
    font-size: 0.64rem;
    color: var(--muted);
    margin: 4px 0 12px;
    line-height: 1.6;
}

.wiz-invoice-note strong { color: #fff; }

.wiz-input.err {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 43, 77, 0.25);
}

/* ---------- Aya fullscreen conversation: centered phone + in-screen chats ---------- */
#paAya.chatting .pa-stage {
    width: min(460px, 94vw);
    padding: env(safe-area-inset-top) 0 0;
    border: 3px solid #17122b;
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    overflow: hidden;
    background: linear-gradient(#ece6fa, #d6f4ff);
    box-shadow: 8px 8px 0 rgba(23, 18, 43, .18);
}

#paAya.chatting .pa-chat {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

#paAya.chatting .pa-chat header {
    flex: none;
}

#paAya.chatting .pa-input {
    width: min(460px, 94vw);
    margin: 0 auto max(16px, env(safe-area-inset-bottom));
    border-top: 0;
    border-radius: 0 0 26px 26px;
    box-shadow: 8px 8px 0 rgba(23, 18, 43, .18);
}

#paAya:not(.chatting) .pa-input {
    display: none;
}

.pa-m strong {
    font-weight: 800;
}

.pa-m a {
    color: #143c91;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pa-route-link {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border: 2px solid #2b3f7a;
    border-radius: 999px;
    background: #c9f0ff;
    color: #17122b;
    font: 8px 'Press Start 2P', monospace;
    line-height: 1.6;
    text-align: left;
    cursor: pointer;
}

.pa-route-link:hover {
    background: #9feaff;
}

.pa-chat-sidebar {
    position: absolute;
    z-index: 4;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    padding: 14px;
    border-right: 3px solid #17122b;
    border-radius: 0 20px 20px 0;
    background: #f5f8ff;
    box-shadow: 6px 0 18px rgba(23, 18, 43, .22);
    overflow-y: auto;
}

.pa-chat-sidebar[hidden] {
    display: none;
}

.pa-chat-sidebar header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font: 10px 'Press Start 2P', monospace;
}

.pa-chat-sidebar header button {
    width: 28px;
    height: 28px;
    border: 2px solid #17122b;
    border-radius: 50%;
    background: #ff5ec4;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.pa-chat-sidebar ul {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.pa-chat-sidebar li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    border: 2px solid #5b4a9a;
    border-radius: 12px;
    background: #f5f8ff;
    cursor: pointer;
}

.pa-chat-sidebar li.active {
    border-color: #00c8ff;
    background: #c9f0ff;
}

.pa-chat-sidebar li b,
.pa-chat-sidebar li small {
    display: block;
    overflow-wrap: anywhere;
}

.pa-chat-sidebar li b {
    margin-bottom: 5px;
    font: 8px 'Press Start 2P', monospace;
}

.pa-chat-sidebar li small {
    color: #5f4c8a;
    font: 9px 'Space Mono', monospace;
}

.pa-chat-sidebar .chat-del {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: #ff5ec4;
    color: #fff;
    cursor: pointer;
}

.pa-chat-sidebar > #paNewChat {
    width: 100%;
    padding: 12px;
    border: 3px solid #17122b;
    border-radius: 12px;
    background: #17122b;
    color: #fff;
    font: 8px 'Press Start 2P', monospace;
    cursor: pointer;
}

@media (max-width: 600px) {
    #paAya.chatting .pa-stage,
    #paAya.chatting .pa-input {
        width: min(460px, calc(100vw - 24px));
    }

    #paAya.chatting .pa-stage {
        padding-top: env(safe-area-inset-top);
    }

    #paAya.chatting .pa-input {
        margin-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .pa-top {
        top: max(8px, env(safe-area-inset-top));
        left: auto;
        right: 8px;
        width: auto;
        gap: 6px;
    }

    .pa-top .pa-x {
        margin-left: 0;
    }

    .pa-pill {
        padding: 10px 11px;
        font-size: 8px;
    }

    .pa-x {
        width: 40px;
        height: 40px;
    }
}
