/* Fredoka (SIL Open Font License, see fonts/OFL.txt), served from our own server: loading it from Google Fonts
   would send every visitor's IP address to Google. One variable font file covers all weights. */
@font-face {
    font-family: "Fredoka";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/fredoka-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Fredoka";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/fredoka-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
        U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #FBFAFF;
    --ink: #241F45;
    --ink-soft: #625D80;
    --violet: #6C5CE7;
    --violet-deep: #4B3BC4;
    --violet-soft: #ECE9FF;
    --coral: #F2685A;
    --coral-soft: #FFE5E0;
    --mint: #1FA67A;
    --mint-soft: #DAF5EA;
    --sun: #FFB23E;
    --sun-soft: #FFF1CF;
    --blue: #3B82E0;
    --blue-soft: #DEEBFF;
    --butter: #FFF1CF;
    --white: #FFFFFF;
    /* Soft patches of color: peach top left, mint on the right, lavender at the bottom */
    --page-bg:
        radial-gradient(70vmax 50vmax at 0% 0%, #FFE8DE 0%, rgba(255, 232, 222, 0) 60%),
        radial-gradient(55vmax 55vmax at 105% 45%, #DDF5EA 0%, rgba(221, 245, 234, 0) 60%),
        radial-gradient(80vmax 50vmax at 40% 105%, #E7E2FF 0%, rgba(231, 226, 255, 0) 65%),
        var(--bg);
    --radius: 22px;
    --shadow: 0 5px 0 rgba(36, 31, 69, 0.04), 0 10px 28px rgba(76, 60, 160, 0.12);
}

* { box-sizing: border-box; }

/* The page itself never scrolls, only the app inside it does. When the page scrolls, mobile browsers
   show and hide their address bar, which resizes the viewport and makes bars at the bottom jump. */
html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Fredoka", "Nunito", system-ui, sans-serif;
    color: var(--ink);
    background: var(--page-bg);
    -webkit-tap-highlight-color: transparent;
}

button, textarea { font-family: inherit; color: inherit; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* The scrolling middle in the chat: messages and gift ideas */
.main {
    flex: 1;
    min-height: 0;
    overflow-x: hidden; /* for the full-width backdrop behind Pibbo in the chat */
    overflow-y: auto;
    overscroll-behavior-y: contain;
}
.main-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px 16px;
}
/* In the chat, messages stack up from the bottom, like in a messaging app */
.app:not([data-phase="start"]) .main-inner { justify-content: flex-end; padding-bottom: 0; }

/* ---------- top bar ---------- */
.topbar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 12px 18px 6px;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
}
.logo-mark { width: 34px; height: 34px; display: block; }
.logo-word { font-weight: 600; font-size: 24px; letter-spacing: 0.5px; }
.ghost-btn {
    border: 2px solid rgba(36, 31, 69, 0.08);
    background: rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.ghost-btn:active { transform: scale(0.96); }

/* ---------- start screen ----------
   The whole app scrolls, and Pibbo, its greeting and the message box sit together in the middle,
   with the questions at the very bottom. */
.app[data-phase="start"] { overflow-y: auto; overscroll-behavior-y: contain; }
.app[data-phase="start"] .main { flex: none; overflow: visible; margin-top: auto; }
.app[data-phase="start"] .main-inner { padding-bottom: 0; }
.app[data-phase="start"] .composer { background: none; padding-top: 14px; margin-bottom: auto; }

.hero { text-align: center; padding: 1.5vh 6px 0; }
.hero h1 {
    margin: 0;
    font-size: clamp(23px, 6vw, 30px);
    line-height: 1.15;
    font-weight: 700;
}
.hl { color: var(--violet); }

.intro-steps {
    list-style: none;
    margin: 14px 0 2px;
    padding: 14px 0 0;
    border-top: 2px dashed var(--violet-soft);
    display: grid;
    gap: 10px;
    text-align: left;
}
.intro-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slide-up 0.4s ease-out both;
    animation-delay: 0.5s;
}
.intro-steps li:nth-child(2) { animation-delay: 0.62s; }
.intro-steps li:nth-child(3) { animation-delay: 0.74s; }
.step-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
}
.step-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.step-chat { background: var(--violet-soft); color: var(--violet); }
.step-question { background: var(--coral-soft); color: var(--coral); }
.step-gift { background: var(--mint-soft); color: var(--mint); }
.step-text { font-size: 14.5px; font-weight: 400; line-height: 1.35; color: var(--ink-soft); }
.step-text strong { display: block; font-size: 15.5px; font-weight: 600; color: var(--ink); }

.site-footer {
    flex: none;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 16px 14px;
}
.faq { font-size: 14px; color: var(--ink-soft); }
.faq summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    list-style: none;
    font-weight: 500;
    padding: 6px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq-chevron {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s;
}
.faq[open] .faq-chevron { transform: rotate(180deg); }
.faq dl {
    margin: 6px 0 0;
    padding: 4px 16px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
}
.faq dt { font-weight: 600; color: var(--ink); margin-top: 10px; }
.faq dd { margin: 2px 0 0; line-height: 1.45; }
.noscript { background: var(--butter); border-radius: 14px; padding: 10px 14px; }

.app:not([data-phase="start"]) .hero,
.app:not([data-phase="start"]) .intro-steps,
.app:not([data-phase="start"]) .site-footer { display: none; }

/* ---------- stage: Pibbo and its speech bubble ---------- */
.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
}
.pibbo-wrap {
    width: 136px;
    height: 136px;
    flex: none;
    cursor: pointer;
    transition: width 0.45s cubic-bezier(.5, 1.6, .5, 1), height 0.45s cubic-bezier(.5, 1.6, .5, 1);
}
.pibbo { width: 100%; height: 100%; overflow: visible; }

.bubble {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow);
    max-width: 100%;
    min-height: 50px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 500;
    text-align: center;
    animation: pop-in 0.35s cubic-bezier(.4, 1.8, .6, 1);
}
.bubble::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -9px;
    width: 18px;
    height: 18px;
    background: var(--white);
    border-radius: 4px;
    transform: translateX(-50%) rotate(45deg);
}
.bubble p { margin: 0; position: relative; }
.app[data-phase="start"] .bubble p { min-height: 2.7em; } /* room for the greeting while it's typed */
.bubble .dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    border-radius: 50%;
    background: var(--violet);
    opacity: 0.6;
    animation: dot 1s infinite ease-in-out;
}
.bubble .dots span:nth-child(2) { animation-delay: 0.15s; }
.bubble .dots span:nth-child(3) { animation-delay: 0.3s; }

/* In the chat, Pibbo sits at the bottom, above the composer, next to its newest message */
.app:not([data-phase="start"]) .stage {
    position: sticky;
    bottom: 0;
    z-index: 5;
    flex-direction: row;
    align-items: flex-end;
    gap: 6px;
    margin: 6px -16px 0;
    padding: 18px 16px 6px 8px;
}
/* Messages scroll away behind Pibbo. Its backdrop is the page's own background, fixed to the window so it
   lines up exactly, across the full width, fading in at the top. */
.app:not([data-phase="start"]) .stage::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: calc(50% - 50vw);
    width: 100vw;
    background: var(--page-bg);
    background-attachment: fixed;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20px);
    mask-image: linear-gradient(to bottom, transparent, #000 20px);
}
.app:not([data-phase="start"]) .pibbo-wrap { width: 78px; height: 78px; }
.app:not([data-phase="start"]) .bubble {
    flex: 1;
    text-align: left;
    font-size: 17px;
    padding: 11px 15px;
    margin-bottom: 10px;
    max-height: 34vh;
    overflow-y: auto;
}
.app:not([data-phase="start"]) .bubble::before {
    left: -6px;
    top: auto;
    bottom: 16px;
    transform: rotate(45deg);
}

/* ---------- Pibbo, a shape-shifting blob, and its moods ---------- */
.pibbo-shadow { fill: rgba(76, 60, 160, 0.15); transform-box: fill-box; transform-origin: center; }
.blob { stroke-width: 12; stroke-linejoin: round; } /* the thick stroke rounds the triangle's and square's corners */
.shine { fill: #FFFFFF; opacity: 0.3; }
.cheek { fill: #FF8FA8; opacity: 0.7; }
.eyes-open circle, .mouth-o, .mouth-open path { fill: var(--ink); }
.eyes-open .eye-shine { fill: #FFFFFF; }
.eyes-happy path, .mouth-smile { fill: none; stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; }
.tongue { fill: #FF7F8E; }
.streamer { fill: none; stroke-width: 6.5; stroke-linecap: round; }
.streamers { transform-box: fill-box; transform-origin: 0% 50%; animation: streamers 1.6s ease-in-out infinite; }
.fx-think circle { fill: #FFFFFF; stroke: var(--violet); stroke-opacity: 0.5; stroke-width: 2; }
.fx-question { font: 700 44px "Fredoka", sans-serif; fill: var(--coral); }
.fx-sparkle path { fill: var(--sun); }

.pibbo-body, .eye, .face, .pibbo-fx { transform-box: fill-box; transform-origin: center; }
.pibbo-body { transform-origin: 50% 100%; }

.face, .pibbo-fx { opacity: 0; transition: opacity 0.15s; }
.eye { animation: blink 4.2s infinite; }
.eye circle { transition: transform 0.3s ease; transform-box: fill-box; transform-origin: center; }

/* idle */
[data-mood="idle"] .eyes-open, [data-mood="idle"] .mouth-smile { opacity: 1; }
[data-mood="idle"] .pibbo-body { animation: bob 2.8s ease-in-out infinite; }
[data-mood="idle"] .pibbo-shadow { animation: shadow-bob 2.8s ease-in-out infinite; }

/* curious: head tilt and a little "?" */
[data-mood="curious"] .eyes-open, [data-mood="curious"] .mouth-o, [data-mood="curious"] .fx-question { opacity: 1; }
[data-mood="curious"] .pibbo-body { animation: tilt 2.6s ease-in-out infinite; }
[data-mood="curious"] .eye circle:first-child { transform: scale(1.2); }
[data-mood="curious"] .fx-question { animation: float-q 1.6s ease-in-out infinite; }

/* excited: ^^ eyes, bouncing */
[data-mood="excited"] .eyes-happy, [data-mood="excited"] .mouth-open, [data-mood="excited"] .fx-sparkle { opacity: 1; }
[data-mood="excited"] .pibbo-body { animation: bounce 0.6s cubic-bezier(.3, .7, .4, 1) infinite; }
[data-mood="excited"] .pibbo-shadow { animation: shadow-bounce 0.6s cubic-bezier(.3, .7, .4, 1) infinite; }
[data-mood="excited"] .fx-sparkle { animation: twinkle 0.8s ease-in-out infinite; }

/* thinking: looking up, thought bubbles, slow squish */
[data-mood="thinking"] .eyes-open, [data-mood="thinking"] .mouth-o, [data-mood="thinking"] .fx-think { opacity: 1; }
[data-mood="thinking"] .eye circle { transform: translate(3px, -3px); }
[data-mood="thinking"] .pibbo-body { animation: squish 1.4s ease-in-out infinite; }
[data-mood="thinking"] .fx-think circle { animation: think-dot 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
[data-mood="thinking"] .fx-think circle:nth-child(2) { animation-delay: 0.2s; }
[data-mood="thinking"] .fx-think circle:nth-child(3) { animation-delay: 0.4s; }

/* party: big jumps */
[data-mood="party"] .eyes-happy, [data-mood="party"] .mouth-open, [data-mood="party"] .fx-sparkle { opacity: 1; }
[data-mood="party"] .pibbo-body { animation: jump 0.9s cubic-bezier(.3, .7, .4, 1) infinite; }
[data-mood="party"] .pibbo-shadow { animation: shadow-bounce 0.9s cubic-bezier(.3, .7, .4, 1) infinite; }
[data-mood="party"] .fx-sparkle { animation: twinkle 0.6s ease-in-out infinite; }

/* listening: big eyes, leaning in, sound waves coming in */
.fx-listen path { fill: none; stroke: var(--violet); stroke-width: 6; stroke-linecap: round; }
[data-mood="listening"] .eyes-open, [data-mood="listening"] .mouth-smile, [data-mood="listening"] .fx-listen { opacity: 1; }
[data-mood="listening"] .eye circle:first-child { transform: scale(1.2); }
[data-mood="listening"] .pibbo-body { animation: lean 2.4s ease-in-out infinite; }
[data-mood="listening"] .fx-listen path { animation: sound-in 1.2s ease-in-out infinite; }
[data-mood="listening"] .fx-listen path:nth-child(1) { animation-delay: 0.3s; }

/* oops: a wobble */
[data-mood="oops"] .eyes-open, [data-mood="oops"] .mouth-o { opacity: 1; }
[data-mood="oops"] .pibbo-body { animation: shake 0.5s ease-in-out 2; }

@keyframes streamers { 0%, 100% { transform: rotate(-5deg) scaleX(0.96); } 50% { transform: rotate(4deg) scaleX(1.04); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-6px) scale(0.98, 1.02); } }
@keyframes shadow-bob { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.9); } }
@keyframes tilt { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(-3deg) translateY(-3px); } }
@keyframes float-q { 0%, 100% { transform: translateY(0) rotate(8deg); } 50% { transform: translateY(-8px) rotate(-4deg); } }
@keyframes lean { 0%, 100% { transform: rotate(6deg); } 50% { transform: rotate(9deg) translateY(-3px); } }
@keyframes sound-in { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1.06, 0.94); }
    40% { transform: translateY(-18px) scale(0.96, 1.05); }
    70% { transform: translateY(0) scale(1.08, 0.92); }
}
@keyframes jump {
    0%, 100% { transform: translateY(0) scale(1.1, 0.9); }
    45% { transform: translateY(-34px) scale(0.94, 1.08) rotate(-4deg); }
    75% { transform: translateY(0) scale(1.1, 0.9); }
}
@keyframes shadow-bounce { 0%, 100% { transform: scale(1.05); } 45% { transform: scale(0.65); opacity: 0.6; } }
@keyframes twinkle { 0%, 100% { transform: scale(0.7) rotate(0); } 50% { transform: scale(1.15) rotate(20deg); } }
@keyframes squish { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, 0.96); } }
@keyframes think-dot { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(-4px); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px) rotate(-4deg); } 75% { transform: translateX(7px) rotate(4deg); } }
@keyframes pop-in { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-5px); opacity: 1; } }
@keyframes slide-up { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- chat thread ---------- */
.thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 6px;
}
.thread:empty { display: none; }
.msg {
    max-width: 82%;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 16px;
    line-height: 1.4;
    animation: slide-up 0.3s ease-out;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.msg.user {
    align-self: flex-end;
    background: var(--violet-soft);
    color: #2B2170;
    border-bottom-right-radius: 6px;
    font-weight: 500;
}
.msg.pibbo {
    align-self: flex-start;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 0;
    max-width: 88%;
}
.msg.pibbo .text {
    background: rgba(255, 255, 255, 0.85);
    padding: 10px 15px;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
}
.mini-pibbo {
    flex: none;
    width: 28px;
    height: 28px;
    background: url("../favicon.svg") center / contain no-repeat;
}

/* ---------- gift ideas ---------- */
.results { display: flex; flex-direction: column; gap: 12px; margin: 4px 0; }
.notice { background: var(--butter); border-radius: 16px; padding: 10px 14px; font-size: 14px; }
.gift-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--white);
    border: 3px solid var(--tint);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    animation: card-pop 0.5s cubic-bezier(.4, 1.6, .6, 1) both;
    animation-delay: calc(var(--i) * 0.08s);
}
.gift-card:active { transform: scale(0.98); }
@keyframes card-pop { from { transform: translateY(20px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.gift-pic {
    flex: none;
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 18px;
    background: var(--tint);
    display: grid;
    place-items: center;
    font-size: 40px;
}
.gift-pic img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}
.gift-pic .badge {
    position: absolute;
    right: -6px;
    bottom: -6px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 21px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.gift-text { display: flex; flex-direction: column; min-width: 0; }
.gift-text h3 { margin: 2px 0 4px; font-size: 17px; font-weight: 600; line-height: 1.25; }
.gift-text p { margin: 0; font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); }
.gift-text .find {
    align-self: flex-start;
    margin-top: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--tint);
    font-size: 13.5px;
    font-weight: 600;
}
.fine-print {
    margin: 0 4px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--ink-soft);
    text-align: center;
}
.fine-print a { color: inherit; }

/* ---------- composer ---------- */
.composer {
    flex: none;
    padding: 6px 16px 12px;
}
.composer > * { max-width: 528px; margin-left: auto; margin-right: auto; }
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scrollbar-width: none;
}
.chips:empty { display: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none;
    border: 2px solid var(--white);
    background: var(--white);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 3px 0 rgba(36, 31, 69, 0.07);
    animation: chip-in 0.35s cubic-bezier(.4, 1.8, .6, 1) both;
    animation-delay: calc(var(--i) * 0.05s);
}
.chip.special { background: var(--sun-soft); border-color: var(--sun-soft); color: #6B4A00; }
.chip:active { transform: scale(0.94); }
@keyframes chip-in { from { transform: translateY(10px) scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }

.composer-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 26px;
    padding: 4px 4px 4px 14px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}
.composer-row:focus-within { border-color: #C9C1FF; }
/* The AI Act asks chatbots to say they're an AI; small, but always visible under the message box */
.ai-note {
    margin-top: 6px;
    margin-bottom: 0;
    padding: 0 4px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--ink-soft);
    text-align: center;
}
.composer-row textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 16px;
    line-height: 1.35;
    padding: 9px 0;
    max-height: 120px;
}
.composer-row textarea::placeholder { color: #A29DBA; }
.send-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--violet);
    color: var(--white);
    cursor: pointer;
    transition: transform 0.15s;
}
.send-btn svg { width: 22px; height: 22px; margin-left: 2px; }
.send-btn:active { transform: scale(0.9); }
.app.busy .send-btn, .app.busy .chip { opacity: 0.5; pointer-events: none; }
.mic-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--violet-soft);
    color: var(--violet);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, color 0.15s;
}
.mic-btn[hidden] { display: none; }
.mic-btn svg { width: 22px; height: 22px; }
.mic-btn .stop-icon { display: none; }
.mic-btn:active { transform: scale(0.9); }

/* Listening: the mic turns into a purple stop button with a ring that grows with what Pibbo hears */
.app.listening .mic-btn {
    --level: 0;
    background: var(--violet);
    color: var(--white);
    box-shadow: 0 0 0 calc(3px + var(--level) * 9px) rgba(108, 92, 231, calc(0.35 - var(--level) * 0.15));
    transition: transform 0.15s, background 0.15s, color 0.15s;
}
.app.listening .mic-btn .mic-icon { display: none; }
.app.listening .mic-btn .stop-icon { display: block; }
.app.listening .composer-row { box-shadow: 0 0 0 2px var(--violet), var(--shadow); }
.app.listening .chips { display: none; }

/* A waveform above the message box, in place of the chips */
.listen-bar {
    display: flex;
    justify-content: center;
    padding: 4px 0 8px;
    animation: chip-in 0.3s cubic-bezier(.4, 1.8, .6, 1) both;
}
.listen-bar[hidden] { display: none; }
.wave {
    height: 22px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.wave i {
    width: 3px;
    height: 100%;
    border-radius: 2px;
    background: var(--violet);
    transform: scaleY(0.15);
    transition: transform 0.08s linear;
}

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i {
    position: absolute;
    top: -12px;
    width: 9px;
    height: 14px;
    border-radius: 3px;
    animation: fall var(--dur) cubic-bezier(.2, .6, .4, 1) forwards;
}
@keyframes fall {
    0% { transform: translate(0, 0) rotate(0); opacity: 1; }
    100% { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- links to the privacy page and the contact address ---------- */
.ai-note a { color: inherit; }
.footer-links {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--ink-soft);
    text-align: center;
}
.footer-links a { color: inherit; }

/* ---------- text pages, such as /privacy: these scroll like any web page ---------- */
html.doc, html.doc body { height: auto; overflow: visible; }
html.doc body { min-height: 100vh; }
.doc-topbar { max-width: 680px; margin: 0 auto; }
.doc-main {
    max-width: 680px;
    margin: 0 auto;
    padding: 8px 20px 48px;
    font-size: 16px;
    line-height: 1.55;
}
.doc-main h1 { font-size: 30px; line-height: 1.2; margin: 12px 0 8px; }
.doc-main h2 { font-size: 20px; margin: 28px 0 6px; }
.doc-main p { margin: 0 0 12px; }
.doc-main a { color: var(--violet-deep); }
.doc-lead { font-size: 18px; color: var(--ink-soft); }
.doc-updated { margin-top: 28px; font-size: 14px; color: var(--ink-soft); }
