/* Browser tab (browser.js) — full-width like MyTube */
#browser.tab-content {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
}

.br-shell {
    --br-a: #7c83ff;
    --br-b: #c56bff;
    --br-c: #3ee0ff;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 120px);
    min-height: 420px;
    background: #080a16;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 80px -30px rgba(124, 131, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.br-shell:fullscreen { height: 100vh; border-radius: 0; }

/* ---------- toolbar ---------- */
.br-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(26, 30, 58, 0.95), rgba(16, 19, 40, 0.95));
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(14px);
}
.br-nav {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.br-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #d9dcff;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.br-btn svg, .br-lock svg, .br-hero svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.br-btn:hover:not(:disabled) { background: rgba(124, 131, 255, 0.18); color: #fff; }
.br-btn:active:not(:disabled) { transform: scale(0.9); }
.br-btn:focus { outline: none; }
.br-btn:focus-visible { box-shadow: 0 0 0 2px var(--br-a); }
.br-btn:disabled { opacity: 0.28; cursor: default; }
.br-shell.is-loading #brReload svg { animation: br-spin 0.9s linear infinite; }

.br-form {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.br-lock {
    position: absolute;
    left: 14px;
    display: flex;
    color: #6ef2b1;
    pointer-events: none;
}
.br-lock svg { width: 14px; height: 14px; }
.br-url {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    padding: 0 16px 0 36px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(5, 7, 18, 0.7);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.br-url::placeholder { color: rgba(220, 224, 255, 0.4); }
.br-url:focus {
    border-color: rgba(124, 131, 255, 0.7);
    background: rgba(5, 7, 18, 0.95);
    box-shadow: 0 0 0 4px rgba(124, 131, 255, 0.15), 0 0 24px rgba(124, 131, 255, 0.25);
}
.br-progress {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.br-progress::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--br-c), var(--br-b), transparent);
    animation: br-bar 1.1s ease-in-out infinite;
}
.br-shell.is-loading .br-progress { opacity: 1; }
@keyframes br-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- viewport ---------- */
.br-view { position: relative; flex: 1; min-height: 0; }
.br-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    display: block;
}

/* ---------- home / new tab page ---------- */
.br-home {
    position: relative;
    height: 100%;
    overflow: auto;
    isolation: isolate;
}
.br-aurora {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    filter: blur(70px) saturate(140%);
    opacity: 0.55;
    pointer-events: none;
}
.br-aurora span {
    position: absolute;
    width: 46vmax;
    height: 46vmax;
    border-radius: 50%;
}
.br-aurora span:nth-child(1) { background: var(--br-a); top: -20%; left: -10%; animation: br-drift1 18s ease-in-out infinite alternate; }
.br-aurora span:nth-child(2) { background: var(--br-b); bottom: -30%; right: -10%; animation: br-drift2 22s ease-in-out infinite alternate; }
.br-aurora span:nth-child(3) { background: var(--br-c); top: 30%; left: 40%; width: 28vmax; height: 28vmax; opacity: 0.6; animation: br-drift3 16s ease-in-out infinite alternate; }
@keyframes br-drift1 { to { transform: translate(18%, 22%) scale(1.15); } }
@keyframes br-drift2 { to { transform: translate(-22%, -15%) scale(0.9); } }
@keyframes br-drift3 { to { transform: translate(-40%, -30%) scale(1.3); } }

.br-gridfx {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
    pointer-events: none;
}

.br-home-inner {
    min-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 40px 16px;
    animation: br-rise 0.6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes br-rise { from { opacity: 0; transform: translateY(14px); } }

.br-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #c9ffe4;
    background: rgba(110, 242, 177, 0.08);
    border: 1px solid rgba(110, 242, 177, 0.25);
}
.br-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6ef2b1;
    box-shadow: 0 0 0 0 rgba(110, 242, 177, 0.7);
    animation: br-ping 2s infinite;
}
@keyframes br-ping { 70% { box-shadow: 0 0 0 8px rgba(110, 242, 177, 0); } 100% { box-shadow: 0 0 0 0 rgba(110, 242, 177, 0); } }

.br-time {
    margin-bottom: -14px;
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(220, 224, 255, 0.55);
    font-variant-numeric: tabular-nums;
}
.br-logo {
    font-size: clamp(34px, 6vw, 64px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 40px rgba(124, 131, 255, 0.35);
}
.br-logo span {
    background: linear-gradient(90deg, var(--br-c), var(--br-a), var(--br-b), var(--br-c));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: br-shine 6s linear infinite;
}
@keyframes br-shine { to { background-position: 300% 0; } }

.br-hero {
    position: relative;
    display: flex;
    align-items: center;
    width: min(620px, 100%);
    height: 58px;
    padding: 0 8px 0 20px;
    box-sizing: border-box;
    border-radius: 20px;
    background: rgba(10, 12, 28, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
    transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
}
.br-hero::before {
    content: '';
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: 21px;
    padding: 1px;
    background: linear-gradient(120deg, var(--br-c), var(--br-a), var(--br-b));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.35;
    transition: opacity 0.25s;
}
.br-hero:focus-within {
    transform: translateY(-2px);
    border-color: transparent;
    box-shadow: 0 0 0 6px rgba(124, 131, 255, 0.12), 0 0 60px -10px rgba(124, 131, 255, 0.6);
}
.br-hero:focus-within::before { opacity: 1; }
.br-hero-icon { flex: none; color: rgba(220, 224, 255, 0.55); width: 20px !important; height: 20px !important; }
.br-hero input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 14px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 17px;
    outline: none;
}
.br-hero input::placeholder { color: rgba(220, 224, 255, 0.4); }
.br-hero-go {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--br-a), var(--br-b));
    box-shadow: 0 6px 20px -6px var(--br-b);
    transition: transform 0.15s, filter 0.15s;
}
.br-hero-go:hover { transform: scale(1.06); filter: brightness(1.15); }
.br-hero-go:active { transform: scale(0.95); }

.br-setup {
    max-width: 440px;
    text-align: center;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255, 180, 60, 0.12);
    color: #ffd59a;
    font-size: 14px;
}

.br-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 112px);
    gap: 14px;
    margin-top: 6px;
}
.br-quick {
    --c: #7c83ff;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    background:
        radial-gradient(120px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c) 28%, transparent), transparent 70%),
        rgba(255, 255, 255, 0.035);
    color: #e4e6ff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    animation: br-rise 0.5s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 45ms + 150ms);
    transition: transform 0.2s cubic-bezier(.2, .8, .2, 1), border-color 0.2s, box-shadow 0.2s;
}
.br-quick:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--c) 60%, transparent);
    box-shadow: 0 14px 34px -12px var(--c), inset 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent);
}
.br-quick:active { transform: translateY(-2px) scale(0.97); }
.br-quick-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    font-size: 26px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--c) 40%, transparent), color-mix(in srgb, var(--c) 10%, transparent));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 16px -6px var(--c);
    transition: transform 0.25s cubic-bezier(.2, .8, .2, 1);
}
.br-quick:hover .br-quick-icon { transform: scale(1.12) rotate(-6deg); }
.br-quick-icon { overflow: hidden; }
.br-quick-icon img { width: 70%; height: 70%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.br-quick-icon.fill { background: none; }
.br-quick-icon.fill img { width: 100%; height: 100%; object-fit: cover; filter: none; }

.br-recent { width: min(620px, 100%); }
.br-recent-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(220, 224, 255, 0.5);
}
.br-recent-head button {
    border: none;
    background: none;
    color: rgba(220, 224, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
}
.br-recent-head button:hover { color: #fff; }
.br-recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.br-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 200px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #dfe2ff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.br-pill:hover { background: rgba(124, 131, 255, 0.16); border-color: rgba(124, 131, 255, 0.4); }
.br-pill b {
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    color: #fff;
}
.br-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- loading ---------- */
.br-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 16px;
    text-align: center;
    background: radial-gradient(circle at 50% 45%, rgba(40, 30, 90, 0.95), rgba(8, 10, 22, 0.97));
    color: #cfd3ff;
    font-size: 14px;
}
.br-orbit { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.br-orbit b { font-size: 30px; animation: br-bob 2s ease-in-out infinite; }
.br-orbit span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--br-c);
    animation: br-spin 1.2s linear infinite;
}
.br-orbit span:nth-child(2) { inset: 9px; border-top-color: var(--br-a); animation-duration: 1.6s; animation-direction: reverse; }
.br-orbit span:nth-child(3) { inset: 18px; border-top-color: var(--br-b); animation-duration: 0.9s; }
@keyframes br-spin { to { transform: rotate(360deg); } }
@keyframes br-bob { 50% { transform: translateY(-4px) scale(1.06); } }

.br-shell .hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .br-aurora span, .br-logo span, .br-dot { animation: none; }
}

@media (max-width: 900px) {
    .br-shell { height: calc(100dvh - 170px); border-radius: 0; }
    .br-bar { gap: 6px; padding: 8px; }
    .br-nav { padding: 2px; }
    .br-btn { width: 30px; height: 30px; }
    #brFull { display: none; }
    .br-quick-grid { grid-template-columns: repeat(3, minmax(0, 88px)); gap: 10px; }
    .br-quick { padding: 12px 4px 10px; font-size: 11px; }
    .br-quick-icon { width: 40px; height: 40px; font-size: 21px; }
    .br-hero { height: 52px; }
    .br-hero input { font-size: 16px; }
}
