/* ============================================
   GHOST MODEL — Typographic Mode Selector
   Chat · Code · Think — text only, color is identity
   ============================================ */

.ghost-model-wrapper {
    position: fixed;
    top: 1.1rem;
    left: calc(var(--left-sidebar-width, 260px) + 1rem);
    z-index: 500;
    pointer-events: auto;
    transition: left 0.25s ease;
}

.ghost-model-wrapper.guest-disabled {
    pointer-events: none;
    opacity: 0.4;
}

.ghost-model {
    display: none;
}

/* ── Segmented control — Claude Desktop style ── */

.ghost-pills {
    display: inline-flex !important;
    align-items: center;
    position: static;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
    min-width: 0;
    max-width: none;
    max-height: none;
    overflow: visible;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none;
}

.ghost-pill__group { display: none; }
.ghost-pill__icon { display: none; }
.ghost-pill__note { display: none; }

.ghost-pill {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    transition: background 150ms ease, color 150ms ease;
}

.ghost-pill__label {
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
    font-weight: 400;
    color: var(--text-tertiary, #7a7a90);
    letter-spacing: 0;
    text-transform: none;
    transition: color 150ms ease;
}

.ghost-pill:hover:not(.active):not(.locked) {
    background: rgba(255, 255, 255, 0.03);
}

.ghost-pill:hover .ghost-pill__label {
    color: var(--text-secondary, #b8b8c8);
}

/* ── Active: raised surface, slightly brighter text ── */
.ghost-pill.active,
.ghost-pill.locked {
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ghost-pill.active .ghost-pill__label,
.ghost-pill.locked .ghost-pill__label {
    color: var(--text-primary, #f0f0f4);
    font-weight: 500;
}

/* ── Think — editorial serif italic (contemplative), always on ── */
.ghost-pill[data-model="deepseek-reasoner"] .ghost-pill__label {
    font-family: 'Newsreader', 'Instrument Serif', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

/* ── Code active only — monospace + pushed-in 3D emboss
   Inactive keeps the same neutral style as Chat/Think. ── */

.ghost-pill[data-model="deepseek-chat"].active,
.ghost-pill[data-model="deepseek-chat"].locked {
    background: #141419;
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.6),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04),
        0 1px 0 rgba(255, 255, 255, 0.05);
}

.ghost-pill[data-model="deepseek-chat"].active .ghost-pill__label,
.ghost-pill[data-model="deepseek-chat"].locked .ghost-pill__label {
    font-family: 'Roboto Mono', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: -0.01em;
    color: var(--text-primary, #f0f0f4);
    font-weight: 500;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}

/* Light theme — push-in = darker than the track, crisp edge highlight */
[data-theme="light"] .ghost-pill[data-model="deepseek-chat"].active,
[data-theme="light"] .ghost-pill[data-model="deepseek-chat"].locked {
    background: #d4cabb;
    box-shadow:
        inset 0 2px 5px rgba(40, 30, 50, 0.25),
        inset 0 -1px 0 rgba(255, 255, 255, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .ghost-pill[data-model="deepseek-chat"].active .ghost-pill__label,
[data-theme="light"] .ghost-pill[data-model="deepseek-chat"].locked .ghost-pill__label {
    color: var(--text-primary, #2a2330);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ── Light theme ── */
[data-theme="light"] .ghost-pills {
    background: rgba(40, 30, 50, 0.05);
    border: none;
    box-shadow: none;
}

[data-theme="light"] .ghost-pill__label {
    color: var(--text-tertiary, #8a8090);
}

[data-theme="light"] .ghost-pill:hover:not(.active):not(.locked) {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .ghost-pill:hover .ghost-pill__label {
    color: var(--text-secondary, #4a4450);
}

[data-theme="light"] .ghost-pill.active,
[data-theme="light"] .ghost-pill.locked {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 2px rgba(40, 30, 50, 0.06);
}

[data-theme="light"] .ghost-pill.active .ghost-pill__label,
[data-theme="light"] .ghost-pill.locked .ghost-pill__label {
    color: var(--text-primary, #2a2330);
    font-weight: 500;
}

/* ── Attribution ── */

.message-model-attribution {
    display: inline;
    font-size: 0.7rem;
    color: var(--text-tertiary, #5a5a70);
    margin-left: 0.4em;
    user-select: none;
    white-space: nowrap;
    vertical-align: baseline;
    letter-spacing: 0.01em;
}

/* ── Bottom sheet: off ── */

.ghost-bottom-sheet,
.ghost-bottom-sheet__backdrop {
    display: none !important;
}

/* ── Mobile: pills live in header center ── */

@media (max-width: 768px) {
    .ghost-model-wrapper {
        display: none !important;
    }
}
