:root {
  --ink: #1d2420;
  --muted: #647067;
  --paper: #f5efe4;
  --panel: #fffaf1;
  --line: #e0d4bf;
  --green: #256f4f;
  --gold: #b86f17;
  --red: #9c3328;
  --shadow: 0 24px 80px rgba(44, 35, 22, 0.13);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(184,111,23,.18), transparent 34rem),
    linear-gradient(135deg, #f8f1e5 0%, #ece0cc 45%, #f7f4eb 100%);
  min-height: 100vh;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--line);
  background: rgba(255,250,241,.78); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; letter-spacing: .02em; color: var(--ink); }
nav { display: flex; gap: 18px; align-items: center; }
button, .button {
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px;
  background: var(--panel); color: var(--ink); cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.primary { background: var(--green); color: white; border-color: var(--green); }
.inline-form { display: inline; }
.inline-form button { padding: 0; border: 0; background: transparent; color: var(--green); }
.shell { width: min(1280px, calc(100% - 32px)); margin: 28px auto 80px; }
.hero, .page-heading {
  display: flex; justify-content: space-between; gap: 28px; align-items: center;
  padding: 34px; border-radius: 30px; background: rgba(255,250,241,.86); box-shadow: var(--shadow);
}
.hero h1, .page-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 4rem); line-height: .95; max-width: 850px; }
.hero p, .page-heading p { color: var(--muted); max-width: 720px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .76rem; color: var(--gold); font-weight: 800; }
.grid { display: grid; gap: 22px; margin-top: 24px; }
.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.panel, .auth-card {
  background: rgba(255,250,241,.92); border: 1px solid var(--line); border-radius: 24px;
  padding: 24px; box-shadow: 0 12px 36px rgba(44, 35, 22, .08);
}
.narrow, .auth-card { max-width: 720px; margin: 0 auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
td, th { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td span, .lead-card span, .task span { display: block; color: var(--muted); font-size: .88rem; margin-top: 3px; }
.lead-card, .task, .note {
  display: block; padding: 14px; border: 1px solid var(--line); border-radius: 18px;
  background: rgba(255,255,255,.42); margin: 10px 0;
}
.integration-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.integration-card p { color: var(--muted); margin: 6px 0; }
.small { color: var(--muted); font-size: .84rem; }
.integration-card code {
  display: inline-flex;
  background: rgba(29,36,32,.08);
  border-radius: 10px;
  padding: 5px 8px;
}
.ok { background: #dff1e7; color: var(--green); }
.steps li { margin: 10px 0; }
.score-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 20px 0;
}
.score-strip div {
  background: var(--ink); color: white; padding: 18px; border-radius: 20px;
}
.score-strip span { display: block; opacity: .7; font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; }
.score-strip strong { font-size: 1.35rem; }
.filter-panel { margin: 22px 0; }
.enrichment-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr);
  gap: 20px;
  align-items: end;
  margin: 22px 0;
}
.enrichment-panel h2 { margin-top: 0; }
.enrichment-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}
.filter-grid label:first-child { grid-column: span 2; }
.filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.checkline {
  align-self: center;
  grid-template-columns: auto 1fr !important;
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.checkline input { width: auto; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.table-meta { color: var(--muted); margin-bottom: 12px; }
.external-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.form-card p { display: grid; gap: 6px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px;
  background: white; color: var(--ink); font: inherit;
}
.pill {
  display: inline-flex; border-radius: 999px; padding: 4px 9px; margin: 2px;
  background: #eef1ea; color: var(--ink); font-size: .75rem;
}
.danger { background: #f4dfdb; color: var(--red); }
.warn { background: #faedcf; color: #81500f; }
.message { padding: 12px 16px; border-radius: 16px; background: #e9f3ec; margin-bottom: 16px; }
.callout { background: #fff4dc; border: 1px solid #efd397; border-radius: 16px; padding: 14px; }
pre { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.vendor { padding: 8px 0; color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: 10px; align-items: center; }
.pagination { display: flex; justify-content: center; gap: 16px; padding-top: 18px; }

@media (max-width: 860px) {
  .topbar, .hero, .page-heading { flex-direction: column; align-items: flex-start; }
  .two, .score-strip, .filter-grid, .enrichment-panel { grid-template-columns: 1fr; }
  table { font-size: .84rem; }
}

@media print {
  .topbar, .print-hide { display: none; }
  body { background: white; }
  .shell { width: 100%; margin: 0; }
  .panel { box-shadow: none; border: 0; }
}
