/* ============================================================
   TECHREF CONTENT STYLES
   Covers: test_signals technical reference sections
   ============================================================ */
:root {
  --bg: #212121;
  --surface: #111111;
  --surface-2: #1c2230;
  --border: #2a3140;
  --border-accent: #3d4f6a;
  --text: #cdd6e4;
  --text-dim: #cdd4de;
  --text-bright: #f0f4fc;
  --accent:#F74B4B;
  --accent-dim: #264a78;
  --green: #3fb950;
  --green-dim: #1a3a24;
  --orange: #d29922;
  --orange-dim: #3d2e0a;
  --pink: #db61a2;
  --pink-dim: #3d1a30;
  --purple: #a78bfa;
  --purple-dim: #2a1f4e;
  --cyan: #56d4dd;
  --red:#F74B4B;
  --gold: #f0c040;
  --magenta: #d02090;
  --mono: 'JetBrains Mono', 'Share Tech Mono', monospace;
  --sans: 'DM Sans', 'Barlow', -apple-system, sans-serif;
  --cond: 'Barlow Condensed', sans-serif;
  --text-muted: #7d8da1;
}

.techref-content {
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.techref-content h2 {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.techref-content h3 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 28px 0 12px;
}
.techref-content h4 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 20px 0 8px;
}
.techref-content p {
  margin: 8px 0 12px;
  font-size: 14.5px;
}
.techref-content .section-intro {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 20px;
  max-width: 780px;
}
.techref-content ul, .techref-content ol {
  margin: 8px 0 16px 20px;
  font-size: 14.5px;
}
.techref-content li {
  margin-bottom: 4px;
}
.techref-content code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--orange);
}
.techref-content pre {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 12px 0 16px;
  overflow-x: auto;
  color: var(--text);
  line-height: 1.7;
}
.techref-content a {
  color: var(--accent) !important;
}

/* ── TOC ── */
.techref-content .toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 32px;
}
.techref-content .toc-title {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.techref-content .toc ol {
  list-style: decimal;
  margin-left: 20px;
}
.techref-content .toc li {
  margin-bottom: 6px;
}
.techref-content .toc a {
  color: var(--accent) !important;
  text-decoration: none;
  font-size: 14px;
}
.techref-content .toc a:hover {
  text-decoration: underline;
}

/* ── Tables ── */
.techref-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0 20px;
}
.techref-content thead th {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.techref-content tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
.techref-content tbody tr:last-child td { border-bottom: none; }
.techref-content tbody tr:hover { background: rgba(255,255,255,0.015); }

.techref-content td.region {
  font-family: var(--mono);
  font-weight: 600;
  white-space: nowrap;
  font-size: 13px;
}
.techref-content td.dur {
  font-family: var(--mono);
  color: var(--cyan);
  white-space: nowrap;
  font-size: 12.5px;
}
.techref-content td.num {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 12px;
  width: 32px;
  text-align: center;
}
.techref-content td.digit {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text-bright);
  text-align: center;
  width: 44px;
}
.techref-content td.idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  text-align: center;
}

/* ── Cards ── */
.techref-content .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 16px 0;
}
.techref-content .card.green {
  border-left: 3px solid var(--green);
}
.techref-content .card.accent {
  border-left: 3px solid var(--accent);
}
.techref-content .card-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.techref-content .card p {
  font-size: 14px;
  color: var(--text);
}

/* ── Figures ── */
.techref-content .figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin: 16px 0;
  text-align: center;
  overflow-x: auto;
}
.techref-content .figure img {
  max-width: 100%;
  height: auto;
}
.techref-content .figure-caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 10px;
}

/* ── Equations ── */
.techref-content .equation {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 12px 0 16px;
  color: var(--cyan);
  line-height: 1.8;
}

/* ── Comparison blocks ── */
.techref-content .comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
@media (max-width: 700px) {
  .techref-content .comparison { grid-template-columns: 1fr; }
}
.techref-content .comparison > div {
  padding: 14px 18px;
  background: var(--surface);
  border-radius: 6px;
}
.techref-content .comparison .label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* ── Badges ── */
.techref-content .badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.techref-content .badge-excellent { background: rgba(63,185,80,0.15); color: var(--green); border: 1px solid var(--green-dim); }
.techref-content .badge-good { background: rgba(88,166,255,0.1); color: var(--accent); border: 1px solid var(--accent-dim); }
.techref-content .badge-fair { background: rgba(210,153,34,0.15); color: var(--orange); border: 1px solid var(--orange-dim); }
.techref-content .badge-poor { background: rgba(244,112,103,0.15); color: var(--red); border: 1px solid rgba(244,112,103,0.3); }
.techref-content .badge-bad { background: rgba(219,97,162,0.15); color: var(--pink); border: 1px solid var(--pink-dim); }

/* ============================================================
   WAV STRUCTURE STYLES (from ToneBurst-WAV-Structure_2.html)
   ============================================================ */

/* ── Timeline diagram ── */
.techref-content .timeline-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.techref-content .timeline {
  display: flex;
  align-items: stretch;
  min-width: 820px;
  height: 54px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.techref-content .timeline .seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  padding: 4px 2px;
  border-right: 1px solid rgba(255,255,255,0.06);
  position: relative;
  transition: filter 0.15s;
}
.techref-content .timeline .seg:last-child { border-right: none; }
.techref-content .timeline .seg:hover { filter: brightness(1.2); }
.techref-content .timeline .seg .label { font-size: 8.5px; opacity: 0.7; margin-top: 1px; }

.techref-content .seg.silence   { background: var(--surface-2); color: var(--text-dim); }
.techref-content .seg.prn       { background: var(--accent-dim); color: var(--accent); }
.techref-content .seg.dtmf      { background: var(--purple-dim); color: var(--purple); }
.techref-content .seg.burst     { background: var(--green-dim); color: var(--green); }
.techref-content .seg.noise     { background: var(--orange-dim); color: var(--orange); }
.techref-content .seg.pad       { background: #1a2030; color: #667799; }

.techref-content .timeline-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.techref-content .timeline-legend .item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--mono);
}
.techref-content .timeline-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.techref-content .dot.silence { background: var(--surface-2); border: 1px solid var(--border); }
.techref-content .dot.prn     { background: var(--accent-dim); border: 1px solid var(--accent); }
.techref-content .dot.dtmf    { background: var(--purple-dim); border: 1px solid var(--purple); }
.techref-content .dot.burst   { background: var(--green-dim); border: 1px solid var(--green); }
.techref-content .dot.noise   { background: var(--orange-dim); border: 1px solid var(--orange); }
.techref-content .dot.pad     { background: #1a2030; border: 1px solid #667799; }

/* ── Section numbering badges ── */
.techref-content .section-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: rgba(88,166,255,0.1);
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 600;
  margin-right: 8px;
}

/* ── Notes ── */
.techref-content .note {
  font-size: 13px;
  color: var(--text-dim);
  padding: 12px 16px;
  border-left: 3px solid var(--accent-dim);
  background: rgba(88,166,255,0.03);
  border-radius: 0 6px 6px 0;
  margin-top: 16px;
}
.techref-content .note strong { color: var(--accent); font-weight: 600; }

/* ── DTMF section ── */
.techref-content .dtmf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 700px) {
  .techref-content .dtmf-grid { grid-template-columns: 1fr; }
}
.techref-content .dtmf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}
.techref-content .dtmf-card .band-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.techref-content .dtmf-card .band-range {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-family: var(--mono);
}
.techref-content .dtmf-card .freq-group { margin-bottom: 8px; }
.techref-content .dtmf-card .freq-group .group-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.techref-content .dtmf-card .freq-list { display: flex; gap: 6px; flex-wrap: wrap; }
.techref-content .dtmf-card .freq-chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.techref-content .dtmf-card.low  .band-label { color: var(--green); }
.techref-content .dtmf-card.low  .freq-chip  { color: var(--green); border-color: var(--green-dim); }
.techref-content .dtmf-card.mid  .band-label { color: var(--orange); }
.techref-content .dtmf-card.mid  .freq-chip  { color: var(--orange); border-color: var(--orange-dim); }
.techref-content .dtmf-card.high .band-label { color: var(--pink); }
.techref-content .dtmf-card.high .freq-chip  { color: var(--pink); border-color: var(--pink-dim); }

/* ── Diff callout ── */
.techref-content .diff-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-top: 20px;
}
.techref-content .diff-callout h4 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 10px;
}
.techref-content .diff-callout ul { list-style: none; padding: 0; margin: 0; }
.techref-content .diff-callout li {
  font-size: 13.5px;
  color: var(--text);
  padding: 4px 0 4px 18px;
  position: relative;
}
.techref-content .diff-callout li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}

/* ── Diagram container ── */
.techref-content .diagram-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.techref-content .diagram-wrap svg {
  display: block;
  margin: 0 auto;
}
.techref-content .diagram-caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 12px;
}

/* ── Formula ── */
.techref-content .formula {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cyan);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  display: inline-block;
  margin: 8px 0;
}

/* ── Pipeline steps ── */
.techref-content .pipeline {
  display: flex;
  gap: 0;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.techref-content .pipeline .step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  text-align: center;
  line-height: 1.4;
}
.techref-content .pipeline .step .step-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.techref-content .pipeline .step .step-val {
  color: var(--cyan);
  font-weight: 600;
}
.techref-content .pipeline .arrow {
  font-size: 16px;
  color: var(--text-dim);
  padding: 0 6px;
}

/* ── Divider ── */
.techref-content .divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ── Badge row ── */
.techref-content .badge-row {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}
.techref-content .badge-row .badge {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
}
.techref-content .badge-row .badge.blue { color: var(--accent); border-color: var(--accent-dim); background: rgba(88,166,255,0.06); }
.techref-content .badge-row .badge.green { color: var(--green); border-color: var(--green-dim); background: rgba(63,185,80,0.06); }

/* ============================================================
   HELP / REFERENCE MANUAL STYLES (from tonebursthelp.html)
   ============================================================ */

/* ── Section headers with icons ── */
.techref-content .section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 48px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.techref-content .section-icon {
  width: 36px; height: 36px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.techref-content .icon-gen  { background: rgba(88,166,255,0.15); border: 1px solid var(--accent); }
.techref-content .icon-ana  { background: rgba(86,212,221,0.15); border: 1px solid var(--cyan); }
.techref-content .icon-cmp  { background: rgba(208,32,144,0.15); border: 1px solid var(--magenta); }
.techref-content .icon-view { background: rgba(240,192,64,0.12); border: 1px solid var(--gold); }
.techref-content .icon-dir  { background: rgba(63,185,80,0.12); border: 1px solid var(--green); }
.techref-content .icon-cli  { background: rgba(128,128,255,0.12); border: 1px solid #8888ff; }

.techref-content .section-header h2 {
  border-bottom: none;
  margin: 0;
  padding: 0;
}

/* ── Intro blurb ── */
.techref-content .intro {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  margin-bottom: 28px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Cards grid ── */
.techref-content .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.techref-content .cards .card {
  transition: border-color 0.2s, transform 0.15s;
}
.techref-content .cards .card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.techref-content .cards .card-title {
  font-family: var(--cond), var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}
.techref-content .cards .card-title.magenta { color: var(--magenta); }
.techref-content .cards .card-title.gold    { color: var(--gold); }
.techref-content .cards .card-title.green   { color: var(--green); }
.techref-content .cards .card-title.blue    { color: #8888ff; }

/* ── Param tables ── */
.techref-content .param-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}
.techref-content .param-table thead tr {
  background: var(--surface-2);
  border-bottom: 1px solid var(--accent);
}
.techref-content .param-table th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.techref-content .param-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(42,49,64,0.5);
  vertical-align: top;
  color: var(--text);
}
.techref-content .param-table tr:last-child td { border-bottom: none; }
.techref-content .param-table tr:hover td { background: rgba(88,166,255,0.04); }

.techref-content .default-badge {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(88,166,255,0.15);
  border: 1px solid var(--accent);
  color: var(--cyan);
  padding: 1px 7px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ── Workflow ── */
.techref-content .workflow {
  display: flex;
  gap: 0;
  margin: 24px 0;
  overflow-x: auto;
}
.techref-content .workflow-step {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  padding: 14px 18px;
  flex: 1;
  min-width: 140px;
  position: relative;
}
.techref-content .workflow-step:first-child { border-radius: 6px 0 0 6px; }
.techref-content .workflow-step:last-child  { border-radius: 0 6px 6px 0; border-right: 1px solid var(--border); }
.techref-content .workflow-step::after {
  content: '\25B6';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 12px;
  z-index: 1;
}
.techref-content .workflow-step:last-child::after { display: none; }
.techref-content .workflow-step .step-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.techref-content .workflow-step .step-label {
  font-family: var(--cond), var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.techref-content .workflow-step p {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── CLI block ── */
.techref-content .cli-block {
  background: #0a0f18;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  margin-top: 16px;
  overflow-x: auto;
}
.techref-content .cli-block pre {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  line-height: 1.8;
  margin: 0;
  background: none;
  border: none;
  padding: 0;
}
.techref-content .cli-block .comment { color: var(--text-dim); }
.techref-content .cli-block .flag    { color: var(--cyan); }
.techref-content .cli-block .value   { color: var(--gold); }

/* ── Output format tags ── */
.techref-content .tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  margin: 2px;
  border: 1px solid;
}
	.techref-content .tag-dir  { color: var(--green); border-color: var(--green); background: rgba(63,185,80,0.1); }
.techref-content .tag-svg  { color: var(--cyan); border-color: var(--cyan); background: rgba(86,212,221,0.1); }
.techref-content .tag-png  { color: var(--gold); border-color: var(--gold); background: rgba(240,192,64,0.1); }
.techref-content .tag-wav  { color: var(--green); border-color: var(--green); background: rgba(63,185,80,0.1); }
.techref-content .tag-csv  { color: var(--magenta); border-color: var(--magenta); background: rgba(208,32,144,0.1); }

/* ── Table wrap ── */
.techref-content .table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}
.techref-content .table-wrap table {
  border: none;
  border-radius: 0;
  margin: 0;
}
