* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* Header — Glassmorphism */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(28,28,30,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    gap: 6px;
}
.header h1 {
    font-size: 1.1em; color: #fff; white-space: nowrap;
    font-weight: 600; letter-spacing: -0.02em;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.disk-info {
    font-size: 0.7em; color: #8e8e93;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    white-space: nowrap;
}
.header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Pipeline power button */
.power-btn {
    width: 40px; height: 40px;
    border: 2px solid rgba(255,255,255,0.15); border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #8e8e93;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    font-size: 0.6em; font-weight: 600;
}
.power-btn:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.25); }
.power-btn:active { transform: scale(0.9); transition: transform 0.05s; }
.power-btn.on { border-color: #30d158; color: #30d158; background: rgba(48,209,88,0.15); }
.power-btn.starting { border-color: #ff9f0a; color: #ff9f0a; background: rgba(255,159,10,0.15); animation: pulse 1s infinite; }
.power-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.power-btn.ir-on { border-color: #ff453a; color: #ff453a; background: rgba(255,69,58,0.15); }
.power-btn.led-on { border-color: #ff9f0a; color: #ff9f0a; background: rgba(255,159,10,0.15); }
.power-btn.irled-on { border-color: #ff453a; color: #ff453a; background: rgba(255,69,58,0.15); }
.power-btn.spk-on { border-color: #ff9f0a; color: #ff9f0a; background: rgba(255,159,10,0.15); }
.power-btn.mic-on { border-color: #30d158; color: #30d158; background: rgba(48,209,88,0.15); }
.pipeline-label {
    font-size: 0.6em; color: #8e8e93;
    text-align: center; margin-top: 2px;
}

.status-badge {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.8em; color: #8e8e93;
}
.viewer-badge {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.75em; color: #30d158;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

/* Toolbar toggle */
.toolbar-toggle {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    color: #8e8e93; cursor: pointer; padding: 5px 7px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.toolbar-toggle:hover { background: rgba(255,255,255,0.15); color: #fff; }
.toolbar-toggle.active { background: rgba(10,132,255,0.2); border-color: #0a84ff; color: #0a84ff; }

/* Toolbar — Glassmorphism */
.toolbar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(28,28,30,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
}
.toolbar.open { display: flex; }
.rec-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #636366; display: inline-block;
}
.rec-dot.active {
    background: #ff453a;
    animation: pulse 1s infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* Main content — 2-column: video (left) + tabbed controls (right) */
.main {
    max-width: 1920px; margin: 0 auto; padding: 8px 16px;
    display: flex; gap: 12px; width: 100%;
    height: calc(100vh - 52px); height: calc(100dvh - 52px);
    overflow: hidden;
}
.main.toolbar-open { height: calc(100vh - 108px); height: calc(100dvh - 108px); }
.video-column { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.video-area-sticky { display: flex; flex-direction: column; min-height: 0; }
.controls-panel {
    width: 340px; flex-shrink: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
    border-left: 0.5px solid rgba(255,255,255,0.08);
    padding-left: 12px;
}

/* Tab bar — iOS segment style */
.panel-tabs {
    display: flex; gap: 2px;
    padding: 3px; margin-bottom: 8px;
    background: rgba(118,118,128,0.24);
    border-radius: 8px; flex-shrink: 0;
}
.panel-tab {
    flex: 1; padding: 5px 0;
    border: none; border-radius: 6px;
    background: transparent; color: #8e8e93;
    cursor: pointer; font-size: 0.72em; font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    transition: all 0.2s; text-align: center;
}
.panel-tab:hover { color: #fff; }
.panel-tab.active {
    background: #636366; color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Tab content — scrollable */
.panel-content { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Video area */
.video-wrap {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    margin: 0 auto;
    transition: max-width 0.2s;
}
.video-wrap video, .video-wrap img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    transform-origin: center center;
    transition: transform 0.3s;
}
.video-label {
    position: absolute; top: 10px; left: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3px 10px; border-radius: 6px;
    font-size: 0.75em; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.video-label.live { color: #ff453a; }
.video-label.rec { color: #30d158; }
.webrtc-stats {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255,255,255,0.1);
    padding: 8px 12px; border-radius: 12px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.68em; color: #30d158; line-height: 1.5;
    pointer-events: none; z-index: 10;
    min-width: 180px; white-space: pre;
}
.webrtc-stats .warn { color: #ff9f0a; }
.webrtc-stats .bad { color: #ff453a; }
.video-osd {
    position: absolute; bottom: 10px; left: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255,255,255,0.1);
    padding: 6px 12px; border-radius: 12px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.72em; color: rgba(255,255,255,0.85);
    line-height: 1.4;
    text-align: left;
    pointer-events: none;
}
/* Audio level monitor */
.audio-monitor {
    position: absolute; bottom: 10px; left: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 8px 10px;
    display: none;
}
.audio-monitor.active { display: block; }
.audio-monitor-header {
    font-size: 0.6em; color: #30d158;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    margin-bottom: 3px;
    display: flex; justify-content: space-between;
}
.audio-monitor canvas {
    display: block;
    border-radius: 4px;
}
.audio-sliders {
    margin-top: 4px;
    font-size: 0.55em;
    color: #8e8e93;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}
.audio-sliders label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
}
.audio-sliders input[type=range] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.2); border-radius: 2px;
    cursor: pointer;
}
.audio-sliders input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px;
    background: #fff; border-radius: 50%; cursor: pointer;
}
.audio-sliders .slider-val {
    min-width: 20px;
    text-align: right;
    color: #30d158;
}

/* Speaker control panel */
.speaker-panel {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 12px;
    display: none;
    min-width: 220px;
    z-index: 5;
}
.speaker-panel.active { display: block; }
.speaker-panel-header {
    font-size: 0.65em; color: #ff9f0a;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    margin-bottom: 6px;
    display: flex; justify-content: space-between; align-items: center;
}
.speaker-panel-header .spk-status { color: #8e8e93; }
.speaker-panel-header .spk-status.playing { color: #30d158; }
.spk-buttons {
    display: flex; gap: 8px; margin-bottom: 8px;
}
.spk-buttons button {
    flex: 1; padding: 6px 0;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    background: rgba(255,255,255,0.08); color: #ccc;
    cursor: pointer; font-size: 0.75em; font-weight: 600;
    transition: all 0.2s;
}
.spk-buttons button:hover { background: rgba(255,255,255,0.15); color: #fff; }
.spk-buttons button.active { background: #ff9f0a; color: #000; border-color: #ff9f0a; }
.spk-sliders {
    font-size: 0.6em;
    color: #8e8e93;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}
.spk-sliders label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 3px 0;
}
.spk-sliders input[type=range] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.2); border-radius: 2px;
    cursor: pointer;
}
.spk-sliders input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px;
    background: #fff; border-radius: 50%; cursor: pointer;
}
.spk-sliders .slider-val {
    min-width: 28px;
    text-align: right;
    color: #ff9f0a;
}

/* Custom playback bar (outside video-wrap, never rotates) */
.playback-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #1c1c1e;
    border-radius: 0 0 12px 12px;
    margin-top: -2px;
}
.playback-bar.active { display: flex; }
.playback-bar button {
    background: none; border: none; color: #e0e0e0;
    font-size: 1.1em; cursor: pointer; padding: 2px 6px;
}
.playback-bar button:hover { color: #0a84ff; }
.playback-bar .pb-time {
    font-size: 0.75em; color: #8e8e93;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    min-width: 90px; text-align: center;
}
.playback-bar input[type=range] {
    flex: 1; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.2); border-radius: 2px; cursor: pointer;
}
.playback-bar input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px;
    background: #fff; border-radius: 50%; cursor: pointer;
    box-shadow: 0 0.5px 4px rgba(0,0,0,0.5);
}

/* Control bar */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.ctrl-btn {
    width: 48px; height: 48px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #ccc;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.15); color: #fff; transform: scale(1.08); }
.ctrl-btn:active { transform: scale(0.88); transition: transform 0.05s; }
.ctrl-btn.active { background: #ff453a; color: #fff; }
.ctrl-btn.live-btn { background: rgba(255,255,255,0.1); }
.ctrl-btn.live-btn.connected { background: #30d158; color: #000; }
.ctrl-btn svg { width: 22px; height: 22px; fill: currentColor; }
.ctrl-btn.big { width: 56px; height: 56px; }
.ctrl-btn.big svg { width: 26px; height: 26px; }
.ctrl-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.1); margin: 0 6px; }

/* Status line */
.status-line {
    text-align: center;
    font-size: 0.8em;
    color: #636366;
    padding-bottom: 8px;
}
.status-line .filename {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    color: #0a84ff;
}

/* Recording list */
.rec-section { margin-top: 0; }
.rec-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}
.rec-section-header h3 {
    font-size: 0.85em; color: #8e8e93;
    text-transform: uppercase; letter-spacing: 0.5px;
    font-weight: 600;
}
.rec-list {
    max-height: 400px;
    overflow-y: auto;
}
.rec-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #1c1c1e;
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.rec-item:hover { background: #2c2c2e; }
.rec-item.active { background: #2c2c2e; border-left: 3px solid #0a84ff; }
.rec-item .rec-icon {
    width: 32px; height: 32px; margin-right: 10px;
    color: #636366; flex-shrink: 0;
}
.rec-item.active .rec-icon { color: #0a84ff; }
.rec-item .rec-info { flex: 1; min-width: 0; }
.rec-item .rec-name {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.85em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-item .rec-meta {
    font-size: 0.75em; color: #636366; margin-top: 2px;
}
.rec-item .rec-del {
    width: 28px; height: 28px; border: none; border-radius: 50%;
    background: transparent; color: #636366; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-left: 6px; transition: all 0.2s;
}
.rec-item .rec-del:hover { background: #ff453a; color: #fff; }
.rec-item .rec-del svg { width: 16px; height: 16px; fill: currentColor; }

/* Settings row */
.settings-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.75em; color: #8e8e93;
}
.settings-row input {
    background: #1c1c1e; border: 1px solid #38383a;
    color: #fff; padding: 4px 8px; border-radius: 8px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace; font-size: 1em; width: 170px;
}
.btn-sm {
    padding: 4px 10px; border: none; border-radius: 6px;
    background: rgba(255,255,255,0.08); color: #8e8e93; cursor: pointer;
    font-size: 0.85em; font-weight: 600;
    transition: all 0.2s;
}
.btn-sm:hover { background: rgba(255,255,255,0.15); color: #fff; }
.speed-btn {
    padding: 6px 0; border: none; border-radius: 6px;
    background: transparent; color: #8e8e93; cursor: pointer;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace; font-size: 0.8em; font-weight: 600;
    transition: all 0.2s; min-width: 40px;
}
.speed-btn:hover { color: #fff; }
.speed-btn.active {
    background: #636366; color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Control groups — iOS Segment Control style */
.ctrl-group {
    padding: 4px 0;
}
.ctrl-group-section {
    margin-bottom: 6px;
}
.ctrl-group-section > .ctrl-label {
    display: block;
    width: 100%;
    text-align: left;
    color: #8e8e93;
    font-size: 0.7em;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    margin-bottom: 2px;
    padding-left: 2px;
}
.ctrl-group-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 2px;
    background: rgba(118,118,128,0.24);
    border-radius: 8px;
}
.ctrl-group-row .speed-btn {
    flex: 1;
    text-align: center;
    min-width: 0;
    border-radius: 6px;
    padding: 6px 0;
}

/* Debug panel */
.debug-toggle {
    position: fixed; bottom: 12px; right: 12px; z-index: 100;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(28,28,30,0.9); color: #636366;
    cursor: pointer; font-size: 0.7em; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.debug-toggle:hover { border-color: #ff9f0a; color: #ff9f0a; }
.debug-toggle.open { border-color: #ff9f0a; color: #ff9f0a; }

.debug-panel {
    display: none;
    position: fixed; bottom: 60px; right: 12px; z-index: 99;
    width: 480px; max-height: 70vh;
    background: rgba(28,28,30,0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255,255,255,0.1); border-radius: 12px;
    overflow: hidden;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.75em;
}
.debug-panel.open { display: flex; flex-direction: column; }
.debug-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 0.5px solid rgba(255,255,255,0.1);
    font-weight: 600; color: #ff9f0a;
}
.debug-header span { font-size: 0.85em; color: #636366; font-weight: 400; }
.debug-body { overflow-y: auto; padding: 8px 14px; flex: 1; }
.debug-section { margin-bottom: 10px; }
.debug-section-title {
    font-size: 0.85em; color: #8e8e93; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 4px;
    border-bottom: 0.5px solid rgba(255,255,255,0.08); padding-bottom: 4px;
}
.debug-row {
    display: flex; justify-content: space-between; padding: 2px 0;
}
.debug-key { color: #8e8e93; }
.debug-val { color: #fff; text-align: right; }
.debug-val.ok { color: #30d158; }
.debug-val.warn { color: #ff9f0a; }
.debug-val.err { color: #ff453a; }

.debug-log {
    max-height: 250px; overflow-y: auto;
    background: rgba(0,0,0,0.3); border-radius: 8px; padding: 6px 10px;
}
.debug-log-entry {
    padding: 1px 0; border-bottom: 0.5px solid rgba(255,255,255,0.05);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.debug-log-entry .ts { color: #636366; margin-right: 6px; }
.debug-log-entry.info { color: #8e8e93; }
.debug-log-entry.ok { color: #30d158; }
.debug-log-entry.warn { color: #ff9f0a; }
.debug-log-entry.err { color: #ff453a; }

@media (max-width: 600px) {
    .debug-panel { width: calc(100vw - 24px); left: 12px; right: 12px; }
}

/* Responsive — mobile: stacked layout */
@media (max-width: 900px) {
    .main {
        flex-direction: column; padding: 4px;
        height: auto; overflow: visible;
    }
    .main.toolbar-open { height: auto; }
    .video-column { width: 100%; }
    .video-area-sticky { position: sticky; top: 0; z-index: 20; background: #000; }
    .controls-panel {
        width: 100%; border-left: none; padding-left: 0;
        overflow: visible;
    }
    .panel-tabs { position: sticky; top: 0; z-index: 19; background: rgba(0,0,0,0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
    .panel-content { overflow: visible; }
    .rec-list { max-height: 250px; }
}
@media (max-width: 600px) {
    .main { padding: 2px; }
    .header { padding: 6px 8px; }
    .header h1 { font-size: 0.85em; }
    .disk-info { display: none; }
    .toolbar { padding: 6px 10px; gap: 8px; }
    .toolbar .power-btn { width: 32px; height: 32px; font-size: 0.5em; }
    .toolbar .power-btn svg { width: 14px; height: 14px; }
    .pipeline-label { font-size: 0.55em; }
    .viewer-badge { font-size: 0.65em; }
    .status-badge { font-size: 0.7em; }
    .video-wrap { border-radius: 8px; }
    .ctrl-btn { width: 36px; height: 36px; }
    .ctrl-btn.big { width: 44px; height: 44px; }
    .ctrl-btn svg { width: 16px; height: 16px; }
    .ctrl-btn.big svg { width: 20px; height: 20px; }
    .ctrl-divider { height: 24px; margin: 0 3px; }
    .speed-btn { font-size: 0.7em; }
    .ctrl-group-section > .ctrl-label { font-size: 0.6em; }
    .ctrl-group-row { padding: 2px; }
    .ctrl-group-row .speed-btn { padding: 4px 0; font-size: 0.65em; }
    .rec-list { max-height: 200px; }
    .settings-row { flex-wrap: wrap; justify-content: center; }
    .settings-row input { width: 100%; }
    .panel-tab { font-size: 0.65em; padding: 4px 0; }
}
@media (max-width: 400px) {
    .header { padding: 4px 6px; }
    .header h1 { font-size: 0.75em; }
    .main { padding: 2px; }
}

/* BEGIN DEV-ONLY */
.dev-panel {
    position: fixed; bottom: 80px; right: 12px; z-index: 200;
    background: rgba(28,28,30,0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 0.5px solid rgba(255,255,255,0.15);
    border-radius: 12px; padding: 12px; min-width: 200px;
}
.dev-panel-wide { min-width: 280px; }
.dev-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8em; font-weight: 600; margin-bottom: 8px;
}
.dev-panel-close {
    background: none; border: none; color: #8e8e93; font-size: 1.2em;
    cursor: pointer; padding: 0 4px;
}
.net-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.7em; margin: 3px 0;
    font-family: 'SF Mono', 'Menlo', monospace;
}
.net-iface {
    font-weight: 600; padding: 1px 5px; border-radius: 3px;
    font-size: 0.85em;
}
.net-iface.up { background: rgba(48,209,88,0.15); color: #30d158; }
.net-iface.down { background: rgba(99,99,102,0.15); color: #636366; }
.net-detail { color: #8e8e93; }
.net-toggle-row { display: flex; gap: 4px; align-items: center; margin: 4px 0; }
.net-toggle-label { font-size: 0.65em; color: #8e8e93; width: 65px; }
.net-toggle-btn {
    padding: 2px 10px; border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06); color: #636366;
    font-size: 0.65em; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.net-toggle-btn:hover { background: rgba(255,255,255,0.12); }
.net-toggle-btn.active { border-color: #0a84ff; color: #0a84ff; background: rgba(10,132,255,0.15); }
.net-toggle-btn:disabled { opacity: 0.4; cursor: wait; }
.net-ps-fixed { font-size: 0.6em; color: #8e8e93; font-style: italic; }
.wifi-stats {
    margin-top: 6px; padding: 5px 6px; border-radius: 6px;
    background: rgba(255,255,255,0.04); font-size: 0.6em;
    font-family: 'SF Mono','Menlo',monospace; color: #8e8e93;
    line-height: 1.5;
}
.wifi-stats .ws-row { display: flex; justify-content: space-between; }
.wifi-stats .ws-val { color: #e5e5ea; }
.wifi-stats .ws-good { color: #30d158; }
.wifi-stats .ws-warn { color: #ff9f0a; }
.wifi-stats .ws-bad { color: #ff453a; }
.net-status-msg {
    font-size: 0.65em; margin-top: 6px; padding: 3px 6px;
    border-radius: 4px; text-align: center;
    background: rgba(10,132,255,0.12); color: #0a84ff;
}
.net-status-msg.err { background: rgba(255,69,58,0.12); color: #ff453a; }

/* ── BIT Section (DEV only) ── */
.bit-start-btn {
    padding: 6px 16px; border-radius: 8px; border: none;
    background: #30d158; color: #fff; font-size: 0.8em; font-weight: 600;
    cursor: pointer; transition: all 0.2s; margin: 6px 0;
}
.bit-start-btn:hover { background: #28b84e; }
.bit-start-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bit-progress-bar {
    height: 8px; border-radius: 4px; background: rgba(255,255,255,0.1);
    overflow: hidden; margin-bottom: 8px;
}
.bit-progress-fill {
    height: 100%; border-radius: 4px; background: #30d158;
    transition: width 0.3s; width: 0%;
}
.bit-progress-text {
    font-size: 0.7em; color: #8e8e93; margin-bottom: 6px;
    font-family: 'SF Mono', 'Menlo', monospace;
}
.bit-results {
    max-height: 300px; overflow-y: auto;
    font-size: 0.65em; font-family: 'SF Mono', 'Menlo', monospace;
    line-height: 1.6;
}
.bit-item { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.bit-icon { width: 16px; text-align: center; }
.bit-icon.pass { color: #30d158; }
.bit-icon.fail { color: #ff453a; }
.bit-icon.running { color: #0a84ff; }
.bit-icon.pending { color: #636366; }
.bit-name { color: #fff; flex: 1; }
.bit-detail { color: #636366; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bit-time { color: #636366; width: 45px; text-align: right; }
.bit-summary {
    display: flex; gap: 16px; font-size: 0.75em; margin-top: 8px;
    font-family: 'SF Mono', 'Menlo', monospace;
}
.bit-summary .pass-count { color: #30d158; }
.bit-summary .fail-count { color: #ff453a; }
.bit-summary .skip-count { color: #636366; }
/* Event timeline items */
.evt-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 10px; border-bottom: 1px solid rgba(84,84,88,0.3);
    transition: background 0.15s;
}
.evt-item:hover { background: rgba(255,255,255,0.05); }
.evt-item:last-child { border-bottom: none; }
/* END DEV-ONLY */
