/* ── Palette (reuses site variables where possible) ──────────────────────── */
:root {
  --pc-bg:       #f8fafc;
  --pc-surface:  #ffffff;
  --pc-border:   #e2e8f0;
  --pc-border2:  #cbd5e1;
  --pc-text:     #0f172a;
  --pc-text2:    #475569;
  --pc-text3:    #94a3b8;
  --pc-nav:      #111827;
  --pc-ok:       #16a34a;
  --pc-warn:     #d97706;
  --pc-err:      #dc2626;
  --pc-act:      #2563eb;
  --pc-new:      #7c3aed;
  --pc-selected: #eff6ff;
  --pc-row-h:    34px;
}
.pc-col-ok  { color: var(--pc-ok);  }
.pc-col-warn{ color: var(--pc-warn);}
.pc-col-err { color: var(--pc-err); }
.pc-col-act { color: var(--pc-act); }
.pc-col-new { color: var(--pc-new); }

/* ── Page shell ──────────────────────────────────────────────────────────── */
.pc-page {
  background: var(--pc-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--pc-text);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.pc-header {
  background: var(--pc-nav);
  color: #e2e8f0;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}
.pc-header-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pc-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: #f1f5f9; }

.pc-scan-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}
.pc-badge-idle    { background: #374151; color: #9ca3af; }
.pc-badge-running { background: #1e3a5f; color: #93c5fd; }
.pc-badge-done    { background: #14532d; color: #86efac; }
.pc-badge-error   { background: #7f1d1d; color: #fca5a5; }

.pc-stats-row { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.pc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}
.pc-stat-wide { min-width: 90px; }
.pc-stat-val { font-size: 15px; font-weight: 700; line-height: 1.1; color: #f1f5f9; }
.pc-stat-lbl { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.pc-header-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.pc-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e2e8f0;
  padding: 6px 13px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.12s;
  white-space: nowrap;
}
.pc-btn:hover:not(:disabled) { background: rgba(255,255,255,0.16); }
.pc-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pc-btn-primary { background: #1d4ed8; border-color: #2563eb; }
.pc-btn-primary:hover:not(:disabled) { background: #2563eb; }
.pc-btn-primary.paused { background: #065f46; border-color: #10b981; }
.pc-btn-sm { padding: 4px 10px; font-size: 11px; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.pc-toolbar-wrap {
  background: var(--pc-surface);
  border-bottom: 1px solid var(--pc-border);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.pc-toolbar { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }

.pc-search {
  border: 1px solid var(--pc-border2);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 13px;
  width: 170px;
  outline: none;
  background: var(--pc-bg);
}
.pc-search:focus { border-color: var(--pc-act); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }

.pc-tabs { display: flex; gap: 2px; }
.pc-tab {
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--pc-text2);
  transition: all 0.1s;
}
.pc-tab:hover  { background: var(--pc-bg); }
.pc-tab.active { background: var(--pc-nav); color: #f1f5f9; }
.pc-tab-new    { color: var(--pc-new); }
.pc-tab-high   { color: var(--pc-err); }
.pc-tab-broken { color: var(--pc-text3); }
.pc-tab-err    { color: var(--pc-err); }

.pc-select {
  border: 1px solid var(--pc-border2);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
  background: var(--pc-bg);
  color: var(--pc-text);
  cursor: pointer;
}

.pc-result-meta { font-size: 12px; color: var(--pc-text3); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.pc-new-badge { background: var(--pc-new); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; cursor: pointer; }

/* ── Grid columns ────────────────────────────────────────────────────────── */
.pc-grid-header,
.pc-grid-row {
  display: grid;
  grid-template-columns:
    80px   /* symbol  */
    36px   /* tf      */
    36px   /* dir     */
    52px   /* status  */
    46px   /* score   */
    52px   /* priority*/
    72px   /* upper   */
    72px   /* lower   */
    52px   /* width%  */
    52px   /* touches */
    46px   /* angle   */
    52px   /* age     */
    86px   /* detected*/
    86px   /* updated */
    60px   /* zone    */
    1fr    /* reason  */
    28px;  /* tv link */
  align-items: center;
  border-bottom: 1px solid var(--pc-border);
}

.pc-grid-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.pc-grid-header {
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  height: 28px;
  padding: 0 6px;
  flex-shrink: 0;
}
.pc-col { padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pc-grid-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  outline: none;
}
.pc-grid-spacer { pointer-events: none; width: 1px; }
.pc-grid-rows { position: absolute; top: 0; left: 0; right: 0; }

/* ── Rows ────────────────────────────────────────────────────────────────── */
.pc-grid-row {
  height: var(--pc-row-h);
  padding: 0 6px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.07s;
}
.pc-grid-row:hover  { background: #f0f9ff; }
.pc-grid-row.selected   { background: var(--pc-selected); }
.pc-grid-row.row-new    { background: #faf5ff; }
.pc-grid-row.row-expired{ opacity: 0.55; }
.pc-grid-row.row-updated{ animation: pc-flash 0.7s ease; }

@keyframes pc-flash {
  0%  { background: #dbeafe; }
  100%{ background: inherit; }
}

/* Cells */
.pc-sym { font-weight: 600; color: var(--pc-text); }

.pc-tf-pill {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.pc-tf-1h { background: #dbeafe; color: #1e40af; }
.pc-tf-4h { background: #fef3c7; color: #92400e; }
.pc-tf-1d { background: #d1fae5; color: #065f46; }

.pc-dir-up   { color: var(--pc-ok);   font-weight: 700; }
.pc-dir-down { color: var(--pc-err);  font-weight: 700; }
.pc-dir-side { color: var(--pc-text3);}

.pc-status-active  { color: var(--pc-ok);  font-weight: 600; }
.pc-status-expired { color: var(--pc-text3);}
.pc-status-broken  { color: var(--pc-err); font-weight: 600; }
.pc-status-archived{ color: var(--pc-text3);}

.pc-score-high { color: var(--pc-err);  font-weight: 700; }
.pc-score-med  { color: var(--pc-warn); font-weight: 700; }
.pc-score-low  { color: var(--pc-text2);}

.pc-price { font-family: monospace; font-size: 11px; text-align: right; }
.pc-pct   { font-family: monospace; font-size: 11px; color: var(--pc-text3); }

.pc-age-fresh { color: var(--pc-ok);   }
.pc-age-mid   { color: var(--pc-warn); }
.pc-age-old   { color: var(--pc-text3);}

.pc-ts { font-size: 11px; color: var(--pc-text3); }

.pc-reason-cell { font-size: 11px; color: var(--pc-text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-reason-cell.high-pri { color: var(--pc-err); font-weight: 600; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.pc-empty { text-align: center; padding: 60px 20px; color: var(--pc-text2); }
.pc-empty-hint { font-size: 12px; color: var(--pc-text3); margin-top: 8px; }

/* ── Detail panel ────────────────────────────────────────────────────────── */
.pc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.22);
  z-index: 1100;
}
.pc-detail {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px;
  background: var(--pc-surface);
  border-left: 1px solid var(--pc-border2);
  box-shadow: -8px 0 28px rgba(0,0,0,0.12);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pc-detail-hdr {
  background: var(--pc-nav);
  color: #f1f5f9;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 8px;
}
.pc-detail-sym { font-size: 18px; font-weight: 700; margin-right: 6px; }
.pc-tf-badge, .pc-dir-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.pc-detail-acts { display: flex; gap: 4px; align-items: center; }
.pc-detail-close {
  background: none; border: none; color: #94a3b8;
  font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.pc-detail-close:hover { color: #f1f5f9; background: rgba(255,255,255,0.1); }

.pc-detail-body { flex: 1; overflow-y: auto; padding: 14px; }
.pc-detail-sec  { margin-bottom: 16px; }
.pc-sec-title   {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--pc-text3); margin-bottom: 8px;
}
.pc-kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pc-kv      { display: flex; flex-direction: column; }
.pc-kv-lbl  { font-size: 10px; color: var(--pc-text3); }
.pc-kv-val  { font-size: 13px; font-weight: 600; font-family: monospace; }
.pc-reason-text { font-size: 12px; color: var(--pc-text2); }

/* ── Log bar ─────────────────────────────────────────────────────────────── */
.pc-log-bar { border-top: 1px solid var(--pc-border); background: var(--pc-surface); flex-shrink: 0; }
.pc-log-toggle { background: none; border: none; padding: 6px 14px; font-size: 11px; color: var(--pc-text3); cursor: pointer; width: 100%; text-align: left; }
.pc-log-panel { border-top: 1px solid var(--pc-border); max-height: 150px; overflow: hidden; display: flex; flex-direction: column; }
.pc-log-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px; background: #f8fafc; border-bottom: 1px solid var(--pc-border); font-size: 11px; font-weight: 600; color: var(--pc-text3); flex-shrink: 0; }
.pc-log-entries { overflow-y: auto; flex: 1; font-family: monospace; font-size: 11px; }
.pc-log-row { display: flex; gap: 8px; padding: 2px 12px; border-bottom: 1px solid var(--pc-border); }
.pc-log-row:hover { background: var(--pc-bg); }
.pc-log-ts  { color: var(--pc-text3); flex-shrink: 0; }
.pc-log-sym { color: var(--pc-act); font-weight: 600; min-width: 60px; flex-shrink: 0; }
.pc-log-msg { color: var(--pc-text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-log-ok  .pc-log-sym { color: var(--pc-ok);  }
.pc-log-err .pc-log-sym { color: var(--pc-err); }
.pc-log-err .pc-log-msg { color: var(--pc-err); }

/* ── Channel chart image ─────────────────────────────────────────────────── */
.pc-chart-hint {
  font-size: 10px;
  color: var(--pc-text3);
  font-style: italic;
}
.pc-chart-img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--pc-border);
  display: block;
  cursor: zoom-in;
  transition: opacity 0.1s;
}
.pc-chart-img:hover { opacity: 0.88; }

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.pc-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
  box-sizing: border-box;
}
.pc-lightbox-inner {
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pc-lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  cursor: default;
  display: block;
  object-fit: contain;
}
.pc-lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
  transition: background 0.12s;
}
.pc-lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* ── TradingView CTA in detail body ─────────────────────────────────────── */
.pc-tv-cta {
  display: block;
  background: #1d4ed8;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.pc-tv-cta:hover { background: #2563eb; color: #fff; }

/* ── TradingView icon in grid rows ───────────────────────────────────────── */
.pc-col-tv { width: 28px; text-align: center; }
.pc-tv-icon {
  display: none;
  font-size: 13px;
  text-decoration: none;
  opacity: 0.6;
}
.pc-tv-icon:hover { opacity: 1; }
.pc-grid-row:hover .pc-tv-icon { display: inline; }

/* ── Pine Script section ─────────────────────────────────────────────────── */
.pc-sec-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.pc-sec-title-row .pc-sec-title { margin-bottom: 0; }
.pc-pine-hint {
  font-size: 11px;
  color: var(--pc-text3);
  margin: 0 0 6px;
}
.pc-pine-textarea {
  width: 100%;
  height: 280px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10.5px;
  line-height: 1.5;
  border: 1px solid var(--pc-border2);
  border-radius: 6px;
  padding: 8px;
  background: #0f172a;
  color: #e2e8f0;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
}

/* ── Tooltips ────────────────────────────────────────────────────────────── */
.pc-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pc-border2);
  color: var(--pc-text2);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 3px;
  font-style: normal;
  flex-shrink: 0;
}
.pc-tip-hdr {
  font-size: 8px;
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.15);
  color: #94a3b8;
}
/* Tooltip bubble — positioned by JS, escapes all overflow:hidden */
#pc-tooltip {
  position: fixed;
  white-space: pre;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.55);
  max-width: 280px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.15s ease;
  /* start invisible but in flow so offsetWidth is measurable */
}
#pc-tooltip.visible {
  opacity: 1 !important;   /* !important ensures no inline style can override */
}
#pc-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
}

/* ── Sector grouped view ─────────────────────────────────────────────────── */
.pc-sector-panel  { flex:1; overflow-y:auto; padding:16px; background:var(--pc-bg); }
.pc-sector-content{ }
.pc-sector-group  { margin-bottom:24px; }
.pc-sector-header {
  font-size: 16px;
  font-weight: 800;
  color: var(--pc-text);
  border-bottom: 2px solid var(--pc-border2);
  padding: 6px 0 4px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.pc-etf-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--pc-text2);
  margin: 10px 0 4px 8px;
}
.pc-industry-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--pc-text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 6px 0 2px 16px;
}
.pc-sector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.07s;
  font-size: 12px;
}
.pc-sector-row:hover { background: var(--pc-selected); }

/* ── Confluence tab ──────────────────────────────────────────────────────── */
.pc-tab-confluence { color: #c026d3; font-weight: 700; }
.pc-tab-confluence.active { background: #701a75; color: #f5d0fe; }

/* ── Confluence panel ────────────────────────────────────────────────────── */
.pc-confluence-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--pc-bg);
}
.pc-conf-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pc-conf-title { font-size: 15px; font-weight: 700; color: var(--pc-text); }
.pc-conf-sub   { font-size: 12px; color: var(--pc-text3); flex: 1; }
.pc-conf-stats { display: flex; gap: 10px; }
.pc-conf-stat  { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 10px; }
.pc-conf-stat.full    { background: #fdf4ff; color: #86198f; border: 1px solid #e879f9; }
.pc-conf-stat.partial { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }

.pc-conf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.pc-conf-card {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s;
  cursor: pointer;
}
.pc-conf-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.pc-conf-card.full-conf { border-color: #e879f9; border-width: 2px; }

.pc-conf-card-header {
  padding: 12px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pc-conf-symbol { font-size: 17px; font-weight: 800; color: var(--pc-text); }
.pc-conf-zone-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.pc-conf-zone-lower { background: #dcfce7; color: #15803d; }
.pc-conf-zone-upper { background: #fef9c3; color: #92400e; }

.pc-conf-label {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 12px;
  margin: 0 14px 10px;
  border-radius: 4px;
  display: inline-block;
}
.pc-conf-label-full    { background: #fdf4ff; color: #86198f; }
.pc-conf-label-strong  { background: #fef3c7; color: #92400e; }
.pc-conf-label-partial { background: #eff6ff; color: #1d4ed8; }

.pc-conf-tfs {
  padding: 0 14px 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pc-conf-tf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pc-bg);
  border-radius: 6px;
  padding: 6px 10px;
  flex: 1;
  min-width: 120px;
}
.pc-conf-tf-name { font-size: 11px; font-weight: 700; color: var(--pc-text2); min-width: 24px; }
.pc-conf-tf-bar-wrap {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  position: relative;
  overflow: visible;
}
.pc-conf-tf-needle {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: var(--pc-text);
  border-radius: 1px;
  transform: translateX(-50%);
}
.pc-conf-tf-zone-lo { position: absolute; left: 0;   width: 25%; height: 100%; background: #86efac; border-radius: 4px 0 0 4px; }
.pc-conf-tf-zone-hi { position: absolute; right: 0; width: 25%; height: 100%; background: #fde68a; border-radius: 0 4px 4px 0; }
.pc-conf-tf-pct { font-size: 10px; color: var(--pc-text3); min-width: 30px; text-align: right; }

.pc-conf-card-footer {
  border-top: 1px solid var(--pc-border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--pc-text3);
}
.pc-conf-score { font-weight: 700; color: var(--pc-text2); }
.pc-conf-tv-link {
  background: #1d4ed8;
  color: #fff;
  text-decoration: none;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
.pc-conf-tv-link:hover { background: #2563eb; }

/* ── Channel zone ────────────────────────────────────────────────────────── */
.pc-tab-zone { color: #0891b2; }
.pc-tab-zone.active { background: var(--pc-nav); color: #f1f5f9; }

/* Grid column */
.pc-col-zone { min-width: 52px; }

/* Mini zone pill in grid row */
.pc-zone-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.pc-zone-lower  { background: #dcfce7; color: #15803d; }  /* near support — green */
.pc-zone-upper  { background: #fef9c3; color: #b45309; }  /* near resistance — amber */
.pc-zone-mid    { background: #f1f5f9; color: #64748b; }
.pc-zone-out    { background: #fee2e2; color: #dc2626; }

/* Detail panel zone section */
.pc-zone-sec { margin-bottom: 18px; }

.pc-zone-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.pc-zone-badge.lower { background: #dcfce7; color: #15803d; }
.pc-zone-badge.upper { background: #fef9c3; color: #b45309; }
.pc-zone-badge.mid   { background: #f1f5f9; color: #64748b; }
.pc-zone-badge.out   { background: #fee2e2; color: #dc2626; }

/* Position bar */
.pc-zone-bar-wrap {
  position: relative;
  height: 16px;
  border-radius: 8px;
  overflow: visible;
  display: flex;
  margin: 8px 0 4px;
}
.pc-zone-lower-region { width: 25%; background: #86efac; border-radius: 8px 0 0 8px; }
.pc-zone-mid-region   { width: 50%; background: #e2e8f0; }
.pc-zone-upper-region { width: 25%; background: #fde68a; border-radius: 0 8px 8px 0; }
.pc-zone-needle {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 24px;
  background: #0f172a;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.4s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.pc-zone-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--pc-text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pc-zone-pct-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--pc-text2);
  text-align: center;
  margin-top: 4px;
}

/* ── Broken channel indicators ───────────────────────────────────────────── */
.pc-broken-tag {
  display: inline-block;
  font-size: 10px;
  color: var(--pc-err);
  font-weight: 700;
  margin-left: 4px;
  cursor: default;
}
.pc-broken-banner {
  background: #fff5f5;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pc-err);
  margin-bottom: 12px;
}

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
