* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f5f5f5; color: #333; padding: 16px; font-size: 14px; }
h1 { color: #1a73e8; margin-bottom: 0; font-size: 1.3em; }

/* ─── Page layout ─── */
#page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1300px; margin: 0 auto 12px; }
#main-content { max-width: 1300px; margin: 0 auto; }
#app-layout { display: flex; gap: 14px; align-items: flex-start; }
#tab-area { flex: 1; min-width: 0; }

/* Capture sidebar */
#history-sidebar { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-tabs { display: flex; gap: 2px; flex-shrink: 0; margin-bottom: 0; }
.sidebar-tab { padding: 8px 16px; border: 1px solid #ddd; border-bottom: none; border-radius: 8px 8px 0 0; background: #eee; color: #666; font-size: 0.82em; font-weight: 600; cursor: pointer; }
.sidebar-tab:hover { color: #555; background: #e8e8e8; }
.sidebar-tab.active { background: #fff; color: #1a73e8; border-bottom: 1px solid #fff; margin-bottom: -1px; z-index: 1; }
.sync-indicator { margin-left: auto; padding: 4px 10px; font-size: 0.72em; cursor: help; align-self: center; white-space: nowrap; font-weight: 500; }
.sync-indicator.ok { color: #34a853; }
.sync-indicator.err { color: #ea4335; }
.sync-indicator.pending { color: #f9ab00; }
.sidebar-tab-content { display: none; flex: 1; overflow-y: auto; flex-direction: column; border: 1px solid #ddd; border-radius: 0 8px 8px 8px; background: #fff; }
.sidebar-tab-content.active { display: flex; }
.sidebar-header { padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #ddd; border-radius: 8px 8px 0 0; }
.sidebar-capture { padding: 14px 16px; border-bottom: 1px solid #eee; background: #fff; }

/* Capture tab sections */
.cap-section { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }
.cap-section:last-of-type { border-bottom: none; margin-bottom: 8px; padding-bottom: 0; }
.cap-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cap-section-title { font-size: 0.88em; font-weight: 700; color: #333; }
.cap-hint { font-size: 0.76em; color: #999; line-height: 1.4; margin: 4px 0; }
.cap-empty-hint { font-size: 0.8em; color: #aaa; padding: 8px 0; text-align: center; }
.cap-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 0.85em; margin-top: 4px; }
.cap-grid label { color: #666; white-space: nowrap; text-align: right; }
.cap-grid select { padding: 5px 8px; border: 1px solid #ddd; border-radius: 5px; font-size: 1em; width: 100%; }
.cap-actions { display: flex; gap: 8px; margin-top: 14px; }

.sidebar-settings { display: grid; grid-template-columns: auto 1fr auto; gap: 5px 8px; align-items: center; font-size: 0.82em; margin-bottom: 6px; }
.sidebar-settings label { color: #666; white-space: nowrap; text-align: right; }
.sidebar-settings select { padding: 3px 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 1em; min-width: 0; width: 100%; }
.sidebar-section-label { font-size: 0.68em; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: 0.06em; margin: 8px 0 4px; padding-top: 6px; border-top: 1px solid #f0f0f0; }
.sidebar-section-label:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.sidebar-cap-btn { flex: 1; font-size: 0.85em; display: flex !important; flex-direction: column; align-items: center; padding: 8px 6px; line-height: 1.3; }
.sidebar-cap-btn .cap-btn-count { font-size: 0.78em; font-weight: 400; opacity: 0.7; }
.sidebar-controls { padding: 6px 10px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f0f0f0; background: #fafafa; }
.sidebar-list { flex: 1; overflow-y: auto; }
.sidebar-item { padding: 6px 10px; border-bottom: 1px solid #f5f5f5; cursor: pointer; font-size: 0.78em; display: flex; align-items: flex-start; gap: 6px; }
.sidebar-item:hover { background: #f8fbff; }
.sidebar-item.active { background: #fff8e1; border-left: 3px solid #f9ab00; }
.sidebar-item.checked { border-left: 3px solid #1a73e8; }
.sidebar-item .si-id { font-weight: 600; color: #1a73e8; min-width: 24px; }
.sidebar-item .si-device { color: #555; font-weight: 500; }
.sidebar-item .si-note { color: #888; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item .si-time { color: #aaa; font-size: 0.9em; }
.sidebar-item .si-metrics { font-family: monospace; color: #666; font-size: 0.9em; }
.sidebar-item .si-spur { display: inline-block; width: 7px; height: 7px; border-radius: 50%; vertical-align: middle; }
.sidebar-item .si-spur.green { background: #34a853; }
.sidebar-item .si-spur.yellow { background: #f9ab00; }
.sidebar-item .si-spur.red { background: #ea4335; }
.sidebar-item .si-delete { opacity: 0; color: #ea4335; cursor: pointer; font-size: 1.1em; padding: 0 2px; }
.sidebar-item:hover .si-delete { opacity: 0.6; }
.sidebar-item .si-delete:hover { opacity: 1; }
.sidebar-item .si-info { opacity: 0.5; color: #1a73e8; cursor: pointer; font-size: 0.9em; padding: 0 2px; }
.sidebar-item:hover .si-info { opacity: 0.8; }
.sidebar-item .si-info:hover { opacity: 1; }
.sidebar-item .si-ref { opacity: 0.5; color: #1a73e8; cursor: pointer; font-size: 0.7em; font-weight: 600; padding: 1px 4px; border-radius: 3px; border: 1px solid #d0dff0; }
.sidebar-item:hover .si-ref { opacity: 0.8; }
.sidebar-item .si-ref:hover { opacity: 1; background: #e8f0fe; }
.sidebar-item.ref .si-ref { opacity: 1; background: #e8f0fe; border-color: #1a73e8; }
.sidebar-item.ref { border-right: 3px solid #1a73e8; }
.sidebar-session { padding: 8px 10px; background: #f5f5f5; border-top: 2px solid #e0e0e0; font-size: 0.75em; cursor: pointer; }
.sidebar-session:hover { background: #eeeeee; }
.sidebar-session:first-child { border-top: none; }
.sidebar-session .ss-row1 { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.sidebar-session .ss-row2 { display: flex; align-items: center; gap: 6px; padding-left: 38px; min-height: 0; margin-top: 8px; }
.sidebar-session .ss-time { color: #888; white-space: nowrap; }
.sidebar-session .ss-info-btn { cursor: pointer; color: #1a73e8; font-size: inherit; flex-shrink: 0; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: #e8f0fe; border: 1px solid #c2d9f7; white-space: nowrap; display: flex; align-items: center; line-height: 1; }
.sidebar-session .ss-info-btn:hover { background: #c2d9f7; }
.sidebar-session .ss-count { color: #aaa; font-size: 0.9em; margin-left: auto; }
.sidebar-session .ss-count::before { content: '×'; }
.sidebar-session .ss-note-preview { color: #888; font-style: italic; font-size: 0.95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.sidebar-session .ss-snr-load { color: #7b1fa2; cursor: pointer; white-space: nowrap; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: #f3e5f5; border: 1px solid #e1bee7; flex-shrink: 0; }
.sidebar-session .ss-snr-load:hover { background: #e1bee7; }
.sidebar-session.snr { background: #f3e5f5; border-top-color: #ce93d8; }
.sidebar-session.snr:hover { background: #ead5ed; }
.sidebar-session.snr-loaded { border-left: 3px solid #7b1fa2; }
.sidebar-session.snr-loaded .ss-snr-load { background: #7b1fa2; color: #fff; border-color: #7b1fa2; }
.sidebar-session .ss-collapse { cursor: pointer; font-size: 0.8em; color: #aaa; user-select: none; flex-shrink: 0; width: 12px; text-align: center; }
.sidebar-session .ss-collapse:hover { color: #555; }
.sidebar-session .ss-info { cursor: pointer; color: #aaa; font-size: 0.9em; flex-shrink: 0; margin-left: auto; }
.sidebar-session .ss-info:hover { color: #1a73e8; }
.si-snr-pill { font-size: 0.7em; font-weight: 700; padding: 1px 6px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; letter-spacing: 0.03em; }
@media (max-width: 900px) { #history-sidebar { display: none; } #app-layout { display: block; } .tab-content.active { display: block; } }
h3 { font-size: 0.95em; color: #555; margin-bottom: 8px; }

/* Top bars */
.top-bar { margin-bottom: 12px; background: #fff; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.conn-bar { padding: 8px 12px; font-size: 0.85em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid #eee; }
.conn-bar label { color: #666; font-size: 0.82em; }
.session-bar { padding: 8px 12px; font-size: 0.85em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid #eee; }
.session-bar input { padding: 4px 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.85em; width: 120px; }
.session-bar label { color: #666; font-size: 0.82em; }
.conn-dot { width: 10px; height: 10px; border-radius: 50%; background: #ccc; flex-shrink: 0; }
.conn-dot.ok { background: #34a853; } .conn-dot.err { background: #ea4335; } .conn-dot.warn { background: #f9ab00; }
/* Connection list table */
.conn-table { width: 100%; border-collapse: collapse; font-size: 0.82em; }
.conn-table th { text-align: left; padding: 6px 10px; color: #888; font-weight: 600; font-size: 0.8em; border-bottom: 1px solid #eee; background: #fafafa; }
.conn-table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.conn-table tr:last-child td { border-bottom: none; }
.conn-table tr:hover { background: #f8fbff; }
.conn-table .conn-label { font-weight: 600; color: #333; }
.conn-table .conn-url { font-family: monospace; color: #888; font-size: 0.95em; }
.conn-table .conn-status { color: #999; }
.conn-table .conn-actions { white-space: nowrap; }
.sid { font-family: monospace; color: #1a73e8; font-weight: 600; }
.mac { font-family: monospace; color: #888; font-size: 0.82em; }

.status-bar { background: #fff; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #ddd; font-size: 0.88em; }
.s-ready { color: #0d9; font-weight: bold; } .s-run { color: #e8a; font-weight: bold; } .s-done { color: #1a73e8; font-weight: bold; }

/* Tabs */
.tabs { display: flex; gap: 2px; margin-bottom: 0; }
.tab { padding: 8px 18px; border: 1px solid #ddd; border-bottom: none; border-radius: 8px 8px 0 0; background: #eee; color: #666; font-size: 0.85em; font-weight: 600; cursor: pointer; }
.tab.active { background: #fff; color: #1a73e8; border-bottom: 1px solid #fff; margin-bottom: -1px; z-index: 1; }
.tab-content { display: none; background: #fff; border: 1px solid #ddd; border-radius: 0 8px 8px 8px; padding: 16px; margin-bottom: 12px; }
.tab-content.active { display: block; }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary:hover { color: #1a73e8; }
.tab-desc { color: #888; font-size: 0.85em; margin-bottom: 12px; }

/* Badges */
.badge { font-size: 0.7em; padding: 2px 8px; border-radius: 12px; font-weight: bold; display: inline-block; }
.b-pass { background: #e6f4ea; color: #34a853; } .b-fail { background: #fce8e6; color: #ea4335; }
.b-cond { background: #fef7e0; color: #f9ab00; } .b-pend { background: #eee; color: #999; } .b-run { background: #e8f0fe; color: #1a73e8; }

/* Buttons */
.btn { display: inline-block; padding: 6px 12px; border: none; border-radius: 6px; font-size: 0.78em; cursor: pointer; margin: 2px; font-weight: 600; }
.btn-p { background: #1a73e8; color: #fff; } .btn-d { background: #ea4335; color: #fff; }
.btn-s { background: #eee; color: #555; border: 1px solid #ddd; }
.btn-g { background: #34a853; color: #fff; }
.btn-run { background: #e8f0fe; color: #1a73e8; border: 1px solid #c2d9f7; padding: 3px 8px; font-size: 0.72em; }
.btn-xs { padding: 2px 8px; font-size: 0.68em; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.actions { text-align: center; margin: 12px 0; }
.overall { text-align: center; font-size: 1.2em; padding: 12px; background: #fff; border-radius: 8px; margin-bottom: 12px; border: 1px solid #ddd; font-weight: bold; }
.t6-box { background: #fff8e1; border: 1px solid #fbbc04; border-radius: 8px; padding: 12px; text-align: center; margin-bottom: 12px; }
.panel { background: #fafafa; border: 1px solid #eee; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
audio { width: 100%; margin-top: 8px; }

/* Test cards */
.tcard { background: #fff; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.tcard.pass { border-left: 4px solid #34a853; } .tcard.fail { border-left: 4px solid #ea4335; }
.tcard.cond { border-left: 4px solid #fbbc04; } .tcard.running { border-left: 4px solid #1a73e8; background: #f8fbff; }
.tcard-row { display: flex; align-items: stretch; }
.tcard-left { width: 130px; min-width: 130px; padding: 12px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid #eee; }
.tcard-name { font-weight: bold; font-size: 1.05em; margin-bottom: 2px; }
.tcard-sub { color: #888; font-size: 0.78em; }
.tcard-cd { font-family: monospace; color: #1a73e8; font-size: 0.82em; font-weight: bold; margin-top: 4px; }
.tcard-right { flex: 1; padding: 8px 12px; }
.rslot { display: flex; align-items: center; padding: 5px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.83em; gap: 6px; }
.rslot:last-of-type { border-bottom: none; }
.rslot-lbl { color: #666; min-width: 38px; font-weight: 600; }
.rslot-time { color: #aaa; font-size: 0.75em; min-width: 60px; }
.rslot-val { font-family: monospace; flex: 1; }
.rslot-btn { min-width: 40px; text-align: right; }
.rv-pass { color: #34a853; } .rv-fail { color: #ea4335; } .rv-cap { color: #1a73e8; font-style: italic; }

/* Collapsible sections */
.tog { font-size: 0.72em; cursor: pointer; display: inline-block; user-select: none; margin-top: 6px; margin-right: 12px; }
.tog-inst { color: #888; } .tog-log { color: #1a73e8; }
.coll { display: none; margin-top: 4px; } .coll.open { display: block; }
.tinst { background: #fafafa; border: 1px solid #eee; border-radius: 6px; padding: 8px 10px; font-size: 0.78em; line-height: 1.5; }
.tinst dt { color: #555; font-weight: 600; margin-top: 4px; } .tinst dt:first-child { margin-top: 0; }
.tinst dd { color: #666; margin-left: 0; margin-bottom: 2px; }
.tinst .pass-crit { color: #34a853; font-weight: 600; }
.log-box { background: #1e1e1e; border: 1px solid #333; border-radius: 6px; padding: 8px; font-family: monospace; font-size: 0.72em; max-height: 140px; overflow-y: auto; white-space: pre-wrap; color: #ccc; }

/* Diagnostics table */
.diag-table { width: 100%; border-collapse: collapse; font-size: 0.83em; }
.diag-table th { text-align: left; padding: 6px 8px; border-bottom: 2px solid #ddd; color: #666; font-weight: 600; font-size: 0.85em; }
.diag-table td { padding: 6px 8px; border-bottom: 1px solid #f0f0f0; }
.diag-table tr.running td { background: #f0f7ff; }
.diag-table .mono { font-family: monospace; }
.diag-table .desc { color: #888; font-size: 0.9em; max-width: 180px; }
.diag-table td:nth-child(3), .diag-table td:nth-child(4), .diag-table td:nth-child(5),
.diag-table th:nth-child(3), .diag-table th:nth-child(4), .diag-table th:nth-child(5) { min-width: 180px; }

/* Session history */
.hist-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.85em; }
.hist-item:last-child { border-bottom: none; }
.hi-id { font-family: monospace; color: #1a73e8; font-weight: 600; }
.hi-meta { color: #888; margin-left: 8px; }

/* Serial console */
#serialLog { max-height: 200px; min-height: 80px; }
#serialCmd { font-family: monospace; }

/* Capture Lab */
.cap-card { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.cap-card h4 { font-size: 0.88em; color: #555; margin-bottom: 6px; }
.cap-meta { font-size: 0.78em; color: #888; margin-bottom: 6px; }
.cap-meta span { margin-right: 12px; }
.cap-stats { display: flex; gap: 16px; font-size: 0.83em; margin-bottom: 8px; flex-wrap: wrap; }
.cap-stat { background: #f5f5f5; padding: 4px 10px; border-radius: 6px; font-family: monospace; }
.cap-stat label { color: #888; font-size: 0.85em; }

/* ─── Noise Analysis Tab ─── */
.na-controls { margin-bottom: 0; }

/* Signal processing table */
.sp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}
.sp-table th {
  text-align: left;
  padding: 4px 6px;
  color: #999;
  font-weight: 600;
  font-size: 0.82em;
  border-bottom: 1px solid #e8e8e8;
}
.sp-table td {
  padding: 6px 6px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
}
.sp-table tr:last-child td { border-bottom: none; }
.sp-table input[type="checkbox"] { margin: 0; }
.sp-name {
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}
.sp-name label { cursor: pointer; }
.sp-hint {
  color: #999;
  font-size: 0.9em;
}
.sp-info {
  color: #bbb;
  cursor: pointer;
  font-size: 1.15em;
  line-height: 1;
  user-select: none;
}
.sp-info:hover { color: #1a73e8; }
.sp-badge {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e8f0fe;
  color: #1a73e8;
  white-space: nowrap;
  line-height: 1.5;
}
.sp-help-row { display: none; }
.sp-help-row.open { display: table-row; }
.sp-help-row td { padding: 0; border-bottom: none; }
.sp-help {
  font-size: 0.88em;
  color: #666;
  background: #f8f9fa;
  padding: 6px 10px;
  line-height: 1.45;
  border-bottom: 1px solid #eee;
}
.sp-select {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.95em;
  background: #fff;
}
.sp-input {
  width: 52px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.95em;
  text-align: right;
}

.na-results { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 12px 0; }
@media (max-width: 700px) { .na-results { grid-template-columns: 1fr; } }
.na-card { background: #fafafa; border: 1px solid #eee; border-radius: 8px; padding: 12px; }
.na-card h4 { font-size: 0.88em; color: #555; margin-bottom: 8px; }
.na-card.spur-green { border-left: 4px solid #34a853; }
.na-card.spur-yellow { border-left: 4px solid #f9ab00; }
.na-card.spur-red { border-left: 4px solid #ea4335; }
.na-table { width: 100%; border-collapse: collapse; font-size: 0.82em; }
.na-table th { text-align: left; padding: 3px 6px; border-bottom: 1px solid #ddd; color: #888; font-weight: 600; font-size: 0.85em; }
.na-table td { padding: 3px 6px; border-bottom: 1px solid #f0f0f0; }
.na-table .mono { font-family: monospace; }
.na-table .delta-pos { color: #ea4335; }
.na-table .delta-neg { color: #34a853; }
.na-table .spur-warn { color: #f9ab00; }
.na-tooltip { position: absolute; background: rgba(0,0,0,0.85); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 0.75em; font-family: monospace; pointer-events: none; z-index: 10; }
.na-history { max-height: 300px; overflow-y: auto; }
.na-hist-table { width: 100%; border-collapse: collapse; font-size: 0.82em; font-family: monospace; }
.na-hist-table th { position: sticky; top: 0; background: #f8f8f8; padding: 4px 6px; text-align: left; font-size: 0.78em; font-weight: 600; color: #888; border-bottom: 2px solid #ddd; white-space: nowrap; }
.na-hist-table td { padding: 4px 6px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.na-hist-table tr { cursor: pointer; }
.na-hist-table tr:hover { background: #f0f7ff; }
.na-hist-table tr.active { background: #e8f0fe; }
.na-hist-table .spur-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.na-hist-table .spur-dot.green { background: #34a853; }
.na-hist-table .spur-dot.yellow { background: #f9ab00; }
.na-hist-table .spur-dot.red { background: #ea4335; }
.na-toggle { font-size: 0.78em; }

/* Subsystem state checkboxes */
.na-subsys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 500px) { .na-subsys-grid { grid-template-columns: 1fr; } }
.na-subsys-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f8f8f8; border: 1px solid #eee; border-radius: 6px; cursor: pointer; font-size: 0.82em; transition: border-color 0.15s; }
.na-subsys-item:hover { border-color: #ccc; }
.na-subsys-item input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; }
.na-subsys-item input:checked ~ .na-subsys-label { color: #1a73e8; font-weight: 600; }
.na-subsys-label { font-weight: 600; color: #555; min-width: 80px; }
.na-subsys-desc { color: #999; font-size: 0.9em; flex: 1; }
.na-subsys-status { font-size: 0.85em; color: #888; font-style: italic; }

/* Capture settings display */
.na-settings-panel { margin-bottom: 12px; }
.na-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 12px; font-size: 0.82em; }
.na-setting { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid #f0f0f0; }
.na-setting-key { color: #888; }
.na-setting-val { font-family: monospace; color: #333; font-weight: 600; }
.na-setting-note { grid-column: 1 / -1; padding: 4px 0; }
.na-setting-note input { width: 100%; padding: 3px 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.95em; }

/* Analysis section wrapper */
.na-analysis-section { margin: 12px 0; }

/* ─── Device Discovery ─── */
.scan-results { background: #fff; border: 1px solid #ddd; border-top: none; border-radius: 0 0 8px 8px; padding: 8px 12px; font-size: 0.82em; max-height: 200px; overflow-y: auto; }
.scan-status { color: #888; font-size: 0.85em; margin-bottom: 6px; }
.scan-device { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.scan-device:hover { background: #f0f7ff; }
.scan-device .scan-dot { width: 8px; height: 8px; border-radius: 50%; background: #34a853; flex-shrink: 0; }
.scan-device .scan-info { flex: 1; }
.scan-device .scan-host { font-family: monospace; color: #1a73e8; font-weight: 600; }
.scan-device .scan-meta { color: #888; font-size: 0.9em; }
.scan-device .scan-ip { font-family: monospace; color: #555; }

/* ─── Claude Analysis ─── */
.na-claude-panel { margin-top: 12px; }
.na-claude-settings { display: flex; gap: 10px; align-items: center; font-size: 0.85em; flex-wrap: wrap; margin-bottom: 8px; }
.na-claude-settings input[type="password"], .na-claude-settings input[type="text"] { padding: 4px 8px; border: 1px solid #ccc; border-radius: 6px; font-family: monospace; font-size: 0.9em; }
.na-claude-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 0.82em; }
.na-claude-checks label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.na-claude-response { margin-top: 12px; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.na-claude-response-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f5f5f5; border-bottom: 1px solid #eee; }
.na-claude-text { padding: 12px; font-size: 0.85em; line-height: 1.6; white-space: pre-wrap; max-height: 500px; overflow-y: auto; font-family: system-ui; }

/* ─── Capture Plans ─── */
.na-plan-list { display: flex; gap: 6px; flex-wrap: wrap; }
.na-plan-item { padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; font-size: 0.82em; background: #fafafa; transition: all 0.15s; }
.na-plan-item:hover { border-color: #1a73e8; background: #f0f7ff; }
.na-plan-item.na-plan-active { border-color: #1a73e8; background: #e8f0fe; }
.na-plan-name { font-weight: 600; color: #333; }
.na-plan-meta { color: #888; margin-left: 6px; font-size: 0.9em; }
.na-plan-desc { display: none; }
.na-plan-table { width: 100%; border-collapse: collapse; font-size: 0.82em; }
.na-plan-table th { text-align: left; padding: 4px 6px; border-bottom: 2px solid #ddd; color: #888; font-weight: 600; font-size: 0.85em; }
.na-plan-table td { padding: 4px 6px; border-bottom: 1px solid #f0f0f0; }
.na-plan-table tr.running td { background: #f0f7ff; }
.na-plan-table input[type="text"] { border: 1px solid #eee; border-radius: 3px; padding: 1px 4px; font-size: 0.95em; }
.na-plan-table select { font-size: 0.95em; border: 1px solid #eee; border-radius: 3px; }
.na-plan-table input[type="checkbox"] { width: 14px; height: 14px; }

/* ─── Info tooltips ─── */
.na-info { color: #aaa; cursor: help; font-size: 0.85em; margin-left: 4px; }
.na-info:hover { color: #1a73e8; }
#tab-noise label[title] { border-bottom: 1px dotted #ccc; cursor: help; }
#tab-noise .na-subsys-item[title] { border-bottom: none; cursor: pointer; }

/* ─── Capture Sets ─── */
.na-set-list { max-height: 180px; overflow-y: auto; }
.na-set-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid #f0f0f0; font-size: 0.82em; cursor: pointer; }
.na-set-item:hover { background: #f0f7ff; }
.na-set-item.active { background: #e8f0fe; border-left: 3px solid #1a73e8; }
.na-set-name { font-weight: 600; color: #333; }
.na-set-meta { color: #888; font-size: 0.9em; }
.na-set-note { color: #aaa; font-size: 0.9em; font-style: italic; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.na-set-actions { flex-shrink: 0; }

/* History table action buttons */
.na-hist-actions { white-space: nowrap; opacity: 0.3; transition: opacity 0.15s; }
tr:hover .na-hist-actions { opacity: 1; }
.na-hist-actions .btn { padding: 1px 5px; font-size: 0.7em; }

/* ─── Setup / Getting Started Tab ─── */
.setup-intro { background: #e8f0fe; border: 1px solid #c5d8f7; border-radius: 8px; padding: 12px 16px; font-size: 0.88em; color: #333; margin-bottom: 16px; line-height: 1.6; }
.setup-step { display: flex; gap: 16px; background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.setup-num { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: #1a73e8; color: #fff; font-weight: 700; font-size: 1em; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.setup-body { flex: 1; min-width: 0; }
.setup-title { font-weight: 700; font-size: 0.97em; color: #222; margin-bottom: 4px; }
.setup-desc { color: #666; font-size: 0.84em; margin-bottom: 10px; line-height: 1.5; }
.setup-list { padding-left: 18px; font-size: 0.84em; color: #444; line-height: 2; }
.setup-list li { margin-bottom: 2px; }
.setup-list code { background: #f0f0f0; border-radius: 3px; padding: 1px 5px; font-size: 0.95em; color: #c7254e; }
.setup-code { display: inline-block; background: #1e1e1e; color: #80cbc4; font-family: monospace; font-size: 0.85em; border-radius: 5px; padding: 4px 10px; margin: 4px 0; }
.setup-tip { background: #fff8e1; border-left: 3px solid #fbbc04; border-radius: 0 6px 6px 0; padding: 8px 12px; font-size: 0.82em; color: #555; line-height: 1.6; margin-top: 10px; }
.setup-tip code { background: #f0e68c; border-radius: 3px; padding: 1px 4px; font-size: 0.95em; }
.setup-substep { background: #f8f9fa; border: 1px solid #eee; border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; }
.setup-substep strong { font-size: 0.88em; color: #333; display: block; margin-bottom: 4px; }
.setup-tests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
@media (max-width: 650px) { .setup-tests { grid-template-columns: 1fr; } .setup-step { flex-direction: column; gap: 10px; } }
.setup-test-card { background: #fafafa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.setup-test-card:hover { background: #f0f7ff; border-color: #1a73e8; }
.setup-test-title { font-weight: 700; font-size: 0.88em; color: #222; margin-bottom: 5px; }
.setup-test-desc { font-size: 0.79em; color: #666; line-height: 1.55; }

/* ─── SNR Analysis Tab ─── */
.snr-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 600px) { .snr-cards { grid-template-columns: 1fr; } }
.snr-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px 14px; text-align: center; }
.snr-card-label { font-size: 0.75em; color: #888; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.snr-card-value { font-size: 1.6em; font-weight: 700; font-family: monospace; color: #333; line-height: 1.2; }
.snr-card-sub { font-size: 0.72em; color: #aaa; margin-top: 3px; }
.snr-good { color: #34a853; }
.snr-ok { color: #f9ab00; }
.snr-bad { color: #ea4335; }
.snr-table { width: 100%; border-collapse: collapse; font-size: 0.83em; }
.snr-table th { text-align: left; padding: 5px 8px; border-bottom: 2px solid #ddd; color: #666; font-weight: 600; font-size: 0.85em; }
.snr-table td { padding: 5px 8px; border-bottom: 1px solid #f0f0f0; }
.snr-table tr:last-child td { border-bottom: none; }

/* ─── Mic Qualification Plan ─── */
.mq-overall { display: inline-block; padding: 3px 10px; border-radius: 6px; font-weight: 700; border: 1.5px solid currentColor; }
.mq-overall-pass { color: #34a853; }
.mq-overall-fail { color: #ea4335; }
.mq-overall-pending { color: #f9ab00; }

.mq-step { background: #fafafa; border: 1px solid #e8e8e8; border-radius: 8px; padding: 10px 12px; margin-bottom: 9px; font-size: 0.83em; }
.mq-step-header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.mq-step-id { background: #1a73e8; color: #fff; border-radius: 5px; padding: 1px 7px; font-weight: 700; font-size: 0.8em; flex-shrink: 0; }
.mq-step-title { font-weight: 700; font-size: 0.93em; color: #222; }
.mq-step-body { color: #444; }

.mq-rationale { font-size: 0.79em; color: #666; line-height: 1.55; background: #fff; border-left: 3px solid #ddd; padding: 5px 8px; border-radius: 0 4px 4px 0; margin-bottom: 8px; }

.mq-procedure, .mq-criteria { border: 1px solid #eee; border-radius: 5px; padding: 5px 8px; font-size: 0.82em; background: #fff; }
.mq-procedure summary, .mq-criteria summary { cursor: pointer; color: #555; font-weight: 600; }
.mq-procedure summary:hover, .mq-criteria summary:hover { color: #1a73e8; }

