@font-face {
    font-family: Onest;
    src: url("/assets/Onest-Regular.ttf");
}
@font-face {
    font-family: Onest;
    src: url("/assets/Onest-SemiBold.ttf");
    font-weight: 600;
}
:root {
    font-family: Onest, system-ui, sans-serif;
    font-synthesis: none;
    --app-height: 100dvh;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    height: var(--app-height);
    overflow: hidden;
}
button,
input,
textarea,
select {
    font: inherit;
}
button {
    cursor: pointer;
    touch-action: manipulation;
    min-height: 44px;
    border: 0;
}
button:disabled {
    opacity: 0.45;
    cursor: default;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid #66aeba;
    outline-offset: 3px;
}
[hidden] {
    display: none !important;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
.app-shell {
    height: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    padding: max(8px, env(safe-area-inset-top)) 16px max(8px, env(safe-area-inset-bottom));
}
header {
    flex-shrink: 0;
    display: flex;
}
.brand-spark {
    color: var(--rose);
    font-size: 30px;
}
.service-name {
    flex: 1;
}
.service-name small {
    display: block;
    color: var(--muted);
    font-weight: 400;
}
.icon-button,
.text-button {
    background: transparent;
    border-radius: 14px;
}
.icon-button {
    min-width: 44px;
}
.text-button {
    padding: 8px 12px;
}
.primary {
    padding: 14px 22px;
    font-weight: 600;
}
.small {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
}
.eyebrow {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #947582;
    margin: 10px 0;
}
h1 {
    font-weight: 600;
    letter-spacing: -1px;
    font-size: clamp(25px, 4vh, 37px);
    line-height: 1.15;
    margin: 10px 0;
}
h2 {
    font-size: 25px;
    line-height: 1.2;
    letter-spacing: -0.6px;
}
p {
    line-height: 1.5;
}
main {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}
.assistant-region {
    text-align: center;
    flex-shrink: 0;
}
#intro > p:not(.eyebrow) {
    color: var(--muted);
}
.avatar-stage {
    position: relative;
    margin: 10px auto 12px;
    width: min(100% - 16px, 380px);
    height: clamp(200px, 34vh, 360px);
    isolation: isolate;
}
.avatar-frame {
    position: absolute;
    overflow: hidden;
    background: #eee8e5;
}
.avatar-portrait,
#avatar-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#avatar-video {
    opacity: 0;
    object-position: center 30%;
}
.video-connected #avatar-video {
    opacity: 1;
}
.rose-wave {
    position: absolute;
    pointer-events: none;
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.stage-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}
.glass-button {
    border-radius: 50%;
    backdrop-filter: blur(12px);
}
.avatar-status {
    position: absolute;
    margin: 0;
    white-space: nowrap;
    border-radius: 20px;
    backdrop-filter: blur(12px);
}
.avatar-caption {
    color: var(--muted);
    margin: 5px;
}
#voice-mode-label {
    margin: 4px;
    color: var(--muted);
}
#conversation {
    display: flex;
    flex-direction: column;
}
#conversation p {
    margin: 4px;
}
.in-progress #intro,
.in-progress #conversation,
.in-progress .avatar-caption,
.in-progress #voice-mode-label {
    display: none;
}
.in-progress .avatar-stage {
    height: clamp(160px, 26vh, 260px);
    width: min(100% - 24px, 380px);
    margin-top: 6px;
}
.in-progress .avatar-stage[data-layout="dock"] {
    position: absolute;
    z-index: 4;
}
.avatar-stage[data-layout="dock"] .rose-wave {
    border-radius: 21px;
    inset: -4px;
}
.avatar-stage[data-layout="dock"] .stage-controls,
.avatar-stage[data-layout="dock"] .avatar-status {
    display: none;
}
.dock-expand {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 5;
}
.avatar-hidden .assistant-region {
    min-height: 0;
}
#avatar-restore {
    font-size: 11px;
    min-height: 34px;
}
#chat-panel {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}
.voice-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
#session-clock {
    color: var(--muted);
    margin-left: auto;
}
#voice-status {
    min-height: 16px;
}
.chat-log {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.chat-log > p > strong {
    display: none;
}
.chat-log .chat-user {
    border-bottom-right-radius: 5px;
}
.chat-log .chat-assistant {
    border: 1px solid #f2e8eb;
    border-bottom-left-radius: 5px;
}
.speech-now {
    margin: 3px 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.chat-follow {
    position: absolute;
    bottom: 80px;
    right: 10px;
    background: #fff;
    box-shadow: 0 4px 15px #72475a20;
    z-index: 5;
}
.composer {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
#chat-form {
    margin-top: 4px;
}
textarea {
    min-width: 0;
    flex: 1;
    border: 0;
    background: transparent;
    resize: none;
    line-height: 24px;
    padding: 7px 10px;
    max-height: 76px;
}
textarea:focus {
    outline: 0;
}
#chat-send {
    padding: 10px;
}
.mic-button {
    display: grid;
    place-items: center;
    border-radius: 50%;
}
#live-composer {
    flex: 1;
    min-width: 0;
    padding-left: 12px;
}
#input-meter {
    display: flex;
    align-items: center;
    margin-top: 4px;
}
#input-meter i {
    height: 3px;
    border-radius: 5px;
}
#chat-status {
    margin: 0 7px;
    min-height: 0;
}
#error {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 70px;
    padding: 12px;
    background: #fff3e3;
    border: 1px solid #edbe84;
    border-radius: 14px;
    font-size: 12px;
    z-index: 8;
}
.chat-project-list {
    gap: 16px;
}
.speech-project {
    border-radius: 25px;
    transition: box-shadow 0.2s;
}
.speech-project.active,
.speech-project[data-active="true"] {
    box-shadow: 0 0 0 3px #d98baa;
}
.chat-project-card {
    background: #fff;
    overflow: hidden;
}
.card-media {
    position: relative;
}
.card-mosaic {
    display: grid;
    padding: 0;
    width: 100%;
    overflow: hidden;
}
.card-mosaic.single {
    display: block;
}
.card-mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 0;
}
.card-favorite {
    position: absolute;
    border-radius: 50%;
    font-size: 25px;
}
.card-index {
    position: absolute;
    bottom: 10px;
    left: 12px;
    background: #ffffffde;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 10px;
}
.chat-project-location {
    color: var(--muted);
}
.chat-project-price {
    font-weight: 600;
}
.chat-project-price span {
    font-size: 10px;
    font-weight: 400;
}
.chat-project-attributes {
    color: var(--muted);
}
.chat-project-actions {
    display: flex;
    align-items: center;
}
.chat-project-actions button {
    background: none;
}
.chat-project-source {
    color: var(--muted);
}
.chat-project-source summary {
    cursor: pointer;
    display: flex;
    align-items: center;
}
.chat-project-source div {
    line-height: 1.8;
    overflow-wrap: anywhere;
    padding-bottom: 10px;
}
.save-shortlist {
    display: block;
    margin: 14px auto 0;
    width: 100%;
}
.sheet {
    border: 1px solid #f1e1e8;
    border-radius: 30px;
    padding: 28px 24px 20px;
    width: min(460px, calc(100% - 20px));
    max-height: calc(var(--app-height) - 40px);
    overflow: auto;
    box-shadow: 0 20px 80px #40243238;
}
.sheet::backdrop {
    background: #3e2b3c55;
    backdrop-filter: blur(5px);
}
.sheet .close {
    float: right;
    font-size: 25px;
    margin: -14px -10px 0 5px;
}
.sheet p {
    font-size: 13px;
    line-height: 1.6;
}
.sheet .primary {
    width: 100%;
    margin-top: 10px;
}
.sheet > .text-button {
    display: block;
    margin: 5px auto;
}
.test-notice,
.preview-banner {
    padding: 10px;
    background: #f4eff5;
    border-radius: 12px;
    font-size: 11px !important;
}
.sheet input,
.sheet select {
    font-size: 16px;
    min-height: 48px;
    border: 1px solid #dcc9d3;
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    min-width: 0;
    width: 100%;
}
.phone-row {
    display: flex;
    gap: 8px;
}
.phone-row select {
    width: 95px;
}
.sheet label {
    display: block;
    font-size: 12px;
    margin: 12px 0 6px;
}
.sheet .check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.5;
}
.sheet .check input {
    width: 20px;
    min-height: 20px;
    flex-shrink: 0;
    margin-top: 3px;
}
#otp {
    letter-spacing: 12px;
    text-align: center;
    font-size: 26px;
    padding: 10px 0 10px 12px;
}
#save-error {
    color: #9b392c;
}
.gallery-sheet {
    padding: 24px 16px;
}
.gallery-sheet img {
    width: 100%;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 18px;
}
.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}
@media (max-height: 700px) {
    #intro > p:not(.eyebrow) {
        margin: 5px;
    }
    h1 {
        font-size: 25px;
        margin: 5px 0;
    }
    .eyebrow {
        margin: 5px 0;
    }
    .avatar-stage {
        height: clamp(160px, 30vh, 230px);
        margin: 8px auto;
    }
    .in-progress .avatar-stage {
        height: 140px;
    }
    #conversation {
        margin: 7px auto;
    }
    .avatar-caption {
        margin: 2px;
    }
}
@media (orientation: landscape) and (max-height: 550px) {
    .in-progress .avatar-stage:not([data-layout="dock"]) {
        height: 90px;
        width: 160px;
    }
    .avatar-stage {
        height: 130px;
        width: 200px;
    }
    #intro > p,
    #intro .eyebrow,
    .avatar-caption,
    #voice-mode-label {
        display: none;
    }
    h1 {
        font-size: 21px;
    }
    #conversation {
        justify-content: center;
    }
    #conversation p {
        display: none;
    }
    .stage-controls {
        top: 0;
        right: 0;
    }
}
@media (min-width: 750px) {
    .app-shell {
        padding-top: 16px;
    }
    header {
        height: 64px;
    }
    .chat-project-list {
        grid-template-columns: 1fr;
    }
    .card-mosaic {
        height: 250px;
    }
    .sheet {
        max-height: 85vh;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

.card-media.no-photo {
    padding: 18px 80px 18px 16px;
}
.no-photo .card-index {
    position: static;
    margin-left: 6px;
}
.chat-project-kind {
    display: none;
}
.speech-project[data-active="true"] {
    animation: none !important;
    transform: none !important;
}
#saved-projects .chat-project-list {
    display: block;
}
.in-progress .avatar-stage[data-layout="hero"] {
    height: clamp(240px, 38vh, 360px);
}
@media (max-height: 700px) {
    .in-progress .avatar-stage[data-layout="hero"] {
        height: 180px;
    }
}
@media (orientation: landscape) and (max-height: 550px) {
    .in-progress .avatar-stage[data-layout="hero"] {
        height: 90px;
    }
}

body:not(.in-progress) #avatar-collapse {
    display: none;
}

.media-kind {
    position: absolute;
    left: 12px;
    top: 12px;
    border-radius: 12px;
    padding: 4px 8px;
    background: #ffffffda;
    font-size: 9px;
}
.video-connected .media-kind,
.avatar-stage[data-layout="dock"] .media-kind {
    display: none;
}

/* A3 Rose Glass: the approved phone composition, implemented as real controls. */
:root {
    color: #101f45;
    background: #fcfdff;
    --rose: #218fff;
    --muted: #7e88a3;
}
body {
    background:
        radial-gradient(ellipse at 90% 35%, #fff0f8 0, transparent 55%),
        radial-gradient(ellipse at 0% 82%, #edfbff 0, transparent 55%), #fcfdff;
}
@font-face {
    font-family: Onest;
    src: url("/assets/Onest-Regular.ttf");
    font-display: swap;
}
@font-face {
    font-family: Onest;
    src: url("/assets/Onest-SemiBold.ttf");
    font-weight: 600;
    font-display: swap;
}
.app-shell {
    max-width: 520px;
    padding-inline: 16px;
}
header {
    height: 78px;
    gap: 8px;
    padding-inline: 8px;
    align-items: center;
}
.service-name {
    font-size: 23px;
    line-height: 1.15;
    font-weight: 400;
    letter-spacing: -0.5px;
}
.service-name small {
    font-size: 10px;
    margin-top: 5px;
    letter-spacing: 0.3px;
}
#privacy-button {
    font-size: 24px;
    letter-spacing: 2px;
}
.icon-button,
.text-button {
    color: #17284e;
}
.text-button {
    font-size: 13px;
}
.display-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 46px;
    flex-shrink: 0;
    padding: 0 3px 4px;
}
.currency-switch {
    display: flex;
    gap: 2px;
    border-radius: 18px;
    background: #eef3fa99;
    padding: 2px;
}
.currency-switch button {
    font-size: 11px;
    color: #6b7690;
    background: transparent;
    border-radius: 15px;
    min-width: 50px;
    padding: 0 6px;
}
.currency-switch button[aria-pressed="true"] {
    background: #fff;
    color: #112447;
    box-shadow: 0 2px 8px #19295312;
}
#currency-note {
    font-size: 9px;
    color: #77819b;
    text-align: right;
}
#intro .eyebrow,
#intro h1 {
    display: none;
}
#intro > p:not(.eyebrow) {
    font-size: 15px;
    margin: 6px 0 14px;
}
#intro br {
    display: none;
}
.avatar-stage,
.in-progress .avatar-stage {
    width: calc(100% - 2px);
    max-width: none;
    margin: 10px auto 10px;
}
.avatar-stage,
.in-progress .avatar-stage[data-layout="hero"] {
    height: clamp(240px, 42dvh, 390px);
}
.in-progress .avatar-stage[data-layout="medium"] {
    height: clamp(155px, 22dvh, 208px);
}
.avatar-frame {
    inset: 0;
    border: 2px solid #fff;
    border-radius: 32px;
    box-shadow: 0 6px 24px #b9c8e62c;
}
.avatar-portrait img {
    object-position: center 26%;
}
.rose-wave {
    inset: -5px;
    border-radius: 40px;
    padding: 0;
    background: none;
    opacity: 1;
    filter: none;
    -webkit-mask: none;
    mask: none;
    z-index: -1;
}
.rose-glow,
.rose-outline {
    position: absolute;
    inset: 0;
    border-radius: 48px 59px 42px 47px / 47px 52px 47px 55px;
}
.rose-glow {
    background: conic-gradient(from 50deg, #ff8ccc, #ffb6de, #6ce1ff, #76e5ff, #ffc0df, #ff8ccc);
    filter: blur(calc(8px + 6px * var(--speech-level, 0)));
    opacity: calc(0.6 + 0.3 * var(--speech-level, 0));
    transform: scale(calc(1 + 0.018 * var(--speech-level, 0)));
}
.rose-outline {
    background: linear-gradient(125deg, #62daff, #fff 38%, #ff8ed3 58%, #fff 78%, #4bd8ff);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.avatar-status {
    left: 13px;
    bottom: 13px;
    transform: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 7px 11px;
    color: #14244a;
    background: #fffffff0;
    box-shadow: 0 2px 10px #62728c19;
}
.avatar-status::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 17px;
    background: repeating-linear-gradient(90deg, #209bff 0 2px, transparent 2px 4px);
    clip-path: polygon(
        0 35%,
        10% 35%,
        10% 15%,
        22% 15%,
        22% 40%,
        35% 40%,
        35% 0,
        48% 0,
        48% 30%,
        60% 30%,
        60% 10%,
        73% 10%,
        73% 45%,
        86% 45%,
        86% 25%,
        100% 25%,
        100% 75%,
        86% 75%,
        86% 55%,
        73% 55%,
        73% 90%,
        60% 90%,
        60% 70%,
        48% 70%,
        48% 100%,
        35% 100%,
        35% 60%,
        22% 60%,
        22% 85%,
        10% 85%,
        10% 65%,
        0 65%
    );
}
.assistant-speaking .avatar-status {
    color: #bc286f;
}
.speaking-bars {
    position: absolute;
    bottom: 19px;
    right: 17px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.2s;
    filter: drop-shadow(0 0 5px #fff);
}
.assistant-speaking .speaking-bars {
    opacity: 1;
}
.speaking-bars i {
    width: 3px;
    height: calc(5px + 24px * var(--speech-level, 0));
    background: #fff;
    border-radius: 8px;
}
.speaking-bars i:nth-child(2n) {
    height: calc(9px + 30px * var(--speech-level, 0));
}
.speaking-bars i:nth-child(3n) {
    height: calc(12px + 37px * var(--speech-level, 0));
}
.stage-controls {
    z-index: 5;
}
.glass-button {
    color: #26395b;
    background: #ffffffbc;
    font-size: 20px;
    width: 44px;
    box-shadow: 0 2px 10px #1f335915;
}
.primary {
    color: #fff;
    background: linear-gradient(130deg, #55b8ff, #218aff);
    border-radius: 25px;
    box-shadow: 0 5px 22px #68b6f333;
}
#conversation {
    max-width: 100%;
    margin: 7px 0;
    gap: 0;
}
#conversation .primary {
    min-height: 54px;
    font-size: 16px;
}
#conversation .small {
    font-size: 11px;
}
.avatar-caption {
    font-size: 10px;
}
#voice-mode-label {
    font-size: 11px;
}
.in-progress .avatar-stage[data-layout="dock"] {
    width: 74px;
    height: 70px;
    top: -78px;
    margin: 0;
}
body:has(.avatar-stage[data-layout="dock"]) .service-name {
    font-size: 21px;
}
.avatar-stage[data-layout="dock"] .avatar-frame {
    border-radius: 18px;
}
.avatar-stage[data-layout="dock"] .rose-glow,
.avatar-stage[data-layout="dock"] .rose-outline {
    border-radius: 23px;
}
.avatar-stage[data-layout="dock"] .speaking-bars {
    height: 16px;
    right: 7px;
    bottom: 6px;
    gap: 2px;
}
.avatar-stage[data-layout="dock"] .speaking-bars i {
    max-height: 16px;
    width: 2px;
}
.voice-actions {
    height: 42px;
}
.voice-actions button {
    font-size: 12px;
    min-height: 44px;
    padding: 5px 7px;
}
#session-clock {
    font-size: 10px;
}
#voice-status {
    font-size: 11px;
    margin: 0 8px 4px;
}
.chat-log {
    padding: 0 4px 12px;
}
.chat-log > p {
    font-size: 17px;
    line-height: 1.5;
    padding: 15px 18px;
    max-width: 100%;
    margin: 10px 0;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(125deg, #edf4fb, #f3f4faee);
}
.chat-log .chat-user {
    margin-left: 16%;
    background: #eff3fd;
    border-radius: 23px 23px 7px 23px;
    font-size: 16px;
}
.chat-user::before {
    content: "♙";
    float: left;
    margin-right: 10px;
    color: #203969;
    font-size: 20px;
}
.speech-chunk[data-active="true"] {
    background: #bfe7ff;
    color: #10234d;
    box-shadow: 0 0 0 3px #bfe7ff;
    border-radius: 6px;
}
.speech-now {
    font-size: 12px;
    color: #376895;
    max-height: 36px;
}
.composer {
    border: 2px solid #fff;
    padding: 6px;
    border-radius: 40px;
    min-height: 68px;
    gap: 6px;
    background: linear-gradient(115deg, #fbf7fcdd, #f4f8ffdd);
    box-shadow:
        -5px 0 20px #c1f0ff3b,
        5px 0 20px #ffc5e84d,
        0 4px 18px #576f9820;
}
textarea {
    color: #17274c;
    font-size: 16px;
    padding-left: 16px;
}
textarea::placeholder {
    color: #697490;
}
.mic-button {
    width: 52px;
    min-width: 52px;
    height: 52px;
    color: #18325b;
    border: 1px solid #fff;
    background: radial-gradient(ellipse at 20% 15%, #abedff, #eaf1ff 48%, #ffd4e9);
    box-shadow: 0 2px 10px #e3b8d349;
}
.mic-button svg {
    width: 24px;
    height: 24px;
}
.mic-button[data-state="live-listening"] {
    background: radial-gradient(ellipse at 20% 15%, #84e5ff, #c2e7ff 48%, #ffbbdf);
    color: #102e55;
    box-shadow:
        0 0 0 4px #beeefe44,
        0 0 18px #64c5ff55;
}
.mic-button[data-state="live-muted"] {
    background: #edf0f6;
    color: #7a8297;
}
#chat-send {
    width: 48px;
    min-width: 48px;
    height: 48px;
    border-radius: 50%;
}
#live-composer {
    font-size: 13px;
}
#input-meter {
    height: 18px;
    gap: 4px;
}
#input-meter i {
    background: linear-gradient(#56caff, #ffa8d8);
    width: 4px;
}
#chat-status:not(:empty) {
    background: #f2f6fd;
    padding: 8px 12px;
    border-radius: 14px;
    margin: 5px 0;
}
#chat-status:not(:empty)::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #76c9ff;
    margin-right: 8px;
    box-shadow: 0 0 12px #f789cb;
    animation: loader-breathe 1.2s infinite alternate;
}
.chat-shortlist {
    position: relative;
    margin: 17px 0;
}
.chat-shortlist-label {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
    padding-right: 118px;
    min-height: 44px;
    display: flex;
    align-items: center;
    margin: 0 0 8px;
}
.chat-project-list {
    display: block;
}
.carousel-controls {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: flex-end;
    position: absolute;
    top: 0;
    right: 0;
    height: 44px;
}
.carousel-controls button {
    min-width: 36px;
    width: 36px;
    border-radius: 50%;
    min-height: 40px;
    background: #fff;
    color: #152952;
    box-shadow: 0 2px 9px #22375b16;
    font-size: 25px;
    line-height: 1;
}
.carousel-count {
    font-size: 12px;
    margin-right: 7px;
    color: #2c3b5b;
}
.project-slide {
    min-width: 0;
}
.chat-project-card {
    padding: 8px;
    border: 1px solid #fff;
    border-radius: 25px;
    box-shadow: 0 4px 18px #20345610;
}
.speech-project[data-active="true"] {
    box-shadow:
        0 0 0 2px #78dcff,
        0 0 18px #ffc0e080;
}
.card-mosaic {
    height: 256px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.6fr 1fr;
    gap: 5px;
    background: #f0f4fa;
    border-radius: 16px;
}
.card-mosaic img {
    border-radius: 10px;
}
.card-mosaic img:first-child {
    grid-column: span 2;
    grid-row: auto;
}
.card-mosaic.single {
    height: 210px;
}
.card-mosaic.pair {
    height: 210px;
    grid-template-rows: 1fr;
}
.card-mosaic.pair img:first-child {
    grid-column: auto;
}
.card-favorite {
    color: #fff;
    background: #28355193;
    width: 42px;
    min-height: 42px;
    border: 1px solid #ffffff80;
    backdrop-filter: blur(10px);
    top: 10px;
    right: 10px;
}
.card-favorite[aria-pressed="true"] {
    background: #e750969e;
}
.card-index {
    display: none;
}
.card-media.no-photo {
    min-height: 90px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #eef4fa, #f8f0f6);
    border-radius: 16px;
    color: #6c7890;
}
.chat-project-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    padding: 11px 5px 4px;
}
.chat-project-copy h3 {
    font-size: 18px;
    line-height: 1.2;
    margin: 0 0 4px;
    overflow-wrap: anywhere;
}
.chat-project-location {
    font-size: 12px;
    grid-column: 1;
}
.chat-project-price {
    font-size: 18px;
    margin: 0;
    text-align: right;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    white-space: nowrap;
}
.chat-project-price .price-prefix {
    font-size: 11px;
}
.chat-project-price .price-currency {
    display: block;
    font-size: 9px;
    color: var(--muted);
}
.chat-project-attributes {
    font-size: 11px;
    grid-column: 1 / span 2;
    margin-top: 5px;
}
.chat-project-features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px;
    font-size: 10px;
    color: #6d7a96;
}
.chat-project-features > span {
    padding: 3px 5px;
    border-radius: 8px;
    background: #f1f5fa;
}
.chat-project-features > span:first-child {
    display: none;
}
.chat-project-actions {
    padding: 0;
}
.chat-project-actions button {
    font-size: 12px;
    color: #277fcc;
    min-height: 38px;
}
.chat-project-source {
    font-size: 11px;
    margin: 0 5px 2px;
}
.chat-project-source summary {
    min-height: 36px;
}
.save-shortlist {
    background: #ffffffd9;
    border: 1px solid #e3eaf4;
    color: #315379;
    box-shadow: none;
    min-height: 44px;
    font-size: 12px;
    margin-top: 10px;
    padding: 8px 12px;
}
#saved-projects .chat-project-list {
    position: relative;
    padding-top: 46px;
}
.sheet {
    background: linear-gradient(130deg, #fff, #f8faff, #fff8fc);
    color: #17264b;
}
.avatar-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(130deg, #f2faff61, #fff5fc66);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.avatar-loading p {
    position: absolute;
    bottom: 13px;
    margin: 0;
    max-width: calc(100% - 28px);
    font-size: 11px;
    color: #304267;
    background: #fffffff0;
    border-radius: 18px;
    padding: 8px 12px;
    box-shadow: 0 4px 15px #61799720;
}
.avatar-stage[data-loading="true"] .avatar-status {
    visibility: hidden;
}
@keyframes loader-breathe {
    to {
        transform: scale(1.12);
        opacity: 0.75;
    }
}
@media (max-height: 700px) {
    header {
        height: 62px;
    }
    .service-name {
        font-size: 20px;
    }
    #intro {
        display: none;
    }
    .avatar-stage,
    .in-progress .avatar-stage[data-layout="hero"] {
        height: 185px;
    }
    .in-progress .avatar-stage[data-layout="medium"] {
        height: 132px;
    }
    .in-progress .avatar-stage[data-layout="dock"] {
        top: -60px;
        height: 60px;
        width: 64px;
    }
    .voice-actions {
        height: 36px;
    }
    #voice-status {
        font-size: 10px;
    }
    .chat-log > p {
        font-size: 16px;
        padding: 12px 15px;
    }
    .card-mosaic.single {
        height: 160px;
    }
    #conversation .primary {
        min-height: 48px;
    }
    .avatar-caption,
    #voice-mode-label {
        margin: 0;
    }
}
@media (max-width: 360px) {
    .app-shell {
        padding-inline: 12px;
    }
    .service-name {
        font-size: 20px;
    }
    .chat-shortlist-label {
        font-size: 17px;
    }
    .chat-project-copy h3,
    .chat-project-price {
        font-size: 16px;
    }
    body:has(.avatar-stage[data-layout="dock"]) .service-name {
        font-size: 18px;
    }
}
@media (orientation: landscape) and (max-height: 550px) {
    header {
        height: 42px;
    }
    .service-name {
        font-size: 16px;
    }
    .service-name br {
        display: none;
    }
    .service-name small {
        display: inline;
        margin-left: 8px;
    }
    header {
        padding-right: 170px;
    }
    .avatar-stage,
    .in-progress .avatar-stage[data-layout="hero"],
    .in-progress .avatar-stage[data-layout="medium"] {
        width: 170px;
        height: 90px;
        margin: 4px auto;
    }
    .in-progress .avatar-stage[data-layout="dock"] {
        top: 0;
        right: 0;
        height: 55px;
        width: 65px;
    }
    .avatar-status {
        font-size: 9px;
        left: 6px;
        bottom: 6px;
        padding: 5px;
    }
    .voice-actions {
        height: 36px;
    }
    #voice-status {
        display: none;
    }
    .avatar-caption {
        display: none;
    }
    #conversation {
        flex-direction: row;
        gap: 12px;
    }
    .avatar-loading p {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .rose-wave {
        padding: 0 !important;
        opacity: 1 !important;
    }
}
.avatar-portrait img {
    transform: scale(1.13);
    transform-origin: 50% 30%;
}
.rose-outline {
    padding: calc(3px + 2px * var(--speech-level, 0));
}
/* Keep the reserved dock clear of both header buttons at every width. */
body:has(.avatar-stage[data-layout="dock"]) .service-name {
    max-width: none;
    padding-right: 80px;
}
.in-progress .avatar-stage[data-layout="dock"] {
    right: 60px;
}
body:has(#saved-open:not([hidden])) .avatar-stage[data-layout="dock"] {
    right: 108px;
}
@media (max-width: 360px) {
    body:has(.avatar-stage[data-layout="dock"]) .service-name {
        max-width: none;
        padding-right: 68px;
    }
    body:has(#saved-open:not([hidden])) .avatar-stage[data-layout="dock"] {
        right: 103px;
    }
}
#saved-projects {
    position: relative;
    padding-top: 48px;
}
.sheet .close {
    position: relative;
    z-index: 3;
}

/* A3 recorded welcome → quiet loop → first decoded live frame. */
#avatar-cover,
#avatar-idle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 26%;
    transform: scale(1.13);
    transform-origin: 50% 30%;
    opacity: 0;
    transition:
        opacity 550ms ease,
        filter 550ms ease;
    pointer-events: none;
}
.avatar-stage[data-welcome-ready="true"] #avatar-cover {
    opacity: 1;
}
.avatar-stage[data-cover="idle"] #avatar-idle {
    opacity: 1;
}
#avatar-video {
    transition:
        opacity 550ms ease,
        filter 700ms ease;
    filter: blur(5px);
}
.video-connected #avatar-video {
    filter: blur(0);
}
.avatar-stage[data-cover="live"] #avatar-cover,
.avatar-stage[data-cover="live"] #avatar-idle {
    opacity: 0;
    filter: blur(6px);
}
.cover-sound {
    position: absolute;
    right: 12px;
    bottom: 54px;
    z-index: 3;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #fff9;
    border-radius: 22px;
    color: #25344f;
    background: #ffffffe0;
    backdrop-filter: blur(12px);
    font-size: 11px;
}
.avatar-stage[data-layout="dock"] .cover-sound {
    display: none;
}
.stage-controls {
    z-index: 4;
}
.avatar-loading {
    background: #f4f5f61f;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition:
        opacity 450ms ease,
        visibility 450ms ease;
}
.avatar-loading[hidden] {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.connecting-ripple {
    position: relative;
    width: 62px;
    height: 62px;
}
.connecting-ripple i {
    position: absolute;
    inset: 8px;
    border: 1px solid #fff9;
    border-radius: 50%;
    background: #a4a9b314;
    box-shadow: 0 0 12px #6b748218;
    animation: quiet-ripple 3.6s ease-out infinite;
}
.connecting-ripple i:nth-child(2) {
    animation-delay: -1.2s;
}
.connecting-ripple i:nth-child(3) {
    animation-delay: -2.4s;
}
@keyframes quiet-ripple {
    0% {
        transform: scale(0.55);
        opacity: 0;
    }
    35% {
        opacity: 0.75;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}
.rose-outline,
.rose-glow {
    background: linear-gradient(
        115deg,
        #7de5ff 0%,
        #e9faff 20%,
        #ffa4d9 38%,
        #fff4fb 54%,
        #75deff 72%,
        #a7eaff 85%,
        #ffb3df 100%
    );
    background-size: 280% 280%;
    animation: rose-drift 18s ease-in-out infinite alternate;
}
.rose-glow {
    animation-duration: 22s;
    animation-direction: alternate-reverse;
}
@keyframes rose-drift {
    from {
        background-position: 0% 25%;
        border-radius: 48px 59px 42px 47px / 47px 52px 47px 55px;
    }
    to {
        background-position: 100% 80%;
        border-radius: 57px 45px 51px 43px / 54px 43px 55px 46px;
    }
}
.avatar-stage[data-layout="dock"] .rose-glow,
.avatar-stage[data-layout="dock"] .rose-outline {
    animation-name: rose-drift-dock;
}
@keyframes rose-drift-dock {
    from {
        background-position: 0% 25%;
    }
    to {
        background-position: 100% 80%;
    }
}
@media (prefers-reduced-motion: reduce) {
    .rose-outline,
    .rose-glow,
    .connecting-ripple i {
        animation: none;
    }
    #avatar-cover,
    #avatar-idle,
    #avatar-video,
    .avatar-loading {
        transition: none;
    }
}

/* Entry presents the catalogue promise; currency belongs to the actual shortlist. */
#intro.catalogue-banner {
    text-align: left;
    padding: 10px 12px 12px;
    margin: 2px 0 10px;
    border: 1px solid #ffffffdf;
    border-radius: 24px;
    background: linear-gradient(115deg, #edf9ffed, #ffffffc9 55%, #fff0f8be);
    box-shadow: 0 5px 22px #80acd80a;
}
#intro.catalogue-banner .eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 7px;
    font-size: 9px;
    letter-spacing: 1.25px;
    color: #46748d;
}
.catalogue-banner .eyebrow span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #58a9c7;
    box-shadow: 0 0 0 4px #c9edf459;
}
#intro.catalogue-banner h1 {
    display: block;
    font-size: clamp(27px, 3.6dvh, 34px);
    line-height: 1.06;
    letter-spacing: -1.1px;
    margin: 0 0 8px;
}
#intro.catalogue-banner h1 br {
    display: initial;
}
.catalogue-banner h1 em {
    font-style: normal;
    color: #297eaf;
}
#intro.catalogue-banner > p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    max-width: 270px;
    color: #64758c;
}
.chat-shortlist .display-toolbar {
    position: static;
    min-height: 46px;
    padding: 0;
    margin: 0 0 10px;
    width: 100%;
}
@media (max-height: 700px) {
    #intro.catalogue-banner {
        display: block;
        padding: 9px 12px;
        margin: 0 0 6px;
    }
    #intro.catalogue-banner h1 {
        font-size: 23px;
        margin-bottom: 0;
    }
    #intro.catalogue-banner h1 br {
        display: none;
    }
    #intro.catalogue-banner > p:not(.eyebrow) {
        display: none;
    }
}
@media (orientation: landscape) and (max-height: 550px) {
    #intro.catalogue-banner {
        padding: 5px 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }
    #intro.catalogue-banner h1 {
        font-size: 19px;
    }
    #intro.catalogue-banner .eyebrow {
        margin: 0;
        font-size: 8px;
    }
}
.in-progress #intro.catalogue-banner {
    display: none;
}

/* A short compositor-only transition keeps card changes legible without
   animating scroll position or fighting a visitor browsing earlier messages. */
@media (prefers-reduced-motion: no-preference) {
    .project-slide:not([hidden]) {
        animation: property-appear 180ms ease-out;
    }
    @keyframes property-appear {
        from {
            opacity: 0;
            transform: translateY(5px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Local G2 panel uses native dialog focus trapping; it never overlays card value first. */
.g2-dialog { max-width: min(540px,calc(100vw - 32px)); max-height: 85dvh; overflow: auto; padding: 24px; border: 1px solid #ddd; border-radius: 20px; }
.g2-dialog form,.g2-dialog label { display: block; margin: 16px 0; }
.g2-dialog input[type=tel],.g2-dialog input[name=code] { display: block; width: 100%; padding: 12px; border: 1px solid #bbb; border-radius: 8px; }
.g2-dialog button { margin: 6px 8px 6px 0; padding: 10px 14px; }
.g2-dialog::backdrop { background: #17232c66; }
.chat-shortlist > button { margin-right: 8px; margin-top: 8px; }

/* The shared layout controller animates dimensions and the reserved chat space. */
.avatar-stage { transition: none !important; }
.avatar-layout-space { flex: none; width: 1px; pointer-events: none; overflow-anchor: none; }
.in-progress .avatar-stage[data-layout="dock"] { width: 112px; height: 106px; top: -72px; right: 60px; }
body:has(.avatar-stage[data-layout="dock"]) .service-name { font-size: 18px; max-width: calc(100% - 180px); padding-right: 0; }
#new-search { width: auto; padding: 6px 10px; font-size: 11px; white-space: nowrap; }
@media (max-height: 700px) { .in-progress .avatar-stage[data-layout="dock"] { width: 96px; height: 90px; top: -62px; } }
@media (orientation: landscape) and (max-height: 550px) { .in-progress .avatar-stage[data-layout="dock"] { width: 90px; height: 76px; top: 0; } }

/* Follow Safari's visual viewport, including its keyboard pan offset. */
html { height: 100%; overflow: hidden; }
body { height: 100dvh; overscroll-behavior: none; }
.app-shell { position: fixed; inset: var(--app-top, 0px) 0 auto; height: var(--app-height); overflow: hidden; padding-top: max(4px, env(safe-area-inset-top)); }
header { height: 42px; min-height: 42px; gap: 4px; }
.service-name, body:has(.avatar-stage[data-layout="dock"]) .service-name { font-size: 16px; max-width: none; padding: 0; line-height: 1.2; }
.service-name br { display: none; }
.service-name small { display: inline; margin-left: 8px; font-size: 10px; }
.in-progress .avatar-stage[data-layout="dock"] { top: 0; right: 8px; }
.avatar-stage, .in-progress .avatar-stage[data-layout="hero"] { height: clamp(190px, calc(var(--app-height) * .48), 440px); margin-top: 4px; }
body[data-keyboard="true"] .avatar-stage:not([data-layout="dock"]), body[data-keyboard="true"] .in-progress .avatar-stage:not([data-layout="dock"]) { height: clamp(64px, calc(var(--app-height) * .18), 108px); margin-block: 3px; }
body[data-keyboard="true"] #intro, body[data-keyboard="true"] .avatar-caption, body[data-keyboard="true"] #voice-mode-label, body[data-keyboard="true"] #voice-status { display: none; }
body[data-keyboard="true"] header { height: 32px; min-height: 32px; }
body[data-keyboard="true"] .avatar-status { display: none; }
body[data-keyboard="true"] .voice-actions { height: 32px; min-height: 32px; }
body[data-keyboard="true"] .app-shell { padding-bottom: 6px; }
#chat-panel, .chat-log { min-height: 0; }
#chat-form { flex-shrink: 0; }
#avatar-expand::after { content: 'Expand ↗'; position: absolute; bottom: 5px; left: 5px; right: 5px; border-radius: 12px; padding: 4px; font-size: 10px; color: #203149; background: #ffffffe0; }
/* Reserve the dock's small height so the larger portrait cannot cover replies. */
.in-progress .avatar-stage[data-layout="dock"] { position: relative; top: auto; right: auto; margin: 0 8px 4px auto; }

/* Explicit microphone controls follow actual capture/playback state. */
body[data-input-mode="live"] .composer { border-radius: 26px; padding: 10px; gap: 8px; min-height: 110px; }
body[data-input-mode="live"] .mic-button { width: 76px; min-width: 76px; height: 82px; border-radius: 24px; align-content: center; gap: 7px; }
body[data-input-mode="live"] .mic-button svg { width: 32px; height: 32px; }
#mic-action-label { font-size: 12px; font-weight: 600; line-height: 14px; }
body:not([data-input-mode="live"]) #mic-action-label { display: none; }
#mic-status { display: block; color: #152952; font-size: 16px; font-weight: 600; line-height: 1.25; }
#mic-hint { display: block; font-size: 11px; line-height: 1.3; color: #52627d; }
#input-meter { height: 38px; gap: 6px; margin: 3px 0; }
#input-meter i { width: 7px; transition: height 70ms linear; background: #1988c4; }
#input-meter[data-active="false"] { opacity: .28; }
.mic-button[data-state="listening"] { background: #b4eddd; color: #084d40; box-shadow: 0 0 0 4px #b4eddd50; }
.mic-button[data-state="thinking"], .mic-button[data-state="connecting"] { background: #fff0c4; color: #795000; }
.mic-button[data-state="speaking"] { background: #e4d8ff; color: #462773; }
.mic-button[data-state="muted"], .mic-button[data-state="unavailable"] { background: #fbe1de; color: #953730; }
#voice-transcript { flex: 0 0 auto; margin: 4px 4px 6px; padding: 9px 12px; border-radius: 16px; background: #eaf6ff; }
#voice-transcript-label { font-size: 11px; color: #516786; }
#voice-transcript-text { margin: 4px 0; font-size: 15px; line-height: 1.35; max-height: 62px; overflow: auto; overflow-wrap: anywhere; }
#voice-edit { min-height: 28px; padding: 2px 0; font-size: 12px; }
#voice-input-help { flex: 0 0 auto; padding: 10px 12px; border-radius: 16px; background: #fff0d7; }
#voice-input-help p { font-size: 13px; margin: 0 0 8px; }
#voice-input-help button { min-height: 42px; width: 100%; }
/* Navigation belongs to its card, below its contents, inside the same scroll flow. */
.chat-shortlist-label { padding-right: 0; }
.carousel-controls { position: static; min-height: 52px; height: auto; justify-content: center; gap: 16px; margin: 10px 0 2px; }
.carousel-controls button { min-width: 52px; width: 52px; min-height: 48px; }
.carousel-count { order: 1; margin: 0; font-size: 14px; min-width: 48px; text-align: center; }
.carousel-controls button:last-child { order: 2; }
@media (max-height: 550px) { body[data-input-mode="live"] .composer { min-height: 88px; } #voice-transcript-text { max-height: 42px; } #input-meter { height: 24px; } }
