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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #0a1f44;
    min-height: 100vh;
    color: #ebf1f8;
    overflow-x: hidden;
}

.container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 18px 40px;
    z-index: 2;
}

.scene-glow {
    position: fixed;
    width: 680px;
    height: 680px;
    border-radius: 50%;
    top: -240px;
    right: -180px;
    background: radial-gradient(circle, rgba(0, 219, 190, 0.22) 0%, rgba(0, 219, 190, 0) 70%);
    pointer-events: none;
    z-index: 1;
}

.header {
    border: 1px solid rgba(158, 190, 222, 0.25);
    background: rgba(12, 21, 35, 0.75);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
}

.header h1 {
    color: #f4fbff;
    font-size: clamp(1.5rem, 3.6vw, 2.4rem);
    line-height: 1.15;
    margin-bottom: 8px;
}

.header p {
    color: #bdd4ea;
    font-size: 1rem;
    margin-bottom: 14px;
}

.top-status-strip {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.status-indicator {
    background: rgba(13, 27, 45, 0.78);
    border: 1px solid rgba(159, 197, 232, 0.22);
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 0.84rem;
    color: #cfe2f5;
    font-weight: 600;
}

.status-word {
    font-weight: 700;
}

.status-word-ok {
    color: #7ef2d4;
}

.status-word-bad {
    color: #ff9da9;
}

.pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(174, 207, 237, 0.25);
}

.mic-pill {
    margin-left: 8px;
}

.mic-pill-idle {
    background: rgba(97, 135, 174, 0.2);
    color: #bdd4ea;
}

.mic-pill-on {
    background: rgba(0, 194, 156, 0.22);
    color: #7ef2d4;
}

.pill-ok {
    background: rgba(0, 194, 156, 0.2);
    color: #7ef2d4;
}

.pill-bad {
    background: rgba(241, 92, 92, 0.2);
    color: #ffbcbc;
}

.header-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.api-base-label {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #a9c5de;
    word-break: break-all;
}

/* Hardware status bar */
.hw-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid;
}

.hw-bar-disconnected {
    background: rgba(241, 92, 92, 0.1);
    border-color: rgba(241, 92, 92, 0.35);
}

.hw-bar-connected {
    background: rgba(0, 194, 156, 0.1);
    border-color: rgba(0, 194, 156, 0.35);
}

.hw-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.hw-icon {
    font-size: 1.1rem;
}

.hw-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.port-select {
    background: #12253e;
    color: #d0e6fb;
    border: 1px solid #2a4766;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-family: inherit;
    min-width: 180px;
}

.btn-hw-connect {
    background: #00c2a7;
    color: #062421;
    padding: 8px 16px;
    font-size: 0.85rem;
    min-width: auto;
}

.btn-hw-connect:hover {
    background: #2bd9c2;
}

.btn-hw-disconnect {
    background: #5b1f2f;
    color: #ffdce4;
    border-color: #8e3950;
    padding: 8px 16px;
    font-size: 0.85rem;
    min-width: auto;
}

.btn-hw-disconnect:hover {
    background: #7a2d42;
}

/* Mock data warning banner */
.mock-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffe082;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 14px;
    text-align: center;
}

.mode-guide {
    border: 1px solid rgba(159, 197, 232, 0.22);
    background: rgba(11, 20, 34, 0.72);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.mode-guide h3 {
    margin-bottom: 6px;
    color: #dff1ff;
    font-size: 0.96rem;
}

.mode-guide p {
    color: #a9c8e0;
    font-size: 0.86rem;
    margin-bottom: 8px;
}

.mode-rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
}

.mode-rule-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid rgba(152, 192, 228, 0.18);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(16, 31, 49, 0.6);
    font-size: 0.82rem;
    color: #bcd6eb;
}

.mode-rule-card strong {
    color: #e8f6ff;
}

.diag-panel {
    border: 1px solid rgba(126, 242, 212, 0.25);
    background: rgba(10, 31, 52, 0.68);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.diag-panel h3 {
    color: #dff1ff;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.diag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.diag-item {
    border: 1px solid rgba(152, 192, 228, 0.18);
    border-radius: 8px;
    padding: 7px 8px;
    background: rgba(16, 31, 49, 0.58);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.diag-item span {
    color: #a9c8e0;
    font-size: 0.74rem;
}

.diag-item strong {
    color: #e8f6ff;
    font-size: 0.82rem;
}

.diag-hint {
    color: #bcd6eb;
    font-size: 0.78rem;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
}

.speaker-mode-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #c9e2f8;
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 190px;
}

.speaker-select {
    background: #152b42;
    color: #e2f0fc;
    border: 1px solid #2a4766;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.9rem;
}

.transcript-wrap {
    border: 1px solid rgba(159, 197, 232, 0.2);
    background: rgba(11, 20, 34, 0.78);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}

.transcript-wrap h2 {
    color: #edfbff;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.live-graph-panel {
    border: 1px solid rgba(126, 242, 212, 0.28);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, rgba(10, 31, 52, 0.72), rgba(8, 23, 42, 0.72));
}

.live-graph-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.live-graph-head h2 {
    margin: 0;
}

.live-graph-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #c9e2f8;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 190px;
}

.live-node-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.live-node-btn {
    background: #152b42;
    color: #dff2ff;
    border: 1px solid #2a4766;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.live-node-btn:hover {
    background: #1d3a59;
}

.live-node-btn.is-active {
    background: rgba(0, 194, 167, 0.24);
    border-color: rgba(0, 194, 167, 0.8);
    color: #bdfcf0;
}

.live-single-graph {
    min-height: 160px;
    border: 1px solid rgba(126, 242, 212, 0.25);
    border-radius: 8px;
    padding: 10px;
    background: rgba(8, 20, 36, 0.55);
    display: flex;
    align-items: stretch;
}

.live-single-graph-empty {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9fb6cb;
    font-size: 0.9rem;
    border: 1px dashed rgba(126, 242, 212, 0.5);
    border-radius: 8px;
    background: rgba(20, 38, 60, 0.4);
}

.live-trend-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 4px;
    align-items: end;
}

.live-trend-bar-wrap {
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.live-trend-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 1px 1px;
    background: linear-gradient(180deg, #49d0ff, #00c2a7);
    border: 1px solid rgba(125, 225, 255, 0.35);
}

.mic-caption {
    color: #b9d4ea;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.transcript-log {
    background: #0d1b2d;
    border: 1px solid #223a58;
    border-radius: 10px;
    min-height: 170px;
    max-height: 260px;
    overflow-x: auto;
    overflow-y: auto;
    padding: 0;
}

.transcript-graph-panel {
    margin-top: 12px;
    background: #0d1b2d;
    border: 1px solid #223a58;
    border-radius: 10px;
    padding: 10px;
}

.transcript-graph-panel h3 {
    color: #d9ecff;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.transcript-graph-body {
    min-height: 120px;
    border: 1px solid rgba(143, 185, 255, 0.28);
    border-radius: 8px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(19, 40, 64, 0.55), rgba(13, 27, 45, 0.55));
}

.transcript-empty {
    color: #9fb6cb;
    font-size: 0.92rem;
    padding: 10px;
}

.transcript-table {
    width: 100%;
    min-width: 1020px;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.transcript-table th,
.transcript-table td {
    border-bottom: 1px solid rgba(159, 197, 232, 0.18);
    border-right: 1px solid rgba(159, 197, 232, 0.14);
    padding: 8px 9px;
    text-align: center;
}

.transcript-table th:last-child,
.transcript-table td:last-child {
    border-right: 0;
}

.transcript-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #14263c;
    color: #cde4fa;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.transcript-table tbody tr:nth-child(even) {
    background: rgba(19, 36, 57, 0.38);
}

.transcript-table td:first-child {
    white-space: nowrap;
}

.transcript-view-select {
    width: 150px;
    background: #162d45;
    color: #dff2ff;
    border: 1px solid #2a4766;
    border-radius: 6px;
    padding: 5px 6px;
    font-size: 0.78rem;
}

.transcript-row-active {
    outline: 1px solid rgba(126, 242, 212, 0.45);
    box-shadow: inset 0 0 0 1px rgba(126, 242, 212, 0.2);
}

.transcript-graph-bars {
    height: 150px;
    display: grid;
    grid-template-columns: repeat(8, minmax(32px, 1fr));
    gap: 8px;
    align-items: end;
    padding: 6px;
    border: 1px solid rgba(126, 242, 212, 0.2);
    border-radius: 8px;
    background: rgba(8, 20, 36, 0.55);
}

.graph-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    height: 100%;
}

.graph-bar-label {
    color: #aecdde;
    font-size: 0.72rem;
}

.graph-bar {
    width: 100%;
    min-height: 6px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, #49d0ff, #00c2a7);
    border: 1px solid rgba(125, 225, 255, 0.35);
}

.graph-bar-preview {
    background: linear-gradient(180deg, #7aa7ff, #3c6ec9);
    border-color: rgba(141, 182, 255, 0.45);
}

.graph-bar-empty {
    height: 78%;
    min-height: 64px;
    background: repeating-linear-gradient(
        -45deg,
        rgba(126, 242, 212, 0.34),
        rgba(126, 242, 212, 0.34) 8px,
        rgba(126, 242, 212, 0.14) 8px,
        rgba(126, 242, 212, 0.14) 16px
    );
    border: 1px dashed rgba(126, 242, 212, 0.9);
    box-shadow: inset 0 0 0 1px rgba(126, 242, 212, 0.35);
}

.transcript-preview-note {
    color: #9fb6cb;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.timestamp-cell {
    min-width: 120px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #c8def3;
    letter-spacing: 0.02em;
    font-size: 0.78rem;
}

.timestamp-main {
    color: #d9ecff;
    font-weight: 700;
}

.timestamp-sub {
    color: #95b4cf;
    font-size: 0.72rem;
    margin-top: 2px;
}

.transcription-cell {
    text-align: left;
    min-width: 260px;
    color: #d7eafc;
}

.node-cell,
.confidence-cell {
    color: #dff2ff;
    font-weight: 600;
}

.speaker {
    font-weight: 700;
}

.speaker-interviewer {
    color: #66ddff;
}

.speaker-interviewee {
    color: #7ef2d4;
}

.transcript-line {
    color: #d7eafc;
}

.btn {
    padding: 12px 18px;
    font-size: 0.95rem;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    min-width: 140px;
}

.btn-primary {
    background: #00c2a7;
    color: #062421;
}

.btn-primary:hover {
    background: #2bd9c2;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #1a2e44;
    color: #d0e6fb;
    border-color: #2a4766;
}

.btn-secondary:hover {
    background: #234162;
    transform: translateY(-2px);
}

.btn-danger {
    background: #5b1f2f;
    color: #ffdce4;
    border-color: #8e3950;
}

.btn-danger:hover {
    background: #7a2d42;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.card {
    grid-column: span 4;
    background: rgba(11, 20, 34, 0.78);
    border: 1px solid rgba(159, 197, 232, 0.2);
    border-radius: 14px;
    padding: 18px;
    min-height: 220px;
}

.card h2 {
    color: #edfbff;
    margin-bottom: 14px;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.big-number {
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 700;
    color: #7ef2d4;
    margin-bottom: 10px;
}

.metric-row {
    margin: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(171, 201, 231, 0.18);
    padding-bottom: 7px;
}

.metric-row span {
    color: #bdd4ea;
    font-size: 0.92rem;
}

.metric-row strong {
    color: #f4fbff;
    font-size: 1rem;
}

.progress-track {
    width: 100%;
    height: 28px;
    background: #12253e;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #274365;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c2a7, #49d0ff 60%, #8fb9ff);
    transition: width 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #03141f;
    font-weight: 700;
    font-size: 0.86rem;
}

.status {
    margin-top: 12px;
    color: #cce4f8;
    font-size: 0.92rem;
}

.report-box {
    background: #0d1b2d;
    border: 1px solid #223a58;
    border-radius: 10px;
    padding: 12px;
    line-height: 1.6;
    color: #d7eafc;
    min-height: 130px;
}

@media (max-width: 768px) {
    .container {
        padding: 16px 14px 30px;
    }

    .card {
        grid-column: span 12;
        min-height: 180px;
    }

    .header h1 {
        font-size: 1.45rem;
    }

    .top-status-strip {
        justify-content: flex-start;
    }

    .status-indicator {
        width: 100%;
    }

    .controls {
        display: grid;
        grid-template-columns: 1fr;
    }

    .transcript-log {
        max-height: 220px;
    }

    .btn {
        width: 100%;
    }

    .hw-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .hw-bar-right {
        flex-direction: column;
    }

    .port-select {
        min-width: 100%;
    }

    .live-graph-select-wrap {
        width: 100%;
    }

    .live-node-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
