/* ── AP003 AI Architect Auditor — Enterprise Design ─────────────────────────── */

:root {
  --ap3-indigo:    #6366f1;
  --ap3-indigo-d:  #4f46e5;
  --ap3-indigo-l:  #818cf8;
  --ap3-cyan:      #22d3ee;
  --ap3-bg:        #0b0f1a;
  --ap3-bg-card:   #111827;
  --ap3-bg-card2:  #1a2235;
  --ap3-border:    rgba(99,102,241,0.18);
  --ap3-text:      #f1f5f9;
  --ap3-text-muted:#94a3b8;
  --ap3-text-dim:  #64748b;
  --ap3-risk-low:  #22c55e;
  --ap3-risk-mod:  #f59e0b;
  --ap3-risk-high: #f97316;
  --ap3-risk-crit: #ef4444;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.ap003-page {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--ap3-bg);
  color: var(--ap3-text);
  -webkit-font-smoothing: antialiased;
}

.ap003-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section base ─────────────────────────────────────────────────────────── */
.ap003-section {
  padding: 96px 0;
}
.ap003-section-dark {
  background: var(--ap3-bg-card);
  border-top:    1px solid var(--ap3-border);
  border-bottom: 1px solid var(--ap3-border);
}
.ap003-section-chat {
  background: linear-gradient(180deg, var(--ap3-bg) 0%, #0d1425 100%);
  border-top: 1px solid var(--ap3-border);
}
.ap003-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ap3-indigo-l);
  margin-bottom: 12px;
}
.ap003-section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}
.ap003-section-sub {
  font-size: 17px;
  color: var(--ap3-text-muted);
  max-width: 680px;
  line-height: 1.65;
  margin-bottom: 56px;
}

.ap003-engine-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.ap003-engine-stat {
  background: var(--ap3-bg-card2);
  border: 1px solid var(--ap3-border);
  border-radius: 14px;
  padding: 20px;
}
.ap003-engine-stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--ap3-cyan);
  line-height: 1.1;
  margin-bottom: 6px;
}
.ap003-engine-stat-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ap3-text);
  margin-bottom: 6px;
}
.ap003-engine-stat-detail {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ap3-text-dim);
}
.ap003-engine-subtitle {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--ap3-text);
}
.ap003-bottleneck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.ap003-bottleneck-card {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid var(--ap3-border);
  border-radius: 12px;
  padding: 16px 18px;
}
.ap003-bottleneck-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ap3-indigo-l);
  margin: 0 0 8px;
}
.ap003-bottleneck-card p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ap3-text-muted);
  margin: 0;
}
.ap003-engine-footnote {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ap3-text-dim);
  margin: 0;
  max-width: 760px;
}
.ap003-engine-footnote code,
.ap003-section-sub code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: var(--ap3-cyan);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.ap003-hero {
  position: relative;
  padding: 130px 0 100px;
  overflow: hidden;
  border-bottom: 1px solid var(--ap3-border);
}
.ap003-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,0.22) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(34,211,238,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.ap003-hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ap3-indigo-l);
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 100px;
  padding: 6px 16px;
  margin-bottom: 28px;
}
.ap003-hero-title {
  font-size: clamp(36px, 5.5vw, 68px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin-bottom: 24px;
}
.ap003-gradient-text {
  background: linear-gradient(135deg, var(--ap3-indigo-l) 0%, var(--ap3-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ap003-hero-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ap3-text-muted);
  max-width: 620px;
  line-height: 1.65;
  margin-bottom: 40px;
}
.ap003-hero-cta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.ap003-hero-trust {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ap3-text-dim);
  flex-wrap: wrap;
}
.ap003-trust-pill {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--ap3-text-muted);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.ap003-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--ap3-indigo);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .12s, box-shadow .15s;
  text-decoration: none;
  font-family: inherit;
  box-shadow: 0 0 0 0 rgba(99,102,241,0);
}
.ap003-btn-primary:hover {
  background: var(--ap3-indigo-d);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}
.ap003-btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  color: var(--ap3-text-muted);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.ap003-btn-ghost:hover {
  color: var(--ap3-text);
  border-color: rgba(255,255,255,0.25);
}
.ap003-btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }

/* ── RCM Level progression ────────────────────────────────────────────────── */
.ap003-levels {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.ap003-level {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ap3-bg-card);
  border: 1px solid var(--ap3-border);
  border-radius: 12px;
  padding: 16px 20px;
  flex: 1;
  min-width: 160px;
}
.ap003-level-active {
  border-color: rgba(99,102,241,0.5);
  background: rgba(99,102,241,0.08);
}
.ap003-level-future {
  border-color: rgba(34,211,238,0.25);
  background: rgba(34,211,238,0.04);
}
.ap003-level-num {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--ap3-indigo-l);
  background: rgba(99,102,241,0.15);
  border-radius: 6px;
  padding: 4px 8px;
  white-space: nowrap;
}
.ap003-level-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}
.ap003-level-sub {
  font-size: 12px;
  color: var(--ap3-text-muted);
}
.ap003-level-sub em { color: var(--ap3-indigo-l); font-style: normal; }
.ap003-level-arrow {
  color: var(--ap3-text-dim);
  font-size: 20px;
  flex-shrink: 0;
}

/* ── Delta formula card ───────────────────────────────────────────────────── */
.ap003-formula-card {
  background: var(--ap3-bg-card);
  border: 1px solid var(--ap3-border);
  border-radius: 16px;
  padding: 32px 40px;
  margin-bottom: 56px;
  text-align: center;
}
.ap003-formula-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ap3-text-dim);
  margin-bottom: 16px;
}
.ap003-formula {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  font-family: 'Georgia', serif;
  color: var(--ap3-text);
  margin-bottom: 20px;
  letter-spacing: .03em;
}
.ap003-formula-rules {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.ap003-formula-rule {
  font-size: 13px;
  font-family: 'Georgia', serif;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid;
}
.ap003-formula-rule.risk-high {
  color: var(--ap3-risk-high);
  border-color: rgba(249,115,22,0.25);
  background: rgba(249,115,22,0.06);
}
.ap003-formula-rule.risk-low {
  color: var(--ap3-risk-low);
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.06);
}

/* ── 5 Vectors ────────────────────────────────────────────────────────────── */
.ap003-vectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.ap003-vector-card {
  background: var(--ap3-bg-card);
  border: 1px solid var(--ap3-border);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  transition: border-color .15s, transform .15s;
}
.ap003-vector-card:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-2px);
}
.ap003-vector-icon { font-size: 28px; margin-bottom: 8px; }
.ap003-vector-label {
  font-size: 22px;
  font-weight: 800;
  color: var(--ap3-indigo-l);
  margin-bottom: 4px;
}
.ap003-vector-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ap003-vector-desc {
  font-size: 12px;
  color: var(--ap3-text-dim);
  line-height: 1.5;
}

/* ── Comparison table ─────────────────────────────────────────────────────── */
.ap003-compare-table {
  border: 1px solid var(--ap3-border);
  border-radius: 16px;
  overflow: hidden;
}
.ap003-compare-header,
.ap003-compare-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 0;
}
.ap003-compare-header {
  background: rgba(99,102,241,0.1);
  border-bottom: 1px solid var(--ap3-border);
}
.ap003-compare-col-label,
.ap003-compare-col-a,
.ap003-compare-col-b,
.ap003-compare-feature,
.ap003-compare-a,
.ap003-compare-b {
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.5;
  border-right: 1px solid var(--ap3-border);
}
.ap003-compare-col-label:last-child,
.ap003-compare-col-b,
.ap003-compare-b { border-right: none; }
.ap003-compare-col-a {
  font-weight: 700;
  color: var(--ap3-text-muted);
}
.ap003-compare-col-b {
  font-weight: 700;
  color: var(--ap3-indigo-l);
}
.ap003-compare-row {
  border-bottom: 1px solid var(--ap3-border);
}
.ap003-compare-row:last-child { border-bottom: none; }
.ap003-compare-feature {
  font-size: 12px;
  font-weight: 700;
  color: var(--ap3-text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(0,0,0,0.15);
}
.ap003-compare-a { color: var(--ap3-text-muted); }
.ap003-compare-b {
  color: var(--ap3-text);
  background: rgba(99,102,241,0.04);
}

/* ── Steps ────────────────────────────────────────────────────────────────── */
.ap003-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.ap003-step {
  flex: 1;
  padding: 32px 28px;
  background: var(--ap3-bg-card);
  border: 1px solid var(--ap3-border);
  border-radius: 16px;
}
.ap003-step-connector {
  flex-shrink: 0;
  width: 40px;
  height: 2px;
  background: var(--ap3-border);
  align-self: center;
  margin: 0 -4px;
}
.ap003-step-num {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--ap3-indigo-l);
  margin-bottom: 12px;
}
.ap003-step-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}
.ap003-step-desc {
  font-size: 14px;
  color: var(--ap3-text-muted);
  line-height: 1.6;
}

/* ── Access gate ──────────────────────────────────────────────────────────── */
.ap003-gate {
  display: flex;
  justify-content: center;
}
.ap003-gate-card {
  background: var(--ap3-bg-card);
  border: 1px solid var(--ap3-border);
  border-radius: 20px;
  padding: 48px 56px;
  text-align: center;
  max-width: 480px;
  width: 100%;
}
.ap003-gate-icon { font-size: 40px; margin-bottom: 20px; }
.ap003-gate-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
}
.ap003-gate-desc {
  font-size: 14px;
  color: var(--ap3-text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}
.ap003-gate-desc a { color: var(--ap3-indigo-l); }
.ap003-gate-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--ap3-text);
  font-family: inherit;
  margin-bottom: 16px;
  outline: none;
  transition: border-color .15s;
}
.ap003-gate-input:focus { border-color: var(--ap3-indigo); }
.ap003-gate-error {
  font-size: 13px;
  color: var(--ap3-risk-crit);
  margin-top: 10px;
  min-height: 18px;
}

/* ── Chat shell ───────────────────────────────────────────────────────────── */
.ap003-chat-shell { max-width: 1060px; margin: 0 auto; }
.ap003-chat-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.ap003-chat-panel {
  background: var(--ap3-bg-card);
  border: 1px solid var(--ap3-border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ap003-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--ap3-border);
  background: rgba(0,0,0,0.2);
}
.ap003-chat-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.ap003-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ap3-risk-low);
  box-shadow: 0 0 6px var(--ap3-risk-low);
  animation: ap3-pulse 2s infinite;
}
@keyframes ap3-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.ap003-messages {
  flex: 1;
  min-height: 460px;
  max-height: 560px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.ap003-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ap003-msg-user { flex-direction: row-reverse; }
.ap003-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.ap003-msg-user .ap003-msg-avatar {
  background: var(--ap3-indigo);
  color: #fff;
}
.ap003-msg-ai .ap003-msg-avatar {
  background: rgba(34,211,238,0.15);
  color: var(--ap3-cyan);
  border: 1px solid rgba(34,211,238,0.25);
}
.ap003-msg-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.65;
}
.ap003-msg-user .ap003-msg-bubble {
  background: var(--ap3-indigo);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ap003-msg-ai .ap003-msg-bubble {
  background: var(--ap3-bg-card2);
  border: 1px solid var(--ap3-border);
  color: var(--ap3-text);
  border-bottom-left-radius: 4px;
}
.ap003-msg-bubble p { margin: 0 0 8px; }
.ap003-msg-bubble p:last-child { margin-bottom: 0; }
.ap003-msg-bubble strong { color: var(--ap3-text); }
.ap003-msg-bubble code {
  background: rgba(0,0,0,0.3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}
.ap003-msg-bubble ul, .ap003-msg-bubble ol {
  padding-left: 20px;
  margin: 6px 0;
}
.ap003-msg-bubble hr {
  border: none;
  border-top: 1px solid var(--ap3-border);
  margin: 10px 0;
}
.ap003-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.ap003-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ap3-indigo-l);
  animation: ap3-bounce 1.2s infinite;
}
.ap003-typing span:nth-child(2) { animation-delay: .2s; }
.ap003-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ap3-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}
.ap003-input-row {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--ap3-border);
  background: rgba(0,0,0,0.15);
}
.ap003-textarea {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ap3-text);
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color .15s;
  line-height: 1.5;
}
.ap003-textarea:focus { border-color: var(--ap3-indigo); }
.ap003-btn-send {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--ap3-indigo);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background .15s;
}
.ap003-btn-send:hover { background: var(--ap3-indigo-d); }
.ap003-btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Risk panel ───────────────────────────────────────────────────────────── */
.ap003-risk-panel {
  background: var(--ap3-bg-card);
  border: 1px solid var(--ap3-border);
  border-radius: 20px;
  padding: 24px;
  position: sticky;
  top: 80px;
}
.ap003-risk-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ap3-text-dim);
  margin-bottom: 20px;
}
.ap003-score-display { text-align: center; margin-bottom: 24px; }
.ap003-score-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}
.ap003-score-ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}
.ap003-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 8;
}
.ap003-ring-fill {
  fill: none;
  stroke: var(--ap3-indigo);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1), stroke .3s;
}
.ap003-score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ap003-score-num {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}
.ap003-score-tier {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ap3-text-dim);
  margin-top: 3px;
}
.ap003-vectors-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.ap003-vec-row {
  display: grid;
  grid-template-columns: 90px 1fr 32px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.ap003-vec-label { color: var(--ap3-text-muted); font-weight: 600; }
.ap003-vec-bar-wrap {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  overflow: hidden;
}
.ap003-vec-bar {
  height: 100%;
  width: 0%;
  background: var(--ap3-indigo);
  border-radius: 100px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.ap003-vec-val {
  text-align: right;
  color: var(--ap3-text-dim);
  font-weight: 600;
  font-size: 11px;
}
.ap003-delta-display {
  border-top: 1px solid var(--ap3-border);
  padding-top: 16px;
  margin-bottom: 16px;
  text-align: center;
}
.ap003-delta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ap3-text-dim);
  margin-bottom: 6px;
}
.ap003-delta-val {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Georgia', serif;
}
.ap003-bottleneck-display {
  background: rgba(249,115,22,0.06);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 10px;
  padding: 14px;
}
.ap003-bn-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ap3-risk-high);
  margin-bottom: 6px;
}
.ap003-bn-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ap003-bn-mitigation {
  font-size: 12px;
  color: var(--ap3-text-muted);
  line-height: 1.5;
}

/* ── Insight IT Libraries section ────────────────────────────────────────── */
.ap003-libs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.ap003-lib-card {
  background: var(--ap3-bg-card2);
  border: 1px solid var(--ap3-border);
  border-radius: 18px;
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .18s, transform .18s;
}
.ap003-lib-card:hover {
  border-color: rgba(99,102,241,0.45);
  transform: translateY(-3px);
}
.ap003-lib-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ap003-lib-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(99,102,241,0.12);
  padding: 4px;
  flex-shrink: 0;
  object-fit: contain;
}
.ap003-lib-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.ap003-lib-badge--lang {
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
}
.ap003-lib-badge--rag {
  background: rgba(34,211,238,0.12);
  color: #67e8f9;
  border: 1px solid rgba(34,211,238,0.25);
}
.ap003-lib-badge--res {
  background: rgba(52,211,153,0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.25);
}
.ap003-lib-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ap3-text);
}
.ap003-lib-desc {
  font-size: 13px;
  color: var(--ap3-text-muted);
  line-height: 1.65;
  flex: 1;
}
.ap003-lib-desc code {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 11.5px;
  background: rgba(99,102,241,0.12);
  color: var(--ap3-indigo-l);
  padding: 1px 5px;
  border-radius: 4px;
}
.ap003-lib-link {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ap3-indigo-l);
  text-decoration: none;
  margin-top: 4px;
  transition: color .15s;
}
.ap003-lib-link:hover { color: var(--ap3-cyan); }
.ap003-libs-note {
  font-size: 12.5px;
  color: var(--ap3-text-dim);
  border-top: 1px solid var(--ap3-border);
  padding-top: 20px;
  line-height: 1.55;
}

/* ── Use cases ────────────────────────────────────────────────────────────── */
.ap003-usecases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.ap003-usecase {
  background: var(--ap3-bg-card);
  border: 1px solid var(--ap3-border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: border-color .15s, transform .15s;
}
.ap003-usecase:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-2px);
}
.ap003-uc-icon { font-size: 28px; margin-bottom: 14px; }
.ap003-uc-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.ap003-uc-desc { font-size: 13px; color: var(--ap3-text-muted); line-height: 1.6; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.ap003-footer {
  background: var(--ap3-bg-card);
  border-top: 1px solid var(--ap3-border);
  padding: 48px 0 32px;
}
.ap003-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 24px;
}
.ap003-footer-logo {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}
.ap003-footer-tagline {
  font-size: 13px;
  color: var(--ap3-text-dim);
}
.ap003-footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.ap003-footer-links a {
  font-size: 14px;
  color: var(--ap3-text-muted);
  text-decoration: none;
  transition: color .15s;
}
.ap003-footer-links a:hover { color: var(--ap3-text); }
.ap003-footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--ap3-border);
  font-size: 12px;
  color: var(--ap3-text-dim);
}

/* ── Report message ───────────────────────────────────────────────────────── */
.ap003-report-card {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 14px;
  padding: 20px;
  margin-top: 4px;
}
.ap003-report-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}
.ap003-report-card td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ap003-report-card td:first-child { color: var(--ap3-text-dim); }
.ap003-report-card td:last-child { font-weight: 600; text-align: right; }

/* ── Risk tier colours ────────────────────────────────────────────────────── */
.ap003-tier-LOW    { color: var(--ap3-risk-low);  }
.ap003-tier-MODERATE { color: var(--ap3-risk-mod); }
.ap003-tier-HIGH   { color: var(--ap3-risk-high); }
.ap003-tier-CRITICAL { color: var(--ap3-risk-crit); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ap003-chat-layout { grid-template-columns: 1fr; }
  .ap003-risk-panel  { position: static; }
  .ap003-compare-header,
  .ap003-compare-row  { grid-template-columns: 1fr 1fr; }
  .ap003-compare-feature { display: none; }
  .ap003-compare-col-label { display: none; }
  .ap003-steps { flex-direction: column; }
  .ap003-step-connector { width: 2px; height: 24px; align-self: center; margin: -4px 0; }
  .ap003-libs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ap003-hero-title { font-size: 32px; }
  .ap003-levels { flex-direction: column; }
  .ap003-level-arrow { transform: rotate(90deg); align-self: center; }
  .ap003-gate-card { padding: 32px 24px; }
  .ap003-compare-header,
  .ap003-compare-row { grid-template-columns: 1fr; }
  .ap003-compare-col-a,
  .ap003-compare-a   { border-top: 1px solid var(--ap3-border); }
  .ap003-lib-card { padding: 22px 18px; }
}
