/* CloudRaider Ops Dashboard — shared styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-border: #334155;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.08);
  --red-border: rgba(239, 68, 68, 0.25);
  --yellow: #eab308;
  --yellow-bg: rgba(234, 179, 8, 0.06);
  --yellow-border: rgba(234, 179, 8, 0.2);
  --green: #22c55e;
  --blue: #3b82f6;
  --bar-bg: #0b1120;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Top nav --- */
#top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 20px;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-tab.active {
  color: var(--text);
  background: var(--card);
  border-color: var(--card-border);
}

.nav-meta { margin-left: auto; font-size: 11px; color: var(--text-dim); }

#tab-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* --- Loading state --- */
.tab-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Shared section header --- */
.section-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 24px 0 10px;
  padding-left: 2px;
}
.section-header:first-child { margin-top: 0; }

/* --- Shared card --- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.card.red {
  border-left: 3px solid var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}
.card.yellow {
  border-left: 3px solid var(--yellow);
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
}
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.card.red .card-title { color: var(--red); }
.card.yellow .card-title { color: var(--yellow); }
.card-detail { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.card-detail span { display: inline-block; margin-right: 16px; }

/* ========================================================================
   SOC TAB
   ======================================================================== */
#all-clear { display: none; flex: 1; align-items: center; justify-content: center; }
#all-clear .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.7; box-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }
  50% { opacity: 1; box-shadow: 0 0 16px rgba(34, 197, 94, 0.5); }
}

#exceptions { display: none; flex: 1; padding: 20px; padding-bottom: 60px; overflow-y: auto; }

#db-error { display: none; flex: 1; align-items: center; justify-content: center; flex-direction: column; gap: 12px; }
#db-error .icon {
  width: 32px; height: 32px; border-radius: 50%; background: var(--red);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: #fff;
}
#db-error .msg { color: var(--red); font-size: 13px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
#db-error .detail { color: var(--text-dim); font-size: 12px; max-width: 400px; text-align: center; }

.alert-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--card);
  border: 1px solid var(--card-border); border-radius: 6px;
  margin-bottom: 4px; font-size: 13px;
}
.alert-row.critical { border-left: 3px solid var(--red); background: var(--red-bg); border-color: var(--red-border); }
.alert-row.high { border-left: 3px solid var(--yellow); background: var(--yellow-bg); border-color: var(--yellow-border); }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge.critical { background: rgba(239,68,68,0.15); color: var(--red); }
.badge.high { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge.medium { background: rgba(148,163,184,0.15); color: var(--text-dim); }

.alert-source { color: var(--text); font-weight: 500; min-width: 120px; }
.alert-count { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.alert-age { color: var(--text-dim); font-size: 12px; margin-left: auto; }

#alert-summary { padding: 20px 20px 0; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.summary-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 8px; padding: 14px 16px;
}
.summary-card-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.summary-card-counts { display: flex; gap: 8px; flex-wrap: wrap; }

.sev-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sev-pill.critical { background: rgba(239,68,68,0.15); color: var(--red); }
.sev-pill.high { background: rgba(234,179,8,0.15); color: var(--yellow); }
.sev-pill.medium { background: rgba(148,163,184,0.1); color: var(--text-dim); }
.sev-pill.low { background: rgba(148,163,184,0.06); color: #64748b; }
.sev-pill.zero { opacity: 0.3; }

.summary-total {
  margin-left: auto;
  font-size: 22px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.summary-card-row { display: flex; align-items: center; }

.sla-card {
  background: var(--red-bg); border: 1px solid var(--red-border);
  border-left: 3px solid var(--red); border-radius: 8px;
  padding: 12px 16px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 14px;
}
.sla-severity { font-weight: 700; color: var(--red); text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; min-width: 70px; }
.sla-source { color: var(--text); font-weight: 500; min-width: 120px; }
.sla-count { color: var(--red); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.sla-worst { color: var(--text-dim); font-size: 12px; margin-left: auto; }

#stats-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bar-bg); border-top: 1px solid var(--card-border);
  padding: 8px 20px;
  display: flex; align-items: center; justify-content: center;
  gap: 24px; font-size: 12px; color: var(--text-dim);
  z-index: 100; font-variant-numeric: tabular-nums;
}
#stats-bar .stat-value { color: var(--text); font-weight: 600; }
#stats-bar .sep { opacity: 0.3; }
#stats-bar .refresh-age { opacity: 0.6; }

/* ========================================================================
   METRICS TAB
   ======================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  padding: 20px;
}

.metric-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.metric-card h3 {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim);
}
.metric-big {
  font-size: 28px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.metric-sub { font-size: 12px; color: var(--text-dim); }
.metric-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.metric-table th, .metric-table td {
  text-align: left; padding: 4px 8px;
  border-bottom: 1px solid rgba(148,163,184,0.1);
  font-variant-numeric: tabular-nums;
}
.metric-table th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 0.06em; }
.metric-table td.num { text-align: right; }

/* ========================================================================
   SCORECARD TAB
   ======================================================================== */
.scorecard-wrap { padding: 20px; padding-bottom: 60px; overflow-y: auto; }
.scorecard-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.spark-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px;
}
.spark-card h4 {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); margin-bottom: 8px;
}
.spark-current {
  font-size: 22px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.spark-delta { font-size: 11px; margin-left: 8px; }
.spark-delta.up { color: var(--green); }
.spark-delta.down { color: var(--red); }
.spark-svg { width: 100%; height: 48px; margin-top: 6px; display: block; }

.kv-block {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.kv-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px solid rgba(148,163,184,0.06);
  font-size: 13px;
}
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--text-dim); }
.kv-val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.collapse-section { margin-top: 18px; }
.collapse-toggle {
  background: var(--card); border: 1px solid var(--card-border);
  color: var(--text); padding: 8px 14px;
  border-radius: 6px; cursor: pointer;
  font-size: 12px; font-family: inherit;
}
.collapse-body {
  display: none;
  margin-top: 10px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 8px; padding: 14px 18px;
  max-height: 60vh; overflow-y: auto;
  font-size: 13px; line-height: 1.6;
  white-space: pre-wrap;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.collapse-body.open { display: block; }

/* --- Responsive --- */
@media (max-width: 600px) {
  #top-nav { padding: 8px 12px; gap: 12px; }
  .nav-brand { font-size: 12px; }
  .nav-tab { padding: 6px 10px; font-size: 12px; }
  #exceptions { padding: 12px; padding-bottom: 56px; }
  .alert-row { flex-wrap: wrap; gap: 6px; }
  .alert-age { margin-left: 0; }
  .sla-card { flex-wrap: wrap; gap: 8px; }
  .sla-worst { margin-left: 0; }
  #stats-bar { flex-wrap: wrap; gap: 8px; padding: 6px 12px; justify-content: center; font-size: 11px; }
  .metrics-grid, .scorecard-grid { padding: 12px; gap: 10px; }
}

/* --- Phase 2: Mesh tab --- */
.mesh-wrap, .research-wrap { padding: 12px 16px; }
.mesh-node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.mesh-node-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 10px 12px;
}
.mesh-node-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.mesh-node-name { font-weight: 600; font-size: 14px; }
.mesh-node-status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.mesh-node-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.mesh-svc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mesh-svc-table th, .mesh-svc-table td {
  padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--card-border);
}
.mesh-svc-table th {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.mesh-svc-table tr:last-child td { border-bottom: none; }

/* ========================================================================
   PHASE 3 — THREAT INTEL TAB
   ======================================================================== */
.ti-wrap { padding: 12px 16px; padding-bottom: 60px; overflow-y: auto; }
.ti-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }

/* Filter bar */
.ti-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ti-filter-group { display: flex; align-items: center; gap: 8px; }
.ti-filter-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ti-pill-group { display: flex; gap: 2px; }
.ti-pill {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.ti-pill:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.ti-pill.active { color: var(--text); background: var(--bar-bg); border-color: var(--blue); }
.ti-select {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  font-family: inherit;
  cursor: pointer;
}
.ti-range { vertical-align: middle; width: 120px; accent-color: var(--blue); }
.ti-min-ips-val { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 4px; }
.ti-checkbox { font-size: 12px; color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ti-checkbox input { accent-color: var(--blue); }

/* Two-col grid */
.ti-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}
@media (max-width: 1000px) {
  .ti-grid { grid-template-columns: 1fr; }
}

.ti-count-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Feed list */
.ti-feed-list { display: flex; flex-direction: column; gap: 8px; }
.ti-card {
  display: flex;
  gap: 12px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.ti-card:hover { background: rgba(255,255,255,0.03); border-color: var(--blue); }
.ti-card-body { flex: 1; min-width: 0; }
.ti-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ti-card-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.ti-card-chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* IPS badge */
.ti-ips-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 6px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.ti-ips-num { font-size: 17px; font-weight: 700; line-height: 1; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.ti-ips-lbl { font-size: 9px; letter-spacing: 0.08em; margin-top: 2px; opacity: 0.9; }
.ti-band-critical { background: var(--red); color: #fff; }
.ti-band-high     { background: #f97316; color: #fff; }   /* orange */
.ti-band-medium   { background: var(--yellow); color: #1e293b; }
.ti-band-low      { background: var(--blue); color: #fff; }
.ti-band-noise    { background: #64748b; color: #fff; }

/* Chips */
.ti-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid transparent;
}
.ti-chip-cust { background: rgba(59,130,246,0.15); color: #93c5fd; border-color: rgba(59,130,246,0.3); }
.ti-chip-rel  { background: rgba(148,163,184,0.12); color: var(--text-dim); border-color: rgba(148,163,184,0.25); text-transform: uppercase; }
.ti-chip-mon  { background: rgba(34,197,94,0.15); color: #86efac; border-color: rgba(34,197,94,0.3); }
.ti-chip-esc  { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); text-transform: uppercase; }

/* Coverage chips — match Portal COVERAGE_STYLES tokens */
.ti-cov-covered                     { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.35); }
.ti-cov-partial                     { background: rgba(234,179,8,0.15);  color: #fde68a; border-color: rgba(234,179,8,0.35); }
.ti-cov-tactic-only-covered         { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.35); }
.ti-cov-vendor-capability-unmapped  { background: rgba(148,163,184,0.15); color: #cbd5e1; border-color: rgba(148,163,184,0.35); }
.ti-cov-gap                         { background: rgba(244,63,94,0.15);  color: #fda4af; border-color: rgba(244,63,94,0.35); }

.ti-cov-mini {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}

/* Rail */
.ti-rail-col .section-header { margin-top: 18px; }
.ti-rail-col .section-header:first-child { margin-top: 0; }
.ti-rail-content {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
}
.ti-rail-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(148,163,184,0.06);
  font-size: 12px;
  gap: 10px;
  align-items: center;
}
.ti-rail-row:last-child { border-bottom: none; }
.ti-rail-k { color: var(--text-dim); text-transform: uppercase; font-size: 10px; letter-spacing: 0.06em; }
.ti-rail-v { color: var(--text); font-weight: 600; text-align: right; }
.ti-muted { color: var(--text-dim); font-weight: 400; }
.ti-small { font-size: 11px; }
.ti-empty { color: var(--text-dim); font-size: 12px; padding: 8px 4px; text-align: center; }

/* Customer rail blocks */
.ti-customer-block { padding: 6px 0; border-bottom: 1px solid rgba(148,163,184,0.06); }
.ti-customer-block:last-child { border-bottom: none; }
.ti-customer-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.ti-customer-name { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
.ti-customer-counts { font-size: 10px; display: flex; gap: 4px; align-items: center; }
.ti-pill-crit { background: rgba(239,68,68,0.18); color: var(--red); padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.ti-pill-high { background: rgba(249,115,22,0.18); color: #fdba74; padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.ti-pill-med  { background: rgba(234,179,8,0.18); color: var(--yellow); padding: 1px 6px; border-radius: 3px; font-weight: 700; }
.ti-customer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 3px 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.ti-customer-item:hover { color: var(--blue); }
.ti-customer-item-band {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.ti-customer-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Gap rail */
.ti-gap-row {
  display: grid;
  grid-template-columns: 50px 60px 1fr 36px;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(148,163,184,0.06);
  font-size: 11px;
  cursor: pointer;
}
.ti-gap-row:hover { background: rgba(255,255,255,0.03); }
.ti-gap-row:last-child { border-bottom: none; }
.ti-gap-sev { padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-align: center; }
.ti-gap-sev-critical { background: rgba(239,68,68,0.18); color: var(--red); }
.ti-gap-sev-high     { background: rgba(249,115,22,0.18); color: #fdba74; }
.ti-gap-sev-medium   { background: rgba(234,179,8,0.18); color: var(--yellow); }
.ti-gap-sev-low      { background: rgba(148,163,184,0.15); color: var(--text-dim); }
.ti-gap-ttp { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 10px; color: var(--text); }
.ti-gap-title { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-gap-days { text-align: right; font-size: 10px; }

/* Detail overlay */
.ti-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.ti-detail-panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  width: min(800px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.ti-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
}
.ti-detail-title { font-size: 15px; font-weight: 600; color: var(--text); padding-right: 12px; }
.ti-detail-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.ti-detail-close:hover { color: var(--text); }
.ti-detail-body {
  padding: 14px 18px;
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
}
.ti-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 14px;
  margin-bottom: 14px;
}
.ti-detail-meta > div { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ti-detail-section { margin-top: 16px; }
.ti-detail-section .section-header { margin-top: 0; margin-bottom: 6px; }
.ti-detail-desc, .ti-detail-brief {
  white-space: pre-wrap;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  background: var(--bar-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 10px 12px;
}
.ti-detail-cov-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ti-detail-cov-list { display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; }
.ti-detail-cov-row {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 4px;
  border-bottom: 1px solid rgba(148,163,184,0.06);
  font-size: 11px;
}
.ti-detail-cov-row:last-child { border-bottom: none; }
.ti-detail-cov-ttp { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; color: var(--text); min-width: 90px; }

.ti-detail-actions {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--card-border);
  justify-content: flex-end;
}
.ti-btn {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.ti-btn:hover { background: rgba(255,255,255,0.04); }
.ti-btn-primary { background: rgba(34,197,94,0.15); color: #86efac; border-color: rgba(34,197,94,0.3); }
.ti-btn-primary:hover { background: rgba(34,197,94,0.22); }
.ti-btn-warn { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.ti-btn-warn:hover { background: rgba(239,68,68,0.22); }
