/* ═══════════════════════════════════════════════════════════════════════
   GAIBRA — Layout & Components
   ─────────────────────────────────────────────────────────────────────
   Requires gaibra-themes.css loaded first.
   Pure HTML / CSS — no MudBlazor dependency.
   Design: Bloomberg Terminal × DeepSeek × Executive Intelligence
   ═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--fg);
    margin: 0;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Elements that should stay mono (English / technical labels) */
.g-mono,
.g-title,
.g-subtitle,
.g-brand,
.g-role-label,
.g-eyebrow,
.g-footer-note,
.g-theme-pill,
.g-group-label,
.g-status-chip {
    font-family: var(--font-mono) !important;
}

/* Scrollbar — slim and quiet */
*::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* ═══════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-app {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.gaibra-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════
   APPBAR
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 50px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.gaibra-appbar__left,
.gaibra-appbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gaibra-appbar__right {
    gap: 12px;
}

.gaibra-logo-sm {
    height: 22px;
    width: auto;
}

.gaibra-title {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 2.5px;
    color: var(--fg);
    text-transform: uppercase;
}

.gaibra-subtitle {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--fg-faint);
    letter-spacing: 0.08em;
}

.gaibra-icon-btn {
    background: transparent;
    border: none;
    color: var(--fg-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

    .gaibra-icon-btn:hover {
        background: var(--bg-hover);
        color: var(--fg);
    }

/* Status chip */
.g-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #22C55E;
    background: rgba(34, 197, 94, 0.10);
    border: 1px solid rgba(34, 197, 94, 0.18);
}

.g-status-chip__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22C55E;
}

/* ═══════════════════════════════════════════════════════════════════════
   THEME PILLS (for theme switcher)
   ═══════════════════════════════════════════════════════════════════════ */
.g-theme-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--fg-faint);
    transition: all 0.15s ease;
}

    .g-theme-pill:hover {
        border-color: var(--fg-dim);
        color: var(--fg);
    }

.g-theme-pill--active {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}

.g-theme-pill__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, width 0.25s ease;
}

[dir="ltr"] .gaibra-sidebar {
    border-left: none;
    border-right: 1px solid var(--border);
}

.gaibra-sidebar--closed {
    width: 0;
    overflow: hidden;
}

.gaibra-sidebar__header {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gaibra-sidebar__logo {
    height: 20px;
}

.gaibra-sidebar__brand {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--fg);
}

.gaibra-sidebar__new-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--fg-dim);
    transition: all 0.15s;
    margin-left: auto;
}

    .gaibra-sidebar__new-btn:hover {
        border-color: var(--accent);
        color: var(--fg);
        background: var(--bg-accent-soft);
    }

.g-group-label {
    font-size: 9px;
    color: var(--fg-faint);
    letter-spacing: 0.12em;
    padding: 8px 16px 4px;
    display: block;
    text-transform: uppercase;
}

.gaibra-sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 2px 6px 12px;
}

/* Conversation item */
.gaibra-convo {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 1px;
    border: 1px solid transparent;
    position: relative;
    transition: background 0.12s;
}

    .gaibra-convo:hover {
        background: var(--bg-hover);
    }

.gaibra-convo--active {
    background: var(--sidebar-active);
    border-color: var(--border-strong);
}
    /* Right-edge accent bar on active */
    .gaibra-convo--active::before {
        content: '';
        position: absolute;
        right: 0;
        top: 18%;
        bottom: 18%;
        width: 2px;
        background: var(--accent);
        border-radius: 2px;
    }

[dir="ltr"] .gaibra-convo--active::before {
    right: auto;
    left: 0;
}

.gaibra-convo__title {
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 400;
    color: var(--fg-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}

.gaibra-convo--active .gaibra-convo__title {
    color: var(--fg);
    font-weight: 600;
}

.gaibra-convo__time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-faint);
    margin-top: 2px;
    letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════════════
   CHAT THREAD
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-chat {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-bottom: 140px; /* clear floating composer */
}

.gaibra-chat__inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGES
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-msg {
    animation: g-msg-in 0.22s ease-out;
}

@keyframes g-msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.g-role-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-faint);
    display: block;
    margin-bottom: 10px;
}

/* USER message — card with right accent border */
.gaibra-msg--user {
    background: var(--msg-user-bg);
    padding: 18px 20px;
    margin-top: 20px;
    border-radius: 12px;
    border-right: 2px solid var(--accent);
    transition: background 0.3s;
}

[dir="ltr"] .gaibra-msg--user {
    border-right: none;
    border-left: 2px solid var(--accent);
}

.gaibra-msg--user .g-role-label {
    color: var(--accent);
    opacity: 0.8;
}

.gaibra-msg--user .gaibra-msg__content {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.85;
    color: var(--fg);
    font-weight: 500;
}

/* ASSISTANT message — flowing text, no card */
.gaibra-msg--ai {
    padding: 20px 4px;
    border-bottom: 1px solid var(--border);
}

    .gaibra-msg--ai:last-of-type {
        border-bottom: none;
    }

.gaibra-msg__content {
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.9;
    color: var(--fg);
    word-wrap: break-word;
}

    /* Headings inside AI message */
    .gaibra-msg__content h3,
    .gaibra-msg__content h4 {
        font-family: var(--font-hd);
        font-weight: 700;
        color: var(--fg);
    }

    .gaibra-msg__content h3 {
        font-size: 18px;
        margin: 14px 0 8px;
        line-height: 1.5;
    }

    .gaibra-msg__content h4 {
        font-size: 15px;
        margin: 16px 0 6px;
    }

    .gaibra-msg__content p {
        margin: 0 0 8px;
        color: var(--fg-dim);
        font-weight: 400;
    }

    /* Lists — with accent arrow markers */
    .gaibra-msg__content ul {
        list-style: none;
        padding: 0;
        margin: 0 0 8px;
    }

        .gaibra-msg__content ul li {
            padding-right: 16px;
            display: flex;
            gap: 8px;
            align-items: flex-start;
            margin-bottom: 4px;
        }

[dir="ltr"] .gaibra-msg__content ul li {
    padding-right: 0;
    padding-left: 16px;
}

.gaibra-msg__content ul li::before {
    content: '\25B6';
    color: var(--accent);
    flex-shrink: 0;
    font-size: 11px;
    margin-top: 7px;
    opacity: 0.6;
}

.gaibra-msg__content ul li strong {
    color: var(--fg);
    font-weight: 600;
}

/* Blockquote */
.gaibra-msg__content blockquote {
    border-right: 2px solid var(--accent);
    padding-right: 14px;
    margin: 0.5em 0;
    color: var(--fg-dim);
}

[dir="ltr"] .gaibra-msg__content blockquote {
    border-right: none;
    border-left: 2px solid var(--accent);
    padding-right: 0;
    padding-left: 14px;
}

/* Code */
.gaibra-msg__content code:not(.gcb-code) {
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 2px 5px;
    background: var(--bg-alt);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
}

.gaibra-msg__content pre:not(.gcb pre) {
    font-family: var(--font-mono);
    padding: 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}
/* Ensure .gcb code blocks override any inherited styles */
.gaibra-msg__content .gcb-code {
    padding: 12px 16px 12px 14px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

.gaibra-msg__content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ═══════════════════════════════════════════════════════════════════════
   THINKING LOGO — brain with pulsing red neural nodes
   ─────────────────────────────────────────────────────────────────────
   HTML:
   <div class="gaibra-thinking">
     <span class="g-role-label" style="color:#FF3D1F;opacity:0.9">GAIBRA THINKING</span>
     <div class="gaibra-thinking-logo">
       <img src="/path/to/gaibra-logo.jpg" alt="" />
       <svg viewBox="0 0 100 100"> ... 14 nodes ... </svg>
     </div>
   </div>
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-thinking {
    padding: 30px 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: g-think-in 0.4s ease;
}

@keyframes g-think-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gaibra-thinking-logo {
    position: relative;
    width: 88px;
    height: 88px;
    animation: g-logo-float 2.2s ease-in-out infinite;
}

    .gaibra-thinking-logo img {
        width: 100%;
        height: 100%;
        display: block;
    }

    .gaibra-thinking-logo svg {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
    }

@keyframes g-logo-float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* Each neural node pulses with staggered timing */
.gaibra-thinking-logo .g-node {
    transform-origin: center;
    animation: g-node-blaze 1.5s ease-in-out infinite;
}

@keyframes g-node-blaze {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }

    20% {
        opacity: 1;
        transform: scale(1.1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1);
    }

    80% {
        opacity: 0.3;
        transform: scale(0.9);
    }

    100% {
        opacity: 0;
        transform: scale(0.6);
    }
}

/* Staggered delays for 14 nodes */
.gaibra-thinking-logo .g-node:nth-child(1) {
    animation-delay: 0.00s;
    animation-duration: 1.2s;
}

.gaibra-thinking-logo .g-node:nth-child(2) {
    animation-delay: 0.13s;
    animation-duration: 1.5s;
}

.gaibra-thinking-logo .g-node:nth-child(3) {
    animation-delay: 0.26s;
    animation-duration: 1.8s;
}

.gaibra-thinking-logo .g-node:nth-child(4) {
    animation-delay: 0.39s;
    animation-duration: 1.2s;
}

.gaibra-thinking-logo .g-node:nth-child(5) {
    animation-delay: 0.52s;
    animation-duration: 1.5s;
}

.gaibra-thinking-logo .g-node:nth-child(6) {
    animation-delay: 0.65s;
    animation-duration: 1.8s;
}

.gaibra-thinking-logo .g-node:nth-child(7) {
    animation-delay: 0.78s;
    animation-duration: 1.2s;
}

.gaibra-thinking-logo .g-node:nth-child(8) {
    animation-delay: 0.91s;
    animation-duration: 1.5s;
}

.gaibra-thinking-logo .g-node:nth-child(9) {
    animation-delay: 1.04s;
    animation-duration: 1.8s;
}

.gaibra-thinking-logo .g-node:nth-child(10) {
    animation-delay: 1.17s;
    animation-duration: 1.2s;
}

.gaibra-thinking-logo .g-node:nth-child(11) {
    animation-delay: 1.30s;
    animation-duration: 1.5s;
}

.gaibra-thinking-logo .g-node:nth-child(12) {
    animation-delay: 1.43s;
    animation-duration: 1.8s;
}

.gaibra-thinking-logo .g-node:nth-child(13) {
    animation-delay: 1.56s;
    animation-duration: 1.2s;
}

.gaibra-thinking-logo .g-node:nth-child(14) {
    animation-delay: 1.69s;
    animation-duration: 1.5s;
}

/* ═══════════════════════════════════════════════════════════════════════
   COMPOSER — floating, centered, DeepSeek-style
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-composer-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--composer-gradient);
    padding: 20px;
    pointer-events: none;
    z-index: 20;
}

.gaibra-composer {
    max-width: 760px;
    margin: 0 auto;
    pointer-events: auto;
}

.gaibra-composer__input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--composer-input-bg);
    border: 1px solid var(--composer-input-border);
    border-radius: var(--composer-radius);
    padding: 10px 14px;
    box-shadow: var(--composer-shadow);
    transition: all 0.2s ease;
}

    .gaibra-composer__input-row:focus-within {
        border-color: var(--accent);
        box-shadow: var(--composer-shadow), 0 0 0 3px var(--accent-soft);
    }

.gaibra-composer__field {
    flex: 1;
    font-size: 14px;
    color: var(--fg);
    font-family: var(--font-body);
    padding: 6px 0;
    min-height: 24px;
    max-height: 200px; /* ~8 lines (24px × 8), then scrollbar */
    outline: none;
    line-height: 1.7;
    caret-color: var(--accent);
    border: none;
    background: transparent;
    resize: none;
    overflow-y: hidden; /* hidden until content exceeds max-height */
    transition: height 0.1s ease;
}

    .gaibra-composer__field::placeholder {
        color: var(--fg-faint);
    }

.gaibra-composer__send {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--border-strong);
    border: none;
    color: var(--fg-faint);
    cursor: not-allowed;
    border-radius: var(--send-radius);
    transition: all 0.15s;
    opacity: 0.35;
}

.gaibra-composer__send--active {
    background: var(--accent);
    color: var(--accent-fg);
    cursor: pointer;
    opacity: 1;
}

    .gaibra-composer__send--active:hover {
        transform: scale(1.05) translateY(-1px);
    }

    .gaibra-composer__send--active:active {
        transform: scale(1);
    }

.gaibra-composer__attach {
    background: transparent;
    border: none;
    color: var(--fg-faint);
    cursor: pointer;
    padding: 4px;
    display: flex;
    flex-shrink: 0;
}

    .gaibra-composer__attach:hover {
        color: var(--fg-dim);
    }

.gaibra-composer__footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 6px;
}

    .gaibra-composer__footer span {
        font-family: var(--font-mono);
        font-size: 9px;
        color: var(--fg-faint);
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

/* ═══════════════════════════════════════════════════════════════════════
   EMPTY STATE — DeepSeek-style centered intro
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    animation: g-fade-up 0.5s ease both;
}

@keyframes g-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.g-eyebrow {
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--fg);
    opacity: 0.85;
    margin-bottom: 18px;
}

.gaibra-empty__logo {
    height: 64px;
    margin-bottom: 18px;
    opacity: 0.85;
}

.gaibra-empty__wordmark {
    font-family: var(--font-mono);
    font-size: 40px;
    font-weight: 600;
    letter-spacing: 6px;
    color: var(--fg);
    line-height: 1;
    margin-bottom: 14px;
}

.gaibra-empty__tagline {
    font-family: var(--font-hd);
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    line-height: 1.7;
    max-width: 440px;
    margin: 0 0 6px;
}

.gaibra-empty__sub {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 300;
    color: var(--fg-faint);
    line-height: 1.8;
    max-width: 440px;
    margin: 0 0 28px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gaibra-empty__composer-wrap {
    width: 100%;
    max-width: 680px;
}

/* Hint chips (dual-label) */
.gaibra-hints {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.gaibra-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 20px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--fg-dim);
    cursor: pointer;
    background: transparent;
    transition: all 0.15s ease;
}

    .gaibra-hint:hover {
        border-color: var(--accent);
        color: var(--fg);
        background: var(--bg-accent-soft);
    }

.gaibra-hint__en {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--fg-faint);
    letter-spacing: 0.12em;
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS — generic
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-btn {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: none;
}

.gaibra-btn--primary {
    background: var(--accent);
    color: var(--accent-fg);
    font-family: var(--font-hd);
    font-weight: 700;
}

    .gaibra-btn--primary:hover {
        opacity: 0.9;
    }

.gaibra-btn--outline {
    background: transparent;
    color: var(--fg-dim);
    border-color: var(--border-strong);
}

    .gaibra-btn--outline:hover {
        border-color: var(--fg-dim);
        color: var(--fg);
    }

.gaibra-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTH CARD (Login / Register)
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-auth {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.gaibra-auth__card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-alt);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    overflow: hidden;
}

.gaibra-auth__accent {
    height: 2px;
    background: var(--accent);
}

.gaibra-auth__body {
    padding: 28px 28px 24px;
}

.gaibra-auth__logo-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-accent-soft);
    border: 1.5px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    overflow: hidden;
}

    .gaibra-auth__logo-ring img {
        height: 32px;
    }

.gaibra-auth__heading {
    font-family: var(--font-hd);
    font-size: 20px;
    font-weight: 700;
    color: var(--fg);
    text-align: center;
    margin-bottom: 4px;
}

.gaibra-auth__sub {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--fg-dim);
    text-align: center;
    line-height: 1.75;
    max-width: 280px;
    margin: 0 auto 24px;
}

/* Numbered feature list */
.gaibra-auth__features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.gaibra-auth__feat {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--fg-dim);
}

.gaibra-auth__feat-n {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
    opacity: 0.8;
}

/* Form field */
.gaibra-field {
    margin-bottom: 12px;
}

.gaibra-field__label {
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-faint);
    margin-bottom: 6px;
}

.gaibra-field__input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--fg);
    font-size: 13px;
    font-family: var(--font-mono);
    outline: none;
    direction: ltr;
    text-align: left;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .gaibra-field__input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-soft);
    }

/* Auth actions row */
.gaibra-auth__actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

    .gaibra-auth__actions .gaibra-btn--primary {
        flex: 1;
        padding: 11px 0;
    }

    .gaibra-auth__actions .gaibra-btn--outline {
        padding: 11px 20px;
    }

.gaibra-auth__switch {
    text-align: center;
    margin-top: 16px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--fg-dim);
}

    .gaibra-auth__switch a {
        color: var(--accent);
        cursor: pointer;
        font-weight: 600;
        text-decoration: none;
    }

.g-footer-note {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--fg-faint);
    margin-top: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   DIALOG / MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.gaibra-dialog {
    background: var(--bg-alt);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.gaibra-dialog__accent {
    height: 2px;
    background: var(--accent);
}

.gaibra-dialog__title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.5px;
    color: var(--fg);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    padding: 14px 20px;
}

.gaibra-dialog__content {
    padding: 20px;
    color: var(--fg);
}

.gaibra-dialog__actions {
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .gaibra-sidebar {
        width: 100%;
        max-width: 280px;
        position: absolute;
        z-index: 30;
        height: 100%;
    }

    .gaibra-chat {
        padding-bottom: 160px;
    }

    .gaibra-chat__inner,
    .gaibra-composer {
        padding: 0 12px;
    }

    .gaibra-empty__wordmark {
        font-size: 32px;
        letter-spacing: 4px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════════════ */
@media print {
    .gaibra-sidebar,
    .gaibra-appbar,
    .gaibra-composer-wrap {
        display: none !important;
    }

    .gaibra-app,
    .gaibra-main,
    .gaibra-chat {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    @page {
        size: A4;
        margin: 15mm;
    }
}
