/* Credit: UI polish tokens adapted from unslop by Damir Sokolovsky (@heydamir), CC BY 4.0 */

:root {
    --v2-primary: #10a37f;
    --v2-primary-hover: #0d8a6a;
    --v2-input-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    --v2-border: rgba(23, 23, 23, 0.08);
    --v2-card-border: rgba(23, 23, 23, 0.08);
    --v2-sidebar-border: rgba(23, 23, 23, 0.08);
    --v2-input-border: rgba(23, 23, 23, 0.14);
}

/* Remove purple-slate dark palette and unify onto Graphite instrument ramp */
[data-theme="dark"] {
    --v2-bg-main: #141415;
    --v2-bg-sidebar: #0f0f10;
    --v2-bg-sidebar-hover: #19191b;
    --v2-bg-sidebar-active: #232325;
    --v2-sidebar-text: #ededed;
    --v2-sidebar-text-muted: #85858b;
    --v2-sidebar-border: rgba(237, 237, 237, 0.08);
    --v2-sidebar-accent: #10a37f;
    --v2-sidebar-cta: #ededed;
    --v2-sidebar-cta-hover: #d4d4d8;
    --v2-text-main: #ededed;
    --v2-text-secondary: #a1a1a6;
    --v2-text-muted: #85858b;
    --v2-card-bg: #19191b;
    --v2-card-border: rgba(237, 237, 237, 0.08);
    --v2-bubble-user: #232325;
    --v2-bubble-user-text: #ededed;
    --v2-bubble-ai: transparent;
    --v2-border: rgba(237, 237, 237, 0.08);
    --v2-input-bg: #19191b;
    --v2-input-border: rgba(237, 237, 237, 0.14);
    --v2-input-shadow: none;
    --v2-code-bg: #0f0f10;
    --v2-think-bg: #19191b;
    --v2-think-border: rgba(237, 237, 237, 0.08);
}

/* Quiet chrome & tabular numerals */
.v2-token-badge,
.v2-canvas-lines-info,
#v2-canvas-lines-info {
    font-variant-numeric: tabular-nums;
}

.v2-composer-capsule,
.v2-header-btn,
.v2-model-selector-btn,
.v2-mode-card,
.v2-tool-pill,
.v2-composer-send-btn {
    transition: background-color 150ms cubic-bezier(0.22, 1, 0.36, 1),
                border-color 150ms cubic-bezier(0.22, 1, 0.36, 1),
                color 150ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.v2-welcome-title {
    font-weight: 500;
    letter-spacing: -0.015em;
}

/* Sidebar Daily Token Quota Bar */
.v2-quota-bar-card {
    display: block;
    text-decoration: none;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--v2-sidebar-border);
    transition: background-color 150ms ease, border-color 150ms ease;
}
.v2-quota-bar-card:hover {
    background: rgba(0, 0, 0, 0.055);
}
[data-theme="dark"] .v2-quota-bar-card {
    background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .v2-quota-bar-card:hover {
    background: rgba(255, 255, 255, 0.07);
}
.v2-quota-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 11px;
    line-height: 1.2;
}
.v2-quota-bar-title {
    font-weight: 600;
    color: var(--v2-sidebar-text);
}
.v2-quota-bar-meta {
    font-weight: 600;
    color: var(--v2-sidebar-text-muted);
    font-variant-numeric: tabular-nums;
}
.v2-quota-bar-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}
[data-theme="dark"] .v2-quota-bar-track {
    background: rgba(255, 255, 255, 0.12);
}
.v2-quota-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 250ms ease, background-color 200ms ease;
}
.v2-quota-bar-fill.is-ok { background: #10a37f; }
.v2-quota-bar-fill.is-warn { background: #f59e0b; }
.v2-quota-bar-fill.is-danger { background: #ef4444; }
.v2-quota-bar-fill.is-unlimited { background: #0d9488; }

/* Per-message Inline Token Bar Badge */
.v2-token-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.045);
    color: var(--v2-text-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}
.v2-token-badge.free {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}
[data-theme="dark"] .v2-token-badge {
    background: rgba(255, 255, 255, 0.07);
}
[data-theme="dark"] .v2-token-badge.free {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.v2-token-bar-label {
    font-size: 10.5px;
    opacity: 0.85;
}
.v2-token-bar-track {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    overflow: hidden;
    flex-shrink: 0;
}
[data-theme="dark"] .v2-token-bar-track {
    background: rgba(255, 255, 255, 0.16);
}
.v2-token-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 220ms ease;
}
.v2-token-bar-fill.is-free { background: #10b981; }
.v2-token-bar-fill.is-low { background: #10a37f; }
.v2-token-bar-fill.is-mid { background: #f59e0b; }
.v2-token-bar-fill.is-high { background: #ef4444; }
.v2-token-bar-pct {
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
