/* ── Reset ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Shared ── */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #000;
    color: #fff;
}

/* ════════════════════════════════════════MAIN BROWSER (index.html)
════════════════════════════════════════ */

body.browser {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Tab bar ── */
.tab-bar {
    display: flex;
    align-items: stretch;
    background: #000;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    min-height: 38px;
    flex-shrink: 0;border-bottom: 1px solid #1a1a1a;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px 0 10px;
    background: #000;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    color: #3a3a3a;
    white-space: nowrap;
    max-width: 180px;
    min-width: 80px;
    transition: color 0.15s;
    user-select: none;
    flex-shrink: 0;align-self: stretch;
    border-right: 1px solid #1a1a1a;
}

.tab:first-child {
    border-left: 1px solid #1a1a1a;
}

.tab:hover { color: #888; }

.tab.active {
    color: #fff;
    font-weight: 500;
}

.tab-favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;object-fit: contain;
}

.tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    color: #333;
    flex-shrink: 0;
    transition: color 0.15s;
}

.tab-close:hover { color: #fff; }

.tab-close svg {
    width: 11px;
    height: 11px;
}

.new-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border: none;
    border-right: 1px solid #1a1a1a;
    color: #333;
    padding: 0 10px;
    cursor: pointer;
    flex-shrink: 0;
    align-self: stretch;
    transition: color 0.15s;
}

.new-tab-btn svg {
    width: 14px;
    height: 14px;
}

.new-tab-btn:hover { color: #fff; }
.new-tab-btn:active { transform: scale(0.92); }

/* ── Toolbar ── */
.toolbar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #000;
    border-bottom: 1px solid #1a1a1a;
    align-items: center;
    flex-shrink: 0;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #444;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s;
    flex-shrink: 0;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

.nav-btn:hover { color: #fff; }
.nav-btn:active { transform: scale(0.92); }

.url-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    padding: 0 12px;
    gap: 8px;
    transition: border-color 0.2s;
}

.url-bar:focus-within { border-color: #333; }

.url-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #e0e0e0;
    font-size: 13px;
    font-family: 'Inter', system-ui, sans-serif;
    padding: 7px 0;
    min-width: 0;
}

.url-bar input::placeholder { color: #333; }

.go-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #333;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s;flex-shrink: 0;
}

.go-btn svg {
    width: 15px;
    height: 15px;
}

.go-btn:hover {
    color: #fff;background: none;
}

/* ── Status dot ── */
.status-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: default;
    transition: background 0.3s;
}

.status-dot.ready { background: #22c55e; }
.status-dot.error { background: #ef4444; }
.status-dot.init  { background: #f59e0b; }

.status-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #aaa;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
}

.status-wrap:hover .status-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* ── Frames ── */
.frames {
    flex: 1;
    position: relative;
    overflow: hidden;
}

iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    display: none;
}

iframe.active { display: block; }


/* ════════════════════════════════════════
   NEW TAB PAGE (newtab.html)
════════════════════════════════════════ */

body.newtab {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
}

.newtab-logo {
    width: 200px;
    user-select: none;
}

.search-container {
    width: 100%;
    max-width: 540px;
    padding: 0 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 10px 16px;
    gap: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.03);
}

.search-icon {
    color: #333;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-icon svg {
    width: 16px;
    height: 16px;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #e0e0e0;
    font-size: 15px;
    font-family: 'Inter', system-ui, sans-serif;
    caret-color: #fff;
}

.search-input::placeholder { color: #333; }

.search-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;flex-shrink: 0;
}

.search-btn svg {
    width: 16px;
    height: 16px;
}

.search-btn:hover {
    color: #fff;
    background: none;
}

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

.newtab-hint {
    font-size: 12px;
    color: #222;
    font-weight: 500;
    letter-spacing: 0.01em;
}