/* chat-modern split: composer, suggestions, tab strip, empty states. */

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

#chat-app footer {
    padding: 0 22px 16px;
    background: var(--gb-bg);
}

#chat-app .chat-footer-content:empty { display: none; }

#chat-app .input-container {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 7px 8px 7px 6px;
    background: var(--gb-surface);
    border: 1px solid var(--gb-border);
    border-radius: 22px;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.05);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

#chat-app .input-container:focus-within {
    border-color: rgba(22, 163, 74, 0.55);
    /* Exactly one border, no halo: the old double outline made the composer
       look like a focused form control instead of a writing surface. */
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
}

#chat-app .gb-attachment {
    background: var(--surface, #f4f4f5) !important;
    border: 1px solid var(--gb-border);
    border-radius: 10px;
    padding: 4px 8px;
    color: var(--gb-text) !important;
}

#chat-app .gb-attachment-name {
    color: var(--gb-text) !important;
}

#chat-app .gb-attachment-btn {
    color: var(--text, #3f3f46) !important;
}

#chat-app .gb-attachment-btn:hover {
    color: var(--gb-accent) !important;
}

#chat-app .gb-model-picker {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    border-radius: 8px;
    padding: 8px 6px;
    margin: 0 0 0 4px;
    max-width: 150px;
    font-size: 12px;
    color: var(--gb-muted);
    cursor: pointer;
}

#chat-app .gb-model-picker:focus {
    outline: none;
    color: var(--gb-text);
}

#chat-app #messageInput {
    flex: 1;
    min-height: 24px;
    max-height: 180px;
    padding: 10px 4px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--gb-text) !important;
    font-size: 14.5px;
    line-height: 1.45;
    resize: none;
}

#chat-app #messageInput::placeholder { color: var(--text, #a1a1aa); }
#chat-app #messageInput:focus { outline: none; }

#chat-app #sendBtn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--gb-accent);
    color: var(--surface, #fff);
    font-size: 16px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 120ms ease, filter 120ms ease;
}

#chat-app #sendBtn:hover { transform: translateY(-1px); filter: brightness(1.06); }
#chat-app #sendBtn:disabled { opacity: 0.5; cursor: default; transform: none; }

#chat-app .file-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--gb-muted);
    cursor: pointer;
}

#chat-app .file-btn:hover { background: color-mix(in srgb, var(--text, #18181b) 5%, transparent); }

/* ── Suggestions ───────────────────────────────────────────────────── */

#chat-app .suggestions-container {
    padding: 0 2px 10px;
    gap: 6px;
}

#chat-app .suggestion-chip,
#chat-app .suggestion-button {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--gb-border);
    background: var(--gb-surface);
    color: var(--text, #52525b);
    font-size: 12.5px;
    line-height: 1.2;
    box-shadow: none;
    transition: border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

#chat-app .suggestion-chip:hover,
#chat-app .suggestion-button:hover {
    border-color: rgba(22, 163, 74, 0.5);
    color: var(--gb-accent);
    transform: translateY(-1px);
    background: var(--gb-surface);
}

/* ── Tab strip ─────────────────────────────────────────────────────── */

/* Explicit stacking: the conversation tabs always sit above the message
 * canvas and the composer, even when a new tab or a restored workspace
 * re-attaches the panes in a different DOM order. */
#chat-app .gb-tab-strip {
    order: -1;
    flex: 0 0 auto;
    padding: 8px 12px 6px;
    gap: 6px;
    border-bottom: 1px solid var(--gb-border);
    background: var(--gb-surface);
}

#chat-app #messages,
#chat-app .chat-pane {
    order: 0;
    min-height: 0;
}

#chat-app footer {
    order: 1;
    flex: 0 0 auto;
}

#chat-app .gb-tab {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--gb-muted);
    border: 1px solid transparent;
}

#chat-app .gb-tab:hover { background: color-mix(in srgb, var(--text, #18181b) 5%, transparent); }

#chat-app .gb-tab.active {
    background: var(--gb-accent-soft);
    border-color: rgba(22, 163, 74, 0.25);
    color: var(--gb-accent);
    font-weight: 600;
}

#chat-app .gb-tab-new {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: var(--gb-muted);
    border: 1px dashed color-mix(in srgb, var(--text, #18181b) 18%, transparent);
}

#chat-app .gb-tab-new:hover {
    border-color: var(--gb-accent);
    color: var(--gb-accent);
}

/* ── States ────────────────────────────────────────────────────────── */

#chat-app .gb-state {
    margin: auto;
    padding: 18px 22px;
    border-radius: 14px;
    border: 1px solid var(--gb-border);
    background: var(--gb-surface);
    color: var(--gb-muted);
    font-size: 13px;
}


/* ── Tab overflow (more than five conversations) ───────────────────── */

#chat-app .gb-tab-overflow {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 26px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--gb-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

#chat-app .gb-tab-overflow:hover {
    background: color-mix(in srgb, var(--text, #18181b) 5%, transparent);
    color: var(--gb-text);
}

#chat-app .gb-tab-overflow-count {
    font-size: 9px;
    font-weight: 600;
    opacity: 0.75;
}

.gb-tab-overflow-menu {
    position: fixed;
    z-index: 10050;
    min-width: 220px;
    max-width: min(320px, 80vw);
    max-height: min(360px, 60vh);
    overflow-y: auto;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--gb-border, color-mix(in srgb, var(--text, #18181b) 14%, transparent));
    background: var(--gb-surface, var(--surface, #fff));
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.gb-tab-overflow-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--gb-text, var(--text, #18181b));
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
}

.gb-tab-overflow-item:hover {
    background: var(--gb-accent-soft, rgba(22, 163, 74, 0.10));
}

.gb-tab-overflow-item.active {
    color: var(--gb-accent, #16a34a);
    font-weight: 600;
}

.gb-tab-overflow-item.unread .gb-tab-overflow-title::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--gb-accent, #16a34a);
    vertical-align: middle;
}

.gb-tab-overflow-glyph {
    flex: 0 0 auto;
    font-size: 12px;
}

.gb-tab-overflow-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* #1849 — the chat footer is a live status bar now (GBStatus: Thinking…,
   Generating…, Ready) instead of the decorative "Ready / app name" writing.
   It keeps its normal place below the composer. */
#window-chat .window-statusbar {
    display: flex !important;
}

#window-body-chat {
    padding: 0 !important;
}

#chat-app .gb-tab-strip {
    padding: 5px 10px 4px;
}

#chat-app footer {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Inside a parallel pane the suggestions are a bottom row, not a flexible
   sibling: `flex: 1` here split the conversation 50/50 with the chips. */
#chat-app .chat-pane .suggestions-container {
    flex: 0 0 auto;
    max-height: 52px;
    min-height: 0;
    padding: 0 16px 8px;
}
