/* Nova Open Chat (owner-approved designs, 2026-10-18; kit Investor_Hive_Nova_Open_Chat_Developer_Kit).
   Compact = the docked panel (.na-panel); wide = the fullscreen view (.ncb-modal). Loaded after nova-assistant.css.
   NovaChat.razor's own <style> block renders later in the page, so the wide rules use three-class selectors to win.
   Phones never open the wide view: Expand is hidden at 768px and below (owner, 2026-10-18). */

:root {
    --nv-gold-face:
        linear-gradient(118deg, rgba(255, 255, 213, .54) 0%, rgba(255, 245, 167, .08) 30%, rgba(206, 145, 17, .12) 75%, rgba(255, 221, 113, .3) 100%),
        linear-gradient(180deg, #fff6a2 0%, #ffe376 15%, #efbd46 66%, #e6ac2e 90%, #f8d979 100%);
    --nv-gold-shadow: inset 0 2px 3px #fffbc9, inset 0 -3px 3px #bb7e19, 0 0 2px #fffce0, 0 0 14px #efa92c66, 0 4px 10px #000a;
    --nv-text: #f2f1ff;
    --nv-muted: #b8c5ee;
    --nv-border: #314895;
    --nv-violet: #884ef3;
    --nv-purple: #211050;
    --nv-reading: #0c0f2e;
    --nv-gold: #ffda58;
    --nv-focus: #92c4ff;
}

/* Hidden outside the views that use them. */
.ncb-ai-orb,
.ncb-head-orb,
.ncb-hive-mark,
.ncb-art { display: none; }

/* NovaChat's own style block shows every ".ncb-icon-wrap img" (0,1,1); this keeps the orb out of the inline bar. */
.ncb-icon-wrap .ncb-head-orb { display: none; }

/* ═════════════════ Compact: the docked panel ═════════════════ */
.na-panel {
    background: linear-gradient(180deg, #061128 0%, #020b1c 100%);
    border-left: 1px solid var(--nv-border);
    font-family: 'DM Sans', system-ui, sans-serif;
}

.na-panel header {
    position: relative;
    min-height: 96px;
    padding: 16px 16px 14px 18px;
    border-bottom: 0;
    background:
        linear-gradient(90deg, #020b1ced 0%, #020b1cc9 48%, #020b1c22 85%),
        url('../images/nova/compact-header-horizon.webp') right top / cover no-repeat;
}

.na-panel header .na-orb--nova {
    width: 62px;
    height: 62px;
    border: 0;
    background: none;
    overflow: visible;
}

.na-panel header .na-orb--nova img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }

.na-panel header .na-who { gap: 14px; }

.na-panel header .na-who b {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--nv-text);
}

.na-panel header .na-who .na-byline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 13px;
    color: #d6dcf5;
}

.na-panel header .na-who .na-byline img { width: 16px; height: auto; }
.na-panel header .na-who .na-byline strong { color: #fff; font-weight: 700; }

.na-panel .na-icon-btn {
    width: 40px;
    height: 40px;
    border: 1.5px solid #e3b651;
    border-radius: 10px;
    background: rgba(2, 11, 28, .6);
    color: #ffe7a3;
}

.na-panel .na-icon-btn:hover { border-color: #ffe7a3; color: #fff; }
.na-panel .na-icon-btn:focus-visible { outline: 2px solid var(--nv-focus); outline-offset: 2px; }

/* The luminous gold context bar. */
.na-context {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 12px;
    padding: 9px 14px 9px 10px;
    border: 1.5px solid #fff1a2;
    border-radius: 13px;
    background: var(--nv-gold-face);
    box-shadow: var(--nv-gold-shadow);
    color: #120d02;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
}

.na-context-tile { flex: none; width: 42px; height: 41px; border-radius: 9px; }
.na-context span { min-width: 0; overflow-wrap: anywhere; }

.na-panel .na-topics { padding: 12px 14px 0; }
.na-panel .na-topics button { border-color: var(--nv-border); color: #d6dcf5; }
.na-panel .na-topics button.active { background: var(--nv-purple); border-color: var(--nv-violet); color: #fff; }

.na-panel .na-body {
    margin: 10px 12px 0;
    padding: 14px 12px;
    border: 1px solid var(--nv-border);
    border-radius: 14px;
    background: #050a20;
}

.na-panel .na-suggest button { background: var(--nv-reading); border-color: var(--nv-border); }
.na-panel .na-suggest button:hover { border-color: var(--nv-violet); }

/* Conversation (shared bubble markup; the compact panel shows no inline orb and gold section labels). */
.na-panel .ncb-messages.ncb-messages,
.ncb-modal-backdrop .ncb-modal--oc .ncb-messages {
    padding: 2px;
    border: 0;
    background: transparent;
    gap: 14px;
}

.na-panel .ncb-bubble-row .ncb-bubble,
.ncb-modal-backdrop .ncb-modal--oc .ncb-bubble {
    max-width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    font-family: 'DM Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #ecebff;
    background: var(--nv-reading);
    border: 1px solid #5b48d6;
}

.na-panel .ncb-bubble-row.user .ncb-bubble,
.ncb-modal-backdrop .ncb-modal--oc .ncb-bubble-row.user .ncb-bubble {
    max-width: 82%;
    padding: 12px 16px;
    background: var(--nv-purple);
    border-color: var(--nv-violet);
    color: var(--nv-text);
}

.na-panel .ncb-bubble.ai strong,
.na-panel .ncb-bubble.ai b { color: var(--nv-gold); }

.na-panel .ncb-bubble.ai li::marker { color: var(--nv-gold); }

/* Composer: gold-ringed mic, rounded input, sculpted gold Ask. */
.na-panel footer { border-top: 0; padding: 12px 12px 14px; }

.na-panel .na-input-row,
.ncb-modal-backdrop .ncb-modal--oc .ncb-input-row {
    gap: 10px;
    padding: 6px 6px 6px 7px;
    border: 1px solid var(--nv-border);
    border-radius: 999px;
    background: #050b1f;
}

.na-panel .na-mic,
.ncb-modal-backdrop .ncb-modal--oc .ncb-icon-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    border: 2px solid var(--nv-gold);
    background: radial-gradient(circle at 50% 35%, #2a2008, #0b0904 70%);
    color: var(--nv-gold);
    box-shadow: 0 0 10px #efa92c44;
}

/* Recording stays obvious (not only the pulse, which reduced-motion removes). */
.na-panel .na-mic.recording,
.ncb-modal-backdrop .ncb-modal--oc .ncb-icon-btn.is-recording {
    border-color: #ff8f8f;
    background: radial-gradient(circle at 50% 35%, #7a1c1c, #3a0b0b 70%);
    color: #ffd9d9;
}

.na-panel .na-mic svg,
.ncb-modal-backdrop .ncb-modal--oc .ncb-icon-btn svg { width: 20px; height: 20px; }

.na-panel .na-input-row input,
.ncb-modal-backdrop .ncb-modal--oc .ncb-input {
    font-family: 'DM Sans', Arial, sans-serif;
    font-size: 16px;
    color: var(--nv-text);
    background: transparent;
    border: 0;
}

.na-panel .na-send,
.ncb-modal-backdrop .ncb-modal--oc .ncb-send {
    min-height: 46px;
    padding: 10px 24px;
    border: 1.5px solid #ffeba2;
    border-radius: 999px;
    background: var(--nv-gold-face);
    box-shadow: var(--nv-gold-shadow);
    color: #120d02;
    font-family: 'DM Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.na-panel .na-send:hover,
.ncb-modal-backdrop .ncb-modal--oc .ncb-send:hover:not([aria-disabled="true"]) { filter: brightness(1.05); background: var(--nv-gold-face); }

.na-panel .na-send:focus-visible,
.na-panel .na-mic:focus-visible,
.ncb-modal-backdrop .ncb-modal--oc .ncb-send:focus-visible,
.ncb-modal-backdrop .ncb-modal--oc .ncb-icon-btn:focus-visible { outline: 2px solid var(--nv-focus); outline-offset: 3px; }

/* Compact: the instruction sits above the checkbox. */
.na-panel .na-footer-row { flex-direction: column; align-items: flex-start; gap: 8px; }
.na-panel .na-helper { font-size: 12.5px; color: var(--nv-muted); }
.na-panel .na-footer-row label { color: #e4e8fb; font-size: 14px; }
.na-panel .na-ai-disclaimer { color: #8f9cc4; }

/* ═════════════════ Wide: the fullscreen view ═════════════════ */
.ncb-modal-backdrop .ncb-modal--oc {
    width: min(1448px, 100%);
    height: min(940px, 100%);
    border: 1px solid var(--nv-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #061128 0%, #020b1c 100%);
    font-family: 'DM Sans', system-ui, sans-serif;
}

.ncb-modal-backdrop .ncb-modal--oc .ncb-modal-body { gap: 12px; }

.ncb-modal-backdrop .ncb-modal--oc .ncb-head { padding: 2px 4px 10px; border-bottom: 1px solid #16224d; gap: 14px !important; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-icon,
.ncb-modal-backdrop .ncb-modal--oc .ncb-icon-wrap { width: 62px; height: 62px; min-width: 62px; background: none; border: 0; box-shadow: none; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-icon-wrap > :not(.ncb-head-orb) { display: none; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-head-orb { display: block; width: 62px; height: 62px; object-fit: contain; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-head-title { font-size: 28px !important; color: var(--nv-text) !important; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-title-row { gap: 12px; align-items: center; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-title-text { font-family: 'Outfit', system-ui, sans-serif; font-weight: 600; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-powered { font-size: 13px; padding: 5px 12px; border-color: #3d5bd9; background: #0b1440; color: #e9ecff; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-hive-mark { display: inline-block; width: 28px; height: auto; vertical-align: middle; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-head-sub { font-size: 15px !important; color: var(--nv-muted) !important; margin-top: 2px; }

.ncb-modal-backdrop .ncb-modal--oc [data-nova-collapse] {
    padding: 9px 18px;
    border: 1.5px solid #e3b651;
    border-radius: 12px;
    background: transparent;
    color: #ffe7a3;
    font-size: 15px;
    font-weight: 600;
}

.ncb-modal-backdrop .ncb-modal--oc [data-nova-collapse]:hover { background: rgba(227, 182, 81, .1); color: #fff2c4; }
.ncb-modal-backdrop .ncb-modal--oc [data-nova-collapse] svg { width: 14px; height: 14px; }

.ncb-modal-backdrop .ncb-modal--oc .ncb-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }

.ncb-modal-backdrop .ncb-modal--oc .ncb-chat {
    min-width: 0;
    padding: 0 12px 12px;
    border: 1px solid #2b3d82;
    border-radius: 14px;
    background: #081033;
}

/* The gold context bar ("Ask Nova about …") with the Nova orb tile. */
.ncb-modal-backdrop .ncb-modal--oc .ncb-chat-header {
    margin: -1px -13px 0;
    padding: 9px 16px 9px 10px;
    gap: 14px;
    border: 1.5px solid #fff1a2;
    border-radius: 14px 14px 11px 11px;
    background: var(--nv-gold-face);
    box-shadow: var(--nv-gold-shadow);
    color: #120d02;
}

.ncb-modal-backdrop .ncb-modal--oc .ncb-chat-header span {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 23px !important;
    font-weight: 700 !important;
    margin-top: 0 !important;
}

.ncb-modal-backdrop .ncb-modal--oc .ncb-chat-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    background: linear-gradient(145deg, #201802, #0c0900 55%, #1b1200);
}

.ncb-modal-backdrop .ncb-modal--oc .ncb-chat-avatar img { width: 34px !important; height: 34px !important; }

/* Wide replies carry the Nova orb at their left. */
.ncb-modal-backdrop .ncb-modal--oc .ncb-bubble-row.ai { gap: 10px; align-items: flex-start; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-ai-orb { display: block; flex: none; width: 40px; height: 40px; margin-top: 4px; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-ai-orb img { width: 100%; height: 100%; object-fit: contain; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-bubble-row.ai .ncb-bubble { max-width: 92%; font-size: 16px; line-height: 1.55; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-bubble-row.user .ncb-bubble { max-width: 54%; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-bubble.ai strong { color: #fff; }
.ncb-modal-backdrop .ncb-modal--oc .ncb-bubble.ai li::marker { color: #a27cff; }

/* Right pane: suggested topics when the page has them, the Hive artwork, then "Need more room?". */
.ncb-modal-backdrop .ncb-modal--oc .ncb-pills-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 12px;
    border: 1px solid #2b3d82;
    border-radius: 14px;
    background: #040a20;
    overflow-y: auto;
}

.ncb-modal-backdrop .ncb-modal--oc .ncb-art {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-height: 160px;
    object-fit: contain;
    object-position: center top;
}

/* The expanded view is already the room it asks for (owner, 2026-10-18). */
.ncb-modal-backdrop .ncb-modal--oc .ncb-need-room { display: none; }

/* ═════════════════ Narrow screens ═════════════════ */
@media (max-width: 1100px) {
    .ncb-modal-backdrop .ncb-modal--oc .ncb-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
    .ncb-modal-backdrop .ncb-modal--oc .ncb-chat-header span { font-size: 20px !important; }
}

/* Phones and small tablets: Nova stays in the full-width panel; the wide view is not offered. */
@media (max-width: 768px) {
    /* NovaChat's own Expand buttons only (the admin NovaCommandBar keeps its own). */
    .na-panel .na-expand,
    .nova-command-bar .ncb-expand-cta { display: none !important; }

    .na-panel { width: 100vw; }
    .na-panel header { min-height: 84px; padding: 14px 12px 12px 14px; }
    .na-panel header .na-orb--nova { width: 52px; height: 52px; }
    .na-panel header .na-who b { font-size: 23px; }
    .na-context { font-size: 17px; margin: 0 10px; }
    .na-panel .na-body { margin: 10px 10px 0; padding: 12px 10px; }
    .na-panel footer { padding: 10px 10px 12px; }

    /* If the wide view is already open when the screen narrows (or Button mode opens it), it becomes one reading
       column, full bleed; suggested topics stay, stacked under the chat, while the artwork and the Expand hint go. */
    .ncb-modal-backdrop .ncb-modal--oc { border-radius: 0; }
    .ncb-modal-backdrop .ncb-modal--oc .ncb-grid { grid-template-columns: minmax(0, 1fr); }
    .ncb-modal-backdrop .ncb-modal--oc .ncb-art,
    .ncb-modal-backdrop .ncb-modal--oc .ncb-need-room { display: none; }
    .ncb-modal-backdrop .ncb-modal--oc .ncb-head-title { font-size: 22px !important; }
    .ncb-modal-backdrop .ncb-modal--oc .ncb-hive-mark { display: none; }
}

/* Landscape phones: give the conversation room by trimming the header, the context tile and the mic instructions. */
@media (max-height: 500px) {
    .na-panel header { min-height: 0; padding: 8px 12px; }
    .na-panel header .na-orb--nova { width: 40px; height: 40px; }
    .na-panel header .na-who b { font-size: 19px; }
    .na-context { padding: 6px 12px; font-size: 15px; }
    .na-context-tile,
    .na-panel .na-footer-row .na-helper { display: none; }   /* the instructions only; the mic error notice stays */
    .na-panel .na-body { margin-top: 6px; }
    .na-panel footer { padding-top: 6px; gap: 4px; }
}

@media (max-width: 480px) {
    .na-panel header .na-who b { font-size: 21px; }
    .na-panel header .na-who .na-byline { font-size: 12px; }
    .na-context { font-size: 16px; }
    .na-panel .ncb-bubble-row .ncb-bubble { font-size: 14.5px; padding: 12px 13px; }
    .na-panel .na-mic { width: 44px; height: 44px; min-width: 44px; }
    .na-panel .na-send { min-height: 44px; padding: 9px 18px; }
}

@media (forced-colors: active) {
    .na-context,
    .na-panel .na-send,
    .ncb-modal-backdrop .ncb-modal--oc .ncb-send,
    .ncb-modal-backdrop .ncb-modal--oc .ncb-chat-header { background: Canvas; color: CanvasText; border-color: CanvasText; box-shadow: none; }
}
