:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #64748b;
  --line: #d9e2ec;
  --panel: #ffffff;
  --soft: #f7fafc;
  --bg: #fffdf8;
  --green: #0f766e;
  --blue: #2563eb;
  --amber: #a16207;
  --red: #b42318;
  --violet: #6d28d9;
  --shadow: 0 16px 46px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; letter-spacing: 0; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef7f3 0, rgba(238,247,243,0) 330px),
    linear-gradient(115deg, rgba(37,99,235,.08), rgba(15,118,110,.09) 44%, rgba(162,98,7,.08)),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }

.site-header, main, .site-footer {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand { color: var(--ink); font-weight: 850; }
.navlinks { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.navlinks a { color: #334155; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: end;
  padding: 46px 0 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  text-transform: uppercase;
  font-weight: 850;
  font-size: 12px;
}

h1 {
  margin: 0;
  max-width: 940px;
  font-size: 58px;
  line-height: 1.04;
}

.lede {
  max-width: 760px;
  color: #334155;
  font-size: 18px;
  line-height: 1.62;
}

.stat-panel, .quick-stats {
  display: grid;
  gap: 10px;
}

.stat-panel {
  background: rgba(255, 255, 255, .84);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.stat-panel div, .quick-stats div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  background: var(--soft);
  border: 1px solid #e5edf5;
  border-radius: 6px;
  padding: 10px 12px;
}

.stat-panel strong, .quick-stats strong { color: var(--green); font-size: 28px; }
.stat-panel span, .quick-stats span { color: var(--muted); font-size: 13px; text-align: right; }

.quick-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 4px 0 16px;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
  backdrop-filter: blur(10px);
}

label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 780; }
.search { grid-column: span 2; }
input, select, button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
}
button { cursor: pointer; font-weight: 800; color: var(--green); }

.track-section, .path-section, .results-head {
  margin: 20px 0 12px;
}

.section-head, .results-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

h2 { margin: 0; font-size: 22px; }
.section-head p, .results-head p { margin: 0; color: var(--muted); }

.track-tabs, .path-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 8px;
}

.track-tabs button, .path-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  color: #334155;
}
.track-tabs button.active, .path-tabs button.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.track-assistant,
.filter-assistant {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(239,246,255,.94), rgba(240,253,250,.92)),
    #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
  padding: 14px;
}

.track-assistant span,
.filter-assistant span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.track-assistant strong,
.filter-assistant strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.track-assistant p,
.filter-assistant p {
  margin: 4px 0 0;
  color: #334155;
  line-height: 1.45;
}

.assistant-actions,
.ask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-actions a,
.filter-assistant a,
.ask-action {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 7px 16px rgba(15, 23, 42, .07);
  font-size: 13px;
  font-weight: 850;
  padding: 9px 11px;
  white-space: nowrap;
}

.assistant-actions .primary,
.filter-assistant a,
.ask-action.explain {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.ask-action.audit {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.ask-action.compare {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.path-panel {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.path-panel h3 { margin: 0 0 6px; }
.path-panel p { color: #334155; line-height: 1.5; }
.path-panel ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.path-panel li {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #e5edf5;
  border-radius: 6px;
  background: var(--soft);
  padding: 10px;
}
.path-panel strong { overflow-wrap: anywhere; }
.path-panel small { color: var(--muted); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  padding-bottom: 40px;
}

.entry-card {
  display: grid;
  gap: 11px;
  min-height: 330px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.entry-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.27;
  overflow-wrap: anywhere;
}

.meta { color: var(--muted); font-size: 13px; }
.summary, .why { margin: 0; color: #334155; line-height: 1.5; }
.why { border-left: 3px solid #dbeafe; padding-left: 10px; }

.facts {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 10px;
  border: 1px solid #e5edf5;
  border-radius: 6px;
  background: #fbfdff;
}

.facts div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
}

.facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.facts dd {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tags, .links { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 8px;
  color: #334155;
  background: #f8fafc;
  font-size: 12px;
}
.tag.verified, .tag.L4_carded, .tag.L5_audit_ready { color: var(--green); background: #ecfdf5; border-color: #bbf7d0; }
.tag.needs, .tag.L0_seeded { color: var(--amber); background: #fffbeb; border-color: #fde68a; }
.tag.partial { color: var(--blue); background: #eff6ff; border-color: #bfdbfe; }

.links { margin-top: auto; }
.links a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}

.ask-actions {
  border-top: 1px solid #eef2f7;
  padding-top: 10px;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 24px;
}

.site-footer {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 22px 0 36px;
  color: var(--muted);
  font-size: 14px;
}

.floating-ask {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  border: 1px solid rgba(15, 118, 110, .22);
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .18);
  font-weight: 900;
  padding: 12px 15px;
}

.floating-ask:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.ask-entry-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: end;
  padding: 46px 0 28px;
}

.ask-entry-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.ask-entry-actions a {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
  font-weight: 850;
}

.ask-entry-actions .primary-link {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.ask-context-preview {
  display: grid;
  gap: 6px;
  max-width: 680px;
  margin-top: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: rgba(239, 246, 255, .82);
  padding: 12px 14px;
}

.ask-context-preview span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ask-context-preview strong {
  overflow-wrap: anywhere;
}

.ask-context-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.ask-entry-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 14px;
}

.ask-entry-steps article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.86);
  padding: 16px;
}

.ask-entry-steps span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.ask-entry-steps strong {
  display: block;
  margin: 5px 0 6px;
  font-size: 17px;
}

.ask-entry-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.ask-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 44px;
}

.ask-entry-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  padding: 18px;
}

.ask-entry-grid li {
  margin: 8px 0;
  color: #334155;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .ask-entry-hero { grid-template-columns: 1fr; padding-top: 28px; }
  h1 { font-size: 42px; }
  .quick-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { position: static; grid-template-columns: 1fr 1fr; }
  .section-head, .results-head { align-items: flex-start; flex-direction: column; }
  .track-assistant, .filter-assistant { grid-template-columns: 1fr; }
  .assistant-actions a, .filter-assistant a, .ask-action { white-space: normal; }
}

@media (max-width: 540px) {
  .site-header, main, .site-footer { width: min(100% - 20px, 1200px); }
  .topbar { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 34px; }
  .quick-stats, .controls { grid-template-columns: 1fr; }
  .ask-entry-steps { grid-template-columns: 1fr; }
  .ask-entry-grid { grid-template-columns: 1fr; }
  .floating-ask { left: 12px; right: 12px; text-align: center; }
}
