/* assets/css/chat.css — "Practice with Nova" AI conversation tutor (Phase 27; immersive glass pass Phase 29+) */
.chat-page{position:relative;max-width:880px;margin:0 auto 60px;padding:0 20px;}
@keyframes chat-landing-in{from{opacity:0;transform:translateY(14px);}to{opacity:1;transform:translateY(0);}}
.chat-landing.hidden,.chat-main.hidden{display:none;}
.chat-head{display:flex;align-items:center;gap:16px;margin-bottom:14px;}
/* Roleplay mission banner (scenario objective), pinned above the thread; turns green on completion. */
.chat-goal{
    display:flex;
    align-items:center;
    gap:9px;
    margin-bottom:12px;
    padding:9px 14px;
    border-radius:12px;
    background:rgba(111,95,228,0.08);
    border:1px solid rgba(111,95,228,0.22);
    font-size:0.88rem;
    color:var(--text-color);
    transition:background 0.4s ease,border-color 0.4s ease;
}
.chat-goal.hidden{display:none;}
.chat-goal i{color:var(--primary);font-size:1rem;flex-shrink:0;}
.chat-goal.is-done{background:rgba(16,185,129,0.12);border-color:rgba(16,185,129,0.4);}
.chat-goal.is-done i{color:var(--success);}
/* Immersive conversation mode: nav + footer vanish (like SRS sessions) and the whole conversation is
   locked to the viewport so ONLY the thread scrolls — no page scrollbar. Mirrors the proven
   body.session-active full-screen approach (fixed, 100dvh, hidden overflow). A flex chain carries
   a min-height floor of zero from #app-root all the way down so the thread is the sole scroll
   container and the composer stays pinned. The X chip exits back to the landing. */
body.chat-immersive{position:fixed;width:100%;height:100dvh;overflow:hidden;}
body.chat-immersive header{display:none !important;}
body.chat-immersive footer{display:none !important;}
/* !important counters session.css's global ≤768px sledgehammer (margin:20px auto !important on
   main#app-root), which would inset the full-bleed layout and push the composer down on phones. */
body.chat-immersive main#app-root{height:100%;max-width:none;margin:0 !important;padding:0 !important;overflow:hidden;display:flex;justify-content:center;}
/* Full width with auto side margins keeps the 880px column CENTERED in the full-bleed flex row. The
   page must NOT clip its overflow — the blurred aurora blobs reach past its edges and hiding them
   here painted a hard vertical seam. Viewport-level clipping is the body rule's job. */
body.chat-immersive .chat-page{flex:1;min-height:0;width:100%;margin:0 auto;padding:14px 20px 18px;display:flex;flex-direction:column;}
body.chat-immersive .chat-main{flex:1;min-height:0;display:flex;flex-direction:column;}
body.chat-immersive .chat-card{flex:1;min-height:0;display:flex;flex-direction:column;}
body.chat-immersive .chat-thread-wrap{flex:1;min-height:0;display:flex;flex-direction:column;}
body.chat-immersive .chat-thread{flex:1;min-height:0;max-height:none;}
/* The page-entry animation's fill-mode retains an (identity) transform on the injected view — a
   transformed ancestor is a classic iOS trigger for the text caret painting OUTSIDE the focused
   input. The entry effect is invisible mid-session anyway, so immersive mode drops it entirely. */
body.chat-immersive main#app-root > *{animation:none;}
.chat-exit:hover{border-color:var(--danger);color:var(--danger);}

/* Floating recall chips (mission + photo) pinned top-left of the thread once their rows scroll away. */
.chat-float-meta{
    position:absolute;
    top:8px;
    left:8px;
    z-index:3;
    display:flex;
    flex-direction:column;
    gap:7px;
}
.cfm-chip{
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid rgba(111,95,228,0.3);
    border-radius:12px;
    background:rgba(255,255,255,0.92);
    box-shadow:0 6px 18px rgba(111,95,228,0.22);
    cursor:pointer;
    padding:0;
    overflow:hidden;
    animation:cqp-in 0.2s ease;
}
.cfm-goal{width:38px;height:38px;color:var(--primary);font-size:0.95rem;}
.cfm-goal:hover{background:var(--primary);color:#fff;}
.cfm-pic{width:52px;height:40px;}
.cfm-pic img{width:100%;height:100%;object-fit:cover;display:block;}
.cfm-pic:hover{border-color:var(--primary);}

/* In-thread meta rows: the mission briefing + scenario photo, presented as things Nova provides. */
.chat-meta-row .chat-msg{max-width:76%;}
.chat-goal-bubble{
    display:inline-flex;
    align-items:center;
    gap:9px;
    padding:10px 15px;
    border-radius:18px;
    border-bottom-left-radius:6px;
    background:rgba(111,95,228,0.10);
    border:1px solid rgba(111,95,228,0.28);
    font-size:0.9rem;
    color:var(--text-color);
}
.chat-goal-bubble i{color:var(--primary);flex-shrink:0;}
.chat-picture-bubble img{
    max-height:220px;
    max-width:100%;
    display:block;
    border-radius:18px;
    border-bottom-left-radius:6px;
    border:1px solid rgba(255,255,255,0.85);
    box-shadow:0 10px 28px rgba(111,95,228,0.18);
    cursor:zoom-in;
    transition:transform 0.2s ease;
}
.chat-picture-bubble img:hover{transform:scale(1.02);}
/* Full-size photo lightbox (click / Esc to close). */
.chat-lightbox{
    position:fixed;
    inset:0;
    z-index:10010;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(30,26,50,0.82);
    backdrop-filter:blur(6px);
    -webkit-backdrop-filter:blur(6px);
    cursor:zoom-out;
    animation:cqp-in 0.18s ease;
}
.chat-lightbox.hidden{display:none;}
.chat-lightbox img{max-width:92vw;max-height:88vh;border-radius:14px;box-shadow:0 30px 80px rgba(0,0,0,0.5);}
.chat-lightbox-close{
    position:absolute;
    top:18px;
    right:22px;
    width:42px;
    height:42px;
    border:none;
    border-radius:50%;
    background:rgba(255,255,255,0.14);
    color:#fff;
    font-size:1.1rem;
    cursor:pointer;
}
.chat-lightbox-close:hover{background:rgba(255,255,255,0.28);}
/* Correction diff: the changed/corrected words stand out inside the corrected sentence. */
.chat-corr-diff{background:rgba(244,162,60,0.35);color:inherit;font-weight:800;border-radius:4px;padding:0 3px;}
/* Head action cluster: New chat · voice toggle · limits ring · exit — all 42px, vertically aligned,
   reading as one matched set of white circular chips (New chat is icon-only with a tooltip).
   On phones the three chips collapse into the ⋯ menu (media block at the bottom swaps visibility). */
.chat-head-actions{display:flex;align-items:center;gap:10px;margin-left:auto;flex-shrink:0;}
.chat-head .chat-head-actions .chat-icon-btn{width:42px;height:42px;}
.chat-head-menu{position:relative;display:none;}
.chat-menu-panel{
    position:absolute;
    top:calc(100% + 8px);
    right:0;
    z-index:10003;
    min-width:190px;
    padding:6px;
    border-radius:14px;
    background:var(--card-bg);
    border:1px solid var(--card-border);
    box-shadow:0 14px 40px rgba(42,39,64,0.18);
    display:flex;
    flex-direction:column;
    gap:2px;
    animation:chat-menu-in 0.18s ease;
}
.chat-menu-panel.hidden{display:none;}
/* display none→flex re-runs the animation, so every open fades in. */
@keyframes chat-menu-in{from{opacity:0;transform:translateY(-6px);}to{opacity:1;transform:translateY(0);}}
@media(prefers-reduced-motion:reduce){.chat-menu-panel{animation:none;}}
.chat-menu-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border:none;
    border-radius:10px;
    background:none;
    font:inherit;
    font-size:0.92rem;
    font-weight:700;
    color:var(--text-color);
    text-align:left;
    cursor:pointer;
}
.chat-menu-item:hover{background:rgba(111,95,228,0.10);}
.chat-menu-item i{width:18px;text-align:center;color:var(--primary);}
#chat-menu-exit i{color:var(--danger);}
.chat-head .chat-head-actions .chat-quota{height:42px;background:rgba(255,255,255,0.75);border:1px solid rgba(111,95,228,0.22);border-radius:999px;transition:border-color 0.2s;}
.chat-head .chat-head-actions .chat-quota:hover{border-color:var(--primary);}
.chat-nova-avatar{
    flex-shrink:0;
    width:60px;
    height:60px;
    border-radius:50%;
    padding:4px;
    background:radial-gradient(circle at 50% 40%,rgba(111,95,228,0.16),transparent 70%);
    filter:drop-shadow(0 6px 14px rgba(111,95,228,0.28));
    transition:transform 0.3s ease;
}
/* Nova "speaks": pulsing voice rings + a gentle bob while her clip is playing (chat.js toggles it). */
.chat-nova-avatar.is-speaking{animation:chat-speak-bob 1.15s ease-in-out infinite,chat-speak-ring 1.15s ease-out infinite;}
@keyframes chat-speak-bob{0%,100%{transform:translateY(0);}50%{transform:translateY(-4px);}}
@keyframes chat-speak-ring{0%{box-shadow:0 0 0 0 rgba(111,95,228,0.38);}100%{box-shadow:0 0 0 14px rgba(111,95,228,0);}}
@media(prefers-reduced-motion:reduce){.chat-nova-avatar.is-speaking{animation:none;}}
.chat-head-text{flex:1;min-width:0;}
.chat-title{font-size:1.9rem;margin:0 0 4px;}
.chat-sub{margin:0;color:var(--text-muted);font-size:0.95rem;}
.chat-quota-wrap{position:relative;flex-shrink:0;display:flex;} /* flex kills the inline baseline gap (1px misalign) */
/* "Fuel gauge" pill of messages remaining: bolt + slim draining bar. Vivid fill = what's LEFT. */
.chat-quota{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:0 14px;
    border:none;
    background:none;
    cursor:pointer;
}
.cq-bolt{font-size:0.72rem;color:var(--primary);transition:color 0.3s ease;}
.chat-quota.is-low .cq-bolt{color:var(--secondary);}
.chat-quota.is-empty .cq-bolt{color:var(--danger);}
/* Two stacked bars: thick = messages, thin = additional queries (both drain toward the limit). */
.cq-bars{display:flex;flex-direction:column;gap:2px;}
.cq-track{width:44px;height:8px;border-radius:999px;background:#E6E0F6;overflow:hidden;}
.cq-track-extra{height:3px;width:42px;margin:0 auto;}
.cq-fill{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--primary),#8A5FE0);transition:width 0.4s ease,background 0.3s ease;}
.cq-fill-extra{background:var(--tertiary);} /* plum, not orange — orange reads as a warning */
.chat-quota.is-low .cq-fill{background:var(--secondary);}
/* Message allowance fully spent → the (empty) messages track reads as a faded grey-red. */
.chat-quota.is-empty .cq-track:not(.cq-track-extra){background:rgba(239,68,68,0.16);}
.cq-dash{color:var(--text-muted);font-weight:800;font-size:0.9rem;}
/* Weekly-limit hover panel: anchored under the badge, right-aligned so it never clips the edge. */
.chat-quota-panel{
    position:absolute;
    top:calc(100% + 8px);
    right:0;
    z-index:10002;
    width:260px;
    padding:14px;
    border-radius:14px;
    background:var(--card-bg);
    border:1px solid var(--card-border);
    box-shadow:0 12px 34px rgba(0,0,0,0.18);
}
.chat-quota-panel.hidden{display:none;}
/* Fade + slide-in each time the panel is revealed (the :not(.hidden) match re-triggers on open). */
@keyframes cqp-in{from{opacity:0;transform:translateY(-8px) scale(0.97);}to{opacity:1;transform:translateY(0) scale(1);}}
.chat-quota-panel:not(.hidden){animation:cqp-in 0.2s cubic-bezier(0.16,1,0.3,1);}
@media(prefers-reduced-motion:reduce){.chat-quota-panel:not(.hidden){animation:none;}}
.cqp-title{display:flex;align-items:center;gap:8px;font-weight:800;font-size:0.82rem;color:var(--text-color);margin-bottom:12px;}
.cqp-pro{padding:1px 7px;border-radius:999px;background:var(--secondary);color:#fff;font-size:0.62rem;letter-spacing:0.5px;}
/* Non-Pro: a small Upgrade pill in the panel's upper-right corner. */
.cqp-upgrade{
    margin-left:auto;
    display:inline-flex;
    align-items:center;
    gap:5px;
    padding:3px 10px;
    border-radius:999px;
    background:linear-gradient(90deg,var(--primary),var(--accent));
    color:#fff!important;
    font-size:0.68rem;
    font-weight:800;
    text-decoration:none;
}
.cqp-upgrade i{color:#fff;font-size:0.62rem;}
.cqp-upgrade:hover{filter:brightness(1.08);}
.cqp-row{margin-bottom:11px;}
.cqp-line{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:5px;}
.cqp-label{display:inline-flex;align-items:center;gap:6px;font-size:0.8rem;font-weight:700;color:var(--text-color);}
.cqp-label i{color:var(--primary);font-size:0.76rem;}
.cqp-label i.cqp-info{color:var(--text-muted);font-size:0.72rem;cursor:help;}
.cqp-label i.cqp-info:hover,.cqp-label i.cqp-info:focus{color:var(--primary);outline:none;}
.cqp-count{font-size:0.76rem;font-weight:800;color:var(--text-muted);}
.cqp-count.is-low{color:var(--secondary);}
.cqp-track{height:7px;border-radius:999px;background:#E9E6F0;overflow:hidden;}
.cqp-fill{display:block;height:100%;border-radius:999px;background:var(--primary);transition:width 0.3s ease;}
.cqp-fill.is-low{background:var(--secondary);}
.cqp-reset{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:0.75rem;color:var(--text-muted);}
/* No lift on hover — this is an interactive container, not a clickable card. Frosted-glass shell:
   the cosmic canvas + aurora blobs shine through, so the conversation floats in space. */
.chat-card{
    position:relative;
    z-index:1;
    padding:20px 22px 16px;
    background:rgba(255,255,255,0.55);
    backdrop-filter:blur(26px) saturate(1.4);
    -webkit-backdrop-filter:blur(26px) saturate(1.4);
    border:1px solid rgba(255,255,255,0.8);
    border-radius:28px;
    box-shadow:0 24px 64px rgba(111,95,228,0.16),0 4px 18px rgba(42,39,64,0.06),inset 0 1px 0 rgba(255,255,255,0.9);
}
.chat-card:hover{transform:none;}
/* z-index 3 > the card's 1, so the quota/new-chat popovers in the head paint ABOVE the glass card
   (both create stacking contexts — at equal z the later-in-DOM card would win and bleed through). */
.chat-head{position:relative;z-index:3;}
.chat-select{
    padding:8px 14px;
    border:1px solid rgba(111,95,228,0.22);
    border-radius:999px;
    background:rgba(255,255,255,0.75);
    color:var(--text-color);
    font-size:0.9rem;
    transition:border-color 0.2s,box-shadow 0.2s;
}
.chat-select:hover,.chat-select:focus{border-color:var(--primary);outline:none;box-shadow:0 0 0 3px var(--primary-glow);}
.chat-icon-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    flex-shrink:0;
    border:1px solid var(--card-border);
    border-radius:12px;
    background:var(--card-bg);
    color:var(--text-color);
    font-size:1rem;
    cursor:pointer;
    transition:border-color 0.2s,color 0.2s,background 0.2s;
}
.chat-icon-btn:hover{border-color:var(--primary);color:var(--primary);}
.chat-icon-btn:disabled{opacity:0.45;cursor:not-allowed;}
.chat-icon-btn:disabled:hover{border-color:var(--card-border);color:var(--text-color);}
/* Locked state: the whole composer/reset dims when the message limit is spent for the period. */
.chat-input:disabled{opacity:0.6;cursor:not-allowed;}
.chat-send:disabled,.chat-reset:disabled{opacity:0.5;cursor:not-allowed;}
.chat-voice-toggle.is-off{color:var(--text-muted);}
.chat-mic.is-listening{border-color:var(--danger);color:#fff;background:var(--danger);animation:chat-pulse 1.2s infinite;}
@keyframes chat-pulse{0%,100%{box-shadow:0 0 0 0 rgba(244,63,94,0.5);}50%{box-shadow:0 0 0 7px rgba(244,63,94,0);}}
.chat-thread{
    display:flex;
    flex-direction:column;
    gap:14px;
    min-height:300px;
    max-height:48vh;
    overflow-y:auto;
    padding:18px 8px;
    scrollbar-width:thin;
    scrollbar-color:rgba(111,95,228,0.35) transparent;
    /* Messages dissolve into the glass at the top edge instead of clipping hard. */
    mask-image:linear-gradient(to bottom,transparent,#000 26px);
    -webkit-mask-image:linear-gradient(to bottom,transparent,#000 26px);
}
.chat-thread::-webkit-scrollbar{width:6px;}
.chat-thread::-webkit-scrollbar-thumb{background:rgba(111,95,228,0.30);border-radius:999px;}
.chat-thread::-webkit-scrollbar-track{background:transparent;}
/* Jump-to-newest: floats bottom-right of the thread, appears only when scrolled up (JS toggles .show). */
.chat-thread-wrap{position:relative;}
.chat-scroll-btn{
    position:absolute;
    bottom:10px;
    left:50%;
    width:38px;
    height:38px;
    border-radius:50%;
    border:none;
    background:var(--primary);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:0 6px 18px rgba(111,95,228,0.4);
    opacity:0;
    pointer-events:none;
    transform:translate(-50%,8px) scale(0.85);
    transition:opacity 0.2s ease,transform 0.2s ease;
    z-index:2;
}
.chat-scroll-btn.show{opacity:1;pointer-events:auto;transform:translate(-50%,0) scale(1);}
.chat-scroll-btn:hover{transform:translate(-50%,0) scale(1.1);background:var(--primary-hover);}
.chat-sys{text-align:center;font-size:0.85rem;color:var(--text-muted);padding:6px 12px;}
.chat-sys i{color:var(--primary);margin-right:4px;}
.chat-sys-tag{display:inline-block;margin-left:6px;padding:1px 10px;border-radius:999px;background:rgba(255,255,255,0.7);border:1px solid rgba(111,95,228,0.2);font-size:0.75rem;font-weight:700;color:var(--primary);}
.chat-row{display:flex;align-items:flex-start;gap:10px;}
.chat-row.is-user{justify-content:flex-end;}
.chat-row.is-nova{justify-content:flex-start;}
.chat-avatar{width:34px;height:34px;flex-shrink:0;margin-top:2px;border-radius:50%;filter:drop-shadow(0 3px 6px rgba(111,95,228,0.25));}
/* Per-message aura: the avatar beside the reply being spoken pulses along with the header mascot. */
.chat-avatar.is-speaking{animation:chat-speak-bob 1.15s ease-in-out infinite,chat-speak-ring-sm 1.15s ease-out infinite;}
@keyframes chat-speak-ring-sm{0%{box-shadow:0 0 0 0 rgba(111,95,228,0.34);}100%{box-shadow:0 0 0 9px rgba(111,95,228,0);}}
@media(prefers-reduced-motion:reduce){.chat-avatar.is-speaking{animation:none;}}
.chat-msg{display:flex;flex-direction:column;max-width:76%;}
.chat-msg.is-user{align-items:flex-end;}
.chat-msg.is-nova{align-items:flex-start;}
.chat-bubble{padding:12px 16px;border-radius:20px;font-size:1rem;line-height:1.5;word-wrap:break-word;}
.chat-msg.is-user .chat-bubble{background:linear-gradient(135deg,var(--primary) 0%,#8A5FE0 55%,#A15FD8 100%);color:#fff;border-bottom-right-radius:6px;box-shadow:0 8px 22px var(--primary-glow),inset 0 1px 0 rgba(255,255,255,0.25);}
.chat-msg.is-nova .chat-bubble{
    background:rgba(255,255,255,0.85);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
    color:var(--text-color);
    border:1px solid rgba(111,95,228,0.16);
    border-bottom-left-radius:6px;
    box-shadow:0 4px 16px rgba(111,95,228,0.08);
}
/* Fresh rows glide up into place (the thread fully re-renders per turn, so only animate the
   newest exchange — older rows would otherwise pulse on every send). */
.chat-row:nth-last-child(-n+2){animation:chat-row-in 0.35s ease;}
@keyframes chat-row-in{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}
@media(prefers-reduced-motion:reduce){.chat-row:nth-last-child(-n+2){animation:none;}}
.chat-corr{
    display:flex;
    align-items:baseline;
    gap:7px;
    flex-wrap:wrap;
    margin-bottom:6px;
    padding:7px 12px;
    border-radius:12px;
    background:rgba(244,162,60,0.12);
    border:1px solid rgba(244,162,60,0.35);
    font-size:0.88rem;
    color:var(--text-color);
}
.chat-corr i{color:#b45309;font-size:0.78rem;}
.chat-corr em{flex-basis:100%;font-style:normal;color:var(--text-muted);font-size:0.8rem;}
.chat-explain-btn{padding:1px 8px;font-size:0.66rem;}
.chat-explain-btn.is-open{background:var(--primary);color:#fff;border-color:var(--primary);}
.chat-explain-btn.is-open i{color:#fff;} /* override .chat-corr i (orange) on the active purple bg */
.chat-corr-detail{flex-basis:100%;margin-top:2px;padding:8px 11px;border-radius:9px;background:var(--card-bg);border:1px solid rgba(244,162,60,0.3);font-size:0.82rem;line-height:1.5;color:var(--text-color);}
.chat-corr-detail > i{color:#b45309;margin-right:5px;font-size:0.78rem;}
.chat-corr-loading{color:var(--text-muted);font-size:0.82rem;}
.chat-word{cursor:pointer;border-radius:3px;transition:background 0.12s;white-space:nowrap;}
.chat-word:hover{background:rgba(111,95,228,0.14);}
/* Letter-by-letter fade-in for a freshly-arrived Nova reply (per-char span, staggered delay). */
.chat-chword{white-space:nowrap;}
.chat-ch{opacity:0;animation:chat-ch-in 0.3s ease forwards;}
@keyframes chat-ch-in{from{opacity:0;}to{opacity:1;}}
@media(prefers-reduced-motion:reduce){.chat-ch{opacity:1;animation:none;}}
.chat-word-pop {
    position:fixed;
    z-index:10001;
    max-width:230px;
    padding:10px 12px;
    border-radius:12px;
    background:var(--card-bg);
    border:1px solid var(--card-border);
    box-shadow:0 10px 30px rgba(0,0,0,0.18);
    font-size:0.85rem;
}
.cwp-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px;}
.cwp-word{font-weight:800;color:var(--text-color);}
.cwp-play{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;flex-shrink:0;border:1px solid var(--card-border);border-radius:8px;background:var(--card-bg);color:var(--primary);font-size:0.78rem;cursor:pointer;}
.cwp-play:hover:not(:disabled){border-color:var(--primary);background:var(--primary);color:#fff;}
.cwp-play:disabled{opacity:0.4;cursor:not-allowed;}
.cwp-tr{color:var(--primary);font-weight:700;margin-bottom:8px;}
.cwp-tr.cwp-muted{color:var(--text-muted);font-weight:500;margin-bottom:0;}
.cwp-add {
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:5px 12px;
    border:none;
    border-radius:8px;
    background:var(--primary);
    color:#fff;
    font-weight:700;
    font-size:0.78rem;
    cursor:pointer;
}
.cwp-add:disabled{opacity:0.7;cursor:default;}
.cwp-added{display:inline-flex;align-items:center;gap:6px;color:var(--success);font-weight:700;font-size:0.8rem;}
.cwp-loading{color:var(--text-muted);}
.chat-msg-actions{display:flex;align-items:center;gap:6px;margin-top:5px;}
/* Message timestamps: under the user bubble (right), and just after Nova's action buttons. */
.chat-time{font-size:0.68rem;color:var(--text-muted);font-weight:600;}
.chat-msg.is-user .chat-time{margin-top:4px;padding-right:4px;}
.chat-time-nova{margin-left:3px;}
.chat-mini-btn{
    display:inline-flex;
    align-items:center;
    gap:4px;
    padding:2px 9px;
    border:1px solid var(--card-border);
    border-radius:8px;
    background:var(--card-bg);
    color:var(--text-muted);
    font-size:0.7rem;
    font-weight:800;
    cursor:pointer;
}
.chat-mini-btn:hover{color:var(--primary);border-color:var(--primary);}
/* The play button dims + is inert while its own clip is sounding (chat.js toggles .is-playing). */
.chat-replay.is-playing{opacity:0.4;pointer-events:none;}
.chat-tr-btn.is-open{background:var(--primary);color:#fff;border-color:var(--primary);}
.chat-tr{margin-top:6px;padding:8px 12px;border-radius:10px;background:var(--card-glass);border:1px dashed var(--card-border);font-size:0.9rem;color:var(--text-color);}
.chat-tr > i{color:var(--primary);margin-right:5px;font-size:0.8rem;}
.chat-tr-loading{color:var(--text-muted);font-size:0.85rem;}
/* Pronunciation practice: mic button pulses while listening; result panel scores + colours the words. */
.chat-pron-btn.is-listening{color:#fff;background:var(--danger);border-color:var(--danger);animation:chat-pulse 1.2s infinite;}
.chat-pron{margin-top:6px;padding:9px 12px;border-radius:10px;background:var(--card-glass);border:1px solid var(--card-border);font-size:0.9rem;}
.chat-pron-hint{color:var(--text-muted);font-size:0.85rem;}
.chat-pron-hint i{color:var(--primary);margin-right:5px;}
.chat-pron-result{display:flex;align-items:baseline;gap:9px;}
.chat-pron-icon{color:var(--primary);font-size:0.85rem;flex-shrink:0;align-self:center;}
.chat-pron-score{flex-shrink:0;font-weight:800;font-size:1rem;padding:1px 9px;border-radius:999px;}
.chat-pron-good{background:rgba(16,185,129,0.15);color:var(--success);}
.chat-pron-ok{background:rgba(244,162,60,0.18);color:#b45309;}
.chat-pron-low{background:rgba(244,63,94,0.14);color:var(--danger);}
.chat-pron-text{color:var(--text-color);line-height:1.5;}
.pron-w-ok{color:var(--success);font-weight:700;}
.pron-w-miss{color:var(--danger);font-weight:700;text-decoration:underline wavy rgba(244,63,94,0.55);}
.chat-pron-heard{margin-top:5px;font-size:0.78rem;color:var(--text-muted);font-style:italic;}
.chat-typing .chat-bubble{display:flex;gap:5px;align-items:center;padding:14px 16px;}
.chat-typing .chat-bubble span{width:7px;height:7px;border-radius:50%;background:var(--text-muted);animation:chat-dot 1.2s infinite;}
.chat-typing .chat-bubble span:nth-child(2){animation-delay:0.2s;}
.chat-typing .chat-bubble span:nth-child(3){animation-delay:0.4s;}
@keyframes chat-dot{0%,60%,100%{opacity:0.3;transform:translateY(0);}30%{opacity:1;transform:translateY(-3px);}}
.chat-upsell{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    margin:6px 0 12px;
    padding:12px 16px;
    border-radius:14px;
    background:linear-gradient(135deg,rgba(111,95,228,0.1),rgba(244,130,92,0.1));
    border:1px solid var(--card-border);
    font-size:0.92rem;
    color:var(--text-color);
}
.chat-upsell i.fa-crown{color:var(--secondary);}
.chat-upsell-btn{margin-left:auto;}
.chat-composer{display:flex;align-items:flex-end;gap:10px;padding-top:14px;border-top:1px solid rgba(111,95,228,0.14);}
.chat-input{
    flex:1;
    padding:13px 20px;
    border:1.5px solid rgba(111,95,228,0.22);
    border-radius:24px;
    background:rgba(255,255,255,0.85);
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
    color:var(--text-color);
    font-size:1rem;
    font-family:inherit;
    line-height:1.45;
    resize:none;
    /* JS flips overflow to auto only at max-height, so there's no stray 1-line scrollbar. */
    overflow-y:hidden;
    max-height:132px;
    transition:border-color 0.2s,box-shadow 0.2s;
}
.chat-input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 4px var(--primary-glow),0 6px 20px rgba(111,95,228,0.15);}
.chat-send{
    width:48px;
    height:48px;
    flex-shrink:0;
    padding:0;
    justify-content:center;
    border-radius:50%;
    background:linear-gradient(135deg,var(--primary),var(--secondary));
    box-shadow:0 8px 20px rgba(111,95,228,0.35);
}
/* Keep the gradient on hover (the base .btn:hover swaps to a solid colour → the "flash") + a subtle lift. */
.chat-send:hover:not(:disabled){transform:scale(1.08) rotate(-10deg);box-shadow:0 10px 26px rgba(111,95,228,0.45);background:linear-gradient(135deg,var(--primary),var(--secondary));filter:brightness(1.06);}
.chat-send i{margin-left:-2px;}
.chat-page .chat-icon-btn{border-radius:50%;width:48px;height:48px;background:rgba(255,255,255,0.75);border-color:rgba(111,95,228,0.22);}
.chat-below{display:flex;align-items:flex-start;gap:12px;margin:10px 2px 0;}
.chat-hint{margin:0;font-size:0.8rem;color:var(--text-muted);flex:1;}
/* Character counter toward the 500-char message cap, bottom-right under the send button. */
.chat-count{flex-shrink:0;font-size:0.74rem;font-weight:700;color:var(--text-muted);padding-top:1px;}
.chat-count.is-max{color:var(--secondary);}

/* Phase 90: Nova mission launcher. It replaces the full-height mascot holding screen with useful
   session state and explicit mission configuration while preserving the immersive chat surface. */
.chat-page{max-width:1220px;padding:0 24px;}
.chat-landing{display:block;padding:0;text-align:left;animation:chat-landing-in 0.35s ease;}
.nova-command-head{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:16px;
    margin:2px 4px 18px;
}
.nova-command-icon{display:grid;place-items:center;width:52px;height:52px;border:1px solid rgba(111,95,228,0.14);border-radius:16px;background:linear-gradient(145deg,rgba(255,255,255,0.84),rgba(242,238,255,0.72));color:var(--primary);font-size:1.35rem;box-shadow:0 10px 26px rgba(55,40,120,0.08);}
.nova-command-copy{display:flex;flex-direction:column;min-width:0;}
.nova-command-copy small,.nova-mission-config header small,.nova-dialog-card header small{color:var(--primary);font-size:0.67rem;font-weight:800;letter-spacing:0.15em;text-transform:uppercase;}
.nova-command-copy h1{margin:1px 0 0;font-size:1.85rem;line-height:1.05;}
.nova-command-copy>span{margin-top:4px;color:var(--text-muted);font-size:0.88rem;}
.nova-usage-orbit{display:flex;align-items:center;gap:10px;padding:8px 13px;border:1px solid rgba(111,95,228,0.12);border-radius:14px;background:rgba(255,255,255,0.5);}
.nova-usage-ring{--usage:0%;display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:conic-gradient(var(--primary) var(--usage),rgba(111,95,228,0.1) 0);}
.nova-usage-ring::before{content:"";position:absolute;width:30px;height:30px;border-radius:50%;background:#f7f4ff;}
.nova-usage-ring{position:relative;}
.nova-usage-ring i{position:relative;z-index:1;color:var(--primary);font-size:0.76rem;}
.nova-usage-orbit>span:last-child{display:flex;flex-direction:column;}
.nova-usage-orbit small{color:var(--text-muted);font-size:0.58rem;font-weight:800;letter-spacing:0.08em;text-transform:uppercase;}
.nova-usage-orbit strong{font-size:0.8rem;}
.nova-launch-deck{
    position:relative;
    display:grid;
    grid-template-columns:180px minmax(0,1fr);
    gap:0 30px;
    padding:25px 28px 22px;
    border:1px solid rgba(111,95,228,0.15);
    border-radius:24px;
    background:linear-gradient(125deg,rgba(247,244,255,0.88),rgba(255,250,247,0.82));
    box-shadow:0 18px 46px rgba(56,41,119,0.1);
}
.nova-identity{position:relative;display:flex;align-items:center;justify-content:center;min-height:150px;}
.nova-identity-halo{position:absolute;width:130px;height:130px;border:1px solid rgba(111,95,228,0.14);border-radius:50%;background:radial-gradient(circle,rgba(111,95,228,0.13),rgba(244,130,92,0.04) 55%,transparent 72%);}
.nova-identity-halo::before,.nova-identity-halo::after{content:"";position:absolute;border-radius:50%;border:1px dashed rgba(111,95,228,0.12);}
.nova-identity-halo::before{inset:-12px;}
.nova-identity-halo::after{inset:17px;}
.nova-identity img{position:relative;width:108px;height:108px;filter:drop-shadow(0 14px 24px rgba(111,95,228,0.24));}
.nova-online{position:absolute;bottom:0;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border:1px solid rgba(16,185,129,0.16);border-radius:999px;background:rgba(248,255,252,0.9);color:#17815c;font-size:0.62rem;font-weight:800;letter-spacing:0.05em;text-transform:uppercase;}
.nova-online i{font-size:0.43rem;}
.nova-brief{display:flex;flex-direction:column;justify-content:center;padding:8px 0;}
.nova-brief-eyebrow{color:var(--primary);font-size:0.68rem;font-weight:800;letter-spacing:0.14em;text-transform:uppercase;}
.nova-brief h2{display:block;margin:4px 0 7px;font-family:var(--font-display);font-size:1.75rem;line-height:1.08;}
.nova-brief p{max-width:660px;margin:0;color:var(--text-muted);font-size:0.9rem;line-height:1.55;}
.nova-capabilities{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;}
.nova-capabilities span{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border:1px solid rgba(111,95,228,0.1);border-radius:8px;background:rgba(255,255,255,0.45);color:var(--text-muted);font-size:0.68rem;font-weight:700;}
.nova-capabilities i{color:var(--primary);}
.nova-transmission{grid-column:1/-1;margin-top:20px;padding-top:16px;border-top:1px solid rgba(111,95,228,0.1);}
.nova-resume-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:13px;padding:12px 14px;border:1px solid rgba(111,95,228,0.13);border-radius:15px;background:rgba(255,255,255,0.5);}
.nova-resume-card.is-empty{grid-template-columns:auto minmax(0,1fr);opacity:0.78;}
.nova-resume-icon{display:grid;place-items:center;width:40px;height:40px;border:1px solid rgba(111,95,228,0.12);border-radius:11px;background:rgba(111,95,228,0.06);color:var(--primary);}
.nova-resume-card>span:nth-child(2),.nova-resume-copy{display:flex;flex-direction:column;min-width:0;}
.nova-resume-card small{color:var(--primary);font-size:0.61rem;font-weight:800;letter-spacing:0.08em;text-transform:uppercase;}
.nova-resume-card strong{font-size:0.9rem;}
.nova-resume-card>span:nth-child(2)>span,.nova-resume-copy>span{color:var(--text-muted);font-size:0.7rem;}
.nova-resume-btn{min-width:166px;justify-content:center;padding:9px 14px;font-size:0.82rem;}
.nova-mission-config{position:relative;margin-top:16px;padding:21px 23px;border:1px solid rgba(111,95,228,0.14);border-radius:24px;background:rgba(255,255,255,0.6);box-shadow:0 16px 40px rgba(56,41,119,0.07);}
.nova-mission-config>header{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:14px;}
.nova-mission-config>header>span:first-child{display:flex;flex-direction:column;}
.nova-mission-config>header strong{font-family:var(--font-display);font-size:1.16rem;}
.nova-selected-summary{display:flex;align-items:center;gap:7px;color:var(--text-muted);font-size:0.73rem;font-weight:700;}
.nova-selected-summary i{color:var(--primary);}
.nova-scenario-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.nova-scenario{position:relative;display:flex;align-items:center;gap:9px;min-width:0;padding:10px 11px;border:1px solid rgba(111,95,228,0.1);border-radius:12px;background:rgba(255,255,255,0.42);color:var(--text-color);font:inherit;text-align:left;cursor:pointer;}
.nova-scenario:hover{border-color:rgba(111,95,228,0.24);background:rgba(111,95,228,0.04);}
.nova-scenario.is-active{border-color:rgba(111,95,228,0.3);background:rgba(111,95,228,0.08);box-shadow:inset 3px 0 0 var(--primary);}
.nova-scenario>i:first-child{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border-radius:8px;background:rgba(111,95,228,0.07);color:var(--primary);font-size:0.75rem;}
.nova-scenario>span{display:flex;flex-direction:column;min-width:0;}
.nova-scenario strong{overflow:hidden;font-size:0.76rem;text-overflow:ellipsis;white-space:nowrap;}
.nova-scenario small{overflow:hidden;color:var(--text-muted);font-size:0.58rem;text-overflow:ellipsis;white-space:nowrap;}
.nova-choice-check{margin-left:auto;color:transparent;font-size:0.68rem;}
.nova-scenario.is-active .nova-choice-check{color:var(--primary);}
.nova-level-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px;}
.nova-level{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:0 8px;padding:9px 11px;border:1px solid rgba(111,95,228,0.1);border-radius:12px;background:rgba(255,255,255,0.42);color:var(--text-color);font:inherit;text-align:left;cursor:pointer;}
.nova-level:hover{border-color:rgba(111,95,228,0.24);}
.nova-level.is-active{border-color:rgba(111,95,228,0.3);background:rgba(111,95,228,0.08);box-shadow:inset 3px 0 0 var(--primary);}
.nova-level strong{grid-row:1/3;display:grid;place-items:center;width:33px;height:33px;border-radius:9px;background:rgba(111,95,228,0.07);color:var(--primary);font-size:0.76rem;}
.nova-level span{font-size:0.73rem;font-weight:800;}
.nova-level small{color:var(--text-muted);font-size:0.58rem;}
.nova-launch-actions{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:14px;padding-top:13px;border-top:1px solid rgba(111,95,228,0.09);}
.nova-launch-actions>span{color:var(--text-muted);font-size:0.69rem;}
.nova-launch-actions>span i{margin-right:5px;color:var(--primary);}
.nova-start-btn{min-width:205px;justify-content:center;}
.nova-launch-skeleton{display:flex;flex-direction:column;gap:14px;}
.nova-launch-skeleton span{display:block;border:1px solid rgba(111,95,228,0.1);border-radius:22px;background:linear-gradient(100deg,rgba(111,95,228,0.06) 30%,rgba(139,125,240,0.14) 50%,rgba(111,95,228,0.06) 70%);background-size:220% 100%;animation:chat-launch-sheen 1.2s ease-in-out infinite;}
.nova-launch-skeleton-head{width:48%;height:56px;}
.nova-launch-skeleton-deck{height:245px;}
.nova-launch-skeleton-grid{height:260px;}
@keyframes chat-launch-sheen{0%{background-position:200% 0;}100%{background-position:-100% 0;}}
.nova-dialog{position:fixed;inset:0;z-index:10020;display:grid;place-items:center;padding:18px;}
.nova-dialog.hidden{display:none;}
.nova-dialog-backdrop{position:absolute;inset:0;background:rgba(31,26,57,0.48);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);}
.nova-dialog-card{position:relative;width:min(720px,100%);max-height:min(760px,calc(100dvh - 36px));overflow:auto;padding:22px;border:1px solid rgba(111,95,228,0.17);border-radius:22px;background:linear-gradient(145deg,rgba(252,250,255,0.98),rgba(255,250,247,0.97));box-shadow:0 30px 80px rgba(28,22,60,0.3);animation:chat-dialog-in 0.2s ease;}
.nova-dialog-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:15px;}
body.chat-immersive .nova-dialog-card>header{display:flex !important;}
.nova-dialog-card h2{display:block;margin:2px 0 0;font-size:1.35rem;}
.nova-dialog-card .chat-icon-btn{width:38px;height:38px;}
.nova-dialog-recap{display:flex;align-items:center;gap:11px;padding:11px 12px;border:1px solid rgba(111,95,228,0.11);border-radius:13px;background:rgba(255,255,255,0.55);}
.nova-dialog-recap-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:rgba(111,95,228,0.07);color:var(--primary);}
.nova-dialog-recap>span:last-child{display:flex;flex-direction:column;}
.nova-dialog-recap small{color:var(--primary);font-size:0.59rem;font-weight:800;text-transform:uppercase;}
.nova-dialog-recap strong{font-size:0.82rem;}
.nova-dialog-recap>span:last-child>span{color:var(--text-muted);font-size:0.67rem;}
.nova-harvest-btn{display:inline-flex;align-items:center;gap:6px;margin:9px 0 0;padding:6px 9px;border:1px solid rgba(111,95,228,0.13);border-radius:8px;background:rgba(255,255,255,0.55);color:var(--primary);font:inherit;font-size:0.68rem;font-weight:800;cursor:pointer;}
.nova-harvest-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:8px;}
.nova-harvest-word{display:flex;align-items:center;gap:8px;padding:7px 9px;border:1px solid rgba(111,95,228,0.1);border-radius:9px;background:rgba(255,255,255,0.5);}
.nova-harvest-word>span{display:flex;flex:1;flex-direction:column;min-width:0;}
.nova-harvest-word strong{font-size:0.74rem;}
.nova-harvest-word small{overflow:hidden;color:var(--text-muted);font-size:0.62rem;text-overflow:ellipsis;white-space:nowrap;}
.nova-harvest-word button{display:grid;place-items:center;width:28px;height:28px;border:1px solid rgba(111,95,228,0.12);border-radius:8px;background:transparent;color:var(--primary);cursor:pointer;}
.nova-harvest-added{color:var(--success);}
.nova-harvest-missed{color:var(--text-muted);}
.nova-dialog-section{margin-top:15px;}
.nova-dialog-section>strong{display:block;margin-bottom:7px;font-size:0.78rem;}
.nova-scenario-grid.is-dialog{grid-template-columns:repeat(2,minmax(0,1fr));}
.nova-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;margin-top:18px;padding-top:14px;border-top:1px solid rgba(111,95,228,0.1);}
body.nova-dialog-open{overflow:hidden;}
@keyframes chat-dialog-in{from{opacity:0;transform:translateY(8px) scale(0.98);}to{opacity:1;transform:translateY(0) scale(1);}}
.chat-session-context{display:inline-flex;align-items:center;gap:6px;margin-top:3px;color:var(--primary);font-size:0.68rem;font-weight:800;}
.chat-session-context span{color:var(--text-muted);}
body.chat-immersive .chat-page{max-width:920px;}

@media(max-width:900px){
    .nova-launch-deck{grid-template-columns:145px minmax(0,1fr);}
    .nova-identity img{width:92px;height:92px;}
    .nova-identity-halo{width:112px;height:112px;}
    .nova-scenario-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:640px){
    .chat-page{padding:0 14px;margin-bottom:46px;}
    .chat-landing{padding:0;}
    .nova-command-head{grid-template-columns:auto minmax(0,1fr);gap:11px;margin:0 0 14px;}
    .nova-command-icon{width:44px;height:44px;border-radius:13px;font-size:1.1rem;}
    .nova-command-copy h1{font-size:1.5rem;}
    .nova-command-copy>span{font-size:0.73rem;}
    .nova-usage-orbit{grid-column:1/-1;justify-self:stretch;padding:7px 10px;}
    .nova-usage-ring{width:34px;height:34px;}
    .nova-usage-ring::before{width:27px;height:27px;}
    .nova-launch-deck{grid-template-columns:78px minmax(0,1fr);gap:0 12px;padding:18px 15px 15px;border-radius:20px;}
    .nova-identity{min-height:105px;}
    .nova-identity img{width:68px;height:68px;}
    .nova-identity-halo{width:80px;height:80px;}
    .nova-online{bottom:-2px;white-space:nowrap;font-size:0.48rem;}
    .nova-brief{padding:0;}
    .nova-brief h2{font-size:1.2rem;}
    .nova-brief p{display:-webkit-box;overflow:hidden;font-size:0.72rem;-webkit-box-orient:vertical;-webkit-line-clamp:3;}
    .nova-brief-eyebrow{font-size:0.56rem;}
    .nova-capabilities{display:none;}
    .nova-transmission{margin-top:15px;padding-top:13px;}
    .nova-resume-card{grid-template-columns:auto minmax(0,1fr);gap:9px;padding:10px;}
    .nova-resume-btn{grid-column:1/-1;min-width:0;width:100%;}
    .nova-resume-icon{width:35px;height:35px;}
    .nova-mission-config{padding:17px 13px;border-radius:20px;}
    .nova-mission-config>header{align-items:flex-start;flex-direction:column;gap:4px;margin-bottom:11px;}
    .nova-selected-summary{max-width:100%;justify-content:flex-start;text-align:left;}
    .nova-scenario-grid{grid-template-columns:1fr 1fr;gap:6px;}
    .nova-scenario{gap:7px;padding:9px 8px;}
    .nova-scenario>i:first-child{width:25px;height:25px;flex-basis:25px;}
    .nova-scenario small{display:none;}
    .nova-level-row{display:flex;overflow-x:auto;padding-bottom:4px;scrollbar-width:none;}
    .nova-level-row::-webkit-scrollbar{display:none;}
    .nova-level{min-width:132px;flex:0 0 132px;}
    .nova-level small{display:none;}
    .nova-launch-actions{align-items:stretch;flex-direction:column;}
    .nova-start-btn{width:100%;min-width:0;}
    .nova-dialog{padding:10px;}
    .nova-dialog-card{max-height:calc(100dvh - 20px);padding:17px 13px;border-radius:18px;}
    .nova-scenario-grid.is-dialog{grid-template-columns:1fr 1fr;}
    .nova-harvest-results{grid-template-columns:1fr;}
    .nova-dialog-actions{align-items:stretch;flex-direction:column-reverse;}
    .nova-dialog-actions>*{justify-content:center;width:100%;}
    .nova-launch-skeleton-head{width:75%;}
    .nova-launch-skeleton-deck{height:260px;}
    .nova-launch-skeleton-grid{height:390px;}
    .chat-quota-panel{width:min(260px,calc(100vw - 32px));}
    .chat-msg{max-width:82%;}
    .chat-thread{max-height:none;min-height:260px;}
    .chat-upsell-btn{margin-left:0;}
    /* Immersive on phones — the head condenses to ONE compact row (avatar · "Nova" with the
       "Practice with" span hidden · usage pill · ⋯ menu holding the three collapsed chips) and
       every spare pixel goes to the thread (wordy sub-line + hint dropped, paddings/avatar
       shrunk). The flex chain above already makes the thread the sole scroll area. */
    /* font-size needs !important to beat session.css's global ≤768px h1{2rem !important}; the 4px
       bottom margin (which offsets the sub-line on desktop) would skew the vertical centring here. */
    .chat-title{font-size:1.4rem !important;white-space:nowrap;margin:0;}
    .chat-title-long{display:none;}
    .chat-head{flex-wrap:nowrap;gap:10px;}
    .chat-head-actions{gap:8px;}
    .chat-head-menu{display:block;}
    .chat-head-actions .chat-reset,.chat-head-actions .chat-voice-toggle,.chat-head-actions .chat-exit{display:none;}
    body.chat-immersive .chat-page{padding:8px 12px 12px;}
    body.chat-immersive .chat-head{margin-bottom:8px;}
    body.chat-immersive .chat-head-text .chat-sub{display:none;}
    body.chat-immersive .chat-session-context{margin-top:1px;font-size:0.59rem;}
    body.chat-immersive .chat-nova-avatar{width:40px;height:40px;}
    body.chat-immersive .chat-card{padding:12px 14px 12px;}
    body.chat-immersive .chat-thread{min-height:0;padding:14px 4px;}
    body.chat-immersive .chat-below{margin-top:6px;}
    body.chat-immersive .chat-hint{display:none;}
}
/* Second iOS caret-misplacement guard: backdrop-filter on the input itself also displaces the
   caret in WebKit. The field is 85% opaque white — on touch devices the blur is imperceptible. */
@media(pointer:coarse){
    .chat-input{backdrop-filter:none;-webkit-backdrop-filter:none;}
}
@media(prefers-reduced-motion:reduce){
    .chat-landing,.nova-launch-skeleton span,.nova-dialog-card{animation:none;}
}
