/* Database page — waterfall-enrichment content ported from the Claude Design
   handoff, restyled onto the .apl design system (Geist, landing tokens). Static
   only (no scroll-JS), blue/green/orange token accents — no design-purple. */

/* ── Hero: copy + live search panel ── */
.apl .db-hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; margin-top: 8px; }
@media (max-width: 900px) { .apl .db-hero-grid { grid-template-columns: 1fr; gap: 32px; } }
.apl .db-search { border: 1px solid var(--line); background: var(--bg-1); border-radius: var(--radius-lg); padding: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.45); }
.apl .db-search-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.apl .db-search-bar .ic { color: var(--accent-2); }
.apl .db-search-bar .q { color: var(--fg-2); font-size: 0.9rem; }
.apl .db-search-bar .matches { margin-left: auto; font-family: "Geist Mono", monospace; font-size: 0.72rem; color: var(--ok); }
.apl .db-rows { display: flex; flex-direction: column; gap: 9px; }
.apl .db-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.apl .db-row .av { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--bg-1); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-family: "Geist Mono", monospace; font-size: 0.7rem; color: var(--fg-3); }
.apl .db-row .nm { font-size: 0.88rem; font-weight: 600; color: var(--fg); }
.apl .db-row .role { font-size: 0.76rem; color: var(--fg-3); }
.apl .db-row .tag { margin-left: auto; font-family: "Geist Mono", monospace; font-size: 0.66rem; color: var(--fg-3); background: var(--bg-1); border: 1px solid var(--line-2); padding: 4px 9px; border-radius: 999px; white-space: nowrap; }

/* ── Capability marquee strip ── */
.apl .db-marquee { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px; margin-top: 44px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: "Geist Mono", monospace; font-size: 0.8rem; color: var(--fg-3); }
.apl .db-marquee .sep { color: var(--accent-2); }

/* ── Waterfall enrichment ── */
.apl .wf-grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 22px; margin-top: 32px; align-items: stretch; }
@media (max-width: 900px) { .apl .wf-grid { grid-template-columns: 1fr; } }
.apl .wf-record, .apl .wf-pipe { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.apl .wf-record { background: var(--bg-1); }
.apl .wf-rec-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.apl .wf-rec-head .av { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--accent-2); display: flex; align-items: center; justify-content: center; font-family: "Geist Mono", monospace; font-weight: 600; color: var(--bg); }
.apl .wf-rec-head .nm { font-size: 1.05rem; font-weight: 600; color: var(--fg); }
.apl .wf-rec-head .role { font-size: 0.8rem; color: var(--fg-3); }
.apl .wf-rec-head .cov { margin-left: auto; font-family: "Geist Mono", monospace; font-size: 0.66rem; color: var(--ok); background: rgba(132,225,164,0.1); border: 1px solid rgba(132,225,164,0.3); padding: 5px 10px; border-radius: 999px; }
.apl .wf-fields { display: flex; flex-direction: column; gap: 10px; }
.apl .wf-field { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 12px; background: rgba(132,225,164,0.05); border: 1px solid rgba(132,225,164,0.22); }
.apl .wf-field .k { font-family: "Geist Mono", monospace; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); width: 84px; flex: none; }
.apl .wf-field .v { font-family: "Geist Mono", monospace; font-size: 0.85rem; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apl .wf-field .ck { margin-left: auto; color: var(--ok); flex: none; }
.apl .wf-bar-label { display: flex; justify-content: space-between; font-family: "Geist Mono", monospace; font-size: 0.7rem; color: var(--fg-3); margin: 18px 0 8px; }
.apl .wf-bar-label .pct { color: var(--accent-2); }
.apl .wf-bar { height: 8px; border-radius: 8px; background: var(--bg-2); overflow: hidden; }
.apl .wf-bar > span { display: block; height: 100%; width: 100%; background: var(--ok); }

.apl .wf-pipe { background: var(--bg-2); }
.apl .wf-pipe-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-family: "Geist Mono", monospace; font-size: 0.7rem; }
.apl .wf-pipe-head .ttl { letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); }
.apl .wf-pipe-head .stats { display: flex; gap: 14px; color: var(--fg-3); }
.apl .wf-pipe-head .stats b { color: var(--fg); }
.apl .wf-pipe-head .stats .hit b { color: var(--ok); }
.apl .wf-src { display: flex; align-items: center; gap: 13px; padding: 9px 0; }
.apl .wf-src .node { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; color: var(--fg-4); }
.apl .wf-src.hit .node { background: rgba(132,225,164,0.13); border-color: rgba(132,225,164,0.45); color: var(--ok); }
.apl .wf-src .nm { font-family: "Geist Mono", monospace; font-size: 0.8rem; color: var(--fg-3); }
.apl .wf-src.hit .nm { color: var(--ok); }
.apl .wf-src .tgt { font-size: 0.72rem; color: var(--fg-4); }
.apl .wf-src .badge { margin-left: auto; font-family: "Geist Mono", monospace; font-size: 0.64rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg-3); white-space: nowrap; }
.apl .wf-src.hit .badge { color: var(--ok); background: rgba(132,225,164,0.1); border-color: rgba(132,225,164,0.3); }
.apl .wf-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-family: "Geist Mono", monospace; font-size: 0.72rem; color: var(--ok); line-height: 1.5; }

/* ── Provider grid + legend ── */
.apl .prov-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 12px; margin-top: 32px; }
@media (max-width: 820px) { .apl .prov-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 480px) { .apl .prov-grid { grid-template-columns: repeat(2,1fr); } }
.apl .prov { border: 1px solid var(--line); background: var(--bg-1); border-radius: 14px; padding: 13px; display: flex; flex-direction: column; gap: 14px; min-height: 88px; }
.apl .prov-top { display: flex; align-items: center; justify-content: space-between; }
.apl .prov-dot { width: 9px; height: 9px; border-radius: 3px; }
.apl .prov-dot.blue { background: var(--accent-2); }
.apl .prov-dot.green { background: var(--ok); }
.apl .prov-dot.orange { background: var(--warn); }
.apl .prov-id { font-family: "Geist Mono", monospace; font-size: 0.6rem; color: var(--fg-4); }
.apl .prov .nm { font-family: "Geist Mono", monospace; font-size: 0.72rem; color: var(--fg-2); }
.apl .prov .cat { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-4); margin-top: 3px; }
.apl .cat-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.apl .cat-chip { display: inline-flex; align-items: center; gap: 9px; font-size: 0.82rem; color: var(--fg-2); padding: 8px 14px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 999px; }
.apl .cat-chip .d { width: 8px; height: 8px; border-radius: 2px; }
.apl .cat-chip .c { font-family: "Geist Mono", monospace; font-size: 0.7rem; color: var(--fg-4); }

/* ── Stats row ── */
.apl .db-stats { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--bg-1); margin-top: 8px; }
@media (max-width: 720px) { .apl .db-stats { grid-template-columns: repeat(2,1fr); } }
.apl .db-stat { padding: 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.apl .db-stat .big { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 600; color: var(--fg); letter-spacing: -0.02em; line-height: 1; }
.apl .db-stat .lbl { font-size: 0.82rem; color: var(--fg-3); margin-top: 8px; }
