/* ============================================================
   TraceGen — Check Point Forensic Investigation Dashboard
   Dark theme CSS
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0a0e17;
  --bg-card:      #131a2b;
  --bg-card-alt:  #19223a;
  --bg-input:     #0f1525;
  --border:       #1e2a42;
  --border-focus: #3b82f6;
  --text:         #e0e6f0;
  --text-dim:     #7a8ba8;
  --text-muted:   #4b5c78;
  --accent:       #3b82f6;
  --accent-hover: #2563eb;
  --green:        #22c55e;
  --green-dim:    #16532e;
  --red:          #ef4444;
  --orange:       #f97316;
  --yellow:       #eab308;
  --blue:         #3b82f6;
  --gray:         #6b7280;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --radius:       8px;
  --radius-sm:    4px;
  --shadow:       0 2px 12px rgba(0,0,0,.35);
}

html { font-size: 15px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Scrollbar --------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Navigation -------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: 36px;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  user-select: none;
}

.nav-brand .brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: #fff;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 0;
  height: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 100%;
  color: var(--text-dim);
  font-size: .9rem;
  font-weight: 500;
  position: relative;
  cursor: pointer;
  transition: color .15s;
  text-decoration: none;
  user-select: none;
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.nav-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-dim);
}

.nav-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray);
}

.nav-status-dot.connected { background: var(--green); }
.nav-status-dot.disconnected { background: var(--red); }

/* --- Main container ---------------------------------------- */
#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* --- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s, box-shadow .15s;
  line-height: 1;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-card-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: .8rem;
}

.btn-icon {
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { color: var(--text); border-color: var(--text-dim); }

/* --- Form elements ----------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-input,
.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: .78rem;
  color: var(--text-muted);
}

/* --- Cards ------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

/* --- Badges ------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.4;
}

.badge-critical { background: rgba(239,68,68,.15); color: var(--red); }
.badge-high     { background: rgba(249,115,22,.15); color: var(--orange); }
.badge-medium   { background: rgba(234,179,8,.15);  color: var(--yellow); }
.badge-low      { background: rgba(59,130,246,.15); color: var(--blue); }
.badge-info     { background: rgba(107,114,128,.15); color: var(--gray); }

.badge-count {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  padding: 0 6px;
}

.badge-count-critical { background: var(--red); color: #fff; }
.badge-count-high     { background: var(--orange); color: #fff; }
.badge-count-medium   { background: var(--yellow); color: #000; }
.badge-count-low      { background: var(--blue); color: #fff; }
.badge-count-info     { background: var(--gray); color: #fff; }

/* --- Setup Wizard ------------------------------------------ */
.wizard {
  max-width: 720px;
  margin: 0 auto;
}

.wizard-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -.02em;
}

.wizard-subtitle {
  color: var(--text-dim);
  margin-bottom: 32px;
  font-size: .95rem;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
  gap: 0;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  position: relative;
}

.stepper-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
}

.stepper-step.completed:not(:last-child)::after {
  background: var(--green);
}

.stepper-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  background: var(--bg-card-alt);
  border: 2px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all .2s;
}

.stepper-step.active .stepper-num {
  border-color: var(--accent);
  background: rgba(59,130,246,.15);
  color: var(--accent);
}

.stepper-step.completed .stepper-num {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.stepper-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.stepper-step.active .stepper-label { color: var(--text); }
.stepper-step.completed .stepper-label { color: var(--green); }

/* Wizard step content */
.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}

/* Copyable box */
.copy-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.5;
  word-break: break-all;
  position: relative;
  color: var(--green);
}

.copy-box .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: .7rem;
}

/* Connection test result */
.connection-result {
  padding: 20px;
  border-radius: var(--radius);
  margin-top: 16px;
}

.connection-result.success {
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.25);
}

.connection-result.failure {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
}

.connection-result .result-icon {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.connection-result .result-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.connection-result .result-detail {
  font-size: .85rem;
  color: var(--text-dim);
}

/* Instructions block */
.instructions {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
}

.instructions h4 {
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.instructions code {
  display: block;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--green);
  margin: 6px 0;
  overflow-x: auto;
}

.instructions .copy-cmd {
  cursor: pointer;
  transition: background .15s, border-color .15s;
  border: 1px solid transparent;
}

.instructions .copy-cmd:hover {
  background: var(--bg-card-alt);
  border-color: var(--accent);
}

.instructions .copy-cmd::after {
  content: 'click to copy';
  float: right;
  font-size: .68rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
}

.instructions .copy-cmd.copied {
  color: var(--accent) !important;
  text-align: center;
  border-color: var(--accent);
  background: rgba(59,130,246,.06);
}

.instructions .copy-cmd.copied::after {
  display: none;
}

.instructions .copy-cmd.copied .claude-prompt-caret,
.instructions .copy-cmd.copied .claude-prompt-cursor {
  display: none;
}

/* Claude terminal prompt style */
.claude-prompt {
  display: block;
  background: #1a1a2e;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: #e0e0e0;
  margin: 6px 0;
  line-height: 1.5;
}

.claude-prompt-caret {
  color: #e87b35;
  margin-right: 6px;
  font-weight: 700;
}

.claude-prompt-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: #e0e0e0;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 1s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

.instructions p {
  font-size: .83rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* Ready summary */
.ready-summary {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  font-size: .9rem;
}

.ready-summary dt {
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
}

.ready-summary dd {
  color: var(--text);
}

/* --- Dashboard --------------------------------------------- */
/* Phase stepper (horizontal) */
.phase-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
}

.phase-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.phase-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 10px;
}

.phase-step.completed:not(:last-child)::after {
  background: var(--green);
}

.phase-step .phase-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-card-alt);
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all .2s;
}

.phase-step.active .phase-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(59,130,246,.5);
  animation: pulse-dot 2s infinite;
}

.phase-step.completed .phase-dot {
  border-color: var(--green);
  background: var(--green);
}

.phase-step .phase-label {
  font-size: .76rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: capitalize;
}

.phase-step.active .phase-label { color: var(--accent); font-weight: 700; }
.phase-step.completed .phase-label { color: var(--green); }

/* Summary bar */
.summary-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.summary-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  flex: 1;
  min-width: 140px;
}

.summary-stat .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.summary-stat .stat-label {
  font-size: .78rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.summary-stat.critical .stat-value { color: var(--red); }
.summary-stat.high .stat-value     { color: var(--orange); }
.summary-stat.total .stat-value    { color: var(--text); }

/* Domain cards grid */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.domain-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s;
}

.domain-card:hover { border-color: var(--text-muted); }

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

.domain-card-name {
  font-size: .88rem;
  font-weight: 700;
  text-transform: capitalize;
}

.domain-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.status-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-icon.pending      { background: var(--gray); opacity: .4; }
.status-icon.in_progress  { background: var(--blue); animation: pulse-dot 1.5s infinite; }
.status-icon.completed    { background: var(--green); }
.status-icon.skipped      { background: var(--gray); opacity: .3; }
.status-icon.error        { background: var(--red); }

.domain-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.domain-card-badges .badge-count {
  font-size: .7rem;
}

/* Activity log */
.activity-log {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 360px;
  display: flex;
  flex-direction: column;
}

.activity-log-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  font-weight: 700;
  flex-shrink: 0;
}

.activity-log-body {
  overflow-y: auto;
  padding: 8px 0;
  flex: 1;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 20px;
  font-size: .82rem;
  transition: background .15s;
}

.log-entry:hover { background: rgba(255,255,255,.02); }

.log-entry .log-time {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .72rem;
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}

.log-entry .log-msg {
  color: var(--text-dim);
  line-height: 1.4;
}

.log-entry .log-domain {
  color: var(--accent);
  font-weight: 600;
}

/* --- Findings Feed ----------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .filter-group {
  display: flex;
  gap: 0;
}

.filter-btn {
  padding: 7px 14px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font-sans);
}

.filter-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.filter-btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.filter-btn:not(:first-child) { border-left: none; }

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-btn:hover:not(.active) {
  background: var(--bg-card-alt);
  color: var(--text);
}

/* Summary banner */
.findings-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.findings-summary .summary-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 600;
}

.findings-summary .summary-badge .count {
  font-weight: 800;
}

.findings-summary .summary-badge.critical .count { color: var(--red); }
.findings-summary .summary-badge.high .count     { color: var(--orange); }
.findings-summary .summary-badge.medium .count   { color: var(--yellow); }
.findings-summary .summary-badge.low .count      { color: var(--blue); }
.findings-summary .summary-badge.info .count     { color: var(--gray); }

/* Finding cards */
.findings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--gray);
  padding: 20px 24px;
  animation: fadeSlideIn .35s ease-out;
}

.finding-card.severity-critical { border-left-color: var(--red); }
.finding-card.severity-high     { border-left-color: var(--orange); }
.finding-card.severity-medium   { border-left-color: var(--yellow); }
.finding-card.severity-low      { border-left-color: var(--blue); }
.finding-card.severity-info     { border-left-color: var(--gray); }

.finding-card.new-finding {
  animation: highlightNew .8s ease-out;
}

.finding-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.finding-card-title {
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
  min-width: 200px;
}

.finding-card-domain {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  background: rgba(59,130,246,.1);
  color: var(--accent);
  border-radius: 999px;
  text-transform: capitalize;
}

.finding-card-cve {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  background: rgba(239,68,68,.1);
  color: var(--red);
  border-radius: 999px;
  font-family: var(--font-mono);
}

.finding-card-desc {
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 12px;
}

.finding-card-recommendation {
  font-size: .85rem;
  color: var(--green);
  padding: 10px 14px;
  background: rgba(34,197,94,.06);
  border: 1px solid rgba(34,197,94,.15);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.finding-card-recommendation::before {
  content: 'Recommendation: ';
  font-weight: 700;
}

/* Collapsible evidence */
.evidence-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  transition: color .15s;
}

.evidence-toggle:hover { color: var(--text); }

.evidence-toggle .toggle-arrow {
  display: inline-block;
  transition: transform .2s;
  font-size: .65rem;
}

.evidence-toggle.open .toggle-arrow {
  transform: rotate(90deg);
}

.evidence-section {
  display: none;
  margin-top: 8px;
}

.evidence-section.open {
  display: block;
}

.evidence-command {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--accent);
  padding: 8px 12px;
  background: rgba(59,130,246,.06);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}

.evidence-command::before {
  content: '$ ';
  color: var(--text-muted);
}

.evidence-output {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--text-dim);
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

/* --- Report Viewer ----------------------------------------- */
.report-container {
  max-width: 880px;
  margin: 0 auto;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.report-toolbar h2 {
  font-size: 1.3rem;
  font-weight: 800;
}

.report-not-ready {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-dim);
}

.report-not-ready .not-ready-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: .4;
}

.report-not-ready h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.report-not-ready p {
  font-size: .9rem;
}

/* Rendered markdown */
.report-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
  line-height: 1.7;
}

.report-body h1 {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 32px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  letter-spacing: -.02em;
}

.report-body h1:first-child { margin-top: 0; }

.report-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--accent);
}

.report-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 22px 0 10px;
}

.report-body h4 {
  font-size: .95rem;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--text-dim);
}

.report-body p {
  margin-bottom: 12px;
}

.report-body strong { color: var(--text); }

.report-body ul, .report-body ol {
  margin: 8px 0 16px 24px;
}

.report-body li {
  margin-bottom: 4px;
}

.report-body code {
  font-family: var(--font-mono);
  font-size: .84em;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--green);
}

.report-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 12px 0 16px;
  overflow-x: auto;
}

.report-body pre code {
  background: none;
  padding: 0;
  font-size: .8rem;
  line-height: 1.5;
}

.report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: .88rem;
}

.report-body th {
  background: var(--bg-card-alt);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.report-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
}

.report-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.report-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 12px 0;
  color: var(--text-dim);
  background: rgba(59,130,246,.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* --- Animations -------------------------------------------- */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes highlightNew {
  0%   { background: rgba(59,130,246,.12); }
  100% { background: var(--bg-card); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* --- Utility ----------------------------------------------- */
.text-dim     { color: var(--text-dim); }
.text-muted   { color: var(--text-muted); }
.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-orange  { color: var(--orange); }
.text-yellow  { color: var(--yellow); }

.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }

.hidden { display: none !important; }

/* --- Empty state ------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
}

.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: .35;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: .88rem;
}

/* --- Toast / notification ---------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: .85rem;
  z-index: 1000;
  animation: fadeSlideIn .3s ease-out;
  max-width: 380px;
}

.toast.success { border-left: 4px solid var(--green); }
.toast.error   { border-left: 4px solid var(--red); }
.toast.info    { border-left: 4px solid var(--accent); }

/* --- Print ------------------------------------------------- */
@media print {
  .nav,
  .report-toolbar,
  .filter-bar,
  .summary-bar {
    display: none !important;
  }

  body { background: #fff; color: #000; }

  .report-body {
    background: #fff;
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .report-body h1 { border-color: #ccc; }
  .report-body h2 { color: #333; }
  .report-body pre, .report-body code { background: #f5f5f5; }
  .report-body th { background: #eee; }
  .report-body td, .report-body th { border-color: #ccc; }
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  .nav { padding: 0 12px; height: 50px; }
  .nav-brand { margin-right: 16px; font-size: .95rem; }
  .nav-link { padding: 0 12px; font-size: .82rem; }

  #app { padding: 16px 12px 40px; }

  .form-row { grid-template-columns: 1fr; }
  .stepper { flex-wrap: wrap; gap: 8px; }
  .stepper-step:not(:last-child)::after { display: none; }

  .domain-grid { grid-template-columns: 1fr; }
  .summary-bar { flex-direction: column; }

  .report-body { padding: 24px 20px; }

  .phase-stepper { flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
  .phase-step:not(:last-child)::after { display: none; }
}
