:root {
    --bg: #07141d;
    --surface: #0f1c26;
    --surface2: #162735;
    --border: #264054;
    --accent: #32d4ff;
    --accent2: #ff5f7a;
    --accent3: #ffd166;
    --text: #f2f7ff;
    --muted: #b3c3d4;
    --success: #00e09e;
    --warning: #f6cf77;
    --fg: #f2f7ff;
    --mono: 'Share Tech Mono', monospace;
    --log-font: 'Consolas', 'Monaco', 'Courier New', monospace;
    --sans: 'Syne', sans-serif;
    --bg-gradient: radial-gradient(circle at 15% -10%, #1f4f73 0%, transparent 45%),
        radial-gradient(circle at 90% 10%, #1a3f57 0%, transparent 40%),
        linear-gradient(180deg, #07141d 0%, #0a1721 100%);
    --grid-line: rgba(50, 212, 255, .035);
    --toggle-bg: rgba(8, 18, 26, 0.88);
    --toggle-text: #d7ebff;
    --log-text: #d7e3ef;
    --log-muted: #7ea0bb;
    --log-divider: #86aeca;
    --log-row-separator: rgba(179, 195, 212, .08);
    --btn-bg: rgba(22, 39, 53, .95);
    --btn-hover-bg: #1f384c;
    --btn-text: #d6e5f2;
    --device-item-bg: rgba(13, 28, 39, .55);
    --device-item-text: #d7e3ef;
    --tab-nav-bg: rgba(13, 28, 39, .78);
    --control-bg: rgba(8, 18, 26, .6);
    --chip-bg: rgba(8, 18, 26, .82);
    --chip-text: #e8f3ff;
    --delay-stats-bg-start: rgba(22, 39, 53, 0.98);
    --delay-stats-bg-mid: rgba(22, 39, 53, 0.94);
    --delay-stats-bg-end: rgba(22, 39, 53, 0.82);
    --delay-stats-border: rgba(38, 64, 84, 0.9);
    --delay-bucket-hover-bg: rgba(0, 229, 255, 0.06);
    --delay-bucket-active-bg: rgba(0, 229, 255, 0.1);
    --delay-bucket-active-inset: rgba(0, 229, 255, 0.2);
    --delay-line-bg: rgba(17, 34, 46, 0.6);
    --delay-line-label: #d8e7f4;
    --app-max-width-normal: 1320px;
    --app-max-width-wide: 1880px;
    --app-max-width: var(--app-max-width-wide);
    --page-side-pad: clamp(12px, 2vw, 28px);
    --tab-nav-top: 10px;
    --tab-nav-h: 58px;
}

body.theme-dark {
    --bg: #07141d;
    --surface: #0f1c26;
    --surface2: #162735;
    --border: #264054;
    --accent: #32d4ff;
    --accent2: #ff5f7a;
    --accent3: #ffd166;
    --text: #f2f7ff;
    --muted: #b3c3d4;
    --success: #00e09e;
    --warning: #f6cf77;
    --fg: #f2f7ff;
    --bg-gradient: radial-gradient(circle at 15% -10%, #1f4f73 0%, transparent 45%),
        radial-gradient(circle at 90% 10%, #1a3f57 0%, transparent 40%),
        linear-gradient(180deg, #07141d 0%, #0a1721 100%);
    --grid-line: rgba(50, 212, 255, .035);
    --toggle-bg: rgba(8, 18, 26, 0.88);
    --toggle-text: #d7ebff;
    --log-text: #d7e3ef;
    --log-muted: #7ea0bb;
    --log-divider: #86aeca;
    --log-row-separator: rgba(179, 195, 212, .08);
}

body.theme-light {
    --bg: #e7f3ff;
    --surface: #f7fcff;
    --surface2: #eaf4fb;
    --border: #9cb8cc;
    --accent: #007fc2;
    --accent2: #cb2b56;
    --accent3: #9c5f00;
    --text: #0d2337;
    --muted: #4a6178;
    --success: #0f996a;
    --warning: #a06100;
    --fg: #0d2337;
    --bg-gradient: radial-gradient(circle at 8% -18%, #d8efff 0%, transparent 46%),
        radial-gradient(circle at 93% 8%, #c7e4ff 0%, transparent 44%),
        linear-gradient(180deg, #f3fbff 0%, #e6f3ff 100%);
    --grid-line: rgba(0, 127, 194, .11);
    --toggle-bg: rgba(255, 255, 255, 0.92);
    --toggle-text: #12324a;
    --log-text: #10283d;
    --log-muted: #315774;
    --log-divider: #2f5f84;
    --log-row-separator: rgba(49, 87, 116, .22);
    --btn-bg: rgba(232, 242, 255, 0.88);
    --btn-hover-bg: #d0e6ff;
    --btn-text: #0d2337;
    --device-item-bg: rgba(234, 244, 251, 0.68);
    --device-item-text: #10283d;
    --tab-nav-bg: rgba(245, 251, 255, 0.92);
    --control-bg: rgba(200, 220, 245, 0.55);
    --chip-bg: rgba(220, 235, 255, 0.78);
    --chip-text: #09182f;
    --delay-stats-bg-start: rgba(234, 244, 251, 0.98);
    --delay-stats-bg-mid: rgba(234, 244, 251, 0.94);
    --delay-stats-bg-end: rgba(234, 244, 251, 0.82);
    --delay-stats-border: rgba(124, 157, 184, 0.65);
    --delay-bucket-hover-bg: rgba(0, 127, 194, 0.1);
    --delay-bucket-active-bg: rgba(0, 127, 194, 0.14);
    --delay-bucket-active-inset: rgba(0, 127, 194, 0.25);
    --delay-line-bg: rgba(223, 236, 248, 0.78);
    --delay-line-label: #24435e;
}

body.theme-dark-gray {
    --bg: #14171b;
    --surface: #1b2026;
    --surface2: #24272c;
    --border: #43484f;
    --accent: #bfc4cb;
    --accent2: #b8bdc5;
    --accent3: #adb3bc;
    --text: #edf1f5;
    --muted: #aab0b8;
    --success: #8eb29f;
    --warning: #d7c087;
    --fg: #edf1f5;
    --bg-gradient: radial-gradient(circle at 14% -12%, #34373c 0%, transparent 46%),
        radial-gradient(circle at 88% 10%, #2f3237 0%, transparent 42%),
        linear-gradient(180deg, #14171b 0%, #181d23 100%);
    --grid-line: rgba(223, 226, 231, .05);
    --toggle-bg: rgba(24, 29, 35, 0.9);
    --toggle-text: #d8dce2;
    --log-text: #d7dbe1;
    --log-muted: #a4abb4;
    --log-divider: #b4bac3;
    --log-row-separator: rgba(188, 193, 201, .12);
    --btn-bg: rgba(37, 41, 48, .92);
    --btn-hover-bg: #3a3f47;
    --btn-text: #e3e9ef;
    --device-item-bg: rgba(29, 33, 39, .7);
    --device-item-text: #d7dbe1;
    --tab-nav-bg: rgba(27, 30, 35, .84);
    --control-bg: rgba(19, 22, 26, .62);
    --chip-bg: rgba(33, 37, 43, .86);
    --chip-text: #edf1f5;
    --delay-stats-bg-start: rgba(36, 39, 44, 0.98);
    --delay-stats-bg-mid: rgba(36, 39, 44, 0.94);
    --delay-stats-bg-end: rgba(36, 39, 44, 0.82);
    --delay-stats-border: rgba(84, 89, 97, 0.88);
    --delay-bucket-hover-bg: rgba(191, 196, 203, 0.08);
    --delay-bucket-active-bg: rgba(191, 196, 203, 0.12);
    --delay-bucket-active-inset: rgba(191, 196, 203, 0.2);
    --delay-line-bg: rgba(30, 33, 38, 0.68);
    --delay-line-label: #d5d9df;
}

body.layout-normal {
    --app-max-width: var(--app-max-width-normal);
}

body.layout-wide {
    --app-max-width: var(--app-max-width-wide);
}

/* Font families for reading-friendly monospace fonts */
body.font-consolas {
    --log-font: 'Consolas', 'Monaco', 'Courier New', monospace;
    --mono: 'Consolas', 'Monaco', 'Courier New', monospace;
}

body.font-monaco {
    --log-font: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    --mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

body.font-menlo {
    --log-font: 'Menlo', 'Consolas', 'Monaco', monospace;
    --mono: 'Menlo', 'Consolas', 'Monaco', monospace;
}

body.font-courier {
    --log-font: 'Courier New', 'Courier', monospace;
    --mono: 'Courier New', 'Courier', monospace;
}

body.font-ubuntu {
    --log-font: 'Ubuntu Mono', 'Consolas', 'Monaco', monospace;
    --mono: 'Ubuntu Mono', 'Consolas', 'Monaco', monospace;
}

body.font-droid {
    --log-font: 'Droid Sans Mono', 'Consolas', monospace;
    --mono: 'Droid Sans Mono', 'Consolas', monospace;
}

body.font-inconsolata {
    --log-font: 'Inconsolata', 'Consolas', monospace;
    --mono: 'Inconsolata', 'Consolas', monospace;
}

body.font-share-tech {
    --log-font: 'Share Tech Mono', monospace;
    --mono: 'Share Tech Mono', monospace;
}

body.font-arial {
    --log-font: 'Arial', 'Helvetica', sans-serif;
    --mono: 'Arial', 'Helvetica', sans-serif;
}

body.font-helvetica {
    --log-font: 'Helvetica', 'Arial', sans-serif;
    --mono: 'Helvetica', 'Arial', sans-serif;
}

body.font-verdana {
    --log-font: 'Verdana', 'Arial', sans-serif;
    --mono: 'Verdana', 'Arial', sans-serif;
}

body.font-tahoma {
    --log-font: 'Tahoma', 'Verdana', sans-serif;
    --mono: 'Tahoma', 'Verdana', sans-serif;
}

body.font-trebuchet {
    --log-font: 'Trebuchet MS', 'Arial', sans-serif;
    --mono: 'Trebuchet MS', 'Arial', sans-serif;
}

body.font-georgia {
    --log-font: 'Georgia', 'Times New Roman', serif;
    --mono: 'Georgia', 'Times New Roman', serif;
}

body.font-times {
    --log-font: 'Times New Roman', 'Georgia', serif;
    --mono: 'Times New Roman', 'Georgia', serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    color: var(--text);
    font-family: var(--sans);
    min-height: 100vh;
    overflow-x: hidden;
}

    /* ── Grid bg ── */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
        background-size: 48px 48px;
        pointer-events: none;
        z-index: 0;
    }

/* ── Header ── */
header {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
}

.brand-logo {
    height: 46px;
    width: auto;
    flex-shrink: 0;
}

.logo-mark {
    width: 38px;
    height: 38px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--accent);
    box-shadow: 0 0 12px rgba(0,229,255,.25);
    flex-shrink: 0;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.5px;
}

    .logo-text span {
        color: var(--accent);
    }

.badge {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 20px;
}

.layout-mode-toggle,
.theme-mode-toggle,
.language-select,
.theme-mode-select,
.font-dropdown-trigger,
.account-link-btn {
    border: 1px solid var(--border);
    background: var(--toggle-bg);
    color: var(--toggle-text);
    border-radius: 20px;
    padding: 6px 11px;
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.layout-mode-toggle:hover,
.theme-mode-toggle:hover,
.language-select:hover,
.theme-mode-select:hover,
.font-dropdown-trigger:hover,
.account-link-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.account-link-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.zoom-btn {
    min-width: 78px;
    text-align: center;
}

.theme-mode-select,
.language-select,
.font-dropdown-trigger {
    min-width: 188px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, var(--toggle-text) 50%), linear-gradient(135deg, var(--toggle-text) 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 11px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.language-select {
    min-width: 152px;
}

.auth-language-select {
    display: block;
    margin: 0 0 16px auto;
}

.font-dropdown {
    position: relative;
    z-index: 80;
}

.font-dropdown-trigger {
    width: 100%;
    text-align: left;
}

.font-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 120;
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
    padding: 6px;
    display: none;
}

.font-dropdown.open .font-dropdown-menu {
    display: block;
}

.font-dropdown-option {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.font-dropdown-option:hover,
.font-dropdown-option.is-active {
    background: var(--surface2);
    color: var(--accent);
}

.font-select-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.layout-mode-toggle[aria-pressed="true"],
.theme-mode-toggle[aria-pressed="true"] {
    border-color: rgba(50, 212, 255, 0.6);
    box-shadow: 0 0 10px rgba(50, 212, 255, 0.2);
}

.theme-mode-toggle[data-theme-mode="dark-gray"] {
    border-color: rgba(186, 192, 201, 0.55);
    box-shadow: 0 0 10px rgba(186, 192, 201, 0.18);
}

body.theme-dark-gray .theme-mode-select {
    border-color: rgba(186, 192, 201, 0.55);
    box-shadow: 0 0 10px rgba(186, 192, 201, 0.18);
}

body.theme-dark-gray .layout-mode-toggle[aria-pressed="true"],
body.theme-dark-gray .theme-mode-toggle[aria-pressed="true"] {
    border-color: rgba(186, 192, 201, 0.55);
    box-shadow: 0 0 10px rgba(186, 192, 201, 0.18);
}

body.theme-dark-gray .tab-btn.active {
    background: linear-gradient(135deg, #bec3cb, #a9afb8);
    color: #121418;
    border-color: #c4c9d1;
    box-shadow: 0 10px 24px rgba(190, 195, 203, .22);
}

/* ── Main layout ── */
main {
    position: relative;
    z-index: 1;
    max-width: var(--app-max-width);
    margin: 0 auto;
    padding: 34px var(--page-side-pad) 72px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}

#help-history-stack {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
    min-height: 0;
}

#help-history-stack > .panel {
    min-height: 0;
    flex: 1 1 0;
}

#tab-navigation,
#tab-content {
    grid-column: 1 / -1;
}

@media (max-width: 800px) {
    main {
        grid-template-columns: 1fr;
        padding: 22px 14px 48px;
    }

    header {
        padding: 16px 14px;
        flex-wrap: wrap;
    }

    .brand-logo {
        height: 34px;
    }

    .badge,
    .layout-mode-toggle,
    .theme-mode-toggle,
    .theme-mode-select,
    .font-dropdown,
    .zoom-controls {
        margin-left: 0;
    }

    .zoom-controls {
        flex-wrap: wrap;
    }
}

/* ── Panel ── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(0, 0, 0, .24);
    display: flex;
    flex-direction: column;
}

#info-panel {
    align-self: stretch;
    min-height: 0;
}

.panel-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

    .panel-header .dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--accent);
        box-shadow: 0 0 6px var(--accent);
    }

.panel-body {
    padding: 24px;
}

.panel-body[hidden] {
    display: none !important;
}

#info-panel .panel-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(50, 212, 255, 0.45) rgba(15, 28, 38, 0.65);
}

#info-panel .panel-body::-webkit-scrollbar {
    width: 10px;
}

#info-panel .panel-body::-webkit-scrollbar-track {
    background: rgba(15, 28, 38, 0.65);
    border-left: 1px solid rgba(38, 64, 84, 0.45);
}

#info-panel .panel-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(50, 212, 255, 0.65), rgba(50, 212, 255, 0.35));
    border-radius: 999px;
    border: 2px solid rgba(15, 28, 38, 0.75);
}

#info-panel .panel-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(50, 212, 255, 0.8), rgba(50, 212, 255, 0.5));
}

.dot-warm {
    background: var(--accent3) !important;
    box-shadow: 0 0 6px var(--accent3) !important;
}

.dot-network {
    background: #35baf6 !important;
    box-shadow: 0 0 6px #35baf6 !important;
}

.dot-cpu {
    background: #ff6b6b !important;
    box-shadow: 0 0 6px #ff6b6b !important;
}

.dot-anomaly {
    background: #ff3c6e !important;
    box-shadow: 0 0 6px #ff3c6e !important;
}

.dot-device {
    background: #00e09e !important;
    box-shadow: 0 0 6px #00e09e !important;
}

.dot-gws {
    background: #ff9800 !important;
    box-shadow: 0 0 6px #ff9800 !important;
}

.dot-headset {
    background: #a78bfa !important;
    box-shadow: 0 0 6px #a78bfa !important;
}

.help-body {
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-body strong {
    color: var(--text);
}

.help-code {
    font-family: var(--mono);
    color: var(--accent);
}

.help-list {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Drop zone ── */
#drop-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}

    #drop-zone:hover, #drop-zone.drag-over {
        border-color: var(--accent);
        background: rgba(0,229,255,.04);
    }

    #drop-zone input[type=file] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
        width: 100%;
        height: 100%;
    }

.drop-icon {
    font-size: 36px;
    margin-bottom: 14px;
    display: block;
    filter: grayscale(1);
    transition: filter .2s;
}

#drop-zone:hover .drop-icon {
    filter: none;
}

.drop-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.drop-sub {
    font-size: 13px;
    color: var(--muted);
    font-family: var(--mono);
}

.drop-sub-bt2 {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font);
    opacity: 0.8;
}

/* ── File info ── */
#file-info {
    display: none;
    margin-top: 18px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 12px;
    gap: 10px;
    align-items: center;
}

    #file-info.visible {
        display: flex;
    }

    #file-info .fi-name {
        color: var(--accent);
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #file-info .fi-size {
        color: var(--muted);
    }

    #file-info #clear-files-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

.file-load-status {
    margin-top: 10px;
    min-height: 18px;
    font-size: 12px;
    font-family: var(--mono);
    color: var(--muted);
}

.file-load-status.success {
    color: #6ee7a8;
}

.file-load-status.warning {
    color: var(--warning);
}

.upload-toast {
    position: fixed;
    right: clamp(12px, 2vw, 28px);
    bottom: clamp(12px, 2vw, 28px);
    max-width: min(520px, calc(100vw - 24px));
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface2) 92%, black 8%);
    color: var(--text);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .28);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 1400;
}

.upload-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.upload-toast.success {
    border-color: color-mix(in srgb, var(--success) 60%, var(--border) 40%);
}

.upload-toast.warning {
    border-color: color-mix(in srgb, var(--warning) 62%, var(--border) 38%);
}

@media (max-width: 640px) {
    .upload-toast {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}

/* ── Config section ── */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}

.field label {
    display: block;
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.field input[type=number] {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 12px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
}

.field select {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 12px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
}

.field input:focus {
    border-color: var(--accent);
}

.field select:focus {
    border-color: var(--accent);
}

/* ── Keyword tags ── */
.kw-section {
    margin-top: 20px;
}

    .kw-section > label {
        display: block;
        font-size: 11px;
        font-family: var(--mono);
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 10px;
    }

.kw-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.kw-tag {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-family: var(--mono);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}

    .kw-tag .rm {
        color: var(--muted);
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
        transition: color .15s;
    }

        .kw-tag .rm:hover {
            color: var(--accent2);
        }

.kw-add-row {
    display: flex;
    gap: 8px;
}

    .kw-add-row input {
        flex: 1;
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 8px 12px;
        color: var(--text);
        font-family: var(--mono);
        font-size: 12px;
        outline: none;
        transition: border-color .2s;
    }

        .kw-add-row input:focus {
            border-color: var(--accent);
        }

.btn-sm {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    padding: 8px 14px;
    font-family: var(--mono);
    font-size: 12px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

    .btn-sm:hover {
        background: var(--accent);
        color: var(--bg);
    }

/* ── Parse button ── */
#parse-btn {
    width: 100%;
    margin-top: 24px;
    padding: 15px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .5px;
    transition: opacity .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 0 20px rgba(0,229,255,.2);
}

    #parse-btn:hover {
        opacity: .9;
        box-shadow: 0 0 30px rgba(0,229,255,.35);
    }

    #parse-btn:active {
        transform: scale(.98);
    }

    #parse-btn:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

/* ── BT2 Voice Template Summary ── */
.bt2-section {
    margin-top: 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.bt2-modify-info {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bt2-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
}

.bt2-info-yes {
    flex-shrink: 0;
    font-weight: 700;
    color: #4caf50;
    font-size: 13px;
    margin-top: 1px;
}

.bt2-info-no {
    flex-shrink: 0;
    font-weight: 700;
    color: #f44336;
    font-size: 13px;
    margin-top: 1px;
}

.bt2-info-warn {
    flex-shrink: 0;
    font-weight: 700;
    color: #ff9800;
    font-size: 13px;
    margin-top: 1px;
}

.bt2-label {
    font-family: var(--mono);
    background: var(--device-item-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 11px;
}

.bt2-label-mismatch {
    border-color: #ff9800;
    color: #ff9800;
    background: rgba(255, 152, 0, 0.08);
}

.bt2-info-row code {
    font-family: var(--mono);
    background: var(--device-item-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 11px;
}

.bt2-row-dl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
    transition: border-color .15s, color .15s;
}

.bt2-row-dl:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.bt2-actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 6px !important;
}

.bt2-row-rename {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    transition: border-color .15s, color .15s;
}

.bt2-row-rename:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.bt2-rename-input {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--device-item-bg);
    color: var(--text);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 2px 5px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}

.bt2-rename-hint {
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    margin-left: 4px;
}

.bt2-rename-ok,
.bt2-rename-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    transition: border-color .15s, color .15s;
}

.bt2-rename-ok { color: #4caf50; }
.bt2-rename-ok:hover { border-color: #4caf50; }

.bt2-rename-x  { color: #f44336; }
.bt2-rename-x:hover  { border-color: #f44336; }

.bt2-table td:last-child {
    padding: 2px 6px;
    text-align: center;
}

.bt2-operator-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.bt2-op-chip {
    font-size: 12px;
    color: var(--text);
    background: var(--device-item-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 9px;
}

.bt2-table-wrap {
    overflow-x: auto;
    margin-bottom: 10px;
}

.bt2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: var(--mono);
}

.bt2-table th {
    text-align: left;
    padding: 5px 10px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.bt2-table td {
    padding: 4px 10px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.bt2-table tbody tr:last-child td {
    border-bottom: none;
}

.bt2-table tbody tr:hover td {
    background: var(--hover-bg, rgba(255,255,255,0.04));
}

.bt2-dl-row {
    margin-top: 8px;
}

.bt2-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
    background: var(--device-item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-family: var(--mono);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.bt2-dl-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── PCAP Downloads Section ── */
#pcap-downloads.pcap-section {
    margin-top: 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.raw-bin-file {
    margin-top: 10px;
}

.raw-bin-file summary {
    cursor: pointer;
    font-weight: 700;
}

.raw-bin-dump {
    max-height: 420px;
    overflow: auto;
    margin: 10px 0;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font: 12px/1.45 var(--mono);
    white-space: pre;
}

.pcap-dl-header {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.pcap-dl-note {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.pcap-dl-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.pcap-dl-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.pcap-dl-item a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
    background: var(--device-item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-family: var(--mono);
    font-size: 13px;
    transition: border-color .15s, color .15s, background .15s;
}

.pcap-dl-item a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Results panel ── */
#results-panel {
    grid-column: span 2;
    display: none;
}

@media (max-width: 800px) {
    #results-panel {
        grid-column: span 1;
    }
}

#results-panel.visible {
    display: block;
}

/* ── Stats bar ── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    border-radius: 12px;
}

.stats-bar-with-gap {
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .stats-bar {
        grid-template-columns: 1fr 1fr;
    }
}

.stat {
    background: var(--surface);
    padding: 16px 14px;
    text-align: center;
}

.stat-val {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

    .stat-val.red {
        color: var(--accent2);
    }

    .stat-val.yellow {
        color: var(--accent3);
    }

    .stat-val.cyan {
        color: var(--accent);
    }

    .stat-val.green {
        color: var(--success);
    }

.stat-label {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.1px;
}

.chart-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.device-info-container {
    margin-top: 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.device-info-title {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.device-info-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 980px) {
    .device-info-content {
        grid-template-columns: minmax(0, 1fr);
    }
}

.device-info-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--device-item-bg);
}

.device-info-label {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.device-info-value {
    font-size: 13px;
    font-family: var(--mono);
    color: var(--device-item-text);
    word-break: break-word;
}

.ap-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ap-link-button {
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface2);
    color: var(--device-item-text);
    font: inherit;
    padding: 5px 10px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.ap-link-button:hover,
.ap-link-button:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.ap-link-count {
    color: var(--muted);
}

.chart-grid.single-col {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 980px) {
    .chart-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.chart-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    min-height: 370px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-card.chart-card-wide {
    grid-column: 1 / -1;
}

.combined-chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.series-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--control-bg);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.series-control input[type="checkbox"] {
    accent-color: var(--accent);
}

.series-control input[type="color"] {
    width: 26px;
    height: 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.preset-control select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 11px;
    padding: 4px 8px;
    outline: none;
}

.preset-control select:focus {
    border-color: var(--accent);
}

.chart-title {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-card canvas {
    width: 100%;
    height: 260px !important;
    max-height: 260px;
}

.chart-download {
    margin-top: auto;
    width: 100%;
}

.section-actions {
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.section-label {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.section-subpanel {
    margin-top: 16px;
}

.section-subpanel + .raw-log-tools {
    margin-top: 14px;
}

.history-note {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
}

.history-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.history-field {
    display: grid;
    gap: 4px;
    min-width: 170px;
}

.history-field > span {
    font-size: 10px;
    font-family: var(--mono);
    color: var(--muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dataset-scope-controls {
    margin-bottom: 0;
}

.history-list,
.history-compare {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
    padding: 10px;
}

.history-list {
    margin-bottom: 10px;
}

.history-empty {
    color: var(--muted);
    font-size: 12px;
}

.history-row,
.history-head {
    display: grid;
    grid-template-columns: 170px 1fr 88px 94px 90px 86px 86px;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    padding: 6px 0;
}

.history-head {
    font-family: var(--mono);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.history-row + .history-row {
    border-top: 1px dashed rgba(126, 160, 187, .35);
}

.history-files {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-scope-badge,
.hs-scope-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 10px;
    font-family: var(--mono);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: var(--surface);
    color: var(--muted);
    vertical-align: middle;
}

.history-scope-badge.is-combined,
.hs-scope-badge.is-combined {
    border-color: rgba(0, 229, 255, .55);
    color: var(--accent);
    background: rgba(0, 229, 255, .12);
}

.history-scope-badge.is-device,
.hs-scope-badge.is-device {
    border-color: rgba(126, 160, 187, .5);
    color: var(--text);
    background: rgba(126, 160, 187, .12);
}

.history-compare-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.history-compare-metric {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 8px;
}

.history-compare-label {
    font-size: 10px;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.history-compare-value {
    font-size: 15px;
    font-weight: 700;
    margin-top: 2px;
}

.history-compare-delta {
    font-size: 11px;
    margin-top: 2px;
}

@media (max-width: 980px) {
    .history-row,
    .history-head {
        grid-template-columns: 150px 1fr 72px 76px 72px 78px 78px;
        font-size: 11px;
    }

    .history-compare-grid {
        grid-template-columns: 1fr;
    }
}

#headset-tab .tab-search-sticky {
    margin-top: 14px;
}

.section-subtitle {
    margin-bottom: 10px;
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#network-issues-list,
#gws-issues-list,
#headset-issues-list,
#recognition-issues-list,
#recognition-timing-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#recognition-timing-list {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
}

#recognition-timing-list::-webkit-scrollbar {
    width: 10px;
}

#recognition-timing-list::-webkit-scrollbar-thumb {
    background: rgba(126, 160, 187, .55);
    border-radius: 10px;
}

#network-issues-list .empty-state,
#gws-issues-list .empty-state,
#headset-issues-list .empty-state,
#recognition-issues-list .empty-state,
#recognition-timing-list .empty-state {
    padding: 20px 18px;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
}

.recognition-timing-summary {
    font-size: 12px;
    color: var(--muted);
}

.recognition-timing-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface2);
    padding-bottom: 2px;
}

.recognition-timing-controls .raw-log-source-filter {
    min-width: 110px;
}

.recognition-timing-search {
    flex: 1 1 340px;
    min-width: 240px;
}

.recognition-timing-controls label {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recognition-timing-session {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recognition-timing-session-head {
    font-size: 12px;
    font-family: var(--mono);
    color: var(--text);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.recognition-timing-session-meta {
    color: var(--muted);
}

.recognition-timing-row {
    border: 1px solid rgba(126, 160, 187, .25);
    border-radius: 8px;
    background: rgba(223, 234, 245, 0.6);
    padding: 7px 8px;
    display: grid;
    grid-template-columns: 86px auto 1fr;
    gap: 8px;
    align-items: start;
}

.recognition-timing-row-jump {
    cursor: pointer;
}

.recognition-timing-row-jump:hover {
    background: rgba(0, 229, 255, .1);
}

.recognition-timing-row-jump:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(0, 229, 255, .35);
}

.recognition-timing-row-highlight {
    box-shadow: inset 0 0 0 2px rgba(0, 229, 255, .35);
    background: rgba(0, 229, 255, .14);
}

.recognition-timing-delta {
    font-family: var(--mono);
    color: var(--text);
    font-size: 11px;
}

.recognition-timing-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    font-size: 10px;
    line-height: 1;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #07385d;
    border: 1px solid rgba(80, 136, 179, .45);
    background: rgba(175, 216, 248, .8);
    border-radius: 999px;
    padding: 3px 7px;
}

.recognition-timing-badge-word {
    color: #0e3f27;
    border-color: rgba(82, 156, 120, .5);
    background: rgba(179, 240, 205, .85);
}

.recognition-timing-badge-recognition {
    color: #5b3b00;
    border-color: rgba(183, 140, 42, .45);
    background: rgba(255, 224, 152, .85);
}

.recognition-timing-line {
    min-width: 0;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
    color: var(--text);
}

@media (max-width: 900px) {
    #recognition-timing-list {
        max-height: 600px;
    }

    .recognition-timing-row {
        grid-template-columns: 1fr;
    }
}

.export-results-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.export-format-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid rgba(126, 160, 187, .5);
    background: var(--chip-bg);
    color: var(--chip-text);
    font-size: 10px;
    font-family: var(--mono);
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s, transform .12s;
}

.export-results-btn:hover .export-format-chip {
    border-color: rgba(126, 160, 187, .35);
    background: rgba(200, 220, 245, 0.68);
    color: var(--text);
}

.export-format-chip:hover {
    transform: translateY(-1px);
}

.export-format-chip[data-export-format="txt"]:hover {
    border-color: #9ed8ff;
    color: #07263d;
    background: #9ed8ff;
}

.export-format-chip[data-export-format="csv"]:hover {
    border-color: #9ff2c1;
    color: #07311f;
    background: #9ff2c1;
}

.export-format-chip[data-export-format="pdf"]:hover {
    border-color: #ffb1b1;
    color: #3b0808;
    background: #ffb1b1;
}

.raw-log-content {
    font-family: var(--log-font);
    font-size: 12px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: var(--surface2);
    color: var(--log-text);
    line-height: 1.65;
}

.raw-log-content.raw-log-content-resized {
    max-height: none;
}

.raw-log-content-resizer {
    margin-top: -1px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    touch-action: none;
    color: var(--muted);
}

.raw-log-content-resizer::before {
    content: '⋮⋮';
    font-size: 10px;
    line-height: 1;
    opacity: .75;
}

.raw-log-content-resizer:hover::before,
.raw-log-content-resizer:focus-visible::before {
    color: var(--accent);
}

.log-section-header {
    margin: 20px 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-section-title {
    font-size: 12px;
    font-family: var(--mono);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Group recognition search and content visually */
#recognition-tab .tab-search-sticky {
    margin-top: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    border: 1px solid var(--border);
    border-top: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0 0 10px 10px;
    margin-bottom: -1px;
}

#recognition-tab #recognition-content {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 14px;
    margin-top: 0;
}

.recognition-section-header {
    margin-top: 32px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 12px;
}

.recognition-section-header + .tab-search-sticky {
    border-top: 2px solid var(--accent);
    border-radius: 10px 10px 0 0;
    margin-top: -1px;
}

.raw-log-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 28px;
}

#raw-log-pagination-host .log-pagination {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

#raw-log-pagination-host {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.raw-log-pagination-top {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    min-height: 28px;
}

#raw-log-pagination-host-top .log-pagination {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.raw-log-content .log-pagination {
    display: none !important;
}

.tab-results-footer {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    min-height: 28px;
}

.tab-pagination-host {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.tab-pagination-host .log-pagination {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.tab-search-sticky {
    position: sticky;
    top: calc(var(--tab-nav-top, 10px) + max(var(--tab-nav-h, 58px), 58px) + 8px);
    z-index: 6;
    margin-bottom: 10px;
    padding: 4px 0 10px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 82%, rgba(12, 22, 31, 0) 100%);
}

.raw-log-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.search-shortcut-hint {
    margin: 6px 0 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2px;
}

.active-filter-chips {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.active-filter-chips.visible {
    display: flex;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--chip-bg);
    color: var(--chip-text);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.2;
}

.raw-log-search {
    flex: 1 1 360px;
    min-width: 240px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 12px;
}

.raw-log-source-filter {
    flex: 0 1 260px;
    min-width: 180px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 12px;
}

.raw-log-source-filter:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, .12);
}

.raw-log-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, .12);
}

.raw-log-search-meta {
    margin-left: auto;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-match-badge {
    display: none;
    min-width: 54px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 209, 102, .45);
    border-radius: 999px;
    background: rgba(255, 209, 102, .12);
    color: #ffe8a8;
    font-family: var(--mono);
    font-size: 11px;
    text-align: center;
}

.raw-log-match-badge.visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.raw-log-hit {
    color: #0f1420;
    border-radius: 3px;
    padding: 0 1px;
}

.raw-log-hit-0 {
    background: rgba(255, 209, 102, .92);
}

.raw-log-hit-1 {
    background: rgba(116, 230, 189, .92);
}

.raw-log-hit-2 {
    background: rgba(126, 211, 255, .92);
}

.raw-log-hit-3 {
    background: rgba(255, 167, 158, .92);
}

.raw-log-hit-4 {
    background: rgba(196, 182, 255, .92);
}

.raw-log-hit-5 {
    background: rgba(255, 221, 143, .92);
}

.raw-log-hit-6 {
    background: rgba(154, 247, 200, .92);
}

.raw-log-hit-7 {
    background: rgba(173, 226, 255, .92);
}

.raw-log-jump-banner {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: -14px -14px 10px;
    padding: 8px 12px;
    background: rgba(50, 212, 255, .12);
    border-bottom: 1px solid var(--border);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-line {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    padding: 2px 0;
    border-bottom: 1px dotted var(--log-row-separator);
    min-width: max-content;
    width: 100%;
}

.raw-log-source-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 4px;
    color: var(--log-divider);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.3px;
}

.raw-log-source-divider::before {
    content: '';
    width: 58px;
    flex: 0 0 58px;
}

.raw-log-source-label {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.raw-log-source-divider::after {
    content: '';
    height: 1px;
    flex: 1 1 auto;
    background: linear-gradient(90deg, rgba(126, 160, 187, .22), rgba(126, 160, 187, 0));
}

@media (max-width: 900px) {
    .raw-log-line {
        grid-template-columns: 52px 1fr;
    }

    .raw-log-source-divider::before {
        width: 52px;
        flex-basis: 52px;
    }
}

.raw-log-line:last-child {
    border-bottom: none;
}

.raw-log-find-all-results {
    display: none;
    position: relative;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
    overflow: hidden;
    min-height: 180px;
    max-height: none;
    min-width: 0;
    height: auto;
}

.raw-log-find-all-results.visible {
    display: flex;
    flex-direction: column;
}

.raw-log-find-all-results::after {
    content: '⋮⋮';
    position: absolute;
    right: 8px;
    bottom: 7px;
    font-size: 12px;
    line-height: 1;
    color: var(--muted);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.raw-log-find-all-results:hover::after,
.raw-log-find-all-results:focus-within::after {
    opacity: 0.75;
}

.raw-log-find-all-resizer {
    flex: 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    touch-action: none;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}

.raw-log-find-all-resizer::before {
    content: '⋮⋮';
    font-size: 10px;
    line-height: 1;
    opacity: 0.75;
}

.raw-log-find-all-resizer:hover::before,
.raw-log-find-all-resizer:focus-visible::before {
    color: var(--accent);
}

.raw-log-find-all-header {
    padding: 10px 12px 6px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.raw-log-find-all-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.raw-log-find-all-reset-btn {
    display: none;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    cursor: pointer;
}

.raw-log-find-all-reset-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.raw-log-find-all-results:hover .raw-log-find-all-reset-btn {
    display: inline-flex;
}

.raw-log-find-all-summary {
    padding: 0 12px 10px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-find-all-concat-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 10px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-find-all-concat-option input {
    margin: 0;
}

.raw-log-find-all-list {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 260px;
    overflow: auto;
    border-top: 1px solid var(--border);
}

.raw-log-find-all-results.find-all-resized .raw-log-find-all-list {
    flex: 1 1 auto;
    max-height: none;
}

.raw-log-find-all-item {
    width: 100%;
    display: block;
    padding: 7px 12px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--log-row-separator);
    text-align: left;
    color: inherit;
    cursor: text;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    word-break: break-all;
    user-select: text;
}

.raw-log-find-all-item:hover {
    background: rgba(0, 229, 255, .08);
}

.raw-log-find-all-item:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(0, 229, 255, .35);
}

.raw-log-find-all-item:last-child {
    border-bottom: none;
}

.raw-log-find-all-meta {
    color: var(--log-muted);
    font-family: var(--mono);
    font-size: 11px;
    margin-right: 8px;
    display: inline;
}

.raw-log-find-all-terms {
    display: none;
}

.raw-log-find-all-snippet {
    color: var(--log-text);
    font-family: var(--mono);
    font-size: 12px;
    display: inline;
}

.raw-log-find-all-empty {
    padding: 12px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-find-all-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: transparent;
}

.raw-log-find-all-remaining {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-extracts-panel {
    display: none;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
    overflow: hidden;
}

.raw-log-extracts-panel.visible {
    display: block;
}

.raw-log-extracts-header {
    padding: 10px 12px 6px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.raw-log-extracts-controls {
    padding: 0 12px 12px;
}

.raw-log-extracts-input {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
}

.raw-log-extracts-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, .12);
}

.raw-log-extracts-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.raw-log-extracts-status {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-extracts-status.error {
    color: #ff9fae;
}

.raw-log-extracts-list {
    border-top: 1px solid var(--border);
    max-height: 280px;
    overflow: auto;
}

.raw-log-extract-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--log-row-separator);
}

.raw-log-extract-item:last-child {
    border-bottom: none;
}

.raw-log-extract-meta {
    color: var(--log-muted);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-extract-text {
    margin-top: 5px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--log-text);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.55;
}

.raw-log-extract-hit {
    display: inline;
    padding: 0 1px;
    border-radius: 3px;
    color: #10151f;
}

.analysis-style-hit {
    display: inline;
    padding: 0 1px;
    border-radius: 3px;
    color: #10151f;
}

.raw-log-extract-hit-yellow {
    background: rgba(255, 220, 120, .95);
}

.raw-log-extract-hit-green {
    background: rgba(151, 237, 186, .95);
}

.raw-log-extract-hit-blue {
    background: rgba(151, 213, 255, .95);
}

.raw-log-extract-hit-pink {
    background: rgba(255, 182, 207, .95);
}

.raw-log-extract-hit-orange {
    background: rgba(255, 194, 141, .95);
}

.raw-log-extract-context-menu {
    position: fixed;
    z-index: 1200;
    min-width: 280px;
    max-width: min(420px, 90vw);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .35);
    padding: 10px;
}

.raw-log-extract-context-label {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.45;
}

.raw-log-extract-context-label strong {
    color: var(--text);
}

.raw-log-extract-context-colors {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.raw-log-extract-color-btn {
    color: #0f1420;
    border-color: rgba(0, 0, 0, .18);
}

.raw-log-extract-context-footer {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analysis-style-context-menu {
    display: none;
    position: fixed;
    z-index: 1300;
    min-width: 290px;
    max-width: min(460px, 92vw);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
    padding: 10px;
}

.analysis-style-context-menu.visible {
    display: block;
}

.analysis-style-context-title {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.45;
}

.analysis-style-context-title strong {
    color: var(--text);
}

.analysis-style-context-colors {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analysis-style-color-btn {
    color: #10151f;
    border-color: rgba(0, 0, 0, .18);
}

.analysis-style-context-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.raw-log-extract-item-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.raw-log-extracts-empty {
    padding: 12px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.raw-log-line.highlight {
    background: rgba(255, 209, 102, .14);
    border-radius: 6px;
    border-bottom-color: transparent;
}

.raw-log-line.highlight-from {
    background: rgba(80, 200, 120, .18);
    border-left: 3px solid #50c878;
    border-radius: 6px;
    border-bottom-color: transparent;
}

.raw-log-line.highlight-to {
    background: rgba(100, 160, 255, .18);
    border-left: 3px solid #64a0ff;
    border-radius: 6px;
    border-bottom-color: transparent;
}

.raw-log-ln {
    color: var(--log-muted);
    text-align: right;
    user-select: none;
}

.raw-log-txt {
    color: var(--log-text);
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}

/* ── Anomaly list ── */
#anomaly-list {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.anomaly-group {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    animation: fadeUp .3s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anomaly-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--surface2);
    cursor: pointer;
    user-select: none;
}

.ag-severity {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .ag-severity.high {
        background: var(--accent2);
        box-shadow: 0 0 6px var(--accent2);
    }

    .ag-severity.medium {
        background: var(--accent3);
        box-shadow: 0 0 6px var(--accent3);
    }

    .ag-severity.info {
        background: var(--accent);
        box-shadow: 0 0 6px var(--accent);
    }

.ag-name {
    font-size: 13px;
    font-weight: 700;
    flex: 1;
}

.ag-count {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 9px;
    border-radius: 12px;
}

.ag-chevron {
    color: var(--muted);
    font-size: 12px;
    transition: transform .2s;
}

.anomaly-group.open .ag-chevron {
    transform: rotate(180deg);
}

.ag-entries {
    display: none;
    padding: 0 18px 14px;
    background: var(--surface);
}

.anomaly-group.open .ag-entries {
    display: block;
}

.ag-entries.ag-entries-scrollable {
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
}

.anomaly-search-tools {
    padding: 10px 18px 0;
    margin-bottom: 6px;
}

.anomaly-group-find-all-results {
    margin: 0 0 12px 0;
    border-radius: 10px;
}

.anomaly-search-tools .raw-log-search {
    min-width: 240px;
}

.anomaly-group-search-meta {
    margin-left: auto;
}

.ag-entry {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.6;
    word-break: break-all;
}

.ag-entry-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

    .ag-entry:last-child {
        border-bottom: none;
    }

    .ag-entry .bullet {
        color: var(--accent);
        margin-right: 8px;
    }

.ag-entry-jump {
    cursor: pointer;
    transition: background .15s, color .15s;
}

.ag-entry-jump:hover {
    background: var(--surface2);
    color: var(--accent);
    border-radius: 4px;
    padding-left: 4px;
}

.ag-entry-jump:hover .bullet {
    color: var(--accent3);
}

/* ── Category files ── */
.cat-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.cat-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
    display: flex;
    flex-direction: column;
}

    .cat-card:hover {
        border-color: var(--accent);
        background: rgba(0,229,255,.04);
    }

    .cat-card .checkbox-wrapper {
        margin-bottom: 10px;
    }

    .cat-card .cc-name {
        font-size: 12px;
        font-weight: 700;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cat-card .cc-count {
        font-family: var(--mono);
        font-size: 11px;
        color: var(--muted);
    }

    .cat-card .cc-dl {
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 14px;
        color: var(--muted);
        transition: color .15s;
    }

    .cat-card:hover .cc-dl {
        color: var(--accent);
    }

/* ── Checkboxes ── */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

input[type=checkbox] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface2);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    flex-shrink: 0;
}

    input[type=checkbox]:hover {
        border-color: var(--accent);
    }

    input[type=checkbox]:checked {
        background: var(--accent);
        border-color: var(--accent);
    }

        input[type=checkbox]:checked::after {
            content: '✓';
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--bg);
            font-size: 10px;
        }

.anomaly-group-header .checkbox-wrapper {
    margin-right: auto;
}

/* ── Log preview modal ── */
#modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 100;
    place-items: center;
}

    #modal-overlay.open {
        display: grid;
    }

#modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: min(700px, 95vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#modal-header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

#modal-title {
    font-size: 13px;
    font-weight: 700;
    flex: 1;
    font-family: var(--mono);
}

#modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: color .15s;
}

    #modal-close:hover {
        color: var(--text);
    }

#modal-body {
    overflow-y: auto;
    padding: 20px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.8;
    color: var(--muted);
    white-space: pre-wrap;
    word-break: break-all;
}

#modal-body .hl {
    color: var(--accent2);
}

.log-pagination {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.log-pagination-info {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.log-pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.log-pagination-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 6px;
    padding: 6px 10px;
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.log-pagination-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(0, 229, 255, 0.08);
}

.log-pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.log-pagination-page {
    color: #d8e7f4;
    font-family: var(--mono);
    font-size: 11px;
    padding: 0 2px;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
}

    .empty-state .big {
        font-size: 32px;
        margin-bottom: 12px;
    }

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ── Tab Navigation ── */
.tab-navigation {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    padding: 14px;
    background: var(--tab-nav-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    position: sticky;
    top: var(--tab-nav-top);
    z-index: 5;
    backdrop-filter: blur(8px);
}

.tab-nav-zoom-controls {
    margin-left: auto;
}

.tab-navigation .zoom-btn {
    padding: 8px 10px;
    min-width: 74px;
}

@media (max-width: 880px) {
    .tab-navigation {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tab-nav-zoom-controls {
        margin-left: 0;
    }

    .tab-navigation::-webkit-scrollbar {
        height: 6px;
    }
}

.tab-btn {
    background: var(--btn-bg);
    border: 1px solid var(--border);
    color: var(--btn-text);
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--sans);
    font-weight: 700;
    letter-spacing: .2px;
    transition: all .2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

    .tab-btn:hover {
        background: var(--btn-hover-bg);
        color: var(--text);
        border-color: var(--accent);
    }

    .tab-btn.active {
        background: linear-gradient(135deg, var(--accent), #57e3ff);
        color: #061016;
        border-color: var(--accent);
        box-shadow: 0 10px 24px rgba(50, 212, 255, .22);
    }

/* ── Tab Content ── */
.tab-content {
    grid-column: 1 / -1;
    position: relative;
    background: transparent;
}

.tab-pane {
    display: none;
    animation: fadeIn .24s ease;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    overflow: visible;
}

    .tab-pane.active {
        display: block;
    }

.tab-pane > .panel {
    background: var(--surface);
    border: none;
    box-shadow: none;
    overflow: visible;
}

.tab-pane > .panel > .panel-body {
    background: var(--surface);
}

/* Keep utility tabs consistent with Raw Log styling */
#gws-analysis-tab,
#headset-tab,
#recognition-tab,
#delay-calculator-tab {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    overflow: visible;
}

#gws-analysis-tab .panel,
#headset-tab .panel,
#recognition-tab .panel,
#delay-calculator-tab .panel {
    background: var(--surface);
    border: none;
    box-shadow: none;
    overflow: visible;
}

#gws-analysis-tab .panel-body,
#headset-tab .panel-body,
#recognition-tab .panel-body,
#delay-calculator-tab .panel-body {
    background: var(--surface);
}

#gws-content,
#headset-content,
#dialogue-content,
#recognition-content,
#delay-content {
    font-family: var(--log-font);
    font-size: 12px;
    line-height: 1.65;
    color: var(--log-text);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
    padding: 14px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
}

#gws-content .log-pagination,
#headset-content .log-pagination,
#dialogue-content .log-pagination,
#recognition-content .log-pagination,
#delay-content .log-pagination {
    display: none !important;
}

.analysis-section h3 {
    color: var(--accent);
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── Section Items ── */
.gws-item, .headset-item, .dialogue-item, .recognition-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--surface2);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

.tab-entry-highlight {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.45), 0 0 16px rgba(0, 229, 255, 0.16);
}

.gws-item .gws-content, .headset-item .headset-content, .dialogue-item .dialogue-content, .recognition-item .recognition-content {
    white-space: pre-wrap;
    word-break: break-all;
}

.recognition-item-jump {
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.dialogue-item-jump {
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.gws-item-jump {
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.headset-item-jump {
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.recognition-item-jump:hover {
    border-color: var(--accent);
    background: rgba(0,229,255,.06);
}

.dialogue-item-jump:hover {
    border-color: var(--accent);
    background: rgba(0,229,255,.06);
}

.gws-item-jump:hover {
    border-color: var(--accent);
    background: rgba(50,212,255,.06);
}

.headset-item-jump:hover {
    border-color: #a78bfa;
    background: rgba(167,139,250,.06);
}

.gws-item h3 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
}

.type-badge {
    display: inline-block;
    background: rgba(50, 212, 255, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 6px;
    font-family: var(--mono);
}

.entry-timestamp {
    display: inline-block;
    color: var(--accent3);
    font-size: 11px;
    margin-left: 8px;
    font-family: var(--mono);
}

.entry-source-badge {
    display: inline-block;
    margin-left: 8px;
    margin-bottom: 6px;
    padding: 2px 8px;
    border: 1px solid rgba(126, 160, 187, .4);
    border-radius: 10px;
    font-family: var(--mono);
    font-size: 10px;
    color: #9ec6e4;
    background: rgba(158, 198, 228, .08);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.delay-note {
    margin: 4px 0 10px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.delay-bucket-stats {
    position: sticky;
    top: -14px;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin: -14px -14px 12px;
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, var(--delay-stats-bg-start) 0%, var(--delay-stats-bg-mid) 78%, var(--delay-stats-bg-end) 100%);
    border-bottom: 1px solid var(--delay-stats-border);
    backdrop-filter: blur(8px);
    margin-bottom: 12px;
}

.delay-bucket-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--fg);
    padding: 10px;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}

.delay-bucket-card:hover {
    border-color: var(--accent);
    background: var(--delay-bucket-hover-bg);
    transform: translateY(-1px);
}

.delay-bucket-card.active {
    border-color: var(--accent);
    background: var(--delay-bucket-active-bg);
    box-shadow: 0 0 0 1px var(--delay-bucket-active-inset) inset;
}

.delay-bucket-value {
    display: block;
    color: var(--accent);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.delay-bucket-label {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.delay-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--surface2);
}

.delay-item:last-child {
    margin-bottom: 0;
}

.delay-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.delay-item-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.delay-line {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    background: var(--delay-line-bg);
}

.delay-line-jump {
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.delay-line-jump:hover {
    border-color: var(--accent);
    background: rgba(0, 229, 255, 0.06);
}

.delay-line-label {
    display: inline-block;
    color: var(--delay-line-label);
    font-weight: 700;
    font-size: 11px;
    margin-right: 8px;
}

.delay-line-ts {
    display: inline-block;
    color: var(--accent3);
    font-size: 11px;
}

.delay-line-content {
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── AI Insights ── */
.ai-insights-note {
    font-size: 12px;
    font-family: var(--mono);
    color: var(--muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.ai-insights-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding-top: 12px;
    border-top: 1px solid var(--border);
    z-index: 5;
}

.ai-question {
    width: 100%;
    min-height: 80px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
    resize: vertical;
    transition: border-color .2s;
}

.ai-question:focus {
    border-color: var(--accent);
}

.ai-insights-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
}

.ai-output {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--log-text);
    min-height: 120px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    max-height: 600px;
    overflow-y: auto;
}

.ai-chat-turn {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.22);
}

.ai-chat-turn:last-child {
    margin-bottom: 0;
}

.ai-chat-turn-user {
    border-left: 3px solid var(--accent);
}

.ai-chat-turn-assistant {
    border-left: 3px solid var(--accent3);
}

.ai-chat-role {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ai-chat-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-cite-link {
    border: 1px solid var(--border);
    background: var(--chip-bg);
    color: var(--chip-text);
    border-radius: 5px;
    padding: 0 4px;
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
}

.ai-cite-link:hover {
    border-color: var(--accent);
    color: var(--text);
}

.ai-citation-warning {
    margin-bottom: 10px;
    border: 1px solid rgba(215, 140, 32, 0.45);
    background: rgba(215, 140, 32, 0.12);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: var(--mono);
    font-size: 11px;
}

.ai-references {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-references-title {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ai-ref-item {
    width: 100%;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    color: var(--text);
    padding: 8px 10px;
    display: grid;
    gap: 4px;
    cursor: pointer;
}

.ai-ref-item:hover {
    border-color: var(--accent);
}

.ai-ref-id {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent3);
}

.ai-ref-file {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.ai-ref-text {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--log-text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Standalone Device History Section ──────────────────────────────────── */

#history-section {
    margin-top: 0;
}

#history-section .panel-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(50, 212, 255, 0.45) rgba(15, 28, 38, 0.65);
}

#history-section .panel-body::-webkit-scrollbar {
    width: 10px;
}

#history-section .panel-body::-webkit-scrollbar-track {
    background: rgba(15, 28, 38, 0.65);
    border-left: 1px solid rgba(38, 64, 84, 0.45);
}

#history-section .panel-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(50, 212, 255, 0.65), rgba(50, 212, 255, 0.35));
    border-radius: 999px;
    border: 2px solid rgba(15, 28, 38, 0.75);
}

#history-section .panel-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(50, 212, 255, 0.8), rgba(50, 212, 255, 0.5));
}

#info-panel .panel-header {
    justify-content: space-between;
    gap: 12px;
}

.info-section-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.info-section-title-text {
    white-space: nowrap;
}

.info-section-toggle {
    flex-shrink: 0;
    min-width: 86px;
    text-align: center;
    padding-inline: 12px;
}

#info-panel.info-panel-collapsed .panel-header {
    border-bottom: none;
}

#history-section .panel-header {
    justify-content: space-between;
    gap: 12px;
}

.history-section-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.history-section-title-text {
    white-space: nowrap;
}

.history-section-toggle {
    flex-shrink: 0;
    min-width: 86px;
    text-align: center;
    padding-inline: 12px;
}

#history-section.history-section-collapsed .panel-header {
    border-bottom: none;
}

.history-section-badge {
    margin-left: 6px;
    font-size: 10px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
}

.history-section-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 10px 0;
}

.hs-devices-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hs-device-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface2);
    overflow: hidden;
}

.hs-device-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    gap: 12px;
    transition: background 0.15s;
}

.hs-device-header:hover {
    background: var(--surface);
}

.hs-device-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hs-device-label {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hs-device-meta {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
}

.hs-device-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hs-chevron {
    font-size: 14px;
    color: var(--muted);
    line-height: 1;
    transition: transform 0.15s;
}

.hs-run-list {
    border-top: 1px solid var(--border);
    padding: 10px 14px 12px;
    overflow-x: auto;
}

.hs-run-head,
.hs-run-row {
    display: grid;
    grid-template-columns: 28px 170px 1fr auto 118px;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    padding: 5px 0;
}

.hs-run-head {
    font-size: 10px;
    font-family: var(--mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.hs-run-row + .hs-run-row {
    border-top: 1px dashed rgba(126, 160, 187, .22);
}

.hs-run-date {
    font-family: var(--mono);
    font-size: 11px;
    white-space: nowrap;
}

.hs-run-files {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
}

.hs-run-meta {
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.hs-run-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.hs-run-checkbox-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hs-run-checkbox-cell input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
}

.hs-compare-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-size: 12px;
}

.hs-compare-bar-label {
    flex: 1;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 11px;
}

.hs-compare-note {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted);
    margin: 12px 0 8px;
    padding: 6px 8px;
    background: var(--surface);
    border-radius: 6px;
}

.hs-inline-compare {
    margin-top: 8px;
}

.hs-global-compare {
    margin-top: 12px;
}

@media (max-width: 800px) {
    #info-panel .panel-header,
    #history-section .panel-header {
        flex-wrap: wrap;
    }

    .info-section-toggle,
    .history-section-toggle {
        margin-left: auto;
    }

    .hs-run-head,
    .hs-run-row {
        grid-template-columns: 28px 1fr 1fr;
        gap: 6px;
    }

    .hs-run-checkbox-cell { grid-column: 1; grid-row: 1; }
    .hs-run-date  { grid-column: 2; grid-row: 1; }
    .hs-run-files { grid-column: 2 / -1; grid-row: 2; }
    .hs-run-meta  { grid-column: 2 / -1; grid-row: 3; }
    .hs-run-actions { grid-column: 2 / -1; grid-row: 4; justify-content: flex-end; }
}

/* end AI Insights */
/* ── Log Viewer Modal ───────────────────────────────────────────────────── */
.logs-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.72);
    overflow: auto;
    padding: 24px 16px;
    box-sizing: border-box;
}
.logs-modal-overlay.logs-modal-open { display: flex; align-items: flex-start; justify-content: center; }

.logs-modal-dialog {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 100%;
    max-width: 1280px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
}

.logs-modal-header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface2);
}
.logs-modal-title {
    margin: 0 0 10px;
    font-family: var(--sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.04em;
}

.logs-modal-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 6px;
}
.logs-ctrl-label {
    display: flex;
    flex-direction: column;
    font-family: var(--mono);
    font-size: 0.68rem;
    gap: 2px;
    color: var(--muted);
    letter-spacing: 0.03em;
}
.logs-input, .logs-select {
    background: var(--toggle-bg);
    color: var(--toggle-text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 7px;
    font-family: var(--mono);
    font-size: 0.78rem;
}
.logs-action-btn {
    padding: 4px 11px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--btn-bg);
    color: var(--btn-text);
    font-family: var(--mono);
    font-size: 0.78rem;
    cursor: pointer;
    align-self: flex-end;
    transition: background 0.15s;
}
.logs-action-btn:hover { background: var(--btn-hover-bg); color: var(--accent); border-color: var(--accent); }
.logs-action-btn-danger { border-color: var(--accent2); color: var(--accent2); }
.logs-action-btn-danger:hover { background: color-mix(in srgb, var(--accent2) 15%, var(--surface2) 85%); }
.logs-auto-label { font-family: var(--mono); font-size: 0.75rem; align-self: flex-end; cursor: pointer; color: var(--muted); }
.logs-status { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); min-height: 1.2em; }

.logs-modal-body {
    overflow: auto;
    flex: 1;
    padding: 0;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text);
}
.logs-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface2);
    color: var(--muted);
    font-family: var(--mono);
    font-weight: 600;
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.68rem;
}
.logs-table tbody tr { border-bottom: 1px solid var(--log-row-separator); }
.logs-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent 95%); }
.logs-table td { padding: 4px 10px; vertical-align: top; }

.logs-col-ts     { white-space: nowrap; color: var(--muted); min-width: 160px; }
.logs-col-cat    { white-space: nowrap; }
.logs-col-user   { white-space: nowrap; color: var(--log-muted); }
.logs-col-action { white-space: nowrap; font-weight: 600; color: var(--log-text); }
.logs-col-data   { word-break: break-all; max-width: 500px; color: var(--log-text); }

.log-level-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-transform: uppercase;
}
.log-badge-info  { background: color-mix(in srgb, var(--accent) 18%, transparent 82%); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent 60%); }
.log-badge-warn  { background: color-mix(in srgb, var(--warning) 18%, transparent 82%); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent 60%); }
.log-badge-error { background: color-mix(in srgb, var(--accent2) 18%, transparent 82%); color: var(--accent2); border: 1px solid color-mix(in srgb, var(--accent2) 40%, transparent 60%); }

.log-row-error td { color: var(--accent2); }
.log-row-warn  td { color: var(--warning); }
.log-row-lockout td { background: color-mix(in srgb, var(--warning) 8%, transparent 92%); }

.log-data-pair { margin-right: 8px; white-space: nowrap; }
.log-data-pair b { color: var(--accent); opacity: 0.75; }

.log-lockout-pill {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent 55%);
    background: color-mix(in srgb, var(--warning) 18%, transparent 82%);
    color: var(--warning);
    font-family: var(--mono);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.logs-empty { text-align: center; padding: 24px; color: var(--muted); font-family: var(--mono); font-size: 0.82rem; }
