#toolbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 46px;
    background: rgba(8, 9, 16, 0.78);
    border-bottom: 1px solid var(--line);
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    z-index: 50;
    backdrop-filter: blur(14px);
}

#toolbar.visible {
    display: flex;
    animation: slideDown 0.3s var(--ease);
}

.tb-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--fg-3);
    transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.12s var(--ease);
    flex-shrink: 0;
}

.tb-btn:hover {
    background: rgba(200, 195, 230, 0.06);
    color: var(--fg);
}

.tb-btn:active { transform: scale(0.92); }

.tb-btn:disabled {
    opacity: 0.25;
    cursor: default;
}
.tb-btn:disabled:hover { background: transparent; color: var(--fg-3); }

#urlBar {
    flex: 1;
    height: 30px;
    margin: 0 4px;
    background: rgba(200, 195, 230, 0.03);
    border-radius: 7px;
    border: 1px solid var(--line);
    padding: 0 12px;
    color: var(--fg);
    font-size: 12px;
    font-weight: 400;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
    line-height: 28px;
    outline: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
    font-family: inherit;
}

#urlBar:focus {
    border-color: var(--line-3);
    background: rgba(200, 195, 230, 0.05);
    overflow: auto;
    text-overflow: clip;
}

#urlBar:empty::before {
    content: attr(data-placeholder);
    color: var(--fg-3);
    pointer-events: none;
}

.tab-strip {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(5, 6, 13, 0.85);
    border-bottom: 1px solid var(--line);
    align-items: center;
    padding: 4px 8px 0;
    z-index: 51;
    backdrop-filter: blur(14px);
    gap: 4px;
}
.tab-strip.visible { display: flex; }
.tab-strip.visible ~ #toolbar { top: 36px; }
.tab-strip.visible ~ #lineLoader { top: 82px; }
.tab-strip.visible ~ #frame { top: 82px; height: calc(100vh - 82px); }
.tab-strip.visible ~ #slowToast { top: 120px; }

.tab-list {
    display: flex;
    flex: 1;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    align-items: center;
}
.tab-list::-webkit-scrollbar { height: 0; }

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 6px 0 11px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px 6px 0 0;
    color: var(--fg-3);
    font-size: 11.5px;
    cursor: pointer;
    max-width: 200px;
    min-width: 90px;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease;
    user-select: none;
}
.tab-item:hover { background: rgba(200, 195, 230, 0.05); color: var(--fg-2); }
.tab-item.active {
    background: rgba(200, 195, 230, 0.08);
    border-color: rgba(200, 195, 230, 0.14);
    border-bottom-color: transparent;
    color: var(--fg);
}
.tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}
.tab-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    border-radius: 4px;
    color: var(--fg-3);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
    flex-shrink: 0;
}
.tab-item:hover .tab-close,
.tab-item.active .tab-close { opacity: 1; }
.tab-close:hover { background: rgba(200, 195, 230, 0.15); color: var(--fg); }

.tab-add {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--fg-3);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    flex-shrink: 0;
}
.tab-add:hover { background: rgba(200, 195, 230, 0.08); color: var(--fg); }

.online-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    height: 22px;
    border-radius: 5px;
    background: rgba(200, 195, 230, 0.06);
    border: 1px solid rgba(200, 195, 230, 0.1);
    font-size: 10.5px;
    font-family: 'JetBrains Mono', 'Space Mono', ui-monospace, monospace;
    color: var(--fg-2);
    flex-shrink: 0;
    margin-left: 6px;
    align-self: center;
}
.online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7ce0a8;
    box-shadow: 0 0 6px rgba(124, 224, 168, 0.6);
    animation: onlineDotPulse 2s ease-in-out infinite;
}
@keyframes onlineDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
.online-num {
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
