/* BITB chrome — two-row layout: title bar + tab on top, nav + URL bar below */

#bitb-window {
    width: min(1100px, 96vw);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: width 120ms ease, height 120ms ease;
}

#bitb-window.compact {
    width: min(520px, 92vw);
}

#bitb-window.maximized {
    width: 96vw !important;
    height: 92vh;
}

#bitb-window.maximized #bitb-iframe {
    height: calc(92vh - 80px); /* 80 = titlebar (36) + toolbar (44) */
}

/* --- Title bar (top row): tab + window controls --- */
#bitb-titlebar {
    background: #dee1e6;
    height: 36px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding-left: 8px;
    user-select: none;
    cursor: move;
}

#bitb-tab {
    background: #fff;
    border-radius: 8px 8px 0 0;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 260px;
    margin-top: 5px;
    font-size: 12px;
    color: #3c4043;
    border: 1px solid #d6dae0;
    border-bottom: none;
    flex-shrink: 0;
}

#bitb-tab .favicon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

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

#bitb-controls {
    display: flex;
    align-items: stretch;
    color: #1f1f1f;
}

#bitb-controls .ctl {
    width: 44px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 100ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    padding: 0;
}

#bitb-controls .ctl:hover {
    background: rgba(0, 0, 0, 0.08);
}

#bitb-controls .ctl.exit:hover {
    background: #E81123;
    color: #fff;
}

/* --- Toolbar (second row): nav buttons + URL bar --- */
#bitb-toolbar {
    background: #f1f3f4;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-bottom: 1px solid #dadce0;
    user-select: none;
}

#bitb-toolbar .nav-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    border-radius: 50%;
    font-size: 16px;
    cursor: default;
    flex-shrink: 0;
}

#bitb-toolbar .nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

#bitb-urlbar {
    flex: 1;
    min-width: 0;
    height: 30px;
    background: #fff;
    border-radius: 15px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    font-size: 13px;
    color: #3c4043;
    cursor: text;
}

#bitb-urlbar .padlock {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

#bitb-urlbar .url-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
    color: #1f1f1f;
    font-family: inherit;
    padding: 0;
    min-width: 0;
}

#bitb-iframe {
    width: 100%;
    height: 700px;
    border: 0;
    background: #fff;
    display: block;
    pointer-events: auto;
}

@media (max-width: 600px) {
    #bitb-iframe { height: 480px; }
    #bitb-titlebar { height: 32px; }
    #bitb-toolbar { height: 40px; }
}
