/* ═══════════════════════════════════════════════════════════════
   Aelyne — premium prompt-driven chat
   Viewport-locked: only the chat scrolls (no visible scrollbar).
   ═══════════════════════════════════════════════════════════════ */

/* ── Viewport lock (scoped to aelyne) ────────────────────────── */

body:has(.aelyne-page) {
    overflow: hidden;
    height: 100dvh;
}

body:has(.aelyne-page) .wyverno-main {
    padding: 0;
    margin: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
}

/* Compact footer on landing; hidden during chat */
body:has(.aelyne-page) .wyverno-mini-footer {
    flex-shrink: 0;
    padding: 8px 24px 10px;
    margin-top: 0;
}
body:has(.aelyne-page) .mini-footer-support {
    margin-top: 4px;
}

/* ── Page shell (fills main, becomes grid) ───────────────────── */

.aelyne-page {
    --aelyne-accent: rgba(127, 255, 212, 1);
    --aelyne-accent-soft: rgba(127, 255, 212, 0.55);
    --aelyne-bg: #05080d;

    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-rows: 1fr auto;
    /* No overflow:hidden here — would clip the model dropdown.
       .aelyne-bg manages its own overflow. */
    isolation: isolate;
}

/* ── Background layers ───────────────────────────────────────── */

.aelyne-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.aelyne-bg__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 780px;
    height: 780px;
    border-radius: 50%;
    border: 1px solid rgba(127, 255, 212, 0.045);
    transform: translate(-50%, -58%);
    opacity: 0.9;
}
.aelyne-bg__ring--2 {
    width: 1080px;
    height: 1080px;
    border-color: rgba(127, 255, 212, 0.032);
}
.aelyne-bg__ring--3 {
    width: 1380px;
    height: 1380px;
    border-color: rgba(127, 255, 212, 0.022);
}

.aelyne-bg__glow {
    position: absolute;
    bottom: -180px;
    left: 50%;
    transform: translateX(-50%);
    width: 820px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(127, 255, 212, 0.10) 0%, transparent 65%);
    filter: blur(60px);
}

/* Subtle wave shimmer at the bottom of the landing area */
.aelyne-bg__waves {
    position: absolute;
    bottom: 12vh;
    left: 50%;
    width: 1100px;
    height: 140px;
    transform: translateX(-50%);
    background:
        radial-gradient(ellipse at 50% 100%, rgba(127, 255, 212, 0.18) 0%, transparent 55%),
        repeating-linear-gradient(
            90deg,
            rgba(127, 255, 212, 0.08) 0px,
            rgba(127, 255, 212, 0.08) 1px,
            transparent 1px,
            transparent 6px
        );
    mask-image: radial-gradient(ellipse at 50% 100%, #000 0%, transparent 65%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 100%, #000 0%, transparent 65%);
    opacity: 0.55;
    animation: aelyne-waves 9s ease-in-out infinite;
}

@keyframes aelyne-waves {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.45; }
    50%      { transform: translate(-50%, -8px); opacity: 0.75; }
}

/* Hide background rings/waves when chat is active to keep things clean */
.aelyne-page.has-messages .aelyne-bg__ring,
.aelyne-page.has-messages .aelyne-bg__waves {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* ── Landing-state: compress title + composer to viewport center */

.aelyne-page:not(.has-messages) {
    grid-template-rows: auto auto;
    align-content: center;
}

.aelyne-page:not(.has-messages) .aelyne-stage {
    flex: none;
}

/* ── Landing ─────────────────────────────────────────────────── */

.aelyne-landing {
    position: relative;
    grid-row: 1;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 24px 0;
    min-height: 0;
    animation: aelyne-fade-up 0.6s ease both;
}

.aelyne-page.has-messages .aelyne-landing {
    display: none;
}

@keyframes aelyne-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aelyne-eyebrow {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    font-weight: 600;
}

.aelyne-title {
    margin: 6px 0 0;
    font-size: clamp(3.4rem, 11vw, 6.4rem);
    line-height: 0.95;
    letter-spacing: -0.01em;
    font-weight: 600;
    background: linear-gradient(
        148deg,
        #e6fff8 0%,
        #7fffd4 48%,
        #50d2ff 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(127, 255, 212, 0.18);
}

/* Stage = orb flanked by left/right captions */
.aelyne-stage {
    position: relative;
    margin-top: clamp(24px, 4vh, 56px);
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(20px, 4vw, 64px);
    flex: 1;
    min-height: 0;
}

/* Side captions */
.aelyne-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    color: rgba(255, 255, 255, 0.62);
    max-width: 220px;
}

.aelyne-side--left {
    justify-self: end;
    text-align: right;
    padding-right: 28px;
}

.aelyne-side--right {
    justify-self: start;
    text-align: left;
    padding-left: 28px;
}

.aelyne-side__kicker {
    margin: 0;
    color: var(--aelyne-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.aelyne-side__text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
}

.aelyne-side__connector {
    position: absolute;
    top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--aelyne-accent);
}

.aelyne-side--left .aelyne-side__connector {
    right: -4px;
    flex-direction: row;
}
.aelyne-side--right .aelyne-side__connector {
    left: -4px;
}

.aelyne-side__line {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, rgba(127, 255, 212, 0), rgba(127, 255, 212, 0.55));
}
.aelyne-side--right .aelyne-side__line {
    background: linear-gradient(to left, rgba(127, 255, 212, 0), rgba(127, 255, 212, 0.55));
}

.aelyne-side__node {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--aelyne-accent);
    box-shadow: 0 0 12px rgba(127, 255, 212, 0.85);
    animation: aelyne-node-pulse 2.4s ease-in-out infinite;
}

@keyframes aelyne-node-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.35); opacity: 0.7; }
}

/* ── Hero orb ─────────────────────────────────────────────────── */

.aelyne-hero-orb {
    position: relative;
    width: clamp(180px, 26vh, 280px);
    height: clamp(180px, 26vh, 280px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    animation: aelyne-orb-float 7s ease-in-out infinite;
}

.aelyne-orb__core {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 42%, rgba(180, 255, 232, 0.95) 0%, rgba(127, 255, 212, 0.6) 20%, rgba(40, 90, 110, 0.42) 55%, rgba(8, 14, 22, 0.95) 88%);
    box-shadow:
        inset 0 0 80px rgba(127, 255, 212, 0.55),
        inset 0 0 24px rgba(180, 255, 232, 0.4),
        0 0 80px rgba(127, 255, 212, 0.25);
    animation: aelyne-orb-breathe 4s ease-in-out infinite;
}

.aelyne-orb__spark {
    position: absolute;
    top: 38%;
    left: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, rgba(127, 255, 212, 0.95) 50%, transparent 80%);
    box-shadow: 0 0 28px rgba(180, 255, 232, 0.95);
    animation: aelyne-spark 3s ease-in-out infinite;
}

.aelyne-orb__halo {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(127, 255, 212, 0.22);
    animation: aelyne-orb-ripple 5s ease-out infinite;
    pointer-events: none;
}

.aelyne-orb__halo--mid { inset: -18px; }
.aelyne-orb__halo--far {
    inset: -42px;
    border-color: rgba(127, 255, 212, 0.10);
    animation-delay: -2.5s;
}

@keyframes aelyne-orb-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

@keyframes aelyne-orb-breathe {
    0%, 100% {
        box-shadow:
            inset 0 0 80px rgba(127, 255, 212, 0.55),
            inset 0 0 24px rgba(180, 255, 232, 0.4),
            0 0 80px rgba(127, 255, 212, 0.25);
    }
    50% {
        box-shadow:
            inset 0 0 110px rgba(127, 255, 212, 0.75),
            inset 0 0 36px rgba(180, 255, 232, 0.55),
            0 0 130px rgba(127, 255, 212, 0.42);
    }
}

@keyframes aelyne-orb-ripple {
    0%   { transform: scale(0.92); opacity: 0.55; }
    70%  { opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes aelyne-spark {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
}

/* ── Chat top bar (new conversation button) ───────────────────── */

.aelyne-chat-topbar {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    padding: 12px 20px 0 0;
    pointer-events: none;
}

.aelyne-page.has-messages .aelyne-chat-topbar {
    display: flex;
    pointer-events: auto;
}

.aelyne-new-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(127, 255, 212, 0.22);
    background: rgba(10, 16, 24, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.aelyne-new-chat-btn:hover {
    background: rgba(127, 255, 212, 0.10);
    color: var(--aelyne-accent);
    border-color: rgba(127, 255, 212, 0.45);
    box-shadow: 0 0 16px rgba(127, 255, 212, 0.12);
}

/* ── Chat area (only scroll target) ──────────────────────────── */

.aelyne-chat {
    display: none;
    grid-row: 1;
    z-index: 2;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 0;
    padding: 32px 0 8px;
}

.aelyne-chat::-webkit-scrollbar { display: none; }

.aelyne-page.has-messages .aelyne-chat { display: block; }

.aelyne-chat__inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Message rows ────────────────────────────────────────────── */

.aelyne-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    animation: aelyne-msg-in 0.35s cubic-bezier(.22,.95,.3,1.1) both;
}

@keyframes aelyne-msg-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aelyne-row--user      { justify-content: flex-end; }
.aelyne-row--assistant { justify-content: flex-start; }

/* User avatar (W) on right */
.aelyne-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(80, 200, 200, 0.10);
    border: 1px solid rgba(127, 255, 212, 0.28);
    color: var(--aelyne-accent);
    backdrop-filter: blur(8px);
}

/* Assistant indicator dot on left */
.aelyne-pill {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--aelyne-accent);
    box-shadow:
        0 0 12px rgba(127, 255, 212, 0.85),
        0 0 0 5px rgba(127, 255, 212, 0.10);
    animation: aelyne-pill-pulse 2.6s ease-in-out infinite;
    align-self: center;
}

@keyframes aelyne-pill-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(127,255,212,0.85), 0 0 0 5px rgba(127,255,212,0.10); }
    50%      { transform: scale(1.15); box-shadow: 0 0 20px rgba(127,255,212,1), 0 0 0 8px rgba(127,255,212,0.18); }
}

/* Message bubble */
.aelyne-message {
    max-width: min(760px, 90%);
    border-radius: 22px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(148deg, rgba(15, 22, 32, 0.85) 0%, rgba(10, 15, 22, 0.92) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    position: relative;
}

.aelyne-message--assistant {
    border-color: rgba(127, 255, 212, 0.16);
    background: linear-gradient(148deg, rgba(11, 24, 22, 0.88) 0%, rgba(8, 14, 20, 0.94) 100%);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.38), 0 0 36px rgba(127, 255, 212, 0.05);
}

.aelyne-message--user {
    border-color: rgba(255, 255, 255, 0.08);
}

.aelyne-message-text {
    margin: 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.96rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.aelyne-message-text + .aelyne-message-text { margin-top: 8px; }

/* File chip when user attached audio */
.aelyne-message-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(127, 255, 212, 0.08);
    border: 1px solid rgba(127, 255, 212, 0.18);
    color: rgba(127, 255, 212, 0.85);
    font-size: 0.74rem;
    font-weight: 500;
}

/* ── Audio widget: horizontal single-row layout ───────────────── */

.aelyne-message .wyverno-audio-widget,
.aelyne-upload-strip .wyverno-audio-widget {
    display: flex;
    width: 100%;
    min-width: 260px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.aelyne-message-text + .wyverno-audio-widget { margin-top: 10px; }

/* Single row: [toggle] [timeline] */
.aelyne-message .wyverno-audio-widget__controls,
.aelyne-upload-strip .wyverno-audio-widget__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Toggle button */
.aelyne-message .wyverno-audio-widget__toggle,
.aelyne-upload-strip .wyverno-audio-widget__toggle {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(127, 255, 212, 0.28);
    background: rgba(127, 255, 212, 0.08);
    color: var(--aelyne-accent);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s, box-shadow 0.15s;
    z-index: 1;
}
.aelyne-message .wyverno-audio-widget__toggle:hover,
.aelyne-upload-strip .wyverno-audio-widget__toggle:hover {
    background: rgba(127, 255, 212, 0.16);
    box-shadow: 0 0 12px rgba(127, 255, 212, 0.30);
}

/* SVG icon display */
.aelyne-message .wyverno-audio-widget__icon--pause,
.aelyne-upload-strip .wyverno-audio-widget__icon--pause { display: none; }
.aelyne-message .wyverno-audio-widget.is-playing .wyverno-audio-widget__icon--play,
.aelyne-upload-strip .wyverno-audio-widget.is-playing .wyverno-audio-widget__icon--play { display: none; }
.aelyne-message .wyverno-audio-widget.is-playing .wyverno-audio-widget__icon--pause,
.aelyne-upload-strip .wyverno-audio-widget.is-playing .wyverno-audio-widget__icon--pause { display: block; }

/* Timeline: waveform canvas + fill overlay + seek + time, all stacked */
.aelyne-message .wyverno-audio-widget__timeline,
.aelyne-upload-strip .wyverno-audio-widget__timeline {
    flex: 1;
    position: relative;
    height: 48px;
    border-radius: 8px;
    background: rgba(127, 255, 212, 0.04);
    overflow: hidden;
    cursor: pointer;
    isolation: isolate;
}

.aelyne-upload-strip .wyverno-audio-widget__timeline {
    height: 36px;
}

/* Waveform canvas: lowest layer */
.aelyne-waveform-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Fill overlay: screen blend over waveform — played bars become bright */
.aelyne-message .wyverno-audio-widget__fill,
.aelyne-upload-strip .wyverno-audio-widget__fill {
    position: absolute;
    inset: 0;
    right: auto;
    width: 0%;
    background: rgba(127, 255, 212, 0.48);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 1;
}

/* Invisible seek input covers entire timeline for click/drag */
.aelyne-message .wyverno-audio-widget__seek,
.aelyne-upload-strip .wyverno-audio-widget__seek {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    margin: 0;
    padding: 0;
    z-index: 3;
}
.aelyne-message .wyverno-audio-widget__seek::-webkit-slider-thumb,
.aelyne-upload-strip .wyverno-audio-widget__seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 0;
    height: 0;
    background: transparent;
    border: none;
}
.aelyne-message .wyverno-audio-widget__seek::-moz-range-thumb,
.aelyne-upload-strip .wyverno-audio-widget__seek::-moz-range-thumb {
    width: 0;
    height: 0;
    background: transparent;
    border: none;
}

/* Time label: overlaid at bottom-right of timeline */
.aelyne-message .wyverno-audio-widget__time,
.aelyne-upload-strip .wyverno-audio-widget__time {
    position: absolute;
    bottom: 5px;
    right: 8px;
    z-index: 2;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.60);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.70);
}
.aelyne-message .wyverno-audio-widget__time-sep,
.aelyne-upload-strip .wyverno-audio-widget__time-sep {
    opacity: 0.55;
    margin: 0 2px;
}

/* Hide the upload strip filename label */
.aelyne-upload-strip__label {
    display: none;
}

/* Avatar image styling */
.aelyne-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Pending assistant row: no bubble — just floating orb + text */
.aelyne-row--pending .aelyne-message--assistant {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 4px 6px;
}

/* ── Thinking animation ──────────────────────────────────────── */

.aelyne-thinking {
    display: flex;
    align-items: center;
    padding: 2px 0;
}

.aelyne-thinking__label {
    color: rgba(127, 255, 212, 0.78);
    font-size: 0.92rem;
    font-style: italic;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, rgba(127, 255, 212, 0.55), rgba(180, 255, 232, 1), rgba(127, 255, 212, 0.55));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: aelyne-shimmer 2.4s linear infinite;
}

@keyframes aelyne-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ── Composer ────────────────────────────────────────────────── */

.aelyne-composer {
    grid-row: 2;
    z-index: 3;
    width: 100%;
    padding: 18px 24px 28px;
    position: relative;
}

.aelyne-page.has-messages .aelyne-composer {
    background: linear-gradient(
        to bottom,
        rgba(5, 8, 13, 0) 0%,
        rgba(5, 8, 13, 0.85) 30%,
        rgba(5, 8, 13, 1) 70%
    );
}

.aelyne-composer__inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Upload preview strip above the bar */
/* [hidden] attribute must win over display:flex */
.aelyne-upload-strip[hidden] { display: none !important; }

.aelyne-upload-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 16px;
    border: 1px solid rgba(127, 255, 212, 0.20);
    background: rgba(10, 16, 24, 0.92);
    backdrop-filter: blur(10px);
    animation: aelyne-fade-up 0.3s ease;
}

.aelyne-upload-strip__label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    flex-shrink: 0;
}

.aelyne-upload-strip__player { flex: 1; min-width: 0; }

.aelyne-strip-clear {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.52);
    cursor: pointer;
    display: grid; place-items: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.aelyne-strip-clear:hover {
    background: rgba(255, 80, 80, 0.14);
    color: rgba(255, 160, 160, 0.92);
    border-color: rgba(255, 80, 80, 0.30);
}

/* Main input pill */
.aelyne-composer__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px 9px 14px;
    border-radius: 22px;
    border: 1px solid rgba(127, 255, 212, 0.18);
    background: rgba(10, 15, 24, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 0 0 1px rgba(127, 255, 212, 0.05),
        0 14px 50px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(127, 255, 212, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.aelyne-composer__bar:focus-within {
    border-color: rgba(127, 255, 212, 0.42);
    box-shadow:
        0 0 0 1px rgba(127, 255, 212, 0.18),
        0 14px 50px rgba(0, 0, 0, 0.45),
        0 0 100px rgba(127, 255, 212, 0.12);
}

.aelyne-composer__bar.drag-over {
    border-color: rgba(127, 255, 212, 0.65);
    background: rgba(12, 26, 24, 0.95);
    box-shadow:
        0 0 0 1px rgba(127, 255, 212, 0.30),
        0 0 120px rgba(127, 255, 212, 0.18);
}

/* Attach — only before the first message (session not started) */
.aelyne-attach-btn {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: grid; place-items: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.aelyne-attach-btn[hidden],
.aelyne-page.has-messages .aelyne-attach-btn {
    display: none !important;
}
.aelyne-attach-btn:hover,
.aelyne-attach-btn.has-file {
    background: rgba(127, 255, 212, 0.10);
    color: var(--aelyne-accent);
    border-color: rgba(127, 255, 212, 0.32);
    transform: translateY(-1px);
}

/* Textarea — grows with content; scrollbar hidden (same as chat area) */
.aelyne-composer__textarea {
    flex: 1;
    min-width: 0;
    min-height: 24px;
    max-height: 180px;
    resize: none;
    overflow-y: auto;
    border: none;
    background: transparent;
    color: var(--text, #fff);
    font: inherit;
    font-size: 0.98rem;
    line-height: 1.55;
    padding: 6px 4px;
    outline: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.aelyne-composer__textarea::placeholder {
    color: rgba(255, 255, 255, 0.32);
}
.aelyne-composer__textarea::-webkit-scrollbar {
    display: none;
}

/* Model chip — dropdown opens upward so it doesn't go off-screen */
.aelyne-model-menu { flex-shrink: 0; }

.aelyne-model-menu .model-dropdown {
    top: auto;
    bottom: calc(100% + 10px);
    left: auto;
    right: 0;
}

.aelyne-model-trigger {
    font-size: 0.74rem !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    color: rgba(255, 255, 255, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.aelyne-model-trigger:hover {
    color: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(127, 255, 212, 0.28) !important;
    background: rgba(127, 255, 212, 0.06) !important;
}

/* Send */
.aelyne-send-btn {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(148deg, rgba(160, 255, 220, 0.95) 0%, rgba(58, 205, 168, 0.95) 100%);
    color: rgba(4, 22, 18, 0.96);
    cursor: pointer;
    display: grid; place-items: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 20px rgba(127, 255, 212, 0.30);
}
.aelyne-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(127, 255, 212, 0.55);
}
.aelyne-send-btn:active:not(:disabled) { transform: translateY(0); }
.aelyne-send-btn:disabled {
    opacity: 0.4; cursor: not-allowed; box-shadow: none;
}

/* Drop hint */
.aelyne-drop-hint {
    display: none;
    text-align: center;
    font-size: 0.82rem;
    color: var(--aelyne-accent);
    letter-spacing: 0.04em;
    margin: 2px 0 0;
    pointer-events: none;
}
.aelyne-composer.is-dragging .aelyne-drop-hint { display: block; }

/* Status line (errors only, subtle) */
.aelyne-status {
    min-height: 1em;
    margin: 0;
    text-align: center;
    color: rgba(127, 255, 212, 0.55);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}
.aelyne-status:empty { min-height: 0; }

/* ── Download row (below audio widget) ───────────────────────── */

.aelyne-download-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.aelyne-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(127, 255, 212, 0.18);
    background: rgba(127, 255, 212, 0.06);
    color: rgba(127, 255, 212, 0.55);
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    white-space: nowrap;
}

.aelyne-download-btn:hover {
    background: rgba(127, 255, 212, 0.14);
    color: var(--aelyne-accent);
    border-color: rgba(127, 255, 212, 0.42);
    box-shadow: 0 0 10px rgba(127, 255, 212, 0.16);
    transform: translateY(-1px);
}

.aelyne-download-btn:active {
    transform: translateY(0);
}

/* ── Utility ─────────────────────────────────────────────────── */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 820px) {
    .aelyne-stage { gap: 12px; }
    .aelyne-side { max-width: 160px; padding: 0; }
    .aelyne-side__connector { display: none; }
    .aelyne-side--left { padding-right: 0; }
    .aelyne-side--right { padding-left: 0; }
    .aelyne-side__text { font-size: 0.82rem; }
}

@media (max-width: 640px) {
    .aelyne-title { font-size: clamp(2.6rem, 14vw, 3.6rem); }
    .aelyne-stage {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 20px;
    }
    .aelyne-side { display: none; }
    .aelyne-hero-orb { width: 160px; height: 160px; }
    .aelyne-composer { padding: 12px 14px 20px; }
    .aelyne-model-menu { display: none; }
    .aelyne-upload-strip__label { display: none; }
    .aelyne-chat__inner { padding: 0 14px; }
    .aelyne-message { max-width: 86%; }
}
