/* lyra-persistence-arch.css — Lyra brand palette, Forge aesthetic */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@600;700&family=Outfit:wght@400;600;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Brand tokens ── */
:root,
[data-theme="dark"] {
  --bg:           #0a0a0f;
  --surface:      #18181f;
  --surface-alt:  #1f2937;
  --border:       #2a2a35;
  --border-soft:  #1e1e28;
  --orange:       #e85d04;
  --ember:        #f97316;
  --text:         #fafafa;
  --text-muted:   #9ca3af;
  --text-dim:     #6b7280;

  /* Extended doc palette */
  --teal:         #06b6d4;
  --green:        #10b981;
  --amber:        #f59e0b;
  --red:          #f87171;
  --pink:         #ec4899;
  --plum:         #a855f7;
  --telegram:     #26a5e4;
  --discord:      #5865f2;

  /* DB colors */
  --db-auth:      #f59e0b;
  --db-turns:     #06b6d4;
  --db-msgidx:    #10b981;
  --db-pairing:   #a855f7;
  --db-dead:      #4b5563;
  --db-claude:    #e85d04;
  --db-vault:     #ec4899;

  /* Severity */
  --sev-critical: #f87171;
  --sev-high:     #f97316;
  --sev-medium:   #f59e0b;
  --sev-low:      #06b6d4;
  --sev-fixed:    #10b981;

  --shadow: 0 4px 24px rgba(0,0,0,.5);
  --glow-orange: 0 0 20px rgba(232,93,4,.25);
}

[data-theme="light"] {
  --bg:           #fafaf9;
  --surface:      #f4f4f0;
  --surface-alt:  #e7e5e4;
  --border:       #d6d3d1;
  --border-soft:  #e8e6e4;
  --orange:       #c2410c;
  --ember:        #ea580c;
  --text:         #1c1917;
  --text-muted:   #57534e;
  --text-dim:     #78716c;

  --teal:         #0891b2;
  --green:        #059669;
  --amber:        #d97706;
  --red:          #dc2626;
  --pink:         #db2777;
  --plum:         #9333ea;
  --telegram:     #0088cc;
  --discord:      #4f46e5;

  --db-auth:      #d97706;
  --db-turns:     #0891b2;
  --db-msgidx:    #059669;
  --db-pairing:   #9333ea;
  --db-dead:      #78716c;
  --db-claude:    #c2410c;
  --db-vault:     #db2777;

  --sev-critical: #dc2626;
  --sev-high:     #ea580c;
  --sev-medium:   #d97706;
  --sev-low:      #0891b2;
  --sev-fixed:    #059669;

  --shadow: 0 4px 24px rgba(0,0,0,.12);
  --glow-orange: 0 0 16px rgba(194,65,12,.15);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.25rem .75rem 0;
  border-right: 1px solid var(--border);
  margin-right: .5rem;
  flex-shrink: 0;
}

.nav-brand .wordmark {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
  letter-spacing: .08em;
}

.nav-brand .submark {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  color: var(--text-muted);
  letter-spacing: .12em;
}

.spark {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.tab-list {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-list::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  font-weight: 500;
  padding: .75rem .9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  position: relative;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 0 .5rem .75rem;
  border-left: 1px solid var(--border);
  margin-left: auto;
  flex-shrink: 0;
}

.theme-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: .75rem;
  padding: .35rem .65rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.theme-btn:hover { color: var(--text); border-color: var(--orange); }

/* ── Hero ── */
.hero {
  padding: 2.5rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(135deg, var(--bg) 60%, rgba(232,93,4,.04) 100%);
}

.hero-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--orange);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.hero h1 {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--text);
  line-height: 1.2;
  margin-bottom: .5rem;
}

.hero h1 span { color: var(--orange); }

.hero-sub {
  color: var(--text-muted);
  font-size: .9rem;
  max-width: 64ch;
}

/* ── Panel ── */
.panel {
  display: none;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}
.panel.active { display: block; }

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.section-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(232,93,4,.12);
  border: 1px solid rgba(232,93,4,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.section-header h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
}
.section-header p {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

/* ── Grid layouts ── */
.db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ── DB Card ── */
.db-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.db-card:hover { box-shadow: var(--shadow); }

.db-card-header {
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 1px solid var(--border);
}

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

.db-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
}

.db-badge {
  margin-left: auto;
  font-size: .65rem;
  font-family: 'JetBrains Mono', monospace;
  padding: .15rem .45rem;
  border-radius: 4px;
  border: 1px solid;
}

.db-badge.dead {
  color: var(--text-dim);
  border-color: var(--text-dim);
}

.db-badge.external {
  color: var(--orange);
  border-color: rgba(232,93,4,.4);
}

.db-badge.l1 {
  color: var(--teal);
  border-color: rgba(6,182,212,.4);
}

.db-card-body {
  padding: .75rem 1rem;
}

.managed-by {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

.store-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  padding: .1rem .35rem;
  border-radius: 4px;
  background: rgba(255,255,255,.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Table in DB card */
.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}

.schema-table thead th {
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: .3rem .4rem;
  border-bottom: 1px solid var(--border);
}

.schema-table tbody td {
  padding: .3rem .4rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

.schema-table tbody tr:last-child td { border-bottom: none; }

.col-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--text);
}

.col-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  color: var(--text-dim);
}

.col-note {
  font-size: .7rem;
  color: var(--text-muted);
}

.col-badge {
  display: inline-block;
  font-size: .6rem;
  font-family: 'JetBrains Mono', monospace;
  padding: .05rem .3rem;
  border-radius: 3px;
  margin-left: .2rem;
  vertical-align: middle;
}
.col-badge.pk { background: rgba(232,93,4,.15); color: var(--orange); }
.col-badge.fk { background: rgba(6,182,212,.12); color: var(--teal); }
.col-badge.enc { background: rgba(236,72,153,.12); color: var(--pink); }
.col-badge.dep { background: rgba(239,68,68,.12); color: var(--red); }
.col-badge.idx { background: rgba(16,185,129,.12); color: var(--green); }
.col-badge.opt { background: rgba(107,114,128,.12); color: var(--text-muted); }

.table-section-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: .72rem;
  color: var(--text-muted);
  letter-spacing: .06em;
  padding: .4rem .4rem .15rem;
  text-transform: uppercase;
}

.db-desc {
  font-size: .78rem;
  color: var(--text-muted);
  padding: .5rem 0 .25rem;
  line-height: 1.5;
}

/* ── Store comparison table ── */
.comparison-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.comparison-table thead th {
  background: var(--surface);
  text-align: left;
  padding: .7rem 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
}

.comparison-table tbody tr:last-child { border-bottom: none; }
.comparison-table tbody tr:hover { background: rgba(255,255,255,.02); }

.comparison-table tbody td {
  padding: .65rem 1rem;
  vertical-align: top;
}

.ct-store {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.ct-db {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ct-purpose {
  font-size: .78rem;
  color: var(--text);
  max-width: 200px;
}

.ct-pattern {
  font-size: .75rem;
  color: var(--text-muted);
  max-width: 160px;
}

.ct-who {
  font-size: .75rem;
  color: var(--text-muted);
  max-width: 180px;
}

.tag-write {
  display: inline-block;
  font-size: .65rem;
  font-family: 'JetBrains Mono', monospace;
  padding: .08rem .32rem;
  border-radius: 3px;
  background: rgba(232,93,4,.12);
  color: var(--orange);
  margin: .1rem .1rem .1rem 0;
}

.tag-read {
  display: inline-block;
  font-size: .65rem;
  font-family: 'JetBrains Mono', monospace;
  padding: .08rem .32rem;
  border-radius: 3px;
  background: rgba(16,185,129,.1);
  color: var(--green);
  margin: .1rem .1rem .1rem 0;
}

.survive-yes { color: var(--green); }
.survive-warn { color: var(--amber); }
.survive-no { color: var(--red); }

/* ── Swimlane sequence diagram ── */
.swimlane-wrap {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.swimlane {
  min-width: 900px;
}

.swimlane-actors {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  margin-bottom: .5rem;
}

.actor-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  padding: .4rem .3rem;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .67rem;
  color: var(--text);
  line-height: 1.3;
}

.actor-header.platform { border-top: 3px solid var(--discord); }
.actor-header.hub { border-top: 3px solid var(--orange); }
.actor-header.pipeline { border-top: 3px solid var(--amber); }
.actor-header.pool { border-top: 3px solid var(--teal); }
.actor-header.processor { border-top: 3px solid var(--green); }
.actor-header.cli { border-top: 3px solid var(--pink); }
.actor-header.claude { border-top: 3px solid var(--plum); }
.actor-header.outbound { border-top: 3px solid var(--ember); }
.actor-header.stores { border-top: 3px solid var(--text-muted); }

.swimlane-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.swim-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  min-height: 36px;
}

.swim-cell {
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .3rem .2rem;
  position: relative;
}

.swim-cell.active {
  background: var(--surface);
  border-color: var(--border);
}

.swim-cell.arrow-right::after {
  content: '→';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange);
  font-size: .8rem;
  z-index: 2;
}

.swim-cell.arrow-left::before {
  content: '←';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange);
  font-size: .8rem;
  z-index: 2;
}

.swim-label {
  font-size: .67rem;
  font-family: 'Inter', sans-serif;
  text-align: center;
  color: var(--text);
  line-height: 1.3;
}

.swim-label.op-read {
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
}

.swim-label.op-write {
  color: var(--orange);
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
}

.swim-label.op-spawn {
  color: var(--pink);
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
}

.swim-label.op-mem {
  color: var(--plum);
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
}

.swim-row-label {
  font-size: .68rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  padding: .3rem .5rem;
  display: flex;
  align-items: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(232,93,4,.2);
  color: var(--orange);
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  font-weight: 500;
  flex-shrink: 0;
  margin-right: .4rem;
}

/* Simplified flow steps */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
}

.flow-step::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 100%;
  width: 1px;
  height: .5rem;
  background: var(--border);
}
.flow-step:last-child::before { display: none; }

.flow-actor {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 120px;
  padding-top: .1rem;
}

.flow-actor.fa-platform { color: var(--discord); }
.flow-actor.fa-hub { color: var(--orange); }
.flow-actor.fa-pipeline { color: var(--amber); }
.flow-actor.fa-pool { color: var(--teal); }
.flow-actor.fa-processor { color: var(--green); }
.flow-actor.fa-cli { color: var(--pink); }
.flow-actor.fa-claude { color: var(--plum); }
.flow-actor.fa-outbound { color: var(--ember); }

.flow-content {
  flex: 1;
}

.flow-main {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.4;
}

.flow-stores {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .4rem;
}

.store-op {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  padding: .1rem .4rem;
  border-radius: 4px;
}

.store-op.read {
  background: rgba(16,185,129,.1);
  color: var(--green);
  border: 1px solid rgba(16,185,129,.25);
}

.store-op.write {
  background: rgba(232,93,4,.1);
  color: var(--orange);
  border: 1px solid rgba(232,93,4,.25);
}

.store-op.mem {
  background: rgba(168,85,247,.1);
  color: var(--plum);
  border: 1px solid rgba(168,85,247,.25);
}

.store-op.spawn {
  background: rgba(236,72,153,.1);
  color: var(--pink);
  border: 1px solid rgba(236,72,153,.25);
}

/* ── Resume path flowchart ── */
.resume-tree {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.resume-path {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.resume-path-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.path-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: .9rem;
  flex-shrink: 0;
}

.path-num.p1 { background: rgba(6,182,212,.15); color: var(--teal); }
.path-num.p2 { background: rgba(168,85,247,.15); color: var(--plum); }
.path-num.p3 { background: rgba(16,185,129,.15); color: var(--green); }

.resume-path-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
}

.resume-path-subtitle {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

.path-status {
  margin-left: auto;
}

.resume-path-body {
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 760px) {
  .resume-path-body { grid-template-columns: 1fr; }
}

.path-block {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.path-block-label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.path-block-content {
  font-size: .8rem;
  color: var(--text);
  line-height: 1.5;
}

.path-block-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--teal);
  background: rgba(6,182,212,.08);
  padding: .05rem .25rem;
  border-radius: 3px;
}

.warn-block {
  grid-column: 1 / -1;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 6px;
  padding: .5rem .75rem;
  font-size: .78rem;
  color: var(--red);
  display: flex;
  align-items: flex-start;
  gap: .4rem;
}

.ok-block {
  grid-column: 1 / -1;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 6px;
  padding: .5rem .75rem;
  font-size: .78rem;
  color: var(--green);
  display: flex;
  align-items: flex-start;
  gap: .4rem;
}

.resume-status-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.rs-chip {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: var(--text);
}

.rs-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ── Streaming section ── */
.streaming-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stream-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.stream-card-header {
  padding: .6rem .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
}

.stream-type-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  padding: .15rem .45rem;
  border-radius: 4px;
}

.stb-text { background: rgba(6,182,212,.12); color: var(--teal); }
.stb-tool { background: rgba(232,93,4,.12); color: var(--orange); }
.stb-think { background: rgba(168,85,247,.12); color: var(--plum); }
.stb-multi { background: rgba(16,185,129,.12); color: var(--green); }

.stream-card-body {
  padding: .75rem .9rem;
  font-size: .78rem;
  color: var(--text);
  line-height: 1.55;
}

.stream-timeline {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-top: .6rem;
}

.stl-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .72rem;
}

.stl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .2rem;
}

.stl-dot.read { background: var(--green); }
.stl-dot.write { background: var(--orange); }
.stl-dot.flow { background: var(--teal); }
.stl-dot.lock { background: var(--amber); }

.stl-text { color: var(--text-muted); }
.stl-text strong { color: var(--text); font-weight: 500; }

.key-insight {
  background: linear-gradient(135deg, rgba(232,93,4,.08), rgba(249,115,22,.04));
  border: 1px solid rgba(232,93,4,.25);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-top: 1.5rem;
}

.key-insight h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: .9rem;
  color: var(--orange);
  margin-bottom: .5rem;
}

.key-insight ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.key-insight li {
  font-size: .8rem;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
  line-height: 1.45;
}

.key-insight li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--orange);
}

/* ── Architecture assessment ── */
.findings-grid {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 2.5rem;
}

.finding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  gap: 0;
  overflow: hidden;
}

.finding-sev {
  width: 5px;
  flex-shrink: 0;
}
.finding-sev.critical { background: var(--sev-critical); }
.finding-sev.high { background: var(--sev-high); }
.finding-sev.medium { background: var(--sev-medium); }
.finding-sev.low { background: var(--sev-low); }
.finding-sev.fixed { background: var(--sev-fixed); }

.finding-content {
  flex: 1;
  padding: .75rem 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem .75rem;
}

.finding-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: .88rem;
  color: var(--text);
  align-self: center;
}

.finding-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
  align-self: center;
}

.fb-critical { background: rgba(248,113,113,.15); color: var(--sev-critical); }
.fb-high     { background: rgba(249,115,22,.15);  color: var(--sev-high);     }
.fb-medium   { background: rgba(245,158,11,.15);  color: var(--sev-medium);   }
.fb-low      { background: rgba(6,182,212,.12);   color: var(--sev-low);      }
.fb-fixed    { background: rgba(16,185,129,.12);  color: var(--sev-fixed);    }

.finding-desc {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
  grid-column: 1 / -1;
}

.finding-fix {
  grid-column: 1 / -1;
  font-size: .75rem;
  color: var(--green);
  background: rgba(16,185,129,.06);
  border: 1px solid rgba(16,185,129,.18);
  border-radius: 5px;
  padding: .4rem .6rem;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.4;
}

.finding-fix::before { content: '→ Fix: '; opacity: .7; }

/* ── Hexagonal architecture diagram ── */
.hex-section {
  margin-top: 2rem;
}

.hex-section h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.hex-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-x: auto;
}

.hex-diagram svg {
  max-width: 100%;
  height: auto;
}

/* ── Misc utilities ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.subsection-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: .92rem;
  color: var(--text);
  margin: 1.5rem 0 .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.subsection-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.pill {
  display: inline-block;
  font-size: .7rem;
  font-family: 'JetBrains Mono', monospace;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-weight: 500;
}

.pill-green  { background: rgba(16,185,129,.12); color: var(--green); }
.pill-orange { background: rgba(232,93,4,.12);   color: var(--orange); }
.pill-teal   { background: rgba(6,182,212,.12);  color: var(--teal); }
.pill-amber  { background: rgba(245,158,11,.12); color: var(--amber); }
.pill-red    { background: rgba(248,113,113,.12); color: var(--red); }
.pill-plum   { background: rgba(168,85,247,.12); color: var(--plum); }
.pill-gray   { background: rgba(107,114,128,.12); color: var(--text-muted); }

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8em;
  background: rgba(255,255,255,.06);
  padding: .1em .3em;
  border-radius: 3px;
  color: var(--teal);
}

[data-theme="light"] code {
  background: rgba(0,0,0,.06);
}

/* ── 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-dim); }

/* ── Loading state ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  font-size: .85rem;
  gap: .5rem;
}

/* ── Two-col layout ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
  .panel { padding: 1rem; }
}
