/* ===========================================================================
   CABBI Data Hub — design system
   ---------------------------------------------------------------------------
   Built on the CABBI brand palette (COLORPALETTE-2). The center's mark is three
   interleaved leaf/flame forms in green, olive and gold on a charcoal wordmark,
   so the page language follows it: warm paper rather than cool grey, soft large
   radii rather than square panels, hairline warm borders rather than shadows,
   and the three brand colors used as a repeating signal (the tri-color rule at
   the top of every page, the research-theme badges, the accent underlines).

   Class names are kept stable from the previous stylesheet — .wrap, .stat,
   .card, table.grid, dl.meta, .filters, .badge and friends all still exist, so
   every existing template re-skins rather than breaks.
   =========================================================================== */

:root {
  /* --- CABBI brand palette, verbatim from the style guide ---------------- */
  --cabbi-green:      #007f3d;   /* primary  — the mark's leading leaf       */
  --cabbi-green-mid:  #3ba459;
  --cabbi-olive:      #8ead3e;   /* the mark's middle leaf                   */
  --cabbi-teal:       #00a996;
  --cabbi-teal-deep:  #1a8476;
  --cabbi-sky:        #82cfd0;
  --cabbi-sky-pale:   #b2e0e5;
  --cabbi-gold:       #fcb813;   /* the mark's trailing leaf                 */
  --cabbi-gold-soft:  #ffdd50;
  --cabbi-stone:      #e1deda;   /* warm neutral                             */
  --cabbi-taupe:      #98876e;
  --cabbi-charcoal:   #403a48;   /* the wordmark ink — warm, slightly plum   */

  /* --- Semantic tokens --------------------------------------------------- */
  --ink:        var(--cabbi-charcoal);
  --ink-soft:   #5d5666;
  --muted:      #7a7385;
  --line:       #e7e3df;
  --line-soft:  #f0edea;
  --bg:         #fbfaf9;         /* warm paper, not grey-green              */
  --bg-sunk:    #f4f1ee;
  --card:       #ffffff;
  --green:      var(--cabbi-green);
  --green-dark: #00622f;
  --accent:     var(--cabbi-gold);

  --radius:     14px;
  --radius-lg:  20px;
  --radius-sm:  9px;
  --shadow:     0 1px 2px rgba(64,58,72,.04), 0 8px 24px rgba(64,58,72,.05);
  --shadow-lift:0 2px 4px rgba(64,58,72,.06), 0 14px 38px rgba(64,58,72,.10);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 780px; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* --- Typography ------------------------------------------------------------
   Headings run tighter and larger than the body, with negative tracking; the
   uppercase micro-label ("eyebrow") echoes the logo's spaced-out subtitle. */

h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -.018em; }
h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.13; margin: 6px 0 14px; }
h2 { font-size: clamp(21px, 2.4vw, 26px); line-height: 1.22; margin: 40px 0 14px; }
h3 { font-size: 18px; line-height: 1.3; margin: 0 0 6px; }

.lede { font-size: 18.5px; line-height: 1.62; color: var(--ink-soft); max-width: 68ch; }
.muted { color: var(--muted); }
em.muted { font-style: italic; }
.small { font-size: 14px; }

.eyebrow {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .16em; color: var(--cabbi-green); margin: 0 0 10px;
}
.eyebrow.gold { color: #a8780a; }
.eyebrow.teal { color: var(--cabbi-teal-deep); }
.eyebrow.on-dark { color: var(--cabbi-gold-soft); }

/* Numbers are data — always tabular so columns line up. */
.num, .k, .stat .num, td.num, th.num { font-variant-numeric: tabular-nums; }

/* --- Top bar ---------------------------------------------------------------
   White, so the full-color logo can be used; the brand's three colors appear
   as a hairline rule across the very top of every page. */

.brandline { height: 4px; display: flex; }
.brandline i { flex: 1; }
.brandline i:nth-child(1) { background: var(--cabbi-green); }
.brandline i:nth-child(2) { background: var(--cabbi-olive); }
.brandline i:nth-child(3) { background: var(--cabbi-gold); }

.topbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 13px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 40px; width: auto; display: block; }
.brand .rule { width: 1px; height: 26px; background: var(--line); }
.brand .product {
  font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink);
  white-space: nowrap;
}

.topbar nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--ink-soft); font-weight: 550; font-size: 15px;
  padding: 7px 11px; border-radius: var(--radius-sm);
}
.topbar nav a:hover { color: var(--ink); background: var(--bg-sunk); text-decoration: none; }
.topbar nav a.is-active { color: var(--cabbi-green); background: rgba(0,127,61,.08); }
.topbar .admin-link { color: #a8780a; }
.topbar .admin-link:hover { background: rgba(252,184,19,.14); color: #8a6208; }
/* the sign-out is a POST, so it is a button dressed as the nav links */
.topbar .signout-form { display: inline; margin: 0; }
.topbar nav button.admin-link {
  font: inherit; font-weight: 550; font-size: 15px; background: none; border: 0; cursor: pointer;
  padding: 7px 11px; border-radius: var(--radius-sm);
}

main.wrap { padding-top: 30px; padding-bottom: 56px; min-height: 58vh; }
main.full { max-width: none; padding: 0; }

.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green); }

/* --- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--cabbi-green); color: #fff; }
.btn-primary:hover { background: #006c34; box-shadow: 0 8px 20px rgba(0,127,61,.28); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cabbi-green); color: var(--cabbi-green); }
.btn-on-dark { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.28); }
.btn-on-dark:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 14px; }

/* --- Stat blocks ----------------------------------------------------------- */

.stats { display: flex; gap: 14px; margin: 20px 0 10px; flex-wrap: wrap; }
.stat {
  flex: 1 1 160px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; transition: border-color .12s, box-shadow .12s;
}
a.stat:hover { border-color: var(--cabbi-green); box-shadow: var(--shadow); text-decoration: none; }
.stat .num { font-size: 32px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 14px; }

/* --- Cards ----------------------------------------------------------------- */

.cards {
  list-style: none; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
a.card:hover, .card a:hover { text-decoration: none; }
a.card { display: block; transition: border-color .12s, box-shadow .12s, transform .12s; }
a.card:hover { border-color: var(--cabbi-green); box-shadow: var(--shadow); transform: translateY(-1px); }
.card-title { font-weight: 650; font-size: 16px; color: var(--ink); }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px 26px;
}

/* --- Tables ---------------------------------------------------------------- */

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
table.grid th, table.grid td {
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
table.grid thead th {
  background: var(--bg-sunk); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #fcfbfa; }
table.grid td.num, table.grid th.num { text-align: right; }
.go { font-size: 14px; font-weight: 600; }

/* --- Definition lists ------------------------------------------------------ */

dl.meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 28px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin: 0 0 18px;
}
dl.meta dt {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}
dl.meta dd { margin: 3px 0 0; font-size: 16px; color: var(--ink); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* --- Filters --------------------------------------------------------------- */

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 20px; align-items: center; }
.filters input, .filters select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
.filters input:focus, .filters select:focus {
  outline: none; border-color: var(--cabbi-green); box-shadow: 0 0 0 3px rgba(0,127,61,.12);
}
.filters input[type=search] { min-width: 250px; }
.filters button {
  padding: 9px 18px; background: var(--cabbi-green); color: #fff; border: 0;
  border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600;
}
.filters button:hover { background: var(--green-dark); }
.filters .clear { align-self: center; font-size: 14px; }

/* --- Badges & status pills ------------------------------------------------- */

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 3px 9px; border-radius: 999px;
  vertical-align: middle; margin-left: 6px;
}
.badge.draft { background: #fff3d4; color: #8a6208; }
.badge.live  { background: rgba(0,127,61,.10); color: var(--green-dark); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.now       { background: rgba(0,127,61,.10);  color: var(--green-dark); }
.pill.building  { background: rgba(252,184,19,.16); color: #8a6208; }
.pill.planned   { background: var(--bg-sunk);       color: var(--muted); }
/* "held elsewhere" is a different statement from "planned" — it means the data
   lives in a purpose-built system on purpose, not that we haven't got to it. */
.pill.elsewhere { background: rgba(152,135,110,.16); color: #6d5f4c; }

/* --- Footer ---------------------------------------------------------------- */

.sitefoot { background: var(--cabbi-charcoal); color: #cfc9d6; margin-top: 60px; }
.sitefoot .wrap { padding-top: 40px; padding-bottom: 36px; }
.sitefoot a { color: #fff; }
.foot-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; align-items: start;
}
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; gap: 24px; } }
.sitefoot img.footmark { height: 40px; width: auto; opacity: .95; margin-bottom: 12px; }
.sitefoot h4 {
  color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
  margin: 0 0 10px;
}
.sitefoot ul { list-style: none; padding: 0; margin: 0; }
.sitefoot li { margin-bottom: 6px; font-size: 14.5px; }
.sitefoot p { font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
.foot-legal {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 18px;
  font-size: 13px; color: #a49dae; display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

/* ===========================================================================
   Landing page
   =========================================================================== */

.home-hero {
  background:
    radial-gradient(1100px 460px at 82% -10%, rgba(0,169,150,.30), transparent 60%),
    radial-gradient(760px 420px at 8% 108%,  rgba(0,127,61,.34),  transparent 62%),
    var(--cabbi-charcoal);
  color: #fff; position: relative; overflow: hidden;
}
.home-hero .wrap { position: relative; z-index: 2; padding-top: 78px; padding-bottom: 78px; }
.home-hero .hero-mark {
  position: absolute; right: -70px; top: -60px; width: 460px; opacity: .09;
  pointer-events: none; user-select: none; z-index: 1;
}
.home-hero h1 {
  color: #fff; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.06;
  letter-spacing: -.028em; margin: 0 0 18px; max-width: 17ch;
}
.home-hero h1 .hl {
  background: linear-gradient(
    transparent 66%, rgba(252,184,19,.55) 66%,
    rgba(252,184,19,.55) 92%, transparent 92%);
  padding: 0 3px;
}
.home-hero .lede { color: #ddd8e4; font-size: 19px; max-width: 60ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* Live figures, sitting across the hero's lower edge */
.figstrip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  margin: -38px 0 0; position: relative; z-index: 3;
}
.figstrip .fig { background: var(--card); padding: 18px 20px; }
a.figstrip-link { display: block; color: inherit; }
a.figstrip-link:hover { text-decoration: none; }
a.figstrip-link:hover .fig { background: #fcfbfa; }
a.figstrip-link:hover .fig .n { color: var(--cabbi-green); }
.figstrip .n {
  font-size: 27px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--ink); transition: color .12s;
}
.figstrip .l { font-size: 13.5px; color: var(--muted); }

.section { padding: 8px 0 6px; }
.section-head { max-width: 72ch; margin-bottom: 22px; }
.section-head p { color: var(--ink-soft); font-size: 17px; margin: 0; }

/* Research themes — the three CABBI pillars, using the center's own badges */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .themes { grid-template-columns: 1fr; } }
.theme {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 24px; display: flex; flex-direction: column;
  position: relative; overflow: hidden; transition: box-shadow .14s, transform .14s;
}
.theme:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
/* The top rules are segments of ONE band running across the row, rather than
   three separate colour chips — the themes are one system, and the page should
   look like it. The band runs green → teal → gold and then fades into neutral on
   the card whose data is held elsewhere, so the graphic carries the same honest
   caveat as the copy. Order matters here: it follows the cards in the markup. */
.theme::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.theme.t-feedstock::before {
  background: linear-gradient(90deg, var(--cabbi-green), var(--cabbi-teal));
}
.theme.t-sustainability::before {
  background: linear-gradient(90deg, var(--cabbi-teal), var(--cabbi-gold));
}
.theme.t-conversion::before {
  background: linear-gradient(90deg, var(--cabbi-gold), rgba(152,135,110,.30));
}

/* The integration claim, sitting under the row it describes. */
.themes-note {
  margin: 18px 0 0; padding: 16px 20px; font-size: 15px; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--cabbi-teal); border-radius: var(--radius);
}
.themes-note strong { color: var(--ink); font-weight: 650; }
/* No nowrap here — site names run long ("Sustainable Advanced Bioeconomy
   Research Farm") and an unbreakable link overflows a phone viewport. */
.themes-note a { font-weight: 600; }
.theme img { width: 54px; height: 54px; margin-bottom: 14px; }
.theme h3 { font-size: 19px; margin-bottom: 8px; }
.theme .role { color: var(--ink-soft); font-size: 15px; margin: 0 0 16px; flex: 1; }
.theme ul { list-style: none; padding: 0; margin: 0 0 16px; }
.theme li {
  font-size: 14.5px; padding: 7px 0; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.theme li.plain { display: block; }
.theme li.plain b { display: block; font-weight: 650; }
.theme li.plain span { color: var(--muted); font-size: 13.5px; }
.theme .note {
  font-size: 13.5px; color: var(--muted); margin: 14px 0 0;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.theme .head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}

/* Capability cards */
.caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.cap {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px; display: flex; flex-direction: column;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
a.cap:hover { border-color: var(--cabbi-green); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.cap .ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  margin-bottom: 14px; background: rgba(0,127,61,.13); color: var(--cabbi-green);
}
.cap .ico svg { width: 21px; height: 21px; stroke-width: 1.9; }
.cap.c-teal .ico { background: rgba(0,169,150,.18); color: var(--cabbi-teal-deep); }
.cap.c-gold .ico { background: rgba(252,184,19,.26); color: #96690a; }
.cap.c-olive .ico { background: rgba(142,173,62,.26); color: #55691f; }
.cap h3 { font-size: 17px; }
.cap p { color: var(--ink-soft); font-size: 14.8px; margin: 0 0 14px; flex: 1; }
.cap .cta { color: var(--cabbi-green); font-weight: 650; font-size: 14.5px; }

/* "Built for machine-readable discovery" — dark band, honest status pills */
.band {
  background: var(--bg-sunk); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); margin: 56px 0 0; padding: 56px 0;
}
.band-dark {
  background:
    radial-gradient(900px 400px at 15% 0%, rgba(0,169,150,.20), transparent 60%),
    var(--cabbi-charcoal);
  color: #fff; border: 0;
}
.band-dark h2, .band-dark h3 { color: #fff; }
.band-dark .section-head p, .band-dark .lede { color: #ddd8e4; }

.ready { display: grid; grid-template-columns: repeat(auto-fit, minmax(276px, 1fr)); gap: 16px; }
.ready .r {
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 20px 21px;
}
.ready .r-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ready h3 { font-size: 16.5px; margin: 0; }
.ready p { color: #c9c3d2; font-size: 14.6px; margin: 0; }
.ready .pill.now      { background: rgba(59,164,89,.20);  color: #a8e6bd; }
.ready .pill.building { background: rgba(252,184,19,.18); color: var(--cabbi-gold-soft); }
.ready .pill.planned  { background: rgba(255,255,255,.10); color: #b0a9bb; }

/* Direct-query access — the collaborator-facing half of the dark band.
   Text left, a concrete snippet right, stacking on narrow screens. */
.access {
  margin-top: 22px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg); padding: 26px 28px; align-items: start;
}
@media (max-width: 860px) { .access { grid-template-columns: 1fr; } }
.access h3 { font-size: 20px; margin: 6px 0 10px; letter-spacing: -.015em; }
.access p { color: #c9c3d2; font-size: 15px; margin: 0 0 12px; }
.access p:last-child { margin-bottom: 0; }
.access strong { color: #fff; font-weight: 650; }
.access .head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.access .head-row .eyebrow { margin: 0; }
.access code {
  font-family: var(--mono); font-size: .92em;
  background: rgba(255,255,255,.10); padding: 1px 5px; border-radius: 5px;
}
.access-code {
  margin: 0; background: rgba(0,0,0,.26); border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius); padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.8px; line-height: 1.75; color: #ddd8e4;
}
.access-code .c { color: #9a93a6; }
.access-code .kw { color: var(--cabbi-sky); }
.access-code .st { color: #a8e6bd; }

/* Closing call to action */
.cta-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; padding: 44px 0 10px;
}
.cta-row h2 { margin: 0 0 6px; }
.cta-row p { margin: 0; color: var(--ink-soft); }

@media (max-width: 620px) {
  .topbar .wrap { min-height: 60px; padding: 10px 0 6px; flex-wrap: wrap; gap: 6px; }
  /* One scrolling row rather than a wrapped block — a two-row nav was eating a
     third of a phone viewport, and the bar is sticky. */
  .topbar nav {
    width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding-left: 24px; margin-left: -24px; padding-right: 24px; margin-right: -24px;
  }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { padding: 6px 10px; font-size: 14.5px; }
  .brand img { height: 28px; }
  .brand .product { font-size: 15px; }
  .home-hero .lede { font-size: 17px; }
  .home-hero .wrap { padding-top: 52px; padding-bottom: 60px; }
  .home-hero .hero-mark { width: 300px; right: -80px; }
  .figstrip { margin-top: -20px; }
}

/* ===========================================================================
   Data entry — the event form on a unit page
   =========================================================================== */

.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px;
  font-size: 15px; border: 1px solid transparent;
}
.flash.success { background: rgba(0,127,61,.08); border-color: rgba(0,127,61,.25); color: var(--green-dark); }
.flash.error   { background: #fdeceb; border-color: #f3c6c2; color: #8c2f27; }

.field-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px 22px;
}
.field-wide { grid-column: 1 / -1; }
.field label {
  display: block; font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 6px;
}
.field .req { color: #b3392e; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--cabbi-green); box-shadow: 0 0 0 3px rgba(0,127,61,.12);
}
.field .hint { font-size: 13px; color: var(--muted); margin: 5px 0 0; }
.field .err, .values-table .err {
  font-size: 13px; color: #8c2f27; margin: 5px 0 0; font-weight: 550;
}

.values-table td { white-space: normal; vertical-align: top; }
.values-table select, .values-table input {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 14.5px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.values-table select:focus, .values-table input:focus {
  outline: none; border-color: var(--cabbi-green); box-shadow: 0 0 0 3px rgba(0,127,61,.12);
}
.values-table th:nth-child(1) { width: 40%; }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 8px; align-items: center; }

/* The entry point on the unit profile */
.section-actions {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

/* Raster catalog — the featured live preview above the table */
.raster-demo { margin: 4px 0 12px; }
.raster-demo-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.raster-demo-head .eyebrow { margin-bottom: 6px; }
.raster-demo-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 13.5px;
}
.raster-demo-foot label { display: inline-flex; align-items: center; gap: 8px; }
.raster-demo-foot input[type=range] { accent-color: var(--cabbi-green); }
table.grid tr.is-featured td { background: rgba(0,127,61,.045); }
table.grid tr.is-featured td:first-child { box-shadow: inset 3px 0 0 var(--cabbi-green); }

/* Sites list — the CONUS locator thumbnail beside each row */
.locator {
  width: 64px; height: 28px; display: block;
  overflow: visible;  /* a marker near the coast must not be clipped */
}
.locator use {
  fill: #efebe6; stroke: #b5aca1; stroke-width: 0.8px;
  stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.locator circle {
  fill: var(--cabbi-green); stroke: #fff; stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}
table.grid tr:hover .locator use { fill: #eae6e1; }
table.grid tr:hover .locator circle { fill: var(--cabbi-teal); }

/* ===========================================================================
   Map popups — shared by the geospatial dashboard and the profile maps
   ---------------------------------------------------------------------------
   These live here rather than in geo_dashboard.html because three maps now use
   the overlap-aware popup from static/core/featuremap.js.
   =========================================================================== */

.hitlist { margin: 0; padding: 0; list-style: none; min-width: 230px; }
.hitlist li { padding: 7px 0; border-top: 1px solid var(--line); }
.hitlist li:first-child { border-top: 0; }
.hitlist .lvl {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.hitlist .nm { font-weight: 640; }
.hitlist .meta { color: var(--muted); font-size: 12px; }
.hitlist .here {
  font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--cabbi-teal-deep); background: rgba(0,169,150,.12);
  border-radius: 999px; padding: 1px 7px; margin-left: 4px;
}
.stacknote {
  background: rgba(252,184,19,.16); border: 1px solid rgba(252,184,19,.55);
  color: #7a5606; border-radius: 6px; padding: 5px 8px; font-size: 12px; margin-bottom: 8px;
}

/* Funding attribution — DOE requires funded centers to acknowledge the award.
   The logo renders only when DOE_LOGO names a file that has been supplied;
   see core/context_processors.py. */
.foot-funding {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 22px;
}
.foot-funding .doe-mark {
  /* The reverse (all-white) lockup sits directly on the charcoal, matching the
     CABBI reverse mark above it — no white plate interrupting the dark ground.
     Swap DOE_LOGO to `doe-logo.png` (full colour) and this needs a white field
     again; see config settings. */
  height: 46px; width: auto; flex: none;
}
.foot-funding p {
  margin: 0; font-size: 13.5px; line-height: 1.6; color: #b8b1c4;
  flex: 1 1 380px; max-width: 78ch;
}
.foot-funding strong { color: #fff; font-weight: 600; }
.foot-funding .award { font-family: var(--mono); font-size: .95em; color: #ddd8e4; }
.sitefoot .foot-legal { margin-top: 20px; }

/* Variable catalog — a method's formula sits under its name */
.mono-sm { font-family: var(--mono); font-size: 11.5px; }
table.grid td .mono-sm { white-space: normal; }

/* ===========================================================================
   Germplasm — lineage strip and construct cassette maps
   =========================================================================== */

.lineage {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px;
  align-items: center; margin: 18px 0 8px;
}
@media (max-width: 820px) {
  .lineage { grid-template-columns: 1fr; }
  .lin-arrow { transform: rotate(90deg); justify-self: center; }
}
.lin-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin: 0 0 8px;
}
.lin-node {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px;
  color: var(--ink);
}
a.lin-node:hover { border-color: var(--cabbi-green); text-decoration: none; }
.lin-node.is-self { border-color: var(--cabbi-green); background: rgba(0,127,61,.05); }
.lin-node .mono { display: block; font-family: var(--mono); font-weight: 600; font-size: 14.5px; }
.lin-node .muted { font-size: 12.5px; }
.lin-node:last-child { margin-bottom: 0; }
.lin-empty { font-size: 14px; margin: 0; }
.lin-arrow { color: var(--muted); font-size: 20px; }

.relations { list-style: none; padding: 0; margin: 14px 0 0; }
.relations li {
  padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 15px;
  color: var(--ink-soft);
}
.relations .mono { font-family: var(--mono); font-weight: 600; color: var(--ink); }

/* A cassette reads left to right: promoter → gene → terminator. Not to scale —
   no element length is recorded, and drawing one would invent data. */
.cassettes { display: flex; flex-direction: column; gap: 12px; }
.cassette { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cas-seq {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  width: 18px; flex: none; text-align: right;
}
.cas-map { display: flex; align-items: stretch; gap: 3px; flex-wrap: wrap; }
.cas-part {
  font-family: var(--mono); font-size: 12.5px; font-weight: 550;
  padding: 8px 14px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid; white-space: nowrap;
}
/* Promoter drawn pointed, the conventional signal for direction of transcription. */
.cas-part.promoter {
  background: rgba(0,169,150,.12); border-color: rgba(0,169,150,.45);
  color: var(--cabbi-teal-deep); border-radius: 4px 0 0 4px;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%);
  padding-right: 20px;
}
.cas-part.gene {
  background: rgba(0,127,61,.10); border-color: rgba(0,127,61,.40);
  color: var(--green-dark); font-weight: 700;
}
.cas-part.terminator {
  background: var(--bg-sunk); border-color: var(--line); color: var(--ink-soft);
  border-radius: 0 4px 4px 0;
}
.cas-tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(252,184,19,.30); color: #7a5606; padding: 1px 6px; border-radius: 3px;
}
.cas-source { font-size: 13px; color: var(--muted); }

/* Variable detail — bar chart with SEM whiskers, drawn as plain SVG */
.chartwrap { padding: 18px 20px 10px; margin-bottom: 16px; }
.barchart { width: 100%; height: auto; display: block; overflow: visible; }
.barchart .grid { stroke: var(--line-soft); stroke-width: 1; }
.barchart .axis { stroke: var(--line); stroke-width: 1.5; }
.barchart .bar { fill: var(--cabbi-green); fill-opacity: .82; }
.barchart .bar:hover { fill-opacity: 1; }
.barchart .whisker { stroke: var(--ink-soft); stroke-width: 1.4; }
/* The published mean, so a bar landing on it reads as agreement at a glance. */
.barchart .claim { stroke: var(--cabbi-gold); stroke-width: 2.4; stroke-linecap: round; }
.barchart .tick { fill: var(--muted); font-size: 10.5px; text-anchor: end;
                  font-family: var(--mono); }
.barchart .barlabel { fill: var(--ink-soft); font-size: 12px; text-anchor: middle;
                      font-family: var(--sans); font-weight: 550; }

/* Unit hierarchy — indentation carries the depth, so the design reads at a glance */
.unit-tree td { vertical-align: middle; }
.unit-tree .tw {
  display: inline-flex; align-items: center; gap: 6px;
  padding-left: calc(var(--depth) * 22px);
}
.unit-tree .tw-elbow {
  width: 12px; height: 12px; flex: none;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  border-bottom-left-radius: 3px; margin-bottom: 5px;
}
.unit-tree tr.is-current td { background: rgba(0,127,61,.06); }
.unit-tree tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--cabbi-green); }
