/* ============================================================================
   ORACLE PERSONAL — CORPORATE PALETTE GUARD

   This file loads after the legacy component bundles so old feature styles
   cannot reintroduce bright accent colors into Oracle Personal. Oracle Junior
   is intentionally excluded and retains its dedicated visual language.
   ============================================================================ */

body:not(.oracle-junior-mode) {
    --red: #ffffff;
    --red-bright: #f5f5f5;
    --red-light: #d4d4d4;
    --red-dark: #b8b8b8;
    --red-darker: #8a8a8a;
    --red-darkest: #666666;
    --red-glow: rgba(255, 255, 255, 0.12);
    --red-glow-intense: rgba(255, 255, 255, 0.18);
    --red-glow-subtle: rgba(255, 255, 255, 0.08);
    --accent-primary: #ffffff;
    --accent-primary-glow: rgba(255, 255, 255, 0.12);
    --cyan: #d4d4d4;
    --cyan-dark: #a3a3a3;
    --cyan-glow: rgba(255, 255, 255, 0.1);
    --gold: #d4d4d4;
    --gold-dark: #a3a3a3;
    --green: #d4d4d4;
    --purple: #d4d4d4;
    --orange: #d4d4d4;
    --pink: #d4d4d4;
    --indigo: #d4d4d4;
    --teal: #d4d4d4;
    --michael-color: #ffffff;
    --michael-glow: rgba(255, 255, 255, 0.1);
    --micheal-color: #ffffff;
    --micheal-glow: rgba(255, 255, 255, 0.1);
    --oracle-color: #ffffff;
    --oracle-glow: rgba(255, 255, 255, 0.1);
    --siren-color: #d4d4d4;
    --siren-glow: rgba(255, 255, 255, 0.1);
    --nemesis-color: #d4d4d4;
    --nemesis-glow: rgba(255, 255, 255, 0.1);
}

/* Michael reply time: quiet, local, and independent of the action row. */
body:not(.oracle-junior-mode) .message.ai .message-time {
    display: block !important;
    align-self: flex-start !important;
    margin-top: 8px !important;
    color: rgba(255, 255, 255, 0.38) !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.01em !important;
    text-align: left !important;
}

body:not(.oracle-junior-mode) .message.ai .message-time::before,
body:not(.oracle-junior-mode) .message.ai .message-time::after {
    content: none !important;
    display: none !important;
}

/* ========================================================================== */
/* Normal-chat code delivery                                                  */
/* ========================================================================== */

body:not(.oracle-junior-mode) .message.ai .streaming-artifact,
body:not(.oracle-junior-mode) .message.ai .live-streaming-artifact,
body:not(.oracle-junior-mode) .message.ai .code-block-container {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    color: #f5f5f7;
    background: #09090a;
    border: 1px solid #343437;
    border-radius: 16px;
    box-shadow: none;
    overflow: hidden;
    box-sizing: border-box;
}

/* Long responses arrive at the browser as a complete payload and are revealed
   progressively. Keep the live corporate card visible during that reveal so
   large code never falls back to raw Markdown or the retired side preview. */
body:not(.oracle-junior-mode) .message.ai .live-streaming-artifact {
    display: block !important;
    visibility: visible !important;
}

/* The retired split-screen artifact editor must never take over ordinary
   Oracle chat. Code now stays inline in the corporate Copy/Download card. */
body:not(.oracle-junior-mode) #artifactSidePanel {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* The cyan multi-file preview belonged to the retired Code Mode. A delayed
   response must not cover the stable inline Copy/Download code card. */
body:not(.oracle-junior-mode) .message.ai .code-preview-container {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body:not(.oracle-junior-mode) .chat-think-wrapper.artifact-active {
    display: block !important;
}

body:not(.oracle-junior-mode) .chat-think-wrapper.artifact-active .chat-container {
    width: 100% !important;
    max-width: 100% !important;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-header,
body:not(.oracle-junior-mode) .message.ai .live-artifact-header,
body:not(.oracle-junior-mode) .message.ai .code-block-header {
    min-height: 54px;
    padding: 10px 14px;
    color: #f5f5f7;
    background: #111112;
    border-bottom: 1px solid #2d2d30;
    box-sizing: border-box;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-icon,
body:not(.oracle-junior-mode) .message.ai .live-artifact-icon {
    width: 32px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    overflow: visible;
    color: #d1d1d6;
    background: #1c1c1e;
    border: 1px solid #343437;
    border-radius: 8px;
    font: 650 11px/1 "SFMono-Regular", "SF Mono", ui-monospace, Menlo, monospace;
    filter: grayscale(1);
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-label,
body:not(.oracle-junior-mode) .message.ai .live-artifact-title,
body:not(.oracle-junior-mode) .message.ai .code-lang {
    color: #ffffff;
    font: 650 13px/1.25 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;
    letter-spacing: -0.01em;
    text-transform: none;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-description,
body:not(.oracle-junior-mode) .message.ai .live-artifact-lang,
body:not(.oracle-junior-mode) .message.ai .streaming-artifact-file-badge,
body:not(.oracle-junior-mode) .message.ai .streaming-artifact-stats {
    color: #8e8e93;
}

body:not(.oracle-junior-mode) .message.ai .live-artifact-status,
body:not(.oracle-junior-mode) .message.ai .live-artifact-status span {
    color: #a3a3a3 !important;
    font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;
}

body:not(.oracle-junior-mode) .message.ai .live-artifact-spinner {
    border-color: #3a3a3c !important;
    border-top-color: #f5f5f7 !important;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-code,
body:not(.oracle-junior-mode) .message.ai .live-artifact-code,
body:not(.oracle-junior-mode) .message.ai .code-block {
    color: #f5f5f7;
    background: #050506 !important;
}

body:not(.oracle-junior-mode) .message.ai .streaming-code-content,
body:not(.oracle-junior-mode) .message.ai .live-artifact-content,
body:not(.oracle-junior-mode) .message.ai .code-block code {
    color: #e5e5ea;
    font-family: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 1.55;
    font-variant-ligatures: none;
}

body:not(.oracle-junior-mode) .message.ai .streaming-line-numbers,
body:not(.oracle-junior-mode) .message.ai .live-artifact-lines {
    color: #636366;
    background: #0a0a0b;
    border-color: #252527;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-footer,
body:not(.oracle-junior-mode) .message.ai .live-artifact-footer {
    min-height: 58px;
    padding: 8px 12px;
    background: #111112;
    border-color: #2d2d30;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-actions,
body:not(.oracle-junior-mode) .message.ai .code-block-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-btn,
body:not(.oracle-junior-mode) .message.ai .code-copy-btn,
body:not(.oracle-junior-mode) .message.ai .code-download-btn {
    min-width: 0;
    min-height: 40px;
    padding: 9px 12px;
    color: #f5f5f7;
    background: #1c1c1e;
    border: 1px solid #3a3a3d;
    border-radius: 10px;
    font: 600 12px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: none;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-btn:hover,
body:not(.oracle-junior-mode) .message.ai .code-copy-btn:hover,
body:not(.oracle-junior-mode) .message.ai .code-download-btn:hover {
    color: #111111;
    background: #ffffff;
    border-color: #ffffff;
}

body:not(.oracle-junior-mode) .message.ai .streaming-artifact-btn svg {
    width: 15px;
    height: 15px;
}

@media (max-width: 768px) {
    body:not(.oracle-junior-mode) .message.ai .streaming-artifact,
    body:not(.oracle-junior-mode) .message.ai .live-streaming-artifact,
    body:not(.oracle-junior-mode) .message.ai .code-block-container {
        margin: 16px 0;
        border-radius: 14px;
    }

    body:not(.oracle-junior-mode) .message.ai .streaming-artifact-footer {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    body:not(.oracle-junior-mode) .message.ai .streaming-artifact-actions {
        margin-left: auto;
    }

    body:not(.oracle-junior-mode) .message.ai .streaming-artifact-stats {
        display: none;
    }

    body:not(.oracle-junior-mode) .message.ai .streaming-artifact-btn,
    body:not(.oracle-junior-mode) .message.ai .code-copy-btn,
    body:not(.oracle-junior-mode) .message.ai .code-download-btn {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 12px;
    }

    body:not(.oracle-junior-mode) .message.ai .streaming-code-content,
    body:not(.oracle-junior-mode) .message.ai .live-artifact-content,
    body:not(.oracle-junior-mode) .message.ai .code-block code {
        font-size: 13px;
    }
}

/* ===== Composer dictation control ===== */
body:not(.oracle-junior-mode) #micBtn,
body:not(.oracle-junior-mode) #mobileMicBtn {
    position: relative;
    color: #d1d1d6 !important;
    background: #1c1c1e !important;
    border: 1px solid #3a3a3c !important;
    border-radius: 50% !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) #micBtn svg,
body:not(.oracle-junior-mode) #mobileMicBtn svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
}

body:not(.oracle-junior-mode) #micBtn.active,
body:not(.oracle-junior-mode) #mobileMicBtn.active {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) #micBtn.active::after,
body:not(.oracle-junior-mode) #mobileMicBtn.active::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: inherit;
    pointer-events: none;
    animation: oracle-dictation-pulse 1.35s ease-out infinite;
}

@keyframes oracle-dictation-pulse {
    0% { opacity: 0.8; transform: scale(0.88); }
    75%, 100% { opacity: 0; transform: scale(1.16); }
}

@media (prefers-reduced-motion: reduce) {
    body:not(.oracle-junior-mode) #micBtn.active::after,
    body:not(.oracle-junior-mode) #mobileMicBtn.active::after {
        animation: none;
    }
}

@media (max-width: 768px) {
    body:not(.oracle-junior-mode) #mobileMicBtn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
    }

    /* Interim dictation text adds .has-text. Keep the active mic reachable so
       continuous recognition can always be stopped by the user. */
    body:not(.oracle-junior-mode) .input-buttons.has-text #mobileMicBtn.active {
        display: flex !important;
    }
}

/* ===== Oracle welcome typography ===== */
body:not(.oracle-junior-mode) .welcome-content {
    width: min(720px, 100%);
    padding: 28px 24px !important;
}

body:not(.oracle-junior-mode) .welcome-greeting {
    color: #f5f5f7 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif !important;
    font-size: clamp(28px, 4vw, 42px) !important;
    font-weight: 600 !important;
    line-height: 1.16 !important;
    letter-spacing: -0.04em !important;
    text-wrap: balance;
    margin: 0 auto 10px !important;
}

body:not(.oracle-junior-mode) .welcome-assistant-label {
    display: block;
    color: #8e8e93;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ===== Corporate document cards and exports ===== */
body:not(.oracle-junior-mode) .message.ai .message-content.has-pdf-doc {
    width: min(100%, 720px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

body:not(.oracle-junior-mode) .pdf-download-container {
    display: block !important;
    width: min(100%, 520px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 16px 0 4px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

body:not(.oracle-junior-mode) .oracle-doc-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 13px;
    color: #f5f5f7;
    background: #151516;
    border: 1px solid #343437;
    border-radius: 16px;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

body:not(.oracle-junior-mode) .oracle-doc-card:hover,
body:not(.oracle-junior-mode) .oracle-doc-card:focus-visible {
    background: #1c1c1e;
    border-color: #55555a;
    outline: none;
}

body:not(.oracle-junior-mode) .oracle-doc-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #f5f5f7;
    background: #242426;
    border: 1px solid #3a3a3d;
    border-radius: 11px;
}

body:not(.oracle-junior-mode) .oracle-doc-copy {
    min-width: 0;
}

body:not(.oracle-junior-mode) .oracle-doc-title {
    overflow: hidden;
    color: #ffffff;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.oracle-junior-mode) .oracle-doc-meta {
    margin-top: 3px;
    color: #8e8e93;
    font-size: 12px;
    line-height: 1.25;
}

body:not(.oracle-junior-mode) .oracle-doc-download,
body:not(.oracle-junior-mode) .download-response-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    color: #f5f5f7;
    background: #242426;
    border: 1px solid #3a3a3d;
    border-radius: 10px;
    font: 600 13px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    box-shadow: none;
    cursor: pointer;
}

body:not(.oracle-junior-mode) .download-response-btn {
    margin-top: 14px;
}

body:not(.oracle-junior-mode) .oracle-doc-download:hover,
body:not(.oracle-junior-mode) .download-response-btn:hover {
    color: #111111;
    background: #ffffff;
    border-color: #ffffff;
}

body:not(.oracle-junior-mode) .oracle-download-modal {
    position: fixed;
    inset: 0;
    z-index: 100100;
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.76);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-sizing: border-box;
}

body:not(.oracle-junior-mode) .oracle-download-sheet {
    width: min(100%, 440px);
    min-width: 0;
    padding: 22px;
    color: #f5f5f7;
    background: #111112;
    border: 1px solid #343437;
    border-radius: 22px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
    box-sizing: border-box;
}

body:not(.oracle-junior-mode) .oracle-download-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

body:not(.oracle-junior-mode) .oracle-download-kicker {
    margin: 0 0 4px;
    color: #8e8e93;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body:not(.oracle-junior-mode) .oracle-download-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.035em;
}

body:not(.oracle-junior-mode) .oracle-download-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    color: #f5f5f7;
    background: #242426;
    border: 1px solid #3a3a3d;
    border-radius: 50%;
}

body:not(.oracle-junior-mode) .oracle-download-label {
    display: block;
    margin: 0 0 8px;
    color: #a1a1a6;
    font-size: 13px;
    font-weight: 600;
}

body:not(.oracle-junior-mode) #downloadFilename {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0 0 16px;
    padding: 0 14px;
    color: #ffffff;
    background: #1c1c1e;
    border: 1px solid #3a3a3d;
    border-radius: 12px;
    font: 500 16px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
    outline: none;
    box-sizing: border-box;
}

body:not(.oracle-junior-mode) #downloadFilename:focus {
    border-color: #8e8e93;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

body:not(.oracle-junior-mode) .oracle-download-formats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body:not(.oracle-junior-mode) .oracle-download-formats button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    min-height: 54px;
    padding: 12px 14px;
    color: #f5f5f7;
    background: #1c1c1e;
    border: 1px solid #343437;
    border-radius: 13px;
    font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', sans-serif;
}

body:not(.oracle-junior-mode) .oracle-download-formats button:hover,
body:not(.oracle-junior-mode) .oracle-download-formats button:focus-visible {
    color: #111111;
    background: #ffffff;
    border-color: #ffffff;
    outline: none;
}

body:not(.oracle-junior-mode) .oracle-download-formats small {
    color: #8e8e93;
    font-size: 12px;
    font-weight: 600;
}

body:not(.oracle-junior-mode) .oracle-download-formats button:hover small,
body:not(.oracle-junior-mode) .oracle-download-formats button:focus-visible small {
    color: #55555a;
}

/* ===== Single-header iOS document preview ===== */
body:not(.oracle-junior-mode) .ios-save-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100200 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    color: #f5f5f7 !important;
    background: #0b0b0c !important;
    box-sizing: border-box !important;
}

body:not(.oracle-junior-mode) .ios-save-content {
    position: relative !important;
    z-index: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: #0b0b0c !important;
    box-sizing: border-box !important;
}

body:not(.oracle-junior-mode) .ios-save-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px !important;
    color: #f5f5f7 !important;
    background: rgba(17, 17, 18, 0.96) !important;
    border-bottom: 1px solid #303033 !important;
    box-sizing: border-box !important;
}

body:not(.oracle-junior-mode) .ios-save-heading {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

body:not(.oracle-junior-mode) .ios-save-kicker {
    margin-bottom: 2px;
    color: #8e8e93;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body:not(.oracle-junior-mode) .ios-save-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 650 !important;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.oracle-junior-mode) .ios-save-close {
    display: grid !important;
    place-items: center !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    color: #f5f5f7 !important;
    background: #242426 !important;
    border: 1px solid #3a3a3d !important;
    border-radius: 50% !important;
}

body:not(.oracle-junior-mode) .ios-save-body,
body:not(.oracle-junior-mode) #ios-pdf-canvas-container {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #18181a !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
}

body:not(.oracle-junior-mode) .ios-pdf-canvas {
    display: block !important;
    width: auto;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto 12px !important;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.34);
}

body:not(.oracle-junior-mode) .ios-pdf-more {
    padding: 12px 8px 18px;
    color: #a1a1a6;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

body:not(.oracle-junior-mode) .ios-pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 32px 20px;
    color: #f5f5f7;
    text-align: center;
}

body:not(.oracle-junior-mode) .ios-pdf-error strong {
    margin-top: 14px;
    font-size: 17px;
}

body:not(.oracle-junior-mode) .ios-pdf-error span {
    max-width: 280px;
    margin-top: 7px;
    color: #a1a1a6;
    font-size: 14px;
    line-height: 1.4;
}

body:not(.oracle-junior-mode) .ios-save-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(17, 17, 18, 0.98) !important;
    border-top: 1px solid #303033 !important;
    box-sizing: border-box !important;
}

body:not(.oracle-junior-mode) .ios-action-btn {
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 10px 12px !important;
    color: #f5f5f7 !important;
    background: #242426 !important;
    border: 1px solid #3a3a3d !important;
    border-radius: 13px !important;
    font-size: 14px !important;
    font-weight: 650 !important;
}

body:not(.oracle-junior-mode) .ios-share-btn {
    color: #111111 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .pdf-reopen-pill {
    position: fixed;
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 12px 9px 16px;
    color: #f5f5f7;
    background: #1c1c1e;
    border: 1px solid #3a3a3d;
    border-radius: 999px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.44);
    font-size: 14px;
    font-weight: 650;
    transform: translateX(-50%);
    animation: pdfPillSlideUp 220ms ease-out;
}

body:not(.oracle-junior-mode) .pdf-pill-dismiss {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    margin-left: 2px;
    color: #a1a1a6;
    font-size: 18px;
    line-height: 1;
}

@keyframes pdfPillSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 768px) {
    body:not(.oracle-junior-mode) .app-container:not(.has-messages) .welcome-overlay {
        /* Keep the complete greeting in the clear space above the centered
           composer. The composer height is measured at runtime because image
           previews and Dynamic Type can make it taller than its CSS minimum. */
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 56px) !important;
        right: 0 !important;
        bottom: calc(55dvh + var(--oracle-composer-half-height, 70px) + 18px) !important;
        left: 0 !important;
        width: auto !important;
        padding: 0 20px !important;
        transform: none !important;
        align-items: center !important;
    }

    body:not(.oracle-junior-mode) .welcome-content {
        width: min(100%, 520px);
        padding: 10px 22px !important;
    }

    body:not(.oracle-junior-mode) .welcome-greeting {
        font-size: clamp(25px, 7.2vw, 32px) !important;
    }

    body:not(.oracle-junior-mode) .oracle-doc-download {
        width: 42px;
        min-width: 42px;
        padding: 0;
    }

    body:not(.oracle-junior-mode) .oracle-doc-download span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    body:not(.oracle-junior-mode) .oracle-download-formats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) and (max-height: 720px) {
    body:not(.oracle-junior-mode) .app-container:not(.has-messages) .welcome-overlay {
        top: calc(env(safe-area-inset-top, 0px) + 44px) !important;
        bottom: calc(55dvh + var(--oracle-composer-half-height, 70px) + 12px) !important;
    }

    body:not(.oracle-junior-mode) .welcome-content {
        padding-block: 4px !important;
    }

    body:not(.oracle-junior-mode) .welcome-greeting {
        font-size: clamp(22px, 6.6vw, 27px) !important;
        margin-bottom: 6px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body:not(.oracle-junior-mode) .pdf-reopen-pill {
        animation: none !important;
    }
}

/* ===== Connector authorization handoff ===== */
body:not(.oracle-junior-mode) .connector-oauth-mark {
    color: #ffffff;
    background: #242426;
    border: 1px solid #3a3a3d;
    box-shadow: none;
}

body:not(.oracle-junior-mode) .connector-oauth-actions {
    background: #111112;
    border-top-color: #303033;
}

body:not(.oracle-junior-mode) .connector-oauth-copy {
    color: #f5f5f7;
    background: #1c1c1e;
    border-color: #3a3a3d;
}

/* ========================================================================
   SEARCH SOURCES + MEMORY / PROJECTS — FINAL CORPORATE SURFACES
   ======================================================================== */
body:not(.oracle-junior-mode) .mobile-entity-switcher {
    display: none !important;
}

body:not(.oracle-junior-mode) .oracle-source-section {
    width: 100%;
    margin: 0 0 26px;
    color: #f5f5f7;
}

body:not(.oracle-junior-mode) .oracle-source-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 11px;
    color: #f5f5f7;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

body:not(.oracle-junior-mode) .oracle-source-count {
    color: #8e8e93;
    font-size: 12px;
    font-weight: 600;
}

body:not(.oracle-junior-mode) .oracle-source-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 286px);
    gap: 12px;
    width: 100%;
    padding: 1px 1px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

body:not(.oracle-junior-mode) .oracle-source-rail::-webkit-scrollbar {
    display: none;
}

body:not(.oracle-junior-mode) .oracle-source-card {
    display: flex;
    min-width: 0;
    min-height: 212px;
    overflow: hidden;
    flex-direction: column;
    color: #ffffff !important;
    background: #121214 !important;
    border: 1px solid #303033 !important;
    border-radius: 18px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    scroll-snap-align: start;
    transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

body:not(.oracle-junior-mode) .oracle-source-card:hover {
    color: #ffffff !important;
    background: #18181a !important;
    border-color: #5a5a5f !important;
    transform: translateY(-1px);
}

body:not(.oracle-junior-mode) .oracle-source-visual {
    position: relative;
    display: grid;
    place-items: center;
    height: 104px;
    overflow: hidden;
    color: #0a0a0a;
    background: #f2f2f2;
    border-bottom: 1px solid #303033;
}

body:not(.oracle-junior-mode) .oracle-source-visual img {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body:not(.oracle-junior-mode) .oracle-source-monogram {
    position: relative;
    z-index: 1;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 38px;
    font-weight: 700;
}

body:not(.oracle-junior-mode) .oracle-source-card-body {
    display: flex;
    min-height: 106px;
    flex-direction: column;
    gap: 6px;
    padding: 14px 15px 15px;
}

body:not(.oracle-junior-mode) .oracle-source-domain {
    overflow: hidden;
    color: #a1a1a6;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.oracle-junior-mode) .oracle-source-title {
    display: -webkit-box;
    overflow: hidden;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.015em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

body:not(.oracle-junior-mode) .oracle-source-snippet {
    display: -webkit-box;
    overflow: hidden;
    color: #8e8e93;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body:not(.oracle-junior-mode) .oracle-photo-section .oracle-source-card {
    min-height: 262px;
}

body:not(.oracle-junior-mode) .oracle-photo-section .oracle-source-visual {
    height: 176px;
    background: #0d0d0f;
}

body:not(.oracle-junior-mode) .oracle-photo-section .oracle-source-card-body {
    min-height: 84px;
    padding-top: 12px;
}

body:not(.oracle-junior-mode) .oracle-photo-section .oracle-source-snippet {
    display: none;
}

body:not(.oracle-junior-mode) .memory-palace-overlay,
body:not(.oracle-junior-mode) .memory-palace-overlay.show {
    z-index: 2147483000 !important;
    color: #f5f5f7 !important;
    background: rgba(0, 0, 0, 0.96) !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-container {
    color: #f5f5f7 !important;
    background: #050506 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-sidebar {
    width: 244px !important;
    min-width: 244px !important;
    color: #f5f5f7 !important;
    background: #101011 !important;
    border-color: #2c2c2e !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-sidebar-brand {
    min-height: 72px;
    padding: 19px 20px !important;
    border-color: #2c2c2e !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-sidebar-title,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content-header h2,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card-title,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-title,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-sidebar-nav {
    gap: 4px !important;
    padding: 12px 10px !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-item {
    min-height: 46px !important;
    padding: 11px 12px !important;
    color: #b8b8bd !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-item:hover {
    color: #ffffff !important;
    background: #1c1c1e !important;
    border-color: #303033 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-item.active {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-item.active svg {
    stroke: #000000 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-count {
    color: #a1a1a6 !important;
    background: #272729 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-item.active .palace-nav-count {
    color: #ffffff !important;
    background: #1c1c1e !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-sidebar-bottom {
    border-color: #2c2c2e !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-main {
    min-width: 0;
    color: #f5f5f7 !important;
    background: #050506 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-close,
body:not(.oracle-junior-mode) .palace-mobile-tools > summary {
    color: #ffffff !important;
    background: #1c1c1e !important;
    border: 1px solid #3a3a3c !important;
    border-radius: 50% !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content-header {
    min-height: 88px;
    padding: 22px 76px 18px 28px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content-header h2 {
    margin: 0 !important;
    font-size: 27px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.035em !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-search-input,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-select {
    min-height: 46px !important;
    color: #ffffff !important;
    background: #171719 !important;
    border: 1px solid #343437 !important;
    border-radius: 13px !important;
    font-size: 15px !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-search-input::placeholder {
    color: #77777d !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-search-input:focus,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-select:focus {
    border-color: #737378 !important;
    outline: none !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-btn {
    min-height: 46px !important;
    padding: 11px 17px !important;
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #ffffff !important;
    border-radius: 13px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-btn.secondary {
    color: #f5f5f7 !important;
    background: #1c1c1e !important;
    border-color: #3a3a3c !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content-toolbar {
    padding: 12px 28px 0 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-grid,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-list,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-items-list,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-artifacts-grid {
    gap: 12px !important;
    padding: 20px 28px 32px !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-list-item,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item,
body:not(.oracle-junior-mode) .memory-palace-overlay .category-item,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-artifact-card {
    color: #f5f5f7 !important;
    background: #141416 !important;
    border: 1px solid #303033 !important;
    border-radius: 18px !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card {
    min-height: 168px;
    padding: 18px !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card:hover,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-list-item:hover,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item:hover {
    background: #1a1a1c !important;
    border-color: #55555a !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card.active,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-list-item.active,
body:not(.oracle-junior-mode) .memory-palace-overlay .category-item.active {
    background: #202022 !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card-icon,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-icon,
body:not(.oracle-junior-mode) .memory-palace-overlay .category-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 0 !important;
    color: #ffffff;
    background: #242426;
    border: 1px solid #3a3a3c;
    border-radius: 11px;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-glyph {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-glyph svg {
    width: 100%;
    height: 100%;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-active-label {
    padding: 5px 8px;
    color: #000000;
    background: #ffffff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card-title {
    margin-bottom: 7px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card-meta,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-meta,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-preview,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item-date,
body:not(.oracle-junior-mode) .memory-palace-overlay .category-count {
    color: #8e8e93 !important;
    -webkit-text-fill-color: #8e8e93 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-title,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item-title {
    font-size: 16px !important;
    font-weight: 650 !important;
    line-height: 1.3 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-meta,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-preview,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item-date {
    font-size: 13px !important;
    line-height: 1.35 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-actions,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card-actions,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item-actions {
    opacity: 1 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-btn,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-action-btn,
body:not(.oracle-junior-mode) .memory-palace-overlay .category-delete {
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 10px !important;
    place-items: center;
    color: #c7c7cc !important;
    background: #202022 !important;
    border: 1px solid #39393c !important;
    border-radius: 12px !important;
    opacity: 1 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-btn.delete,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-action-btn.delete {
    color: #b7b7bc !important;
}

body:not(.oracle-junior-mode) .palace-mobile-tools {
    display: none;
}

@media (max-width: 768px) {
    body:not(.oracle-junior-mode) .oracle-source-section {
        margin-bottom: 24px;
    }

    body:not(.oracle-junior-mode) .oracle-source-rail {
        width: calc(100vw - 40px);
        grid-auto-columns: minmax(224px, 78vw);
        gap: 10px;
        margin-right: -20px;
        padding-right: 20px;
    }

    body:not(.oracle-junior-mode) .oracle-source-card {
        min-height: 218px;
        border-radius: 17px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay.show .palace-container {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay.show .palace-sidebar {
        display: flex !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        min-height: calc(62px + env(safe-area-inset-top, 0px)) !important;
        height: auto !important;
        padding: calc(8px + env(safe-area-inset-top, 0px)) 98px 7px 8px !important;
        flex: 0 0 auto !important;
        flex-direction: row !important;
        overflow: visible !important;
        background: rgba(5, 5, 6, 0.96) !important;
        border-right: 0 !important;
        border-bottom: 1px solid #28282b !important;
        -webkit-backdrop-filter: blur(24px) saturate(125%);
        backdrop-filter: blur(24px) saturate(125%);
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-sidebar-brand,
    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-sidebar-bottom {
        display: none !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-sidebar-nav {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
        padding: 0 !important;
        gap: 5px !important;
        overflow: visible !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-item {
        display: flex !important;
        min-width: 0 !important;
        min-height: 46px !important;
        padding: 5px 3px !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 3px !important;
        border-radius: 11px !important;
        font-size: 10.5px !important;
        line-height: 1.05 !important;
        text-align: center !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-label {
        width: 100%;
        overflow: hidden;
        flex: none !important;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-item svg {
        width: 17px !important;
        height: 17px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-nav-count {
        display: none !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay.show .palace-close {
        position: fixed !important;
        top: calc(11px + env(safe-area-inset-top, 0px)) !important;
        right: 9px !important;
        width: 40px !important;
        height: 40px !important;
        z-index: 2147483647 !important;
    }

    body:not(.oracle-junior-mode) .palace-mobile-tools {
        display: block;
        position: fixed;
        top: calc(11px + env(safe-area-inset-top, 0px));
        right: 53px;
        z-index: 2147483647;
    }

    body:not(.oracle-junior-mode) .palace-mobile-tools > summary {
        display: grid;
        width: 40px;
        height: 40px;
        padding: 0;
        place-items: center;
        list-style: none;
        cursor: pointer;
    }

    body:not(.oracle-junior-mode) .palace-mobile-tools > summary::-webkit-details-marker {
        display: none;
    }

    body:not(.oracle-junior-mode) .palace-mobile-tools-menu {
        position: absolute;
        top: 47px;
        right: -43px;
        display: flex;
        width: 210px;
        padding: 7px;
        flex-direction: column;
        gap: 4px;
        background: #151517;
        border: 1px solid #3a3a3c;
        border-radius: 16px;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
    }

    body:not(.oracle-junior-mode) .palace-mobile-tools-menu button {
        display: flex;
        min-height: 46px;
        padding: 10px 12px;
        align-items: center;
        gap: 10px;
        color: #ffffff;
        background: transparent;
        border: 0;
        border-radius: 11px;
        font: 600 14px/1.2 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
        text-align: left;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-main {
        min-height: 0 !important;
        flex: 1 1 auto !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-tab-content {
        min-height: 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content-header {
        min-height: 0 !important;
        padding: 16px 14px 12px !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content-header h2 {
        font-size: 23px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        width: 100% !important;
        gap: 9px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-search-input {
        width: 100% !important;
        min-width: 0 !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #contentMemories .palace-content-actions,
    body:not(.oracle-junior-mode) .memory-palace-overlay #contentArtifacts .palace-content-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #artifactSearchInput {
        grid-column: 1 / -1;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content-toolbar {
        padding: 10px 14px 0 !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-grid,
    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-list,
    body:not(.oracle-junior-mode) .memory-palace-overlay .memory-items-list,
    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-artifacts-grid {
        grid-template-columns: 1fr !important;
        padding: 12px 14px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-list-item,
    body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item {
        min-height: 82px;
        padding: 11px 12px !important;
        gap: 9px !important;
        border-radius: 14px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-preview {
        max-width: none !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-item-actions,
    body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item-actions,
    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-card-actions {
        display: flex !important;
        gap: 6px !important;
        opacity: 1 !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #contentChats .palace-content-header {
        display: flex !important;
        min-height: 118px !important;
        padding: 14px 14px 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 10px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #contentChats .palace-content-header h2 {
        width: 100% !important;
        min-height: 28px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #contentChats .palace-content-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        width: 100% !important;
        gap: 8px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #contentChats .palace-search-input {
        min-height: 42px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #contentChats .palace-content-actions .palace-btn {
        min-height: 44px !important;
        padding: 8px 13px !important;
        border-radius: 11px !important;
        font-size: 13px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #contentChats .palace-content-toolbar {
        display: none !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #palaceChatsList {
        gap: 8px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #palaceChatsList .palace-item-icon {
        display: none !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #palaceChatsList .palace-item-info {
        min-width: 0 !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #palaceChatsList .palace-item-title {
        overflow: hidden;
        font-size: 15px !important;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #palaceChatsList .palace-item-meta {
        margin-top: 2px !important;
        font-size: 11.5px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #palaceChatsList .palace-item-preview {
        margin-top: 3px !important;
        overflow: hidden;
        font-size: 12.5px !important;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #palaceChatsList .palace-item-actions {
        flex: 0 0 auto !important;
        gap: 1px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay #palaceChatsList .palace-item-btn {
        width: 32px !important;
        height: 32px !important;
        padding: 7px !important;
        background: transparent !important;
        border-color: transparent !important;
        border-radius: 9px !important;
    }
}

body:not(.oracle-junior-mode) ::selection {
    color: #000000;
    background: #ffffff;
}

body:not(.oracle-junior-mode) :focus-visible {
    outline-color: #ffffff !important;
}

/* Main navigation and account controls */
body:not(.oracle-junior-mode) #sbUserAvatar {
    color: #000000 !important;
    background: #ffffff !important;
}

body:not(.oracle-junior-mode) #voiceBalanceValue + span,
body:not(.oracle-junior-mode) .plus-submenu-item.manage-link,
body:not(.oracle-junior-mode) .legal-link:hover {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .chat-ctx-item.delete-item {
    color: #a3a3a3 !important;
}

body:not(.oracle-junior-mode) .message-text a,
body:not(.oracle-junior-mode) .message.ai .message-text a,
body:not(.oracle-junior-mode) .message.ai .message-text a:hover,
body:not(.oracle-junior-mode) .message.ai .message-text a:active {
    color: #ffffff !important;
    text-decoration: underline !important;
    text-decoration-color: #737373 !important;
}

/* Upload and generation modals */
body:not(.oracle-junior-mode) .modal-content {
    background: #0b0b0b !important;
    border-color: #333333 !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72) !important;
}

body:not(.oracle-junior-mode) .modal-header {
    border-color: #262626 !important;
}

body:not(.oracle-junior-mode) .modal-title {
    color: #ffffff !important;
    background: none !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none !important;
}

body:not(.oracle-junior-mode) .modal-close {
    color: #ffffff !important;
    background: #1a1a1a !important;
    border-color: #333333 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .modal-close:hover,
body:not(.oracle-junior-mode) .modal-close:focus-visible {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .upload-zone,
body:not(.oracle-junior-mode) .file-upload-area {
    color: #ffffff !important;
    background: #080808 !important;
    border-color: #525252 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .upload-zone:hover,
body:not(.oracle-junior-mode) .upload-zone.dragover,
body:not(.oracle-junior-mode) .file-upload-area:hover {
    background: #141414 !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .upload-icon,
body:not(.oracle-junior-mode) .upload-text {
    color: #ffffff !important;
    text-shadow: none !important;
}

body:not(.oracle-junior-mode) .upload-hint,
body:not(.oracle-junior-mode) .upload-placeholder,
body:not(.oracle-junior-mode) .file-list:empty::after {
    color: #737373 !important;
}

body:not(.oracle-junior-mode) .file-item {
    color: #e5e5e5 !important;
    background: #171717 !important;
    border-color: #333333 !important;
}

body:not(.oracle-junior-mode) .modal-input,
body:not(.oracle-junior-mode) .modal-select {
    color: #ffffff !important;
    background: #171717 !important;
    border-color: #333333 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .modal-input:focus,
body:not(.oracle-junior-mode) .modal-select:focus {
    border-color: #a3a3a3 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .modal-btn,
body:not(.oracle-junior-mode) .modal-btn.warning,
body:not(.oracle-junior-mode) .modal-btn.danger {
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #ffffff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body:not(.oracle-junior-mode) .modal-btn:hover,
body:not(.oracle-junior-mode) .modal-btn.warning:hover,
body:not(.oracle-junior-mode) .modal-btn.danger:hover {
    color: #ffffff !important;
    background: #262626 !important;
    border-color: #737373 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .modal-btn:disabled {
    color: #737373 !important;
    background: #1a1a1a !important;
    border-color: #333333 !important;
}

body:not(.oracle-junior-mode) .mode-btn.active,
body:not(.oracle-junior-mode) .aspect-btn.active {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .header-mode-option:active,
body:not(.oracle-junior-mode) .header-mode-option.selected {
    color: #ffffff !important;
    background: #262626 !important;
}

body:not(.oracle-junior-mode) .header-mode-option .option-check {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .modal-slider {
    background: #333333 !important;
}

body:not(.oracle-junior-mode) .modal-slider::-webkit-slider-thumb {
    background: #ffffff !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .modal-slider::-moz-range-thumb {
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .slider-value,
body:not(.oracle-junior-mode) .model-info {
    color: #d4d4d4 !important;
}

body:not(.oracle-junior-mode) .model-info {
    background: #171717 !important;
    border-color: #333333 !important;
}

/* Active controls and project navigation */
body:not(.oracle-junior-mode) .action-btn.active,
body:not(.oracle-junior-mode) .input-action-btn.active,
body:not(.oracle-junior-mode) .mobile-quick-btn.active,
body:not(.oracle-junior-mode) .mode-chip.active,
body:not(.oracle-junior-mode) .palace-tab.active,
body:not(.oracle-junior-mode) .category-item.active,
body:not(.oracle-junior-mode) .entity-option.active,
body:not(.oracle-junior-mode) .list-item.active,
body:not(.oracle-junior-mode) .project-item.active,
body:not(.oracle-junior-mode) #webModeBtn.active,
body:not(.oracle-junior-mode) .topbar-actions #webModeBtn.active {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body:not(.oracle-junior-mode) .action-btn.active svg,
body:not(.oracle-junior-mode) .input-action-btn.active svg,
body:not(.oracle-junior-mode) .mobile-quick-btn.active svg,
body:not(.oracle-junior-mode) #webModeBtn.active svg {
    color: #000000 !important;
    stroke: #000000 !important;
    filter: none !important;
}

body:not(.oracle-junior-mode) .mobile-quick-btn.active span,
body:not(.oracle-junior-mode) .mode-chip.active .mode-icon,
body:not(.oracle-junior-mode) .category-item.active .category-count {
    color: #000000 !important;
    filter: none !important;
}

body:not(.oracle-junior-mode) .entity-option.active::before {
    background: #000000 !important;
}

body:not(.oracle-junior-mode) .send-btn,
body:not(.oracle-junior-mode) #sendButton,
body:not(.oracle-junior-mode) .submit-btn,
body:not(.oracle-junior-mode) .stop-btn {
    color: #a3a3a3 !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .send-btn:not(:disabled),
body:not(.oracle-junior-mode) #sendButton:not(:disabled),
body:not(.oracle-junior-mode) .submit-btn:not(:disabled) {
    color: #ffffff !important;
}

/* One stable action occupies the composer while a response is running.
   Legacy responsive rules forced the stop button to display at all times and
   let Send/Mic/Voice compete for the same slot. */
body:not(.oracle-junior-mode) .input-buttons:not(.is-generating) #stopBtn {
    display: none !important;
}

body:not(.oracle-junior-mode) .input-buttons.is-generating #stopBtn {
    display: flex !important;
}

body:not(.oracle-junior-mode) .input-buttons.is-generating .send-btn,
body:not(.oracle-junior-mode) .input-buttons.is-generating .mobile-voice-btn,
body:not(.oracle-junior-mode) .input-buttons.is-generating .mobile-mic-btn:not(.active) {
    display: none !important;
}

body:not(.oracle-junior-mode) .input-buttons .send-btn {
    animation: none !important;
}

body:not(.oracle-junior-mode) .toggle-switch.active,
body:not(.oracle-junior-mode) .integration-toggle.active,
body:not(.oracle-junior-mode) .mobile-toggle-switch.active,
body:not(.oracle-junior-mode) .connector-toggle input:checked + .connector-slider {
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .toggle-switch.active::after,
body:not(.oracle-junior-mode) .integration-toggle.active::after,
body:not(.oracle-junior-mode) .mobile-toggle-switch.active::after,
body:not(.oracle-junior-mode) .connector-toggle input:checked + .connector-slider::before {
    background: #000000 !important;
}

body:not(.oracle-junior-mode) .active-badge,
body:not(.oracle-junior-mode) .overdrive-badge.active {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .theme-btn,
body:not(.oracle-junior-mode) .plus-menu-icon {
    filter: grayscale(1) !important;
}

body:not(.oracle-junior-mode) .mobile-integration-card.connected {
    border-color: #a3a3a3 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .mobile-action-btn.danger,
body:not(.oracle-junior-mode) .palace-btn.danger {
    color: #d4d4d4 !important;
    background: #171717 !important;
    border-color: #525252 !important;
}

/* A sent image becomes part of the conversation immediately. */
body:not(.oracle-junior-mode) .message.user.has-image-attachment {
    align-items: flex-end;
}

body:not(.oracle-junior-mode) .message.user.has-image-attachment .message-content,
body:not(.oracle-junior-mode) .message.user.has-image-attachment .message-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

body:not(.oracle-junior-mode) .sent-image-attachment {
    display: block;
    order: -1;
    width: min(260px, 68vw);
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    line-height: 0;
    background: #111111;
    border: 1px solid #404040;
    border-radius: 12px;
    box-shadow: none;
}

body:not(.oracle-junior-mode) .sent-image-attachment img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    background: #0b0b0b;
}

@media (max-width: 768px) {
    body:not(.oracle-junior-mode) .sent-image-attachment {
        width: min(220px, 64vw);
        border-radius: 10px;
    }

    body:not(.oracle-junior-mode) .sent-image-attachment img {
        max-height: 300px;
    }
}

/* Final state details: remove the last hard-coded legacy colors while keeping
   meaningful selected/online/completed states visible through contrast. */
body:not(.oracle-junior-mode) .sidebar::after {
    width: 1px !important;
    right: 0 !important;
    background: rgba(255, 255, 255, 0.14) !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) #voiceBalanceItem > span:first-child,
body:not(.oracle-junior-mode) .mobile-toggle-label,
body:not(.oracle-junior-mode) .mobile-integration-icon,
body:not(.oracle-junior-mode) .mobile-action-btn {
    filter: grayscale(1) !important;
}

body:not(.oracle-junior-mode) #proBadge {
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #ffffff !important;
}

body:not(.oracle-junior-mode) .agent-status.online {
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12) !important;
}

body:not(.oracle-junior-mode) .agent-bar,
body:not(.oracle-junior-mode) .goal-progress-bar {
    background: #303033 !important;
}

body:not(.oracle-junior-mode) .agent-bar-fill,
body:not(.oracle-junior-mode) .goal-progress-fill {
    background: #ffffff !important;
}

body:not(.oracle-junior-mode) .goal-priority,
body:not(.oracle-junior-mode) .goal-priority.critical,
body:not(.oracle-junior-mode) .goal-priority.high,
body:not(.oracle-junior-mode) .goal-priority.medium,
body:not(.oracle-junior-mode) .goal-priority.low {
    color: #d1d1d6 !important;
    background: #242426 !important;
    border: 1px solid #3a3a3c !important;
}

body:not(.oracle-junior-mode) .memory-type,
body:not(.oracle-junior-mode) .goal-deadline {
    color: #d1d1d6 !important;
}

body:not(.oracle-junior-mode) .agent-card.active {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .agent-card.active .agent-name,
body:not(.oracle-junior-mode) .agent-card.active .agent-info {
    color: #000000 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-tab.active,
body:not(.oracle-junior-mode) .memory-palace-overlay .category-item.active,
body:not(.oracle-junior-mode) .memory-palace-overlay .project-item.active {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-tab.active .tab-count,
body:not(.oracle-junior-mode) .memory-palace-overlay .category-item.active .category-count,
body:not(.oracle-junior-mode) .memory-palace-overlay .project-item.active .project-title,
body:not(.oracle-junior-mode) .memory-palace-overlay .project-item.active .project-desc {
    color: #000000 !important;
}

/* Autonomous/idle feedback uses the same small white status language as the
   primary thinking indicator—no purple blob, stripe, tooltip, or listen pill. */
body:not(.oracle-junior-mode) .typing-bubble.autonomous-bubble,
body:not(.oracle-junior-mode) .autonomous-content,
body:not(.oracle-junior-mode) .typing-bubble.ghost,
body:not(.oracle-junior-mode) .ghost-typing.never-mind .typing-bubble {
    color: #f5f5f7 !important;
    background: #171719 !important;
    border-color: #303033 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .autonomous-content::before {
    height: 1px !important;
    background: rgba(255, 255, 255, 0.16) !important;
    animation: none !important;
}

body:not(.oracle-junior-mode) .autonomous-tooltip .tooltip-content {
    color: #f5f5f7 !important;
    background: #171719 !important;
    border-color: #3a3a3c !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.64) !important;
}

body:not(.oracle-junior-mode) .autonomous-tooltip .tooltip-icon {
    filter: grayscale(1) !important;
}

body:not(.oracle-junior-mode) .autonomous-tooltip button {
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #ffffff !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .autonomous-message-footer {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body:not(.oracle-junior-mode) .autonomous-listen-btn {
    color: #ffffff !important;
    background: #242426 !important;
    border-color: #3a3a3c !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .autonomous-listen-btn:hover {
    background: #2c2c2e !important;
}

body:not(.oracle-junior-mode) .ghost-typing.never-mind .ghost-text {
    color: #a1a1a6 !important;
}

/* Collapsible reasoning and feedback controls remain useful, but monochrome. */
body:not(.oracle-junior-mode) .thinking-steps-summary,
body:not(.oracle-junior-mode) .thinking-toggle,
body:not(.oracle-junior-mode) .reasoning-content {
    color: #d1d1d6 !important;
    background: #171719 !important;
    border-color: #3a3a3c !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .thinking-toggle:hover {
    color: #ffffff !important;
    background: #242426 !important;
    border-color: #525254 !important;
}

body:not(.oracle-junior-mode) .thinking-step-icon,
body:not(.oracle-junior-mode) .thinking-toggle-arrow,
body:not(.oracle-junior-mode) .reasoning-content h4,
body:not(.oracle-junior-mode) .reasoning-content strong {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .reasoning-content::-webkit-scrollbar-track {
    background: #171719 !important;
}

body:not(.oracle-junior-mode) .reasoning-content::-webkit-scrollbar-thumb {
    background: #737373 !important;
}

body:not(.oracle-junior-mode) .message-action-btn.active,
body:not(.oracle-junior-mode) .message-action-btn.liked,
body:not(.oracle-junior-mode) .message-action-btn.disliked,
body:not(.oracle-junior-mode) .message-action-btn.copied,
body:not(.oracle-junior-mode) .message-action-btn.speaking,
body:not(.oracle-junior-mode) .message-action-btn.share-btn:hover {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .pdf-link-inline {
    color: #ffffff !important;
    text-decoration: underline !important;
    text-decoration-color: #737373 !important;
}

body:not(.oracle-junior-mode) .connector-approval-card,
body:not(.oracle-junior-mode) .connector-approval-card.is-complete,
body:not(.oracle-junior-mode) .connector-approval-card.is-cancelled,
body:not(.oracle-junior-mode) .connector-approval-card.is-uncertain,
body:not(.oracle-junior-mode) .connector-approval-card.is-expired {
    color: #f5f5f7 !important;
    background: #171719 !important;
    border-color: #3a3a3c !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .connector-approval-badge {
    color: #ffffff !important;
    background: #2c2c2e !important;
}

body:not(.oracle-junior-mode) .connector-approval-send {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .connector-approval-cancel {
    color: #ffffff !important;
    background: #242426 !important;
    border-color: #3a3a3c !important;
}

@media (max-width: 768px) {
    body:not(.oracle-junior-mode) .header-mode-menu {
        top: calc(56px + env(safe-area-inset-top, 0px)) !important;
        max-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        z-index: 2147483647 !important;
    }

    body:not(.oracle-junior-mode) .header-mode-backdrop {
        z-index: 2147483646 !important;
    }

    body:not(.oracle-junior-mode) .sidebar-account-section {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body:not(.oracle-junior-mode) #mobileDisplayNameInput:focus,
    body:not(.oracle-junior-mode) #mobileDisplayNameInput:focus-visible {
        border-color: #ffffff !important;
        outline: 2px solid #ffffff !important;
        outline-offset: 2px !important;
    }

    body:not(.oracle-junior-mode) .panel-overlay.show {
        z-index: 2147483646 !important;
    }

    body:not(.oracle-junior-mode) .side-panel.show,
    body:not(.oracle-junior-mode) .side-panel.open {
        z-index: 2147483647 !important;
        height: 100dvh !important;
    }

    body:not(.oracle-junior-mode) .side-panel .panel-content {
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body:not(.oracle-junior-mode) .modal {
        box-sizing: border-box !important;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body:not(.oracle-junior-mode) .modal-content {
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    }

    body:not(.oracle-junior-mode) .oracle-overlay.show {
        min-height: 100dvh !important;
        box-sizing: border-box !important;
        padding: calc(15px + env(safe-area-inset-top, 0px)) calc(15px + env(safe-area-inset-right, 0px)) calc(30px + env(safe-area-inset-bottom, 0px)) calc(15px + env(safe-area-inset-left, 0px)) !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }
}

/* Research/progress panels */
body:not(.oracle-junior-mode) .orbital-progress::after,
body:not(.oracle-junior-mode) .oracle-source-dot,
body:not(.oracle-junior-mode) .oracle-search-done-icon,
body:not(.oracle-junior-mode) .oracle-research-panel .research-icon-done,
body:not(.oracle-junior-mode) .oracle-research-panel .step-icon {
    color: #000000 !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .oracle-search-query-row,
body:not(.oracle-junior-mode) .oracle-source-link,
body:not(.oracle-junior-mode) .oracle-search-header,
body:not(.oracle-junior-mode) .oracle-think-label,
body:not(.oracle-junior-mode) .oracle-research-panel .research-title {
    color: #d4d4d4 !important;
}

body:not(.oracle-junior-mode) .oracle-search-panel,
body:not(.oracle-junior-mode) .oracle-research-panel,
body:not(.oracle-junior-mode) .deep-thinking-indicator {
    color: #d4d4d4 !important;
    background: #111111 !important;
    border-color: #333333 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .deep-thinking-spinner {
    border-color: #333333 !important;
    border-top-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .deep-thinking-text span {
    color: #ffffff !important;
}

/* Retire the delayed legacy brain/blob and orbital "atom" indicators. */
body:not(.oracle-junior-mode) #neuralCanvas,
body:not(.oracle-junior-mode) .neural-lines,
body:not(.oracle-junior-mode) .neural-line {
    display: none !important;
}

body:not(.oracle-junior-mode) .oracle-orbital {
    display: flex !important;
    min-height: 36px !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 4px !important;
    color: rgba(255, 255, 255, 0.72) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body:not(.oracle-junior-mode) .oracle-orbital .orbital-system {
    position: relative !important;
    width: 8px !important;
    height: 8px !important;
    flex: 0 0 8px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    color: #ffffff !important;
    background: #ffffff !important;
    box-shadow: none !important;
    animation: oracle-corporate-dot-pulse 1.15s ease-in-out infinite !important;
}

body:not(.oracle-junior-mode) .oracle-orbital .orbital-system > *,
body:not(.oracle-junior-mode) .oracle-orbital .orbital-sub,
body:not(.oracle-junior-mode) .oracle-orbital .orbital-systems,
body:not(.oracle-junior-mode) .oracle-orbital .orbital-progress {
    display: none !important;
}

body:not(.oracle-junior-mode) .oracle-orbital .orbital-info {
    display: block !important;
    min-width: 0 !important;
}

body:not(.oracle-junior-mode) .oracle-orbital .orbital-label {
    color: rgba(255, 255, 255, 0.72) !important;
    font: 500 13px/1.4 Inter, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif !important;
    text-shadow: none !important;
}

body:not(.oracle-junior-mode) .deep-thinking-indicator .thinking-brain,
body:not(.oracle-junior-mode) .deep-thinking-indicator .thinking-brain-video,
body:not(.oracle-junior-mode) .deep-thinking-indicator .thinking-dots {
    display: none !important;
}

body:not(.oracle-junior-mode) .deep-thinking-indicator::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #ffffff;
    animation: oracle-corporate-dot-pulse 1.15s ease-in-out infinite;
}

body:not(.oracle-junior-mode) .deep-thinking-indicator .thinking-text {
    color: rgba(255, 255, 255, 0.72) !important;
    font: 500 13px/1.4 Inter, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
    animation: none !important;
}

body:not(.oracle-junior-mode) .autonomous-thinking-indicator {
    justify-content: flex-start !important;
    padding: 8px 0 !important;
}

body:not(.oracle-junior-mode) .autonomous-pre-indicator {
    gap: 10px !important;
    min-height: 36px !important;
    padding: 10px 4px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    animation: none !important;
}

body:not(.oracle-junior-mode) .autonomous-glow-orb {
    width: 8px !important;
    height: 8px !important;
    flex: 0 0 8px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    animation: oracle-corporate-dot-pulse 1.15s ease-in-out infinite !important;
}

body:not(.oracle-junior-mode) .autonomous-text {
    color: rgba(255, 255, 255, 0.72) !important;
    font: 500 13px/1.4 Inter, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif !important;
    letter-spacing: 0 !important;
}

body:not(.oracle-junior-mode) .autonomous-typing-indicator {
    gap: 0 !important;
    min-height: 36px !important;
    padding: 10px 4px !important;
}

body:not(.oracle-junior-mode) .autonomous-typing-indicator .message-avatar {
    display: block !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    flex: 0 0 8px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: none !important;
    animation: oracle-corporate-dot-pulse 1.15s ease-in-out infinite !important;
}

body:not(.oracle-junior-mode) .autonomous-typing-indicator .message-avatar video,
body:not(.oracle-junior-mode) .autonomous-typing-indicator .typing-bubble {
    display: none !important;
}

body:not(.oracle-junior-mode) .message.autonomous-message > .message-avatar {
    display: none !important;
}

body:not(.oracle-junior-mode) .message.autonomous-message .autonomous-content {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

body:not(.oracle-junior-mode) .message.autonomous-message .autonomous-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    color: #8e8e93 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

body:not(.oracle-junior-mode) .message.autonomous-message .autonomous-dot {
    width: 6px !important;
    height: 6px !important;
    flex: 0 0 6px !important;
    background: #d1d1d6 !important;
    border-radius: 50% !important;
}

body:not(.oracle-junior-mode) .autonomous-tooltip,
body:not(.oracle-junior-mode) .autonomous-listen-btn {
    display: none !important;
}

body:not(.oracle-junior-mode) .oracle-think-spinner {
    border-color: #333333 !important;
    border-top-color: #ffffff !important;
    border-right-color: #a3a3a3 !important;
}

/* Errors and retry actions stay calm and non-alarming. */
body:not(.oracle-junior-mode) .image-error,
body:not(.oracle-junior-mode) .image-gen-error,
body:not(.oracle-junior-mode) .artifact-preview-error,
body:not(.oracle-junior-mode) .roblox-error-view,
body:not(.oracle-junior-mode) .roblox-error-message,
body:not(.oracle-junior-mode) .toast.success,
body:not(.oracle-junior-mode) .toast.error {
    color: #d4d4d4 !important;
    background: #171717 !important;
    border-color: #404040 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .image-error .error-icon,
body:not(.oracle-junior-mode) .artifact-preview-error .error-icon,
body:not(.oracle-junior-mode) .roblox-error-icon .error-icon,
body:not(.oracle-junior-mode) .roblox-complete-icon .success-icon {
    color: #d4d4d4 !important;
    filter: grayscale(1) !important;
}

body:not(.oracle-junior-mode) .retry-btn {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .generation-error-action {
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #ffffff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body:not(.oracle-junior-mode) .generation-error-action:hover,
body:not(.oracle-junior-mode) .generation-error-action:focus-visible {
    color: #ffffff !important;
    background: #262626 !important;
    border-color: #737373 !important;
}

/* Payments, account recovery, subscriptions, and usage */
body:not(.oracle-junior-mode) .payment-modal,
body:not(.oracle-junior-mode) .payment-account-check-modal,
body:not(.oracle-junior-mode) .payment-verification-modal {
    color: #ffffff !important;
    background: #111111 !important;
    border-color: #404040 !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.68) !important;
}

body:not(.oracle-junior-mode) .payment-plan,
body:not(.oracle-junior-mode) .payment-plan-addon,
body:not(.oracle-junior-mode) .paywall-plan-featured,
body:not(.oracle-junior-mode) .token-pack,
body:not(.oracle-junior-mode) .token-pack.featured {
    color: #ffffff !important;
    background: #1a1a1a !important;
    border-color: #404040 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .plan-price,
body:not(.oracle-junior-mode) .pack-price,
body:not(.oracle-junior-mode) .plan-features .check,
body:not(.oracle-junior-mode) .usage-indicator-value,
body:not(.oracle-junior-mode) .balance-value.low,
body:not(.oracle-junior-mode) .balance-value.unlimited,
body:not(.oracle-junior-mode) .payment-verification-message,
body:not(.oracle-junior-mode) .payment-footer a {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .payment-cta-btn,
body:not(.oracle-junior-mode) .balance-manage-btn,
body:not(.oracle-junior-mode) .paywall-trial-banner,
body:not(.oracle-junior-mode) .paywall-plan-badge,
body:not(.oracle-junior-mode) .paywall-badge-save,
body:not(.oracle-junior-mode) .pack-badge {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
    animation: none !important;
}

body:not(.oracle-junior-mode) .payment-cta-btn:hover,
body:not(.oracle-junior-mode) .balance-manage-btn:hover {
    color: #ffffff !important;
    background: #333333 !important;
}

body:not(.oracle-junior-mode) .payment-restore-btn,
body:not(.oracle-junior-mode) .payment-cta-secondary,
body:not(.oracle-junior-mode) .manage-subscription-btn,
body:not(.oracle-junior-mode) .balance-action {
    color: #e5e5e5 !important;
    background: #262626 !important;
    border-color: #525252 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .payment-restore-btn:hover,
body:not(.oracle-junior-mode) .payment-cta-secondary:hover,
body:not(.oracle-junior-mode) .manage-subscription-btn:hover {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .payment-account-check-icon,
body:not(.oracle-junior-mode) .payment-verification-icon {
    color: #ffffff !important;
    background: #1f1f1f !important;
    border-color: #525252 !important;
    box-shadow: none !important;
    filter: grayscale(1);
}

body:not(.oracle-junior-mode) .payment-account-check-warning,
body:not(.oracle-junior-mode) .balance-warning {
    color: #d4d4d4 !important;
    background: #1a1a1a !important;
    border-color: #525252 !important;
}

body:not(.oracle-junior-mode) .payment-account-check-warning strong,
body:not(.oracle-junior-mode) .balance-warning .warning-text {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .subscription-badge,
body:not(.oracle-junior-mode) .subscription-badge.pro,
body:not(.oracle-junior-mode) .subscription-badge.grandfathered,
body:not(.oracle-junior-mode) .subscription-badge.admin,
body:not(.oracle-junior-mode) .tier-badge.admin,
body:not(.oracle-junior-mode) .tier-badge.vip,
body:not(.oracle-junior-mode) .tier-badge.pro,
body:not(.oracle-junior-mode) .tier-badge.free {
    color: #ffffff !important;
    background: #262626 !important;
    border: 1px solid #525252 !important;
}

body:not(.oracle-junior-mode) .payment-loading-spinner {
    border-color: #333333 !important;
    border-top-color: #ffffff !important;
}

@media (prefers-reduced-motion: reduce) {
    body:not(.oracle-junior-mode) .payment-modal,
    body:not(.oracle-junior-mode) .modal,
    body:not(.oracle-junior-mode) .toast,
    body:not(.oracle-junior-mode) .oracle-orbital .orbital-system,
    body:not(.oracle-junior-mode) .deep-thinking-indicator::before,
    body:not(.oracle-junior-mode) .autonomous-glow-orb,
    body:not(.oracle-junior-mode) .autonomous-typing-indicator .message-avatar {
        animation: none !important;
    }
}

/* ============================================================================
   PREMIUM APP SURFACES — one consistent black-and-white system

   These rules intentionally live last. A number of older component bundles
   still contain blue, purple, and white-panel defaults. Keeping the final
   visual contract here makes the drawer, menus, settings, and memory surfaces
   feel like the same application without changing any control or interaction.
   ============================================================================ */

body:not(.oracle-junior-mode) {
    color: #f5f5f7;
    background: #000000;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Drawer and account */
body:not(.oracle-junior-mode) .sidebar {
    color: #f5f5f7 !important;
    background: #101010 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 18px 0 54px rgba(0, 0, 0, 0.72) !important;
}

body:not(.oracle-junior-mode) .sidebar .sidebar-brand {
    color: #ffffff !important;
    background: #101010 !important;
}

body:not(.oracle-junior-mode) .sidebar .sidebar-brand > div {
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
}

body:not(.oracle-junior-mode) .sb-nav-item {
    color: rgba(255, 255, 255, 0.86) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
}

body:not(.oracle-junior-mode) .sb-nav-item svg {
    color: #d1d1d6 !important;
    opacity: 1 !important;
    filter: none !important;
}

body:not(.oracle-junior-mode) .sb-nav-item:hover,
body:not(.oracle-junior-mode) .sb-nav-item:active,
body:not(.oracle-junior-mode) .sb-nav-item:focus-visible {
    color: #ffffff !important;
    background: #242426 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body:not(.oracle-junior-mode) .sb-chat-item {
    color: rgba(255, 255, 255, 0.68) !important;
    font-weight: 500 !important;
    letter-spacing: -0.005em !important;
}

body:not(.oracle-junior-mode) .sb-chat-item:hover,
body:not(.oracle-junior-mode) .sb-chat-item:active {
    color: #ffffff !important;
    background: #242426 !important;
}

body:not(.oracle-junior-mode) #userEmail {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

body:not(.oracle-junior-mode) #sbAccountPanel {
    color: #f5f5f7 !important;
    background: #171719 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 14px !important;
    padding: 6px !important;
}

body:not(.oracle-junior-mode) #voiceBalanceItem,
body:not(.oracle-junior-mode) #deleteAccountBtn,
body:not(.oracle-junior-mode) #sbAccountPanel .sb-nav-item {
    color: rgba(255, 255, 255, 0.78) !important;
}

body:not(.oracle-junior-mode) .sidebar-overlay {
    background: rgba(0, 0, 0, 0.66) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    backdrop-filter: blur(5px) !important;
}

body:not(.oracle-junior-mode) .chat-context-menu {
    color: #f5f5f7 !important;
    background: rgba(28, 28, 30, 0.98) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.72) !important;
}

body:not(.oracle-junior-mode) .chat-ctx-item:hover,
body:not(.oracle-junior-mode) .chat-ctx-item:active {
    background: #2c2c2e !important;
}

/* Mode menu and entity picker */
body:not(.oracle-junior-mode) .header-mode-btn {
    color: #ffffff !important;
    font-weight: 600 !important;
    letter-spacing: -0.015em !important;
}

body:not(.oracle-junior-mode) .header-mode-menu {
    color: #f5f5f7 !important;
    background: rgba(28, 28, 30, 0.98) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.76) !important;
    -webkit-backdrop-filter: blur(28px) saturate(135%) !important;
    backdrop-filter: blur(28px) saturate(135%) !important;
}

body:not(.oracle-junior-mode) .header-mode-option {
    color: rgba(255, 255, 255, 0.82) !important;
    background: transparent !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}

body:not(.oracle-junior-mode) .header-mode-option:hover,
body:not(.oracle-junior-mode) .header-mode-option:active {
    color: #ffffff !important;
    background: #2c2c2e !important;
}

body:not(.oracle-junior-mode) .header-mode-option.selected {
    color: #000000 !important;
    background: #ffffff !important;
}

body:not(.oracle-junior-mode) .header-mode-option.selected .option-check,
body:not(.oracle-junior-mode) .header-mode-option.selected .option-icon {
    color: #000000 !important;
    filter: grayscale(1) contrast(1.2) !important;
}

body:not(.oracle-junior-mode) .header-mode-option .option-icon {
    filter: grayscale(1) brightness(1.35) !important;
}

body:not(.oracle-junior-mode) .header-mode-backdrop {
    background: rgba(0, 0, 0, 0.62) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    backdrop-filter: blur(5px) !important;
}

body:not(.oracle-junior-mode) .entity-category-dropdown {
    color: #f5f5f7 !important;
    background: rgba(28, 28, 30, 0.99) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    border-radius: 20px !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78) !important;
    -webkit-backdrop-filter: blur(28px) saturate(135%) !important;
    backdrop-filter: blur(28px) saturate(135%) !important;
}

body:not(.oracle-junior-mode) .entity-dropdown-header {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body:not(.oracle-junior-mode) .dropdown-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    text-shadow: none !important;
}

body:not(.oracle-junior-mode) .entity-option {
    color: #f5f5f7 !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .entity-option:hover,
body:not(.oracle-junior-mode) .entity-option:active {
    background: #2c2c2e !important;
}

body:not(.oracle-junior-mode) .entity-option.active {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .entity-option.active .entity-name,
body:not(.oracle-junior-mode) .entity-option.active .entity-desc,
body:not(.oracle-junior-mode) .entity-option.active .active-badge {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

body:not(.oracle-junior-mode) .entity-option.active .active-badge {
    background: #e5e5ea !important;
    border-color: #d1d1d6 !important;
}

/* Composer add menu and connector sheet */
body:not(.oracle-junior-mode) .plus-menu-popup,
body:not(.oracle-junior-mode) .plus-submenu {
    color: #f5f5f7 !important;
    background: rgba(28, 28, 30, 0.99) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.78) !important;
    scrollbar-color: #737373 transparent !important;
    -webkit-backdrop-filter: blur(28px) saturate(135%) !important;
    backdrop-filter: blur(28px) saturate(135%) !important;
}

body:not(.oracle-junior-mode) .plus-menu-popup::-webkit-scrollbar-thumb {
    background: #737373 !important;
}

body:not(.oracle-junior-mode) .plus-menu-item,
body:not(.oracle-junior-mode) .plus-submenu-item {
    color: rgba(255, 255, 255, 0.84) !important;
    background: transparent !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
}

body:not(.oracle-junior-mode) .plus-menu-item:hover,
body:not(.oracle-junior-mode) .plus-menu-item:active,
body:not(.oracle-junior-mode) .plus-menu-item:focus-visible,
body:not(.oracle-junior-mode) .plus-submenu-item:hover,
body:not(.oracle-junior-mode) .plus-submenu-item:focus-within {
    color: #ffffff !important;
    background: #2c2c2e !important;
    outline-color: #ffffff !important;
}

body:not(.oracle-junior-mode) .plus-menu-icon,
body:not(.oracle-junior-mode) .plus-menu-arrow {
    color: #d1d1d6 !important;
    opacity: 1 !important;
}

body:not(.oracle-junior-mode) .plus-menu-divider,
body:not(.oracle-junior-mode) .plus-submenu-divider {
    background: rgba(255, 255, 255, 0.1) !important;
}

body:not(.oracle-junior-mode) .connector-slider {
    background: #48484a !important;
}

body:not(.oracle-junior-mode) .connector-slider::before {
    background: #f5f5f7 !important;
}

/* Settings, tools, upload, and memory surfaces */
body:not(.oracle-junior-mode) .side-panel,
body:not(.oracle-junior-mode) .panel-content {
    color: #f5f5f7 !important;
    background: #0b0b0c !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

body:not(.oracle-junior-mode) .panel-header {
    color: #ffffff !important;
    background: rgba(11, 11, 12, 0.96) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    -webkit-backdrop-filter: blur(22px) !important;
    backdrop-filter: blur(22px) !important;
}

body:not(.oracle-junior-mode) .panel-title,
body:not(.oracle-junior-mode) .side-panel .metric-section-title,
body:not(.oracle-junior-mode) .side-panel .metric-label,
body:not(.oracle-junior-mode) .side-panel .metric-value {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .panel-close {
    color: #ffffff !important;
    background: #1c1c1e !important;
    border-color: #3a3a3c !important;
}

body:not(.oracle-junior-mode) .agent-card,
body:not(.oracle-junior-mode) .goal-card,
body:not(.oracle-junior-mode) .memory-card,
body:not(.oracle-junior-mode) .metric-item {
    color: #f5f5f7 !important;
    background: #171719 !important;
    border-color: #303033 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .agent-name,
body:not(.oracle-junior-mode) .goal-title,
body:not(.oracle-junior-mode) .memory-content {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .agent-info,
body:not(.oracle-junior-mode) .memory-meta {
    color: #a1a1a6 !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-container,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-header,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-content,
body:not(.oracle-junior-mode) .memory-palace-overlay .palace-body,
body:not(.oracle-junior-mode) .memory-palace-overlay .memories-container,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-categories {
    color: #f5f5f7 !important;
    background: #050506 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-title,
body:not(.oracle-junior-mode) .memory-palace-overlay .chat-title,
body:not(.oracle-junior-mode) .memory-palace-overlay .project-title {
    color: #ffffff !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .palace-tab,
body:not(.oracle-junior-mode) .memory-palace-overlay .category-item,
body:not(.oracle-junior-mode) .memory-palace-overlay .chat-item,
body:not(.oracle-junior-mode) .memory-palace-overlay .project-item,
body:not(.oracle-junior-mode) .memory-palace-overlay .memory-item {
    color: #f5f5f7 !important;
    background: #171719 !important;
    border-color: #303033 !important;
    box-shadow: none !important;
}

body:not(.oracle-junior-mode) .memory-palace-overlay .chat-preview,
body:not(.oracle-junior-mode) .memory-palace-overlay .project-desc,
body:not(.oracle-junior-mode) .memory-palace-overlay .chat-date,
body:not(.oracle-junior-mode) .memory-palace-overlay .project-date {
    color: #a1a1a6 !important;
}

body:not(.oracle-junior-mode) .modal-label,
body:not(.oracle-junior-mode) .file-list {
    color: #d1d1d6 !important;
}

@media (max-width: 768px) {
    body:not(.oracle-junior-mode) .topbar {
        background: rgba(0, 0, 0, 0.92) !important;
        border-color: rgba(255, 255, 255, 0.08) !important;
        -webkit-backdrop-filter: blur(22px) saturate(130%) !important;
        backdrop-filter: blur(22px) saturate(130%) !important;
    }

    body:not(.oracle-junior-mode) .sidebar {
        background: #101010 !important;
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    body:not(.oracle-junior-mode) .sidebar .sidebar-brand > div {
        font-size: 24px !important;
    }

    body:not(.oracle-junior-mode) .sb-nav-item {
        min-height: 50px !important;
        padding: 12px 14px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
    }

    body:not(.oracle-junior-mode) .sb-nav-item svg {
        width: 20px !important;
        height: 20px !important;
    }

    body:not(.oracle-junior-mode) .sb-chat-item {
        padding: 11px 14px !important;
        border-radius: 10px !important;
        font-size: 15px !important;
        line-height: 1.35 !important;
    }

    body:not(.oracle-junior-mode) .header-mode-btn {
        font-size: 16px !important;
    }

    body:not(.oracle-junior-mode) .header-mode-menu {
        width: min(320px, calc(100vw - 24px)) !important;
        min-width: 0 !important;
        padding: 8px !important;
        border-radius: 20px !important;
    }

    body:not(.oracle-junior-mode) .header-mode-option {
        min-height: 52px !important;
        padding: 13px 15px !important;
        border-radius: 14px !important;
        font-size: 16px !important;
    }

    body:not(.oracle-junior-mode) .entity-category-dropdown {
        width: calc(100vw - 24px) !important;
        max-width: 390px !important;
        max-height: min(78dvh, 680px) !important;
        border-radius: 22px !important;
    }

    body:not(.oracle-junior-mode) .entity-dropdown-header {
        padding: 18px 20px !important;
    }

    body:not(.oracle-junior-mode) .dropdown-title {
        font-size: 18px !important;
        font-weight: 700 !important;
        letter-spacing: -0.02em !important;
    }

    body:not(.oracle-junior-mode) .category-name {
        color: #a1a1a6 !important;
        -webkit-text-fill-color: #a1a1a6 !important;
        font-size: 12px !important;
    }

    body:not(.oracle-junior-mode) .entity-option {
        min-height: 58px !important;
        padding: 13px 14px !important;
        border-radius: 13px !important;
    }

    body:not(.oracle-junior-mode) .entity-info .entity-name {
        font-size: 16px !important;
        line-height: 1.25 !important;
    }

    body:not(.oracle-junior-mode) .entity-info .entity-desc {
        color: #a1a1a6 !important;
        -webkit-text-fill-color: #a1a1a6 !important;
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    body:not(.oracle-junior-mode) .entity-option.active .entity-desc {
        color: #3a3a3c !important;
        -webkit-text-fill-color: #3a3a3c !important;
    }

    body:not(.oracle-junior-mode) .plus-menu-popup,
    body:not(.oracle-junior-mode) .plus-submenu {
        border-radius: 20px !important;
        padding: 8px !important;
    }

    body:not(.oracle-junior-mode) .plus-menu-item,
    body:not(.oracle-junior-mode) .plus-submenu-item {
        min-height: 50px !important;
        padding: 12px 14px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
    }

    body:not(.oracle-junior-mode) #mobileSystemPanel {
        color: #f5f5f7 !important;
        background: #000000 !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    body:not(.oracle-junior-mode) .mobile-panel-header {
        background: rgba(0, 0, 0, 0.94) !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
        -webkit-backdrop-filter: blur(22px) !important;
        backdrop-filter: blur(22px) !important;
    }

    body:not(.oracle-junior-mode) .mobile-panel-title {
        color: #ffffff !important;
        font-size: 26px !important;
        font-weight: 700 !important;
        letter-spacing: -0.035em !important;
    }

    body:not(.oracle-junior-mode) .mobile-section-title {
        color: #a1a1a6 !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        letter-spacing: 0.08em !important;
    }

    body:not(.oracle-junior-mode) #mobileDisplayNameInput,
    body:not(.oracle-junior-mode) .mobile-toggle-row,
    body:not(.oracle-junior-mode) .mobile-status-card,
    body:not(.oracle-junior-mode) .mobile-integration-card,
    body:not(.oracle-junior-mode) .mobile-action-btn {
        color: #ffffff !important;
        background: #171719 !important;
        border: 1px solid #303033 !important;
        border-radius: 14px !important;
        box-shadow: none !important;
    }

    body:not(.oracle-junior-mode) #mobileDisplayNameInput {
        font-size: 17px !important;
        min-height: 50px !important;
    }

    body:not(.oracle-junior-mode) .mobile-toggle-label,
    body:not(.oracle-junior-mode) .mobile-status-value,
    body:not(.oracle-junior-mode) .mobile-integration-name,
    body:not(.oracle-junior-mode) .mobile-action-btn {
        color: #ffffff !important;
        font-size: 16px !important;
        font-weight: 600 !important;
    }

    body:not(.oracle-junior-mode) .mobile-status-label,
    body:not(.oracle-junior-mode) .mobile-integration-status {
        color: #a1a1a6 !important;
        font-size: 13px !important;
    }

    body:not(.oracle-junior-mode) .mobile-legal-link,
    body:not(.oracle-junior-mode) .legal-footer .legal-link {
        color: #d1d1d6 !important;
        background: #171719 !important;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1) !important;
    }

    body:not(.oracle-junior-mode) .side-panel {
        width: 100% !important;
        max-width: 100% !important;
        background: #050506 !important;
    }

    body:not(.oracle-junior-mode) .panel-header {
        padding-top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    }

    body:not(.oracle-junior-mode) .panel-title {
        font-size: 22px !important;
        font-weight: 700 !important;
        letter-spacing: -0.03em !important;
    }

    body:not(.oracle-junior-mode) .panel-content {
        padding: 18px !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-title {
        font-size: 22px !important;
        font-weight: 700 !important;
        letter-spacing: -0.03em !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-tabs,
    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-footer {
        color: #f5f5f7 !important;
        background: rgba(5, 5, 6, 0.96) !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
    }

    body:not(.oracle-junior-mode) .memory-palace-overlay .palace-tab {
        font-size: 15px !important;
    }

    body:not(.oracle-junior-mode) .modal-content {
        width: calc(100vw - 24px) !important;
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
        padding: 20px !important;
        border-radius: 22px !important;
    }

    body:not(.oracle-junior-mode) .modal-title {
        font-size: 22px !important;
        font-weight: 700 !important;
        letter-spacing: -0.03em !important;
    }

    body:not(.oracle-junior-mode) .modal-input,
    body:not(.oracle-junior-mode) .modal-select {
        font-size: 16px !important;
        border-radius: 12px !important;
    }

    body:not(.oracle-junior-mode) .upload-zone,
    body:not(.oracle-junior-mode) .file-upload-area {
        border-radius: 18px !important;
    }

    body:not(.oracle-junior-mode) .upload-text {
        font-size: 17px !important;
        font-weight: 700 !important;
        letter-spacing: -0.01em !important;
    }

    body:not(.oracle-junior-mode) .upload-hint,
    body:not(.oracle-junior-mode) .upload-placeholder {
        color: #a1a1a6 !important;
        font-size: 14px !important;
    }

    body:not(.oracle-junior-mode) .modal-btn {
        border-radius: 14px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        letter-spacing: -0.01em !important;
    }

    body:not(.oracle-junior-mode) .mobile-quick-bar,
    body:not(.oracle-junior-mode) #mobileQuickBar {
        background: rgba(5, 5, 6, 0.94) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        -webkit-backdrop-filter: blur(24px) saturate(130%) !important;
        backdrop-filter: blur(24px) saturate(130%) !important;
    }

    /* Float the mobile navigation controls instead of reserving a second
       full-width header row. The controls keep their existing safe-area
       positions and touch targets while the conversation uses the space. */
    body:not(.oracle-junior-mode) .app-container {
        padding-top: 0 !important;
    }

    /* The navigation is intentionally floated, so the app shell no longer
       reserves a header row. Keep loaded chat turns below both the iPhone
       safe area and those floating controls; otherwise the first user bubble
       starts at the viewport origin underneath the status bar/header. */
    body:not(.oracle-junior-mode) .app-container.has-messages .chat-container {
        padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
        scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    }

    body:not(.oracle-junior-mode) .topbar {
        background: transparent !important;
        border-color: transparent !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        pointer-events: none !important;
    }

    body:not(.oracle-junior-mode) .topbar > .header-mode-dropdown,
    body:not(.oracle-junior-mode) .topbar > .active-project-badge {
        pointer-events: auto !important;
    }
}
