/* ==========================================================
   Panel-specific styles
   Extracted from inline <style> blocks to avoid CSSOM recalc
   on every panel refresh (PERF-012).
   ========================================================== */

/* ----------------------------------------------------------
   Shared Panel Tabs (gold standard: Telegram Intel style)
   ---------------------------------------------------------- */
.panel-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 10px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Fade hint on right edge when tabs overflow */
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
}

/* When .panel-content contains tabs (at any depth), remove top padding
   so tabs sit flush against the header — matching panels using insertBefore(). */
.panel-content:has(.panel-tabs) {
  padding-top: 0;
}

/* Bleed tabs full-width: negate .panel-content's 8px horizontal padding.
   Direct children get simple negative margin. For nested tabs, the
   wrapper div is also pulled flush. */
.panel-content > .panel-tabs {
  margin-left: -8px;
  margin-right: -8px;
}
.panel-content > :first-child:has(.panel-tabs) {
  margin-left: -8px;
  margin-right: -8px;
}

.panel-tabs::-webkit-scrollbar {
  display: none;
}

.panel-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.panel-tab:hover {
  color: var(--text);
  background: var(--overlay-subtle);
}

.panel-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.panel-tab .tab-icon {
  font-size: 12px;
}

.panel-tab .tab-label {
  font-weight: 500;
}

.panel-tab.active .tab-label {
  font-weight: 600;
}

/* ----------------------------------------------------------
   Satellite Fires Panel
   ---------------------------------------------------------- */
.fires-panel-content {
  font-size: 12px;
}

.fires-table {
  width: 100%;
  border-collapse: collapse;
}

.fires-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.fires-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.fire-row:hover {
  background: var(--surface-hover);
}

.fire-row.fires-high .fire-region {
  color: var(--threat-high);
}

.fire-row.fires-high .fire-hi {
  color: var(--threat-critical);
  font-weight: 600;
}

.fire-count,
.fire-hi,
.fire-frp {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fire-totals {
  border-top: 1px solid var(--border-strong);
}

.fire-totals td {
  color: var(--accent);
  font-weight: 600;
}

.fires-explosion-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--threat-critical);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

.fires-explosion-alert {
  padding: 6px 8px;
  margin-top: 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--threat-critical) 12%, transparent);
  color: var(--threat-critical);
  font-size: 11px;
  font-weight: 600;
}

.fires-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 8px 0;
  color: var(--text-faint);
  font-size: 10px;
}

/* ----------------------------------------------------------
   Population Exposure Panel
   ---------------------------------------------------------- */
.popexp-panel-content {
  font-size: 12px;
}

.popexp-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: color-mix(in srgb, var(--threat-critical) 8%, transparent);
  border-radius: 4px;
  border-left: 3px solid var(--threat-critical);
}

.popexp-label {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popexp-total {
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.popexp-list {
  display: flex;
  flex-direction: column;
}

.popexp-card {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.popexp-card:hover {
  background: var(--surface-hover);
}

.popexp-card-name {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 3px;
  word-break: break-word;
}

.popexp-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popexp-card-pop {
  color: var(--threat-critical);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.popexp-pop-large {
  color: var(--accent);
  font-weight: 700;
}

.popexp-card-radius {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------
   Climate Anomaly Panel
   ---------------------------------------------------------- */
.climate-panel-content {
  font-size: 12px;
}

.climate-table {
  width: 100%;
  border-collapse: collapse;
}

.climate-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.climate-table th:nth-child(2),
.climate-table th:nth-child(3) {
  text-align: right;
}

.climate-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.climate-row {
  cursor: pointer;
}

.climate-row:hover {
  background: var(--surface-hover);
}

.climate-extreme-row {
  background: color-mix(in srgb, var(--semantic-critical) 5%, transparent);
}

.climate-extreme-row:hover {
  background: color-mix(in srgb, var(--semantic-critical) 10%, transparent);
}

.climate-zone {
  white-space: nowrap;
}

.climate-icon {
  margin-right: 6px;
}

.climate-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.climate-warm {
  color: var(--semantic-high);
}

.climate-cold {
  color: var(--semantic-low);
}

.climate-wet {
  color: var(--semantic-low);
}

.climate-dry {
  color: var(--threat-high);
}

.climate-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.severity-extreme {
  background: color-mix(in srgb, var(--semantic-critical) 20%, transparent);
  color: var(--semantic-critical);
}

.severity-moderate {
  background: color-mix(in srgb, var(--semantic-high) 15%, transparent);
  color: var(--semantic-high);
}

.severity-normal {
  background: var(--overlay-medium);
  color: var(--text-dim);
}

/* ----------------------------------------------------------
   Displacement Panel
   ---------------------------------------------------------- */
.disp-panel-content {
  font-size: 12px;
}

.disp-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.disp-stat-box {
  background: var(--overlay-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 6px;
  text-align: center;
}

.disp-stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.disp-stat-label {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.disp-stat-refugees .disp-stat-value {
  color: var(--threat-critical);
}

.disp-stat-asylum .disp-stat-value {
  color: var(--threat-high);
}

.disp-stat-idps .disp-stat-value {
  color: var(--threat-medium);
}

.disp-stat-total .disp-stat-value {
  color: var(--accent);
}

/* disp-tabs: now uses shared .panel-tabs / .panel-tab */

.disp-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.disp-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.disp-table th:nth-child(3) {
  text-align: right;
}

.disp-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.disp-row {
  cursor: pointer;
}

.disp-row:hover {
  background: var(--surface-hover);
}

.disp-name {
  word-break: break-word;
  overflow-wrap: break-word;
}

.disp-status {
  width: 70px;
  min-width: 70px;
}

.disp-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.disp-crisis {
  background: color-mix(in srgb, var(--semantic-critical) 20%, transparent);
  color: var(--semantic-critical);
}

.disp-high {
  background: color-mix(in srgb, var(--semantic-high) 15%, transparent);
  color: var(--semantic-high);
}

.disp-elevated {
  background: color-mix(in srgb, var(--semantic-elevated) 12%, transparent);
  color: var(--semantic-elevated);
}

.disp-count {
  width: 52px;
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------
   UCDP Events Panel
   ---------------------------------------------------------- */
.ucdp-panel-content {
  font-size: 12px;
}

.ucdp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 4px;
}

/* ucdp-tabs: now uses shared .panel-tabs / .panel-tab */

.ucdp-tab-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  margin-left: 2px;
}

.ucdp-total-deaths {
  color: var(--threat-critical);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ucdp-table {
  width: 100%;
  border-collapse: collapse;
}

.ucdp-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.ucdp-table th:nth-child(2) {
  text-align: right;
}

.ucdp-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.ucdp-row {
  cursor: pointer;
}

.ucdp-row:hover {
  background: var(--surface-hover);
}

.ucdp-date {
  color: var(--text-muted);
  white-space: nowrap;
}

.ucdp-deaths {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ucdp-deaths-state {
  color: var(--semantic-critical);
  font-weight: 600;
}

.ucdp-deaths-nonstate {
  color: var(--semantic-high);
  font-weight: 600;
}

.ucdp-deaths-onesided {
  color: var(--semantic-elevated);
  font-weight: 600;
}

.ucdp-deaths-zero {
  color: var(--text-faint);
}

.ucdp-range {
  color: var(--text-faint);
  font-size: 10px;
}

.ucdp-actors {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 11px;
}

.ucdp-country {
  white-space: nowrap;
}

/* ----------------------------------------------------------
   Download Banner
   ---------------------------------------------------------- */
.wm-dl-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 900;
  width: 230px;
  background: var(--surface);
  border-left: 3px solid var(--green);
  border-top: 1px solid var(--border);
  border-top-left-radius: 8px;
  padding: 14px;
  transform: translateX(110%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.wm-dl-panel.wm-dl-show {
  transform: translateX(0);
}

.wm-dl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.wm-dl-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wm-dl-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.wm-dl-close:hover {
  color: var(--text);
}

.wm-dl-body {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}

.wm-dl-btns {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wm-dl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.wm-dl-btn.mac {
  background: color-mix(in srgb, var(--green) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 20%, transparent);
  color: var(--green);
}

.wm-dl-btn.mac:hover {
  background: color-mix(in srgb, var(--green) 18%, transparent);
}

.wm-dl-btn.win {
  background: color-mix(in srgb, var(--semantic-info) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--semantic-info) 18%, transparent);
  color: var(--semantic-info);
}

.wm-dl-btn.win:hover {
  background: color-mix(in srgb, var(--semantic-info) 15%, transparent);
}

.wm-dl-btn.linux {
  background: color-mix(in srgb, var(--semantic-elevated) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--semantic-elevated) 18%, transparent);
  color: var(--semantic-elevated);
}

.wm-dl-btn.linux:hover {
  background: color-mix(in srgb, var(--semantic-elevated) 15%, transparent);
}

.wm-dl-toggle {
  background: none;
  border: none;
  color: var(--text-dim, #888);
  font-size: 9px;
  cursor: pointer;
  padding: 4px 0 0;
  text-align: center;
  width: 100%;
}

.wm-dl-toggle:hover {
  color: var(--text, #e8e8e8);
}

/* ----------------------------------------------------------
   Giving Panel (Global Giving Activity Index)
   ---------------------------------------------------------- */
.giving-panel-content {
  font-size: 12px;
}

.giving-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.giving-stat-box {
  background: var(--overlay-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 6px;
  text-align: center;
}

.giving-stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.giving-stat-label {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.giving-stat-index .giving-stat-value {
  font-size: 22px;
}

/* giving-tabs: now uses shared .panel-tabs / .panel-tab */

.giving-table {
  width: 100%;
  border-collapse: collapse;
}

.giving-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.giving-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.giving-row:hover {
  background: var(--surface-hover);
}

.giving-platform-name {
  white-space: nowrap;
  font-weight: 600;
}

.giving-platform-vol {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.giving-platform-vel {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.giving-platform-fresh {
  text-align: right;
}

.giving-fresh-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.giving-fresh-live {
  background: color-mix(in srgb, var(--semantic-positive, #44ff88) 15%, transparent);
  color: var(--semantic-positive, #44ff88);
}

.giving-fresh-daily {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.giving-fresh-weekly {
  background: color-mix(in srgb, var(--semantic-elevated) 12%, transparent);
  color: var(--semantic-elevated);
}

.giving-fresh-annual {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  color: var(--text-muted);
}

.giving-cat-table th:nth-child(2) {
  text-align: right;
}

.giving-cat-name {
  white-space: nowrap;
}

.giving-share-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
}

.giving-share-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.giving-share-label {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.giving-trending-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--semantic-positive, #44ff88) 12%, transparent);
  color: var(--semantic-positive, #44ff88);
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 4px;
}

.giving-crypto-content {}

.giving-crypto-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.giving-crypto-receivers {}

.giving-section-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.giving-receiver-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.giving-receiver-list li {
  padding: 3px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
}

.giving-receiver-list li:last-child {
  border-bottom: none;
}

.giving-inst-content {}

.giving-inst-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

/* ----------------------------------------------------------
   Security Advisories Panel
   ---------------------------------------------------------- */
.sa-panel-content {
  font-size: 12px;
}

.sa-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.sa-summary-item {
  background: var(--overlay-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 6px;
  text-align: center;
}

.sa-summary-count {
  display: block;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sa-summary-label {
  display: block;
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.sa-summary-item.sa-level-dnt .sa-summary-count {
  color: var(--semantic-critical);
}

.sa-summary-item.sa-level-reconsider .sa-summary-count {
  color: var(--semantic-high);
}

.sa-summary-item.sa-level-caution .sa-summary-count {
  color: var(--semantic-elevated);
}

.sa-filters {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.sa-filter {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  padding: 3px 10px;
  font-size: 10px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
}

.sa-filter:hover {
  border-color: var(--text-faint);
  color: var(--text-secondary);
}

.sa-filter-active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

.sa-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sa-item {
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid var(--border);
  background: var(--overlay-subtle);
}

.sa-item.sa-level-dnt {
  border-left-color: var(--semantic-critical);
}

.sa-item.sa-level-reconsider {
  border-left-color: var(--semantic-high);
}

.sa-item.sa-level-caution {
  border-left-color: var(--semantic-elevated);
}

.sa-item.sa-level-normal {
  border-left-color: var(--semantic-normal);
}

.sa-item.sa-level-info {
  border-left-color: var(--text-muted);
}

.sa-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.sa-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sa-badge.sa-level-dnt {
  background: color-mix(in srgb, var(--semantic-critical) 20%, transparent);
  color: var(--semantic-critical);
}

.sa-badge.sa-level-reconsider {
  background: color-mix(in srgb, var(--semantic-high) 15%, transparent);
  color: var(--semantic-high);
}

.sa-badge.sa-level-caution {
  background: color-mix(in srgb, var(--semantic-elevated) 12%, transparent);
  color: var(--semantic-elevated);
}

.sa-badge.sa-level-normal {
  background: color-mix(in srgb, var(--semantic-normal) 10%, transparent);
  color: var(--semantic-normal);
}

.sa-badge.sa-level-info {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  color: var(--text-muted);
}

.sa-source {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.sa-body {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sa-title {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  line-height: 1.35;
}

.sa-title:hover {
  color: var(--accent);
  text-decoration: underline;
}

.sa-time {
  flex-shrink: 0;
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sa-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.sa-footer-source {
  font-size: 9px;
  color: var(--text-muted);
}

.sa-refresh-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 10px;
  font-size: 10px;
  cursor: pointer;
  border-radius: 3px;
}

.sa-refresh-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ----------------------------------------------------------
   OREF Sirens Panel
   ---------------------------------------------------------- */
.oref-panel-content {
  font-size: 12px;
}

.oref-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-weight: 600;
}

.oref-ok {
  background: color-mix(in srgb, var(--semantic-normal) 10%, transparent);
  color: var(--semantic-normal);
}

.oref-danger {
  background: color-mix(in srgb, var(--semantic-critical) 12%, transparent);
  color: var(--semantic-critical);
}

.oref-status-icon {
  font-size: 16px;
}

.oref-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--semantic-critical);
  animation: oref-pulse-anim 1.2s ease-in-out infinite;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.oref-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--semantic-critical) 60%, transparent);
  border-radius: inherit;
  pointer-events: none;
  transform: scale(1);
  opacity: 0.6;
  animation: oref-pulse-ring 1.2s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes oref-pulse-anim {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes oref-pulse-ring {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 0;
    transform: scale(2.2);
  }
}

.oref-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.oref-alert-row {
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid var(--semantic-critical);
  background: var(--overlay-subtle);
}

.oref-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.oref-alert-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.oref-alert-time {
  font-size: 9px;
  color: var(--text-muted);
}

.oref-alert-areas {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.oref-history-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.oref-history-title {
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-align: center;
}

.oref-wave-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 320px;
  overflow-y: auto;
}

.oref-wave-row {
  padding: 5px 8px;
  border-radius: 4px;
  border-left: 3px solid var(--border-subtle);
  background: var(--overlay-subtle);
}

.oref-wave-recent {
  border-left-color: var(--semantic-warning, #f59e0b);
}

.oref-wave-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.oref-wave-time {
  font-size: 9px;
  color: var(--text-muted);
}

.oref-wave-summary {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.oref-recent-badge {
  font-size: 8px;
  font-weight: 700;
  color: var(--semantic-warning, #f59e0b);
  background: color-mix(in srgb, var(--semantic-warning, #f59e0b) 12%, transparent);
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ----------------------------------------------------------
   GCC Investments Panel (FDI)
   ---------------------------------------------------------- */
.fdi-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.fdi-search {
  flex: 1;
  min-width: 0;
  background: var(--overlay-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  padding: 6px 8px;
  outline: none;
  transition: border-color 0.15s;
}

.fdi-search::placeholder {
  color: var(--text-faint);
}

.fdi-search:focus {
  border-color: var(--accent);
}

.fdi-filter-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--overlay-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.fdi-filter-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.fdi-filter-toggle.fdi-filters-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.fdi-filters {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.fdi-filters.fdi-filters-open {
  display: flex;
}

.fdi-filter {
  background: var(--overlay-subtle);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
  font-size: 10px;
  padding: 3px 6px;
  outline: none;
  cursor: pointer;
  max-width: 140px;
}

.fdi-filter:focus {
  border-color: var(--accent);
}

.fdi-sort-pills {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-top: 4px;
  width: 100%;
}

.fdi-sort {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 9px;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.fdi-sort:hover {
  border-color: var(--text-faint);
  color: var(--text-secondary);
}

.fdi-sort.fdi-sort-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.fdi-list {
  display: flex;
  flex-direction: column;
}

.fdi-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.1s;
  gap: 0 6px;
}

.fdi-row:hover {
  background: var(--surface-hover);
}

.fdi-row-line1 {
  display: flex;
  align-items: baseline;
  width: 100%;
  min-width: 0;
  gap: 6px;
}

.fdi-flag {
  flex-shrink: 0;
}

.fdi-asset-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.fdi-entity-sub {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.fdi-usd {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  margin-left: auto;
}

.fdi-row-line2 {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
  padding-left: 22px;
  margin-top: 1px;
}

.fdi-country {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.fdi-sector-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}

.fdi-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
  flex-shrink: 0;
}

.fdi-status-label {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.fdi-year {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.fdi-empty {
  padding: 20px 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: 11px;
}

/* ----------------------------------------------------------
   World Clock Panel
   ---------------------------------------------------------- */
.wc-settings-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.wc-settings-btn:hover,
.wc-settings-btn.wc-active {
  opacity: 1;
  color: var(--accent);
}

.wc-container {
  display: flex;
  flex-direction: column;
}

.wc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.wc-row:last-child {
  border-bottom: none;
}

.wc-row:hover {
  background: var(--surface-hover);
}

.wc-row.wc-night {
  opacity: 0.7;
}

.wc-row.wc-home {
  background: color-mix(in srgb, var(--semantic-positive, #44ff88) 8%, transparent);
  border-left: 2px solid color-mix(in srgb, var(--semantic-positive, #44ff88) 40%, transparent);
}

.wc-drag-handle {
  cursor: grab;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  width: 12px;
  text-align: center;
  padding: 10px 8px;
  margin: -10px -4px;
}

.wc-drag-handle:hover {
  color: var(--text-dim);
}

.wc-row.wc-dragging {
  opacity: 0.4;
}

.wc-content-dragging .wc-row {
  user-select: none;
}

.wc-row.wc-drag-over-above {
  border-top: 2px solid var(--accent);
}

.wc-row.wc-drag-over-below {
  border-bottom: 2px solid var(--accent);
}

.wc-info {
  flex: 1;
  min-width: 0;
}

.wc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-home-tag {
  margin-left: 4px;
  font-size: 11px;
  color: var(--semantic-positive, #44ff88);
}

.wc-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.wc-exchange {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.wc-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.wc-status.open {
  color: var(--semantic-positive, #44ff88);
}

.wc-status.closed {
  color: var(--text-faint);
}

.wc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wc-dot.open {
  background: var(--semantic-positive, #44ff88);
}

.wc-dot.closed {
  background: var(--text-faint);
}

.wc-clock {
  flex-shrink: 0;
  text-align: right;
}

.wc-time {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.wc-tz {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted);
  justify-content: flex-end;
}

.wc-bar-wrap {
  width: 40px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.wc-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 1s linear;
}

.wc-bar.day {
  background: var(--semantic-elevated, #f59e0b);
}

.wc-bar.night {
  background: var(--semantic-info, #3b82f6);
}

.wc-empty {
  padding: 20px 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: 11px;
}

/* World Clock Settings View */
.wc-settings-view {
  padding: 4px 0;
}

.wc-region-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 8px 3px;
  border-bottom: 1px solid var(--border-subtle);
}

.wc-region-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 4px;
}

.wc-city-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.1s;
}

.wc-city-option:hover {
  background: var(--surface-hover);
}

.wc-city-option input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

.wc-opt-name {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-opt-label {
  color: var(--text-faint);
  font-size: 9px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   Airline Intelligence Panel
   ---------------------------------------------------------- */
.airline-intel-content {
  font-size: 12px;
}

/* ---- Ops tab ---- */
.ops-grid {
  display: flex;
  flex-direction: column;
}

.ops-row {
  display: grid;
  grid-template-columns: 42px 1fr auto auto auto;
  align-items: center;
  gap: 0 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.ops-row:hover {
  background: var(--surface-hover);
}

.ops-iata {
  font-weight: 700;
  color: var(--text);
  font-size: 12px;
}

.ops-name {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-severity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ops-delay {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  text-align: right;
}

.ops-cancel {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

.ops-closed {
  font-size: 9px;
  font-weight: 700;
  color: var(--semantic-critical);
  grid-column: 3 / -1;
}

.ops-notam {
  font-size: 10px;
  grid-column: 3 / -1;
}

/* ---- Flights tab ---- */
.flights-list {
  display: flex;
  flex-direction: column;
}

.flight-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  align-items: center;
  gap: 0 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.flight-row:hover {
  background: var(--surface-hover);
}

.flight-num {
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}

.flight-route {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flight-time {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.flight-delay {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 36px;
}

.flight-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: right;
  min-width: 56px;
}

/* ---- Airlines (Carriers) tab ---- */
.carriers-list {
  display: flex;
  flex-direction: column;
}

.carrier-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.carrier-row:hover {
  background: var(--surface-hover);
}

.carrier-name {
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carrier-flights {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  text-align: right;
}

.carrier-delay {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 72px;
}

.carrier-cancel {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  text-align: right;
  min-width: 54px;
}

/* ---- Tracking tab ---- */
.tracking-list {
  display: flex;
  flex-direction: column;
}

.track-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.track-row:hover {
  background: var(--surface-hover);
}

.track-cs {
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}

.track-alt {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  text-align: right;
}

.track-spd {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  text-align: right;
}

.track-pos {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---- Prices tab ---- */
.price-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 0;
  align-items: center;
}

.price-input {
  background: var(--overlay-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  padding: 5px 6px;
  outline: none;
  font-family: inherit;
  text-transform: uppercase;
}

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

.price-mode-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
  width: fit-content;
}

.price-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
}

.price-mode-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.price-mode-btn:not(.active):hover {
  background: var(--surface-hover);
}

/* Google Flights itinerary cards */
.gf-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gf-card {
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 8px;
}

.gf-summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}

.gf-price {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.gf-total-dur {
  font-size: 11px;
  color: var(--text-dim);
}

.gf-stops {
  font-size: 10px;
  color: var(--text-muted);
}

.gf-leg {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 2px 0;
}

.gf-airline {
  font-family: var(--font-mono, monospace);
  color: var(--text);
  min-width: 60px;
}

.gf-dur {
  color: var(--text-dim);
}

.gf-degraded {
  font-size: 11px;
  color: #92400e;
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 6px;
}

/* Best Dates grid */
.dp-list {
  display: flex;
  flex-direction: column;
}

.dp-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 5px 8px;
  font-size: 11px;
  border-bottom: 1px solid var(--border-subtle);
}

.dp-row:hover {
  background: var(--surface-hover);
}

.dp-date {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 80px;
}

.dp-return {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 80px;
}

.dp-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.dp-cheap {
  color: #22c55e;
}

.dp-expensive {
  color: #f97316;
}

/* ---- News tab ---- */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
}

.news-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ----------------------------------------------------------
   Map Bottom Grid (Large Screen Drop Zone)
   ---------------------------------------------------------- */
.map-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: row dense;
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface) 40%, var(--bg));
  border-top: 1px solid var(--border);
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
  z-index: 5;
}

.map-bottom-grid:empty {
  flex: 0 0 0;
  min-height: 0;
  padding: 0;
  border-top: none;
  overflow: hidden;
}

body.panel-drag-active .map-bottom-grid:empty {
  flex: 0 0 120px;
  min-height: 120px;
  padding: 12px;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}

/* Base state for placeholder */
.map-bottom-grid::after {
  content: 'Drop panels here to move them below the map';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80%;
  width: 90%;
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s;
}

.map-bottom-grid:empty::after {
  opacity: 0;
}

body.panel-drag-active .map-bottom-grid:empty::after {
  opacity: 0.4;
}

/* Hide placeholder if there are panels */
.map-bottom-grid:not(:empty)::after {
  opacity: 0;
}

/* Highlight zone during drag (handled by JS if possible, but let's add a hover state too) */
.map-bottom-grid:hover {
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
  border-top-color: var(--accent);
}

/* Hide drop zone completely on smaller screens (overridden by media query in main.css) */
@media (max-width: 1599px) {
  .map-bottom-grid {
    display: none !important;
  }
}

.map-bottom-grid .panel {
  height: 100%;
  min-height: 150px;
}

/* ── DeductionPanel ─────────────────────────────────────── */
.deduction-panel-content {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px; height: 100%; overflow-y: auto;
  font-family: var(--font-body-base, system-ui, sans-serif);
}

/* Form */
.deduction-form { display: flex; flex-direction: column; gap: 6px; }
.deduction-input {
  width: 100%; padding: 9px 11px; box-sizing: border-box;
  background: var(--bg-secondary); border: 1px solid var(--border-strong);
  border-radius: 6px; color: var(--text-secondary);
  font-family: var(--font-body-base, system-ui, sans-serif);
  font-size: 13px; resize: vertical; min-height: 68px;
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.deduction-input:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text, #fff);
}
.deduction-form-row { display: flex; gap: 6px; align-items: center; }
.deduction-geo-input {
  flex: 1; padding: 7px 10px; box-sizing: border-box;
  background: transparent; border: 1px solid var(--border);
  border-radius: 5px; color: var(--text-dim);
  font-family: var(--font-body-base, system-ui, sans-serif);
  font-size: 12px; transition: border-color 0.15s; outline: none;
}
.deduction-geo-input:focus { border-color: var(--border-strong); color: var(--text-secondary); }
.deduction-submit-btn {
  padding: 7px 16px; flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 5px; color: var(--accent); cursor: pointer;
  font-family: var(--font-body-base, system-ui, sans-serif);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s;
}
.deduction-submit-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.deduction-submit-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Loading dots */
.deduction-result.loading {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 0; color: var(--text-dim); font-size: 12px;
}
.deduction-loading-dots { display: flex; gap: 4px; }
.deduction-loading-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-dim); animation: deduction-pulse 1.2s ease-in-out infinite;
}
.deduction-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.deduction-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes deduction-pulse { 0%,80%,100% { opacity: 0.2; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

/* Result base */
.deduction-result {
  flex: 1; font-family: var(--font-body-base, system-ui, sans-serif);
  font-size: 13px; line-height: 1.6; color: var(--text-secondary);
}
.deduction-result.error { color: var(--red); padding: 12px 0; font-size: 12px; }

/* Section: Verdict (Bottom line) */
.ds-verdict {
  background: color-mix(in srgb, var(--yellow) 7%, transparent);
  border-left: 2px solid var(--yellow);
  padding: 10px 12px; border-radius: 0 5px 5px 0; margin-bottom: 12px;
  color: var(--text, #fff); font-size: 13px; line-height: 1.6;
}
.ds-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.ds-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ds-verdict .ds-section-label { color: var(--yellow); margin-bottom: 6px; }
.ds-verdict .ds-section-label::after { background: color-mix(in srgb, var(--yellow) 20%, transparent); }

/* Section: Evidence (What we know) */
.ds-evidence { margin-bottom: 12px; }
.ds-evidence .ds-section-label { color: var(--text-dim); }
.ds-evidence ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ds-evidence li {
  padding: 6px 10px 6px 22px; background: var(--bg-secondary);
  border-radius: 4px; font-size: 12px; line-height: 1.5;
  color: var(--text-secondary); position: relative;
}
.ds-evidence li::before { content: '·'; position: absolute; left: 10px; color: var(--text-dim); font-size: 16px; line-height: 1.3; }

/* Section: Primary path (Most likely) */
.ds-primary {
  background: color-mix(in srgb, var(--green) 5%, transparent);
  border-left: 2px solid var(--green);
  padding: 10px 12px; border-radius: 0 5px 5px 0; margin-bottom: 12px;
}
.ds-primary .ds-section-label { color: var(--green); margin-bottom: 6px; }
.ds-primary .ds-section-label::after { background: color-mix(in srgb, var(--green) 20%, transparent); }
.ds-prob-badge {
  background: color-mix(in srgb, var(--green) 18%, transparent);
  color: var(--green); border-radius: 20px; padding: 1px 7px;
  font-size: 10px; font-weight: 700; font-family: var(--font-mono);
  letter-spacing: 0.04em; white-space: nowrap;
}
.ds-primary-body { font-size: 13px; line-height: 1.6; color: var(--text, #fff); }

/* Section: Alternative paths */
.ds-alt { margin-bottom: 12px; }
.ds-alt .ds-section-label { color: var(--text-dim); }
.ds-alt ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ds-alt li {
  padding: 6px 10px 6px 10px; background: transparent;
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 12px; line-height: 1.5; color: var(--text-dim); display: flex; gap: 8px;
}
.ds-alt-prob {
  background: color-mix(in srgb, var(--text-dim) 15%, transparent);
  color: var(--text-secondary); border-radius: 20px; padding: 1px 7px;
  font-size: 10px; font-weight: 700; font-family: var(--font-mono);
  white-space: nowrap; flex-shrink: 0; align-self: flex-start; margin-top: 1px;
}

/* Section: Confidence */
.ds-confidence { margin-bottom: 10px; }
.ds-confidence .ds-section-label { color: var(--text-dim); }

/* ----------------------------------------------------------
   Thermal Escalation Panel (Option A — Dense Intel)
   ---------------------------------------------------------- */
.te-panel { font-size: 12px; }

/* Summary strip */
.te-summary {
  display: flex;
  gap: 1px;
  background: var(--border-subtle);
  border-bottom: 1px solid var(--border);
}

.te-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  background: var(--surface);
  gap: 1px;
}

/* P3: no hover — stats are display-only, no click handler */

.te-stat-val {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  line-height: 1;
}

.te-stat-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.te-stat-spike .te-stat-val { color: var(--semantic-critical); }
.te-stat-persistent .te-stat-val { color: var(--semantic-high); }
.te-stat-elevated .te-stat-val { color: var(--semantic-elevated); }
.te-stat-conflict .te-stat-val { color: color-mix(in srgb, var(--semantic-critical) 75%, var(--text-dim)); }
.te-stat-strategic .te-stat-val { color: color-mix(in srgb, var(--semantic-elevated) 75%, var(--text-dim)); }

/* Card list */
.te-list { display: flex; flex-direction: column; }

.te-card {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
}

.te-card:hover { background: var(--surface-hover); }
.te-card:last-child { border-bottom: none; }

/* Left accent bar — color set per status via modifier */
.te-card-accent {
  width: 3px;
  flex-shrink: 0;
  background: var(--border-strong);
}

.te-card-spike .te-card-accent { background: var(--semantic-critical); }
.te-card-persistent .te-card-accent { background: var(--semantic-high); }
.te-card-elevated .te-card-accent { background: var(--semantic-elevated); }
.te-card-normal .te-card-accent { background: var(--semantic-normal); }

.te-card-body {
  flex: 1;
  padding: 7px 8px;
  min-width: 0;
}

.te-region {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.te-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.te-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.te-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 2px;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.te-badge-spike {
  background: color-mix(in srgb, var(--semantic-critical) 18%, transparent);
  color: var(--semantic-critical);
  border-color: color-mix(in srgb, var(--semantic-critical) 32%, transparent);
}

.te-badge-persistent {
  background: color-mix(in srgb, var(--semantic-high) 15%, transparent);
  color: var(--semantic-high);
  border-color: color-mix(in srgb, var(--semantic-high) 28%, transparent);
}

.te-badge-elevated {
  background: color-mix(in srgb, var(--semantic-elevated) 13%, transparent);
  color: var(--semantic-elevated);
  border-color: color-mix(in srgb, var(--semantic-elevated) 25%, transparent);
}

.te-badge-normal {
  background: color-mix(in srgb, var(--semantic-normal) 12%, transparent);
  color: var(--semantic-normal);
  border-color: color-mix(in srgb, var(--semantic-normal) 22%, transparent);
}

.te-badge-strategic {
  background: color-mix(in srgb, var(--semantic-elevated) 10%, transparent);
  color: color-mix(in srgb, var(--semantic-elevated) 80%, var(--text-dim));
  border-color: color-mix(in srgb, var(--semantic-elevated) 20%, transparent);
}

.te-badge-conflict {
  background: color-mix(in srgb, var(--semantic-critical) 9%, transparent);
  color: color-mix(in srgb, var(--semantic-critical) 75%, var(--text-dim));
  border-color: color-mix(in srgb, var(--semantic-critical) 18%, transparent);
}

.te-badge-energy {
  background: color-mix(in srgb, #4488ff 10%, transparent);
  color: #6699ff;
  border-color: color-mix(in srgb, #4488ff 20%, transparent);
}

.te-badge-industrial {
  background: color-mix(in srgb, var(--text-dim) 10%, transparent);
  color: var(--text-dim);
  border-color: color-mix(in srgb, var(--text-dim) 18%, transparent);
}

/* Right metrics column */
.te-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 7px 10px 7px 6px;
  flex-shrink: 0;
}

.te-frp {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.te-frp-unit { font-size: 9px; color: var(--text-muted); font-weight: 400; }

.te-delta {
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.te-delta.pos { color: var(--semantic-critical); font-weight: 600; }
.te-delta.neg { color: var(--semantic-normal); font-weight: 600; }

.te-persist {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 10px;
  background: var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

/* P2: lastDetectedAt age reinstated */
.te-last {
  font-size: 9px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* P2: confidence badges reinstated */
.te-badge-conf-high {
  background: color-mix(in srgb, var(--semantic-normal) 12%, transparent);
  color: var(--semantic-normal);
  border-color: color-mix(in srgb, var(--semantic-normal) 22%, transparent);
}

.te-badge-conf-medium {
  background: color-mix(in srgb, var(--semantic-elevated) 11%, transparent);
  color: var(--semantic-elevated);
  border-color: color-mix(in srgb, var(--semantic-elevated) 20%, transparent);
}

.te-badge-conf-low {
  background: color-mix(in srgb, var(--text-dim) 9%, transparent);
  color: var(--text-muted);
  border-color: color-mix(in srgb, var(--text-dim) 16%, transparent);
}

/* P2: nearbyAssets reinstated */
.te-assets {
  font-size: 9px;
  color: var(--text-faint);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.te-footer {
  padding: 5px 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 10px;
  color: var(--text-faint);
  text-align: right;
}

/* Grocery Basket Panel */
.gb-wrapper { overflow: hidden; }
.gb-scroll { overflow-x: auto; }
.gb-table { border-collapse: collapse; width: 100%; font-size: 0.75rem; }
.gb-table th, .gb-table td { padding: 4px 6px; border: 1px solid rgba(255,255,255,0.08); text-align: right; white-space: nowrap; }
.gb-item-col, .gb-item-name { text-align: left; min-width: 110px; position: sticky; left: 0; z-index: 2; background: var(--panel-bg); }
.gb-country-header { text-align: center; font-weight: 600; min-width: 80px; }
.gb-country-name { font-size: 0.65rem; opacity: 0.7; }
.gb-cell { position: relative; }
.gb-local { display: block; font-size: 0.6rem; opacity: 0.6; }
.gb-unit { display: block; font-size: 0.6rem; opacity: 0.5; }
.gb-na { opacity: 0.3; text-align: center; }
.gb-cheapest { background: rgba(34,197,94,0.15); color: #4ade80; }
.gb-priciest { background: rgba(239,68,68,0.1); color: #f87171; }
.gb-total-row td { border-top: 2px solid rgba(255,255,255,0.2); }
.gb-wow { display: block; font-size: 0.6rem; opacity: 0.85; margin-top: 1px; }
.gb-updated { font-size: 0.65rem; opacity: 0.4; text-align: right; padding: 4px 6px; }

/* ── Geo Hubs & Tech Hubs Panels ─────────────────────────────────────── */
.geo-hub-item,
.tech-hub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}
.geo-hub-item:hover,
.tech-hub-item:hover {
  background: color-mix(in srgb, var(--text-dim) 6%, transparent);
}

.hub-rank {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 14px;
  text-align: right;
}

.geo-hub-indicator,
.hub-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}
.geo-hub-indicator.high,
.hub-indicator.high {
  background: var(--semantic-critical);
  box-shadow: 0 0 5px color-mix(in srgb, var(--semantic-critical) 60%, transparent);
}
.geo-hub-indicator.elevated,
.hub-indicator.elevated {
  background: var(--semantic-elevated);
}
.geo-hub-indicator.low,
.hub-indicator.low {
  background: var(--text-muted);
}

.hub-info {
  flex: 1;
  min-width: 0;
}

.hub-header {
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.3;
}

.hub-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #e8e8e8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-flag {
  font-size: 12px;
  flex-shrink: 0;
}

.hub-breaking {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--semantic-high) 15%, transparent);
  color: var(--semantic-high);
  border: 1px solid color-mix(in srgb, var(--semantic-high) 25%, transparent);
}
.hub-breaking.geo {
  background: color-mix(in srgb, var(--semantic-critical) 15%, transparent);
  color: var(--semantic-critical);
  border-color: color-mix(in srgb, var(--semantic-critical) 25%, transparent);
}

.hub-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.hub-news-count {
  font-size: 10px;
  color: var(--text-dim);
}

.hub-trend {
  font-size: 11px;
  font-weight: 600;
}
.hub-trend.rising { color: var(--semantic-critical); }
.hub-trend.falling { color: var(--semantic-normal); }

.geo-hub-type,
.hub-tier {
  font-size: 10px;
  color: var(--text-muted);
}

.hub-score {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 26px;
  text-align: right;
  flex-shrink: 0;
}
.hub-score.geo { color: var(--semantic-high); }
.geo-hub-item.high .hub-score.geo { color: var(--semantic-critical); }

.hub-top-story,
a.hub-top-story {
  display: block;
  padding: 4px 10px 7px 30px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--link-color, #4a9eff);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  opacity: 0.85;
  transition: opacity 0.15s;
}
.hub-top-story:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Climate News Panel */
.climate-news-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 380px;
  overflow-y: auto;
}

.climate-news-card {
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}
.climate-news-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

.climate-news-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.climate-news-card__source {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-green, #22c55e);
  opacity: 0.8;
}

.climate-news-card__time {
  font-size: 9px;
  color: var(--text-faint);
}

.climate-news-card__title {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.climate-news-card__summary {
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ── Latest Brief panel ───────────────────────────────────────────── */

.latest-brief-card {
  display: block;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-color, #222);
  transition: transform 140ms ease, border-color 140ms ease;
}
.latest-brief-card--ready:hover {
  transform: translateY(-1px);
  border-color: var(--accent, #4ade80);
}

.latest-brief-cover {
  background: #0a0a0a;
  color: #f2ede4;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.latest-brief-cover-logo {
  width: 32px;
  height: 32px;
  opacity: 0.85;
  margin-bottom: 6px;
}
.latest-brief-cover-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}
.latest-brief-cover-issue {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}
.latest-brief-cover-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.latest-brief-cover-kicker {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8b3a1f;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.latest-brief-meta {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--panel-bg, #161616);
}
.latest-brief-greeting {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--text-primary, #eee);
  line-height: 1.3;
}
.latest-brief-cta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent, #4ade80);
  white-space: nowrap;
}

/* Share button row (Phase 9 / Todo #223) */
.latest-brief-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 12px;
  background: var(--panel-bg, #161616);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.latest-brief-share {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-primary, #eee);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.latest-brief-share:hover:not(:disabled) {
  border-color: var(--accent, #4ade80);
  background-color: rgba(74, 222, 128, 0.08);
}
.latest-brief-share:disabled {
  opacity: 0.5;
  cursor: default;
}
.latest-brief-share-status {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted, #888);
  white-space: nowrap;
}

.latest-brief-card--composing {
  padding: 32px 20px;
  text-align: center;
  background: var(--panel-bg, #161616);
}
.latest-brief-logo {
  width: 28px;
  height: 28px;
  margin: 0 auto 12px;
  opacity: 0.6;
  color: var(--text-muted, #888);
}
.latest-brief-logo svg,
.latest-brief-empty-title {
  display: block;
}
.latest-brief-empty-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-primary, #eee);
}
.latest-brief-empty-body {
  font-size: 12px;
  color: var(--text-muted, #888);
  line-height: 1.5;
  max-width: 36ch;
  margin: 0 auto;
}
.latest-brief-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted, #888);
  font-size: 12px;
}

/* ----------------------------------------------------------
   Watchlist Table View (StockAnalysisPanel, StockBacktestPanel)
   Option B from watchlist-panel-playground.html — replaces the
   one-long-card-per-symbol scroll with a sortable summary table
   that expands inline on row click. Scales to 50+ symbols.
   ---------------------------------------------------------- */
.watchlist-table-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watchlist-intro {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 4px 0;
}

.watchlist-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
}

.watchlist-search {
  width: 100%;
  background: var(--input-bg, #1a1a1a);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 8px;
  font-family: inherit;
  font-size: 11px;
  border-radius: 3px;
}
.watchlist-search:focus {
  outline: none;
  border-color: var(--border-strong);
}

.watchlist-control-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.watchlist-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.watchlist-pill {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 8px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}
.watchlist-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.watchlist-pill-active {
  color: var(--accent);
  background: var(--overlay-medium);
  border-color: var(--border-strong);
}

.watchlist-sort {
  margin-left: auto;
  background: var(--input-bg, #1a1a1a);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 3px 6px;
  font-family: inherit;
  font-size: 11px;
  border-radius: 3px;
}

.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.watchlist-table-scroll {
  /* Source of truth for the virtual row height. MUST equal
     VIRTUAL_ROW_HEIGHT_PX in WatchlistTableView.ts — the spacer pixel math and
     the scroll→index mapping there assume every data row is exactly this tall. */
  --watchlist-row-height: 33px;
  max-height: min(58vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.watchlist-table thead th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.4px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-bg, var(--bg));
}
.watchlist-table thead th.watchlist-th-right {
  text-align: right;
}
.watchlist-table thead th.watchlist-th-sortable {
  cursor: pointer;
  user-select: none;
}
.watchlist-table thead th.watchlist-th-sortable:hover {
  color: var(--text);
}
.watchlist-table tbody tr.watchlist-row {
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s ease;
  /* Pin each data row to exactly one virtual row height so the virtualization
     spacer math and scroll→index mapping cannot drift with cell content (e.g.
     a wrapped long name on a narrow/mobile viewport). */
  height: var(--watchlist-row-height, 33px);
}
.watchlist-table tbody tr.watchlist-row > td {
  /* Keep cells single-line so a row can never grow past --watchlist-row-height. */
  white-space: nowrap;
  overflow: hidden;
}
.watchlist-table tbody tr.watchlist-row:hover {
  background: var(--overlay-subtle);
}
.watchlist-table tbody tr.watchlist-row-expanded {
  background: var(--overlay-light);
}
.watchlist-table tbody td {
  padding: 6px 4px;
}
.watchlist-table tbody td.watchlist-td-right {
  text-align: right;
}
.watchlist-table tbody tr.watchlist-detail-row > td {
  padding: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.watchlist-table tbody tr.watchlist-virtual-spacer > td {
  pointer-events: none;
}
.watchlist-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
}
