:root {
    color-scheme: dark;
    --bg: #0D0A16;
    --bg-deep: #050409;
    --panel: rgba(26, 19, 48, 0.62);
    --panel-strong: rgba(26, 19, 48, 0.88);
    --line: rgba(224, 179, 255, 0.16);
    --text: #fbf9ff;
    --muted: #b9a8d2;
    --soft: #e0d3f3;
    --violet: #7B61FF;
    --magenta: #B06CFF;
    --mist: #E0B3FF;
    --indigo: #1A1330;
    --black: #0D0A16;
    --accent: #B06CFF;
    --shadow: 0 32px 90px rgba(0, 0, 0, 0.58);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    min-width: 320px;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 0%, rgba(123, 97, 255, 0.32), transparent 25rem),
        radial-gradient(circle at 84% 18%, rgba(176, 108, 255, 0.26), transparent 24rem),
        linear-gradient(145deg, var(--bg-deep) 0%, var(--black) 48%, #08060d 100%);
    color: var(--text);
    font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overscroll-behavior: none;
    touch-action: manipulation;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: 0.68;
}

svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-shell {
    position: relative;
    width: min(100vw, 430px);
    height: 100dvh;
    margin: 0 auto;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(224, 179, 255, 0.075), transparent 24%),
        radial-gradient(circle at 50% 41%, rgba(123, 97, 255, 0.22), transparent 20rem),
        var(--black);
    isolation: isolate;
}

.app-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(rgba(224, 179, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(224, 179, 255, 0.035) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 78%, transparent);
}

.app-shell::after {
    content: "";
    position: absolute;
    inset: -18% -22% auto;
    z-index: -1;
    height: 58%;
    background:
        conic-gradient(from 205deg at 50% 50%, transparent, rgba(123, 97, 255, 0.16), transparent, rgba(224, 179, 255, 0.13), transparent);
    filter: blur(28px);
    opacity: 0.8;
    animation: slowSpin 18s linear infinite;
}

.phone-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
}

.topbar {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
}

.topbar-title {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.topbar-title span,
.sidebar-brand span {
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 0.9rem;
    font-weight: 850;
}

.topbar-title small,
.sidebar-brand small,
.account-dock small {
    color: var(--muted);
    font-size: 0.68rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-select {
    width: 56px;
    height: 42px;
    border: 1px solid rgba(224, 179, 255, 0.18);
    border-radius: 999px;
    outline: 0;
    background: rgba(26, 19, 48, 0.82);
    color: var(--mist);
    text-align: center;
    font-size: 0.73rem;
    font-weight: 850;
}

.icon-button {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(224, 179, 255, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(224, 179, 255, 0.12), rgba(123, 97, 255, 0.05)),
        rgba(26, 19, 48, 0.72);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
}

.profile-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.profile-button span,
.account-mark,
.account-hero span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 20%, #fff, transparent 22%),
        linear-gradient(135deg, var(--mist), var(--magenta) 48%, var(--violet));
    color: var(--black);
    font-weight: 950;
    box-shadow: 0 0 22px rgba(176, 108, 255, 0.48);
}

.view {
    position: relative;
    display: none;
    flex: 1;
    min-height: 0;
    padding-top: 12px;
}

.view.is-visible {
    display: flex;
    flex-direction: column;
}

.view-chat {
    justify-content: space-between;
}

.logo-watermark {
    position: absolute;
    inset: 14% 8% auto;
    display: grid;
    height: 32%;
    place-items: center;
    opacity: 0.14;
    pointer-events: none;
    filter: saturate(1.3) drop-shadow(0 0 34px rgba(176, 108, 255, 0.36));
}

.logo-watermark img {
    max-width: 78%;
    max-height: 100%;
    object-fit: contain;
}

.logo-watermark.is-missing::before {
    content: "ECHOES";
    color: rgba(224, 179, 255, 0.22);
    font-size: clamp(2.45rem, 16vw, 4.5rem);
    font-weight: 900;
}

.is-hidden {
    display: none !important;
}

.character-strip {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    margin-top: 5px;
    padding: 8px;
    border: 1px solid rgba(224, 179, 255, 0.16);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(224, 179, 255, 0.09), rgba(123, 97, 255, 0.055)),
        rgba(13, 10, 22, 0.74);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(22px);
}

.character-strip label {
    padding-left: 6px;
    color: var(--mist);
    font-size: 0.66rem;
    font-weight: 850;
    text-transform: uppercase;
}

.character-strip select,
.field input {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(224, 179, 255, 0.14);
    border-radius: 999px;
    outline: 0;
    background: rgba(26, 19, 48, 0.74);
    color: var(--text);
}

.character-strip select {
    height: 38px;
    padding: 0 14px;
}

.avatar-stage {
    position: relative;
    display: grid;
    flex: 1;
    min-height: 372px;
    place-items: center;
    overflow: hidden;
    perspective: 1100px;
    transform-style: preserve-3d;
}

#auraCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.94;
}

.space-halo,
.orbital-line {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.space-halo {
    width: min(88vw, 365px);
    aspect-ratio: 1;
    border: 1px solid rgba(224, 179, 255, 0.18);
    box-shadow:
        inset 0 0 38px rgba(123, 97, 255, 0.16),
        0 0 46px rgba(176, 108, 255, 0.12);
    animation: breathe 4.6s ease-in-out infinite;
}

.halo-two {
    width: min(62vw, 266px);
    border-color: rgba(123, 97, 255, 0.24);
    animation-delay: -1.4s;
}

.orbital-line {
    width: min(70vw, 300px);
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-top-color: rgba(224, 179, 255, 0.65);
    border-left-color: rgba(123, 97, 255, 0.28);
    transform: rotateX(68deg) rotateZ(0deg);
    animation: orbitSpin 7s linear infinite;
}

.orbit-two {
    width: min(54vw, 235px);
    border-top-color: rgba(176, 108, 255, 0.65);
    animation-duration: 5.2s;
    animation-direction: reverse;
}

.avatar-face {
    --tilt-x: -7deg;
    --tilt-y: 12deg;
    --gaze-x: 0px;
    --gaze-y: 0px;
    position: relative;
    width: min(64vw, 268px);
    aspect-ratio: 0.78;
    transform-style: preserve-3d;
    transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-2px);
    animation: livingHead 7.5s ease-in-out infinite;
    filter: drop-shadow(0 34px 45px rgba(0, 0, 0, 0.58));
}

.app-shell.is-listening .avatar-face,
.app-shell.is-speaking .avatar-face {
    animation-duration: 2.55s;
}

.face-shadow {
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: -8%;
    height: 24%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.48);
    filter: blur(18px);
    transform: translateZ(-70px) rotateX(78deg);
}

.face-cranium {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 1px solid rgba(224, 179, 255, 0.24);
    border-radius: 49% 49% 44% 44% / 36% 36% 54% 54%;
    background:
        radial-gradient(circle at 36% 22%, rgba(255, 255, 255, 0.34), transparent 12%),
        radial-gradient(circle at 42% 44%, rgba(176, 108, 255, 0.35), transparent 28%),
        radial-gradient(circle at 72% 63%, rgba(123, 97, 255, 0.28), transparent 24%),
        linear-gradient(145deg, rgba(224, 179, 255, 0.24), rgba(26, 19, 48, 0.8) 42%, rgba(8, 6, 13, 0.92));
    box-shadow:
        inset 22px 12px 34px rgba(255, 255, 255, 0.11),
        inset -34px -22px 52px rgba(0, 0, 0, 0.52),
        inset 0 0 80px rgba(176, 108, 255, 0.2),
        0 0 80px rgba(176, 108, 255, 0.22);
    transform: translateZ(34px);
}

.face-cranium::before,
.face-cranium::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.face-cranium::before {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 18%, transparent 75%, rgba(0, 0, 0, 0.4)),
        radial-gradient(ellipse at 50% 105%, transparent 42%, rgba(224, 179, 255, 0.13) 43%, transparent 62%);
    mix-blend-mode: screen;
}

.face-cranium::after {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: conic-gradient(from 132deg, transparent, rgba(224, 179, 255, 0.15), transparent, rgba(123, 97, 255, 0.13), transparent);
    animation: faceLight 7s linear infinite;
    mix-blend-mode: overlay;
}

.face-skin {
    position: absolute;
    inset: 4% 7% 6%;
    border-radius: inherit;
    background:
        linear-gradient(rgba(224, 179, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(224, 179, 255, 0.055) 1px, transparent 1px);
    background-size: 19px 17px;
    opacity: 0.38;
    mask-image: radial-gradient(ellipse, #000 35%, transparent 76%);
    animation: gridDrift 5.4s ease-in-out infinite;
}

.photo-face {
    position: absolute;
    inset: 7% 10% 8%;
    z-index: 0;
    border-radius: 48% 48% 44% 44% / 36% 36% 54% 54%;
    background-position: center top;
    background-size: cover;
    opacity: 0;
    mix-blend-mode: screen;
    filter: grayscale(0.2) contrast(1.16) saturate(0.8);
    transform: translateZ(12px) scale(1.04);
    transition: opacity 0.28s ease;
}

.has-photo-face .photo-face {
    opacity: 0.46;
}

.has-photo-face .face-cranium {
    background:
        radial-gradient(circle at 36% 22%, rgba(255, 255, 255, 0.28), transparent 12%),
        radial-gradient(circle at 42% 44%, rgba(176, 108, 255, 0.3), transparent 28%),
        radial-gradient(circle at 72% 63%, rgba(123, 97, 255, 0.24), transparent 24%),
        linear-gradient(145deg, rgba(224, 179, 255, 0.16), rgba(26, 19, 48, 0.76) 42%, rgba(8, 6, 13, 0.92));
}

.temple {
    position: absolute;
    top: 36%;
    width: 42px;
    height: 112px;
    border: 1px solid rgba(224, 179, 255, 0.12);
    border-radius: 50%;
    background: rgba(13, 10, 22, 0.14);
    filter: blur(0.2px);
}

.temple-left {
    left: -2px;
    transform: rotate(-9deg);
}

.temple-right {
    right: -2px;
    transform: rotate(9deg);
}

.face-scan {
    position: absolute;
    left: 12%;
    right: 12%;
    top: 20%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--mist), transparent);
    box-shadow: 0 0 18px var(--mist);
    animation: scanLine 3.8s ease-in-out infinite;
}

.hairline {
    position: absolute;
    left: 24%;
    right: 24%;
    top: 12%;
    height: 28%;
    border-top: 7px solid rgba(224, 179, 255, 0.26);
    border-radius: 50%;
    transform: rotate(-5deg);
}

.eye {
    position: absolute;
    top: 42%;
    width: 48px;
    height: 18px;
    border-radius: 999px;
    background: rgba(5, 4, 9, 0.84);
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.85),
        0 0 22px rgba(176, 108, 255, 0.48);
    transform: translateZ(58px);
}

.eye span {
    position: absolute;
    top: 4px;
    left: 12px;
    width: 24px;
    height: 9px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--mist), var(--magenta), var(--violet));
    box-shadow: 0 0 18px var(--magenta), 0 0 28px rgba(123, 97, 255, 0.52);
    transform: translate(var(--gaze-x), var(--gaze-y));
    animation: blink 4.6s ease-in-out infinite;
}

.eye-left {
    left: 23%;
}

.eye-right {
    right: 23%;
}

.brow {
    position: absolute;
    top: 35%;
    width: 56px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(224, 179, 255, 0.46), transparent);
}

.brow-left {
    left: 20%;
    transform: rotate(-9deg);
}

.brow-right {
    right: 20%;
    transform: rotate(9deg);
}

.nose {
    position: absolute;
    top: 47%;
    left: 50%;
    width: 24px;
    height: 58px;
    border-radius: 50%;
    border-right: 2px solid rgba(224, 179, 255, 0.34);
    border-bottom: 1px solid rgba(224, 179, 255, 0.18);
    transform: translateX(-50%) rotate(8deg);
    filter: drop-shadow(0 0 12px rgba(176, 108, 255, 0.28));
}

.mouth {
    position: absolute;
    bottom: 25%;
    left: 50%;
    width: 68px;
    height: 22px;
    overflow: hidden;
    border-radius: 0 0 999px 999px;
    transform: translateX(-50%) translateZ(62px);
}

.mouth span,
.mouth i {
    position: absolute;
    left: 0;
    right: 0;
    display: block;
    border-radius: 999px;
}

.mouth span {
    top: 10px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--mist), var(--magenta), transparent);
    box-shadow: 0 0 18px var(--magenta);
}

.mouth i {
    left: 18%;
    right: 18%;
    top: 7px;
    height: 0;
    background: rgba(5, 4, 9, 0.86);
    box-shadow: inset 0 0 12px rgba(176, 108, 255, 0.4);
}

.app-shell.is-listening .mouth span,
.app-shell.is-speaking .mouth span {
    animation: talkLine 0.34s ease-in-out infinite alternate;
}

.app-shell.is-listening .mouth i,
.app-shell.is-speaking .mouth i {
    animation: talkOpen 0.34s ease-in-out infinite alternate;
}

.jaw {
    position: absolute;
    left: 30%;
    right: 30%;
    bottom: 12%;
    height: 20px;
    border-bottom: 1px solid rgba(224, 179, 255, 0.22);
    border-radius: 50%;
}

.cheek {
    position: absolute;
    top: 54%;
    width: 42px;
    height: 13px;
    border-radius: 999px;
    background: rgba(176, 108, 255, 0.38);
    filter: blur(8px);
}

.cheek-left {
    left: 17%;
}

.cheek-right {
    right: 17%;
}

.voice-panel {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 82px 1fr;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(224, 179, 255, 0.18);
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(224, 179, 255, 0.13), rgba(123, 97, 255, 0.055)),
        rgba(13, 10, 22, 0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(26px);
}

.voice-status {
    min-width: 0;
}

.voice-status small {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.69rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-status strong {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    font-size: 0.88rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mic-button {
    display: grid;
    width: 82px;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(224, 179, 255, 0.34);
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 23%, rgba(255, 255, 255, 0.88), transparent 17%),
        linear-gradient(145deg, var(--mist), var(--magenta) 49%, var(--violet));
    color: var(--black);
    box-shadow:
        0 0 0 9px rgba(176, 108, 255, 0.14),
        0 18px 42px rgba(176, 108, 255, 0.34);
}

.mic-button svg {
    width: 1.75rem;
    height: 1.75rem;
    stroke-width: 2.2;
}

.app-shell.is-listening .mic-button {
    animation: micPulse 0.9s ease-in-out infinite;
}

.waveform {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    height: 34px;
}

.waveform span {
    width: 5px;
    height: 8px;
    border-radius: 999px;
    background: var(--mist);
    opacity: 0.48;
}

.app-shell.is-listening .waveform span,
.app-shell.is-speaking .waveform span {
    background: var(--magenta);
    animation: barDance 0.72s ease-in-out infinite;
}

.waveform span:nth-child(2) { animation-delay: -0.2s; }
.waveform span:nth-child(3) { animation-delay: -0.38s; }
.waveform span:nth-child(4) { animation-delay: -0.12s; }
.waveform span:nth-child(5) { animation-delay: -0.48s; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: min(84vw, 336px);
    flex-direction: column;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    border-right: 1px solid rgba(224, 179, 255, 0.18);
    border-radius: 0 34px 34px 0;
    background:
        linear-gradient(180deg, rgba(224, 179, 255, 0.11), rgba(123, 97, 255, 0.04)),
        rgba(13, 10, 22, 0.95);
    box-shadow: 34px 0 90px rgba(0, 0, 0, 0.58);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    backdrop-filter: blur(28px);
}

.sidebar-glow {
    position: absolute;
    inset: 4% auto auto 18%;
    width: 130px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(176, 108, 255, 0.22);
    filter: blur(48px);
    pointer-events: none;
}

.app-shell.sidebar-open .sidebar {
    transform: translateX(0);
}

.sidebar-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.sidebar-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.sidebar-menu {
    position: relative;
    display: grid;
    gap: 10px;
    margin-top: 34px;
}

.menu-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 20px;
    background: transparent;
    color: var(--soft);
    text-align: left;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 850;
    text-decoration: none;
}

.menu-link {
    box-sizing: border-box;
}

.menu-item.is-active,
.menu-item:active {
    border-color: rgba(224, 179, 255, 0.26);
    background: rgba(176, 108, 255, 0.14);
    color: var(--text);
    box-shadow: inset 0 0 22px rgba(176, 108, 255, 0.08);
}

.account-dock {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 11px;
    margin-top: auto;
    padding: 13px;
    border: 1px solid rgba(224, 179, 255, 0.16);
    border-radius: 24px;
    background: rgba(224, 179, 255, 0.07);
    color: var(--text);
    text-align: left;
}

.account-dock strong {
    display: block;
    font-size: 0.88rem;
}

.scrim {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(5, 4, 9, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.app-shell.sidebar-open .scrim,
.app-shell.account-open .scrim {
    opacity: 1;
    pointer-events: auto;
}

.section-head {
    margin: 8px 0 16px;
}

.back-to-chat {
    width: 100%;
    margin: -4px 0 12px;
}

.section-head span {
    color: var(--mist);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.section-head h1 {
    margin: 5px 0 0;
    font-size: clamp(1.82rem, 10vw, 2.75rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.character-form,
.plan-card,
.timeline article {
    border: 1px solid rgba(224, 179, 255, 0.16);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(24px);
}

.character-form {
    display: grid;
    gap: 13px;
    padding: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

.field span {
    color: var(--soft);
    font-size: 0.77rem;
    font-weight: 800;
}

.field input {
    height: 48px;
    padding: 0 14px;
}

.upload-box {
    position: relative;
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 132px;
    padding: 16px;
    border: 1px dashed rgba(224, 179, 255, 0.28);
    border-radius: var(--radius-lg);
    background: rgba(224, 179, 255, 0.06);
    text-align: center;
}

.upload-box input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.upload-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    background: rgba(176, 108, 255, 0.18);
    color: var(--mist);
    box-shadow: 0 0 28px rgba(176, 108, 255, 0.22);
}

.upload-box strong {
    font-size: 0.94rem;
}

.upload-box small,
.timeline small,
.plan-card small,
.character-card small {
    color: var(--muted);
    font-size: 0.74rem;
}

.primary-button,
.soft-button {
    min-height: 40px;
    border-radius: 999px;
    font-weight: 900;
}

.primary-button {
    background: linear-gradient(135deg, var(--mist), var(--magenta) 50%, var(--violet));
    color: var(--black);
    box-shadow: 0 12px 28px rgba(176, 108, 255, 0.26);
}

.soft-button {
    padding: 0 14px;
    border: 1px solid rgba(224, 179, 255, 0.14);
    background: rgba(224, 179, 255, 0.075);
    color: var(--text);
}

.full-width {
    width: 100%;
}

.character-list {
    display: grid;
    gap: 10px;
    min-height: 0;
    margin-top: 14px;
    overflow: auto;
    padding-bottom: 10px;
}

.character-card {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(224, 179, 255, 0.14);
    border-radius: 22px;
    background: rgba(224, 179, 255, 0.055);
}

.character-orb {
    width: 44px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, var(--magenta)), rgba(255, 255, 255, 0.72));
    box-shadow: 0 0 28px color-mix(in srgb, var(--accent, var(--magenta)) 42%, transparent);
}

.character-thumb {
    width: 44px;
    aspect-ratio: 1;
    border: 1px solid rgba(224, 179, 255, 0.2);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 28px color-mix(in srgb, var(--accent, var(--magenta)) 42%, transparent);
}

.character-card strong {
    display: block;
}

.timeline {
    display: grid;
    gap: 12px;
    overflow: auto;
    padding-bottom: 20px;
}

.timeline article,
.plan-card {
    padding: 16px;
}

.timeline strong,
.plan-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.04rem;
}

.timeline p,
.plan-card p {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.plan-card {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.plan-card.is-featured {
    border-color: rgba(224, 179, 255, 0.28);
    background:
        linear-gradient(135deg, rgba(176, 108, 255, 0.18), rgba(123, 97, 255, 0.09)),
        var(--panel-strong);
}

.account-modal {
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 60;
    width: min(calc(100vw - 32px), 398px);
    padding: 16px;
    border: 1px solid rgba(224, 179, 255, 0.2);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(224, 179, 255, 0.15), rgba(123, 97, 255, 0.06)),
        rgba(13, 10, 22, 0.96);
    box-shadow: var(--shadow);
    transform: translate(-50%, calc(110% + 24px));
    transition: transform 0.28s ease;
    backdrop-filter: blur(30px);
}

.app-shell.account-open .account-modal {
    transform: translate(-50%, 0);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: rgba(224, 179, 255, 0.09);
    color: var(--text);
}

.account-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 44px;
}

.account-hero span {
    width: 54px;
    height: 54px;
}

.account-hero small,
dt {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.account-hero strong {
    display: block;
    margin-top: 3px;
    font-size: 1.18rem;
}

dl {
    display: grid;
    gap: 9px;
    margin: 18px 0;
}

dl div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(224, 179, 255, 0.12);
}

dd {
    margin: 0;
    color: var(--soft);
    text-align: right;
}

@keyframes livingHead {
    0%, 100% { transform: rotateX(-8deg) rotateY(13deg) rotateZ(-1deg) translateY(-6px); }
    24% { transform: rotateX(-3deg) rotateY(-16deg) rotateZ(1.5deg) translateY(8px); }
    48% { transform: rotateX(5deg) rotateY(8deg) rotateZ(-1deg) translateY(0); }
    72% { transform: rotateX(-12deg) rotateY(-8deg) rotateZ(1deg) translateY(7px); }
}

@keyframes breathe {
    0%, 100% { transform: scale(0.95); opacity: 0.42; }
    50% { transform: scale(1.08); opacity: 0.96; }
}

@keyframes orbitSpin {
    to { transform: rotateX(68deg) rotateZ(360deg); }
}

@keyframes slowSpin {
    to { transform: rotate(360deg); }
}

@keyframes faceLight {
    to { transform: rotate(360deg); }
}

@keyframes gridDrift {
    0%, 100% { transform: translateY(-3px) scale(1.03); }
    50% { transform: translateY(8px) scale(0.98); }
}

@keyframes scanLine {
    0%, 100% { top: 22%; opacity: 0; }
    18%, 82% { opacity: 0.82; }
    50% { top: 74%; opacity: 0.4; }
}

@keyframes blink {
    0%, 90%, 100% { transform: translate(var(--gaze-x), var(--gaze-y)) scaleY(1); opacity: 1; }
    94% { transform: translate(var(--gaze-x), var(--gaze-y)) scaleY(0.12); opacity: 0.48; }
}

@keyframes talkLine {
    from { transform: scaleX(0.76); opacity: 0.76; }
    to { transform: scaleX(1.08); opacity: 1; }
}

@keyframes talkOpen {
    from { height: 4px; opacity: 0.72; }
    to { height: 14px; opacity: 1; }
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 9px rgba(176, 108, 255, 0.14), 0 18px 42px rgba(176, 108, 255, 0.34); }
    50% { box-shadow: 0 0 0 17px rgba(224, 179, 255, 0.13), 0 18px 52px rgba(123, 97, 255, 0.38); }
}

@keyframes barDance {
    0%, 100% { height: 8px; opacity: 0.5; }
    50% { height: 32px; opacity: 1; }
}

@media (max-height: 690px) {
    .avatar-stage {
        min-height: 308px;
    }

    .avatar-face {
        width: min(56vw, 226px);
    }

    .voice-panel {
        padding: 10px;
    }

    .mic-button {
        width: 70px;
    }
}
