/* LLM-MS Capability Catalogue: site theme on top of Datasette's app.css.
   Layout inspired by ChEBI; red accents, black structure, IBM Plex. */
:root {
  --red: #c8102e;
  --red-dark: #8f0b21;
  --red-soft: #fbe9ec;
  --black: #141414;
  --ink: #1f1f1f;
  --muted: #5c5c5c;
  --line: #d6d6d6;
  --bg: #f2f2f2;
  --card: #ffffff;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Archivo", "Segoe UI", Helvetica, Arial, sans-serif;
  --wrap: 1180px;
}

html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); font-size: 16px; line-height: 1.5; margin: 0; }
code, pre, .sql, textarea { font-family: var(--mono); }
a, a:link, a:visited { color: var(--red-dark); }
a:hover { color: var(--red); }
h1, h2, h3, h4 { font-family: var(--sans); color: var(--black); }

/* ---------- header ---------- */
header.site-header { background: #fff; color: var(--black); border-top: 4px solid var(--black); border-bottom: 1px solid var(--line); padding: 0; overflow: visible; min-height: 0; }
header.site-header a:link, header.site-header a:visited { color: #333; text-decoration: none; }
header.site-header a.brand:link, header.site-header a.brand:visited { color: var(--black); }
header.site-header .site-nav a:hover, header.site-header .site-nav a:focus { color: var(--red); }
footer.site-footer a:link, footer.site-footer a:visited { color: #ff8a9b; }
footer.site-footer a:hover { color: #fff; }
.site-header-inner { max-width: var(--wrap); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 24px; }
/* LLM-MS wordmark: Tektur, heaviest weight; MS in red */
.logo-font { font-family: "Tektur", var(--sans); font-weight: 900; letter-spacing: .5px; }
.logo-font .ms { color: var(--red); }
.brand, .brand:visited { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--black); }
.brand-text { font-family: "Inter", var(--sans); font-weight: 800; font-size: 30px; letter-spacing: -0.04em; line-height: 1; color: #111111; }
.brand-icon { flex: none; display: block; }
.brand-text .ms { font-family: "Press Start 2P", monospace; font-weight: 400; font-size: 0.79em; letter-spacing: 0; color: #c8102e; -webkit-text-stroke: 1.2px #c8102e; margin-right: -0.06em; position: relative; top: 0.139em; }
.brand-text .bench { font-style: normal; font-weight: 800; }
.brand-name { font-family: "Press Start 2P", monospace; font-weight: 400; letter-spacing: 0; font-size: 22px; line-height: 1; color: #111111; }
.brand-sub { display: block; font-family: "Silkscreen", monospace; font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.12em; color: #666666; margin-top: 7px; }
.site-nav { display: flex; gap: 15px; margin-left: auto; flex-wrap: wrap; }
.site-nav a, .site-nav a:visited { color: #333; text-decoration: none; font-size: 14.5px; padding: 6px 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.site-nav a:hover { color: var(--red); border-bottom-color: var(--red); }
.dmsl-logo img { height: 58px; width: auto; display: block; }
.nav-toggle, .nav-toggle-label { display: none; }

.demo-ribbon { background: var(--black); color: #eee; font-size: 13px; text-align: center; padding: 5px 16px; }
.demo-ribbon a, .demo-ribbon a:visited { color: #ff8a9b; }
.demo-ribbon i { color: var(--red); margin-right: 4px; }

.crumb-bar { max-width: var(--wrap); margin: 0 auto; padding: 14px 20px 0; font-size: 13.5px; color: var(--muted); }
.crumb-bar p.crumbs { margin: 0; }
.crumb-bar a, .crumb-bar a:visited { color: var(--muted); text-decoration: none; }
.crumb-bar a:hover { color: var(--black); text-decoration: underline; }
.crumb-bar:empty { display: none; }

/* ---------- content area (Datasette pages) ---------- */
section.content { max-width: var(--wrap); margin: 0 auto; padding: 8px 20px 40px; background: transparent; }
/* Datasette page titles: plain, with a black rule under the main title (like the site's own pages) */
section.content > h1 { font-size: 36px; font-weight: 800; letter-spacing: -.4px; margin: 14px 0 12px; padding: 0 0 12px; border-bottom: 4px solid var(--black); }
section.content > h2 { font-size: 22px; font-weight: 700; margin: 30px 0 10px; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
section.content > h3 { font-size: 18px; }
/* description: plain text, no box; source line small underneath */
section.content > .metadata-description { background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 0 6px !important; max-width: 900px; font-size: 16.5px; color: #2a2a2a; }
section.content > .metadata-description p { margin: 0 0 10px; }
section.content > .metadata-description + p { font-size: 13.5px; color: var(--muted); margin: 0 0 22px; }
section.content > .metadata-description + p a { color: var(--muted); }
/* SQL editor: its own white panel */
form.sql { background: #fff; padding: 16px 18px 14px; margin: 0 0 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
form.sql h3 { margin: 0 0 10px; font-size: 18px; }
form.sql .CodeMirror, form.sql .cm-editor, form.sql textarea { border: 1px solid var(--line) !important; }
table.rows-and-columns { background: #fff; border: 1px solid var(--line); }
table.rows-and-columns th { background: #fafafa; border-bottom: 2px solid var(--black); }
table.rows-and-columns th a, table.rows-and-columns th a:visited { color: var(--black); }
table.rows-and-columns td, table.rows-and-columns th { border-color: #ececec; }
table.rows-and-columns tr:hover td { background: #f4f4f4; }
input[type=submit], button[type=submit], .core input[type=submit] {
  background: var(--black); border: 1px solid var(--black); color: #fff; font-family: var(--sans); font-weight: 600; border-radius: 0;
}
input[type=submit]:hover, button[type=submit]:hover { background: #333; }
.filters input[type=text], .filters select, input[type=search], textarea { border-radius: 0; border: 1px solid #999; font-family: var(--sans); }
.facet-results { background: #fff; border: 1px solid var(--line); padding: 8px; }
.facet-info-name a.cross, .facet-info a.cross { color: var(--red); }
.table-description { margin: 0 0 14px; }
pre.wrapped-sql { background: #fff; border: 1px solid var(--line); }
.message-info { background: #fff; border-left: 4px solid var(--black); }
.message-warning { background: var(--red-soft); border-left: 4px solid var(--red); }

/* ---------- home: hero (big text, numbers, statistics background) ---------- */
.hero {
  background:
    linear-gradient(90deg, rgba(247,247,247,.80) 0%, rgba(247,247,247,.62) 40%, rgba(247,247,247,.15) 75%, rgba(247,247,247,0) 100%),
    url("/modeldb/assets/hero.svg?v=11") left top / 100% 100% no-repeat,
    #f7f7f7;
  border-bottom: 6px solid var(--black);
  padding: 54px 0 46px;
}
.hero-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.hero-title { font-size: 76px; line-height: 1.06; font-weight: 800; letter-spacing: -1.2px; margin: 0 0 18px; color: var(--black); border: 0 !important; padding: 0 !important; }
.hero-title span { color: var(--red); }
.hero-lead { font-size: 21px; max-width: 640px; margin: 0 0 30px; color: #2a2a2a; }
.hero-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; max-width: 980px; border-top: 3px solid var(--black); background: transparent; padding-left: 0; }
.hero-stats .stat { padding: 18px 16px 6px 0; overflow: visible; }
.stat b { display: block; font-size: 34px; font-weight: 700; color: var(--black); line-height: 1.4; padding-top: 4px; overflow: visible; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 14px; color: var(--muted); line-height: 1.3; }
.hero-actions { margin: 30px 0 40px; gap: 22px; }

/* model finder in the catalogue card */
.findrow { display: flex; gap: 14px; margin: 12px 0 6px; }
.findrow input[type=text] { flex: 1; min-width: 0; font-size: 16px; padding: 8px 10px; border: 2px solid #888; border-radius: 0; font-family: var(--sans); }
.findrow input[type=text]:focus { outline: 2px solid var(--red); border-color: var(--red); }

/* ---------- cards ---------- */
.home-section { max-width: var(--wrap); margin: 0 auto; padding: 28px 20px 8px; }
.home-section > h2 { font-size: 26px; margin: 0 0 14px; }
.home-section > p.sub { margin: -8px 0 16px; color: var(--muted); }
.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.usemap > *, .flow > * { min-width: 0; }
h4 { text-decoration: none; }
/* Datasette's own buttons (Apply, Run SQL, Format SQL): plain black and white, red is kept for links */
form input[type=submit], form button, .core input[type=submit], .core button, button.button-as-link.run {
  background: var(--black) !important; border: 1px solid var(--black) !important; color: #fff !important;
  border-radius: 0 !important; font-family: var(--sans) !important; font-weight: 600 !important; box-shadow: none !important;
  padding: 6px 14px !important; font-size: 14.5px !important;
}
form input[type=submit]:hover, form button:hover { background: #333 !important; }
form button#sql-format, form button.button-secondary, form input[type=submit].button-secondary { background: #fff !important; color: var(--black) !important; border-color: var(--black) !important; }
form button#sql-format:hover { background: #f1f1f1 !important; }
.select-wrapper, .filters select { border-radius: 0 !important; }
.card { background: var(--card); border-bottom: 8px solid var(--black); box-shadow: 0 1px 4px rgba(0,0,0,.12); padding: 22px 22px 20px; display: flex; gap: 20px; }
.card .icon { font-size: 54px; color: var(--black); width: 70px; text-align: center; flex: none; line-height: 1; padding-top: 4px; }
.card h3 { margin: 0 0 6px; font-size: 23px; font-weight: 500; line-height: 1.2; }
.card h3 a, .card h3 a:visited { color: var(--red); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card h3 .go { font-size: 21px; vertical-align: 1px; margin-left: 6px; }
.card p { margin: 0 0 8px; font-size: 17px; color: #222; }
.card .meta { font-size: 14px; color: var(--muted); }
.card.feature { border-bottom-color: var(--black); }
.card.pending { border-bottom-color: #9a9a9a; }
.card.pending .icon { color: #9a9a9a; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; padding: 2px 8px; border: 1px solid var(--black); margin-right: 6px; vertical-align: 2px; }
.tag.red { border-color: var(--red); color: var(--red); }
.tag.grey { border-color: #888; color: #666; }
/* buttons: flat block with a hard black offset shadow; pressing moves it into the shadow */
.btnrow { margin-top: 12px; display: flex; gap: 16px; flex-wrap: wrap; }
a.btn, a.btn:link, a.btn:visited, button.btn {
  display: inline-block; text-decoration: none; font-family: var(--sans); font-weight: 600; font-size: 15px; line-height: 1.3;
  padding: 8px 16px; border: 2px solid var(--black); color: var(--black); background: #fff; cursor: pointer;
  box-shadow: 5px 5px 0 var(--black); transition: transform .08s ease, box-shadow .08s ease, background .12s ease;
}
a.btn:hover, button.btn:hover { background: #f1f1f1; color: var(--black); }
a.btn:active, button.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--black); }
a.btn.primary, a.btn.primary:link, a.btn.primary:visited, button.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
a.btn.primary:hover, button.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
a.btn.big { font-size: 19px; font-weight: 700; padding: 12px 24px; box-shadow: 7px 7px 0 var(--black); }
a.btn.big:active { transform: translate(5px, 5px); box-shadow: 2px 2px 0 var(--black); }
button.btn { border-radius: 0 !important; }
form button.btn.primary { background: var(--red) !important; border: 2px solid var(--red) !important; box-shadow: 5px 5px 0 var(--black) !important; font-weight: 600 !important; }
form button.btn.primary:hover { background: var(--red-dark) !important; }

/* ---------- inner pages ---------- */
.page { max-width: var(--wrap); margin: 0 auto; }
/* one page-title style for every page (the site's own and Datasette's) */
.page-head { background: transparent; padding: 0; margin: 14px 0 26px; }
.page-head h1, section.content > h1, section.content .page-header h1 { font-size: 36px; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; color: var(--black); }
.page-head h1 { margin: 0 0 12px; padding: 0 0 12px !important; border: 0 !important; border-bottom: 4px solid var(--black) !important; }
.page-head h1 > i:first-child { font-size: .82em; margin-right: .3em; }
.page-head p { margin: 0; color: #2a2a2a; font-size: 16.5px; max-width: 900px; }
.panel { background: #fff; padding: 18px 22px; margin: 0 0 22px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.panel h2 { margin-top: 0; font-size: 22px; }
.panel h2 i { color: var(--red); margin-right: 8px; }
.legend { text-align: center; font-size: 14px; color: var(--muted); margin: -8px 0 22px; }
.label { font-family: var(--mono); font-size: 12px; font-weight: 500; padding: 1px 6px; border: 1px solid; }
.label.verified { color: #0a6b2f; border-color: #0a6b2f; }
.label.inferred { color: #8a5a00; border-color: #8a5a00; }
.label.unknown { color: #555; border-color: #777; }
table.plain { width: 100%; border-collapse: collapse; background: #fff; font-size: 15px; }
table.plain th { text-align: left; border-bottom: 2px solid var(--black); padding: 8px 10px; background: #fafafa; }
table.plain td { border-bottom: 1px solid #eee; padding: 7px 10px; vertical-align: top; }
table.plain tr:hover td { background: #f4f4f4; }
table.plain td.num, table.plain th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: #eee; min-width: 80px; position: relative; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.status-dot.archived { background: var(--red); }
.status-dot.unknown { background: #aaa; }
.status-dot.live { background: var(--black); }

/* flow diagram */
.flow { --gap: 30px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--gap); align-items: stretch; margin: 10px 0 6px; }
.flow .step { background: #fff; border: 2px solid var(--black); padding: 12px; position: relative; overflow-wrap: anywhere; }
.flow .step code { overflow-wrap: anywhere; word-break: break-word; }
/* connector: a line from this box's outer edge across the gap, its head touching the next box */
.flow .step:not(:last-child)::after { content: ""; position: absolute; top: 50%; left: calc(100% + 2px); width: calc(var(--gap) - 9px); height: 2px; margin-top: -1px; background: var(--black); }
.flow .step:not(:last-child)::before { content: ""; position: absolute; top: 50%; left: calc(100% + 2px + var(--gap) - 10px); margin-top: -6px; border-left: 10px solid var(--black); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.flow .step h4 { margin: 0 0 4px; font-size: 16px; }
.flow .step h4 i { color: var(--red); margin-right: 6px; }
.flow .step p { margin: 0; font-size: 13.5px; color: #333; }
.flow .step.hot { border-color: var(--red); }

/* used-where map */
.usemap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.zone { background: #fff; border-top: 8px solid var(--black); padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.zone.ranking { border-top-color: var(--red); }
.zone.empty { border-top-color: #aaa; }
.zone h3 { margin: 0 0 4px; font-size: 18px; }
.zone h3 i { margin-right: 6px; color: var(--red); }
.zone p.what { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.zone ul { list-style: none; padding: 0; margin: 0; }
.zone li { padding: 5px 0; border-bottom: 1px dashed #e2e2e2; font-size: 14.5px; }
.zone li code { font-size: 13.5px; }
.zone li .why { display: block; color: var(--muted); font-size: 13px; }
.zone li.warn code::after { content: " \f071"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--red); }

/* issues */
.issue { background: #fff; border-left: 8px solid var(--black); padding: 14px 18px; margin: 0 0 14px; }
.issue.high { border-left-color: var(--red); }
.issue h3 { margin: 0 0 6px; font-size: 19px; }
.issue h3 .n { display: inline-block; min-width: 30px; color: var(--red); }
.issue p { margin: 4px 0; }
.issue .fix { font-size: 15px; }
.issue .fix b { color: var(--black); }

/* code blocks */
pre.example { background: #141414; color: #f1f1f1; padding: 12px 14px; overflow-x: auto; font-size: 14px; }
pre.example .c { color: #ff8a9b; }

/* ---------- footer ---------- */
.site-footer { background: var(--black); color: #cfcfcf; padding: 0; margin-top: 30px; }
.site-footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 22px 20px; display: flex; gap: 22px; align-items: center; font-size: 14px; line-height: 1.6; }
.site-footer a, .site-footer a:visited { color: #ff8a9b; }
.site-footer code { color: #fff; }
.footer-logo { height: 56px; background: #fff; padding: 4px; }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .usemap { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: 1fr; column-gap: 0; row-gap: var(--gap); }
  .flow .step:not(:last-child)::after { top: calc(100% + 2px); left: 50%; width: 2px; height: calc(var(--gap) - 9px); margin: 0 0 0 -1px; }
  .flow .step:not(:last-child)::before { top: calc(100% + 2px + var(--gap) - 10px); left: 50%; margin: 0 0 0 -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid var(--black); border-bottom: 0; }
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-title { font-size: 60px; }
}
@media (max-width: 760px) {
  .site-header-inner { flex-wrap: wrap; gap: 12px; padding: 10px 16px; }
  .brand-text { font-size: 24px; }
  .dmsl-logo { margin-left: auto; }
  .dmsl-logo img { height: 44px; }
  .nav-toggle-label { display: block; order: 3; font-size: 22px; cursor: pointer; }
  .site-nav { display: none; order: 4; width: 100%; flex-direction: column; gap: 0; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a, .site-nav a:visited, .site-nav a:hover { padding: 10px 0; border-bottom: 1px solid #e6e6e6; }
  .grid-2, .grid-3, .usemap { grid-template-columns: 1fr; }
  .hero { padding: 34px 0 32px; background: linear-gradient(180deg, rgba(247,247,247,.92) 0%, rgba(247,247,247,.80) 100%), url("/modeldb/assets/hero.svg?v=11") left top / 100% 100% no-repeat, #f7f7f7; }
  .hero-title { font-size: 44px; letter-spacing: -.8px; }
  .hero-lead { font-size: 17px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 28px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .findrow { flex-direction: column; }
  .brand-name { font-size: 16px; }
  .card { flex-direction: column; gap: 8px; }
  .card .icon { text-align: left; font-size: 40px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
  section.content, .home-section, .crumb-bar, .hero-inner { padding-left: 16px; padding-right: 16px; }
}

/* buttons inside cards stay simple: no offset shadow */
.card a.btn, .card a.btn:link, .card a.btn:visited, .card button.btn, .card form button.btn.primary {
  box-shadow: none !important; border-width: 1px !important; font-size: 14px !important; font-weight: 600 !important; padding: 6px 12px !important;
}
.card a.btn:active, .card button.btn:active { transform: none; }
.card .btnrow { gap: 8px; }
.card .findrow { gap: 8px; }
.card .findrow input[type=text] { font-size: 15px; padding: 6px 9px; border-width: 1px; }

/* starred footnotes: centred, small, no box */
.star { color: var(--red); font-weight: 700; }
h2 sup.star { font-size: .7em; margin-left: 2px; }
.footnote { text-align: center; font-size: 14px; color: var(--muted); margin: 16px auto 0; max-width: 760px; }

/* sources table: dot and name on one line, publisher underneath, aligned */
td.src-cell { min-width: 210px; }
.src-name { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.src-name .status-dot { margin: 0; flex: none; }
.src-pub { margin: 2px 0 0 17px; font-size: 13px; color: #666; line-height: 1.35; }
td.method-cell { min-width: 150px; max-width: 240px; overflow-wrap: break-word; }
.examples-list { margin: 6px 0 10px; padding-left: 20px; } .examples-list li { margin: 3px 0; }
table.plain td, table.plain th { vertical-align: top !important; }
table.plain td, table.plain th { white-space: normal; }
/* Datasette's title wrapper: no coloured side bar; black rule underneath instead */
section.content .page-header { border-left: 0 !important; padding: 0 0 12px !important; margin: 14px 0 14px !important; border-bottom: 4px solid var(--black) !important; }
section.content .page-header h1 { font-size: 36px; font-weight: 800; letter-spacing: -.4px; margin: 0; padding: 0; border: 0; }

/* Datasette's query and row pages put an inline coloured side bar on a bare h1 */
section.content > h1[style] { border-left: 0 !important; padding-left: 0 !important; padding-bottom: 12px !important; }
/* icons on Datasette page titles, matching the site's own page titles */
section.content .page-header h1::before, section.content > h1::before {
  font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .82em; margin-right: .3em; color: var(--black);
}
body.db section.content .page-header h1::before { content: "\f1c0"; }
body.table section.content .page-header h1::before { content: "\f0ce"; }
body.query section.content > h1::before { content: "\f120"; }
body.row section.content > h1::before { content: "\f15c"; }
/* Datasette result tables: header and cells share the same padding so columns line up */
@media (min-width: 577px) {
  table.rows-and-columns th, table.rows-and-columns td { padding: 7px 10px; text-align: left; }
  table.rows-and-columns th { font-weight: 600; font-size: 14px; color: var(--black); }
}
/* phone: Datasette turns each row into a card; square it off and keep the column labels readable */
@media (max-width: 576px) {
  .rows-and-columns tr { border-radius: 0 !important; border: 1px solid var(--line) !important; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  .rows-and-columns td { padding: 6px 12px !important; }
  .rows-and-columns td:before { margin-left: 0 !important; color: var(--muted) !important; font-size: 12px !important; font-weight: 600; }
}
table.rows-and-columns td.type-float, table.rows-and-columns td.type-int { font-variant-numeric: tabular-nums; }

/* ---------- automated catalogue: status colours (the only extra colours: muted dots and borders) ---------- */
:root { --st-green: #3f8a5a; --st-yellow: #c08a1e; --st-grey: #a3a3a3; }
.status-dot.green { background: var(--st-green); }
.status-dot.yellow { background: var(--st-yellow); }
.status-dot.red { background: var(--red); }
.status-dot.grey { background: var(--st-grey); }
.auto-stats { margin: 6px 0 4px; }
.auto-stats .stat b { font-size: 28px; }

/* source map: source nodes on the left, wired to one bus, which feeds the catalogue box */
.srcmap { --node-h: 156px; --node-gap: 14px; --bus-x: 22px; display: grid; grid-template-columns: minmax(0, 1fr) 48px 250px; align-items: stretch; margin-top: 8px; }
.srcmap-nodes { display: flex; flex-direction: column; gap: var(--node-gap); min-width: 0; }
.srcnode { position: relative; height: var(--node-h); overflow: hidden; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--st-grey); padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.srcnode { overflow: visible; }
.srcnode > * { overflow: hidden; }
.srcnode.st-green { border-left-color: var(--st-green); }
.srcnode.st-yellow { border-left-color: var(--st-yellow); }
.srcnode.st-red { border-left-color: var(--red); }
.srcnode::after { content: ""; position: absolute; top: 50%; left: calc(100% + 1px); width: var(--bus-x); height: 2px; margin-top: -1px; background: var(--black); }
.srcnode-head { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.srcnode-head a { overflow: hidden; text-overflow: ellipsis; }
.srcnode-head .status-dot { margin: 0; flex: none; }
.srcnode-head .tag { margin-left: auto; flex: none; }
.srcnode-grid { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 10px; font-size: 13.5px; margin-top: 6px; line-height: 1.45; }
.srcnode-grid span { color: var(--muted); }
.srcnode-grid b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srcnode-why, .srcnode-err { font-size: 13px; color: #444; margin-top: 4px; white-space: nowrap; text-overflow: ellipsis; }
.srcnode-err { color: var(--muted); }
.srcnode-err i { color: var(--black); }
.srcmap-bus { border-left: 2px solid var(--black); margin: calc(var(--node-h) / 2) 0 calc(var(--node-h) / 2) var(--bus-x); }
.srcmap-hub { align-self: center; }
.hubbox { position: relative; background: #fff; border: 2px solid var(--red); padding: 12px 14px; }
.hubbox::before { content: ""; position: absolute; top: 50%; left: calc(-48px + var(--bus-x) + 2px); width: calc(48px - var(--bus-x) - 2px - 12px); height: 2px; margin-top: -1px; background: var(--black); }
.hubbox::after { content: ""; position: absolute; top: 50%; left: -12px; margin-top: -6px; border-left: 10px solid var(--black); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.hubbox h4 { margin: 0 0 6px; font-size: 16px; }
.hubbox h4 i { color: var(--red); margin-right: 6px; }
.hubbox p { margin: 4px 0 0; font-size: 13.5px; }

/* review queue */
.review-kinds { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
.review-kinds a.on { color: var(--black); font-weight: 700; text-decoration: none; }
.review-item { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; padding: 14px 0; border-top: 1px solid #eee; }
.review-title { font-weight: 600; overflow-wrap: anywhere; }
.review-title .tag { margin-right: 8px; }
.review-score { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-weight: 400; }
.review-detail { font-size: 14.5px; color: #333; margin: 4px 0; overflow-wrap: anywhere; }
.review-why { font-size: 13.5px; color: #444; margin: 6px 0; overflow-wrap: anywhere; }
.review-ev { font-size: 13.5px; margin: 6px 0; }
.review-prop { margin: 6px 0; padding-left: 20px; font-size: 14px; }
.review-raw summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.review-raw pre { max-height: 240px; overflow: auto; font-size: 12px; background: #fafafa; border: 1px solid #eee; padding: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-form { display: flex; flex-direction: column; gap: 8px; align-self: start; }
.review-form input[type=text] { font-family: var(--sans); font-size: 14px; padding: 6px 8px; border: 1px solid #999; border-radius: 0; }
.inline-form { margin: 0; }

@media (max-width: 760px) {
  .srcmap { grid-template-columns: 1fr; row-gap: 14px; }
  .srcmap-bus, .srcnode::after, .hubbox::before, .hubbox::after { display: none; }
  .srcnode { height: auto; }
  .review-item { grid-template-columns: 1fr; }
  .auto-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* new pages: buttons inside panels stay plain (offset shadows only under the hero) */
.panel a.btn, .panel a.btn:link, .panel a.btn:visited { box-shadow: none; border-width: 1px; font-size: 14px; padding: 6px 12px; }
.panel a.btn:active { transform: none; }
.panel .btnrow { gap: 8px; }
/* new pages on a phone: wide tables scroll inside their panel, never the page */
.page-automated .panel, .page-skills .panel, .page-how .panel, .page-api .panel, .page-downloads .panel, .page-sources .panel, .page-source-map .panel, .page-review .panel, .review-main { overflow-x: auto; min-width: 0; }

/* Source map: hub diagram (sources -> automated catalogue), coloured by source state */
.hubdiagram svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
.hubdiagram .edge { fill: none; stroke-width: 2.2; }
.hubdiagram .e-live { stroke: #2e7d32; fill: #2e7d32; }
.hubdiagram .e-stale { stroke: #c98a00; fill: #c98a00; }
.hubdiagram .e-error { stroke: var(--red); fill: var(--red); }
.hubdiagram .e-frozen { stroke: #9a9a9a; fill: #8a8a8a; }
.hubdiagram path.e-frozen { stroke-dasharray: 6 5; }
.hubdiagram path.e-error { stroke-dasharray: 2 4; stroke-width: 2.6; }
.hubdiagram .ah-live { fill: #2e7d32; } .hubdiagram .ah-stale { fill: #c98a00; }
.hubdiagram .ah-error { fill: var(--red); } .hubdiagram .ah-frozen { fill: #9a9a9a; }
.hubdiagram .elabel { font-size: 11.5px; font-family: var(--mono); stroke: #fff; stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; }
.hubdiagram .snode rect { fill: #fff; stroke: var(--black); stroke-width: 1.5; }
.hubdiagram .snode.n-frozen rect { stroke: #9a9a9a; stroke-dasharray: 4 3; }
.hubdiagram .snode.n-error rect { stroke: var(--red); stroke-width: 2.5; }
.hubdiagram .sname { font-size: 13.5px; font-weight: 600; fill: var(--black); }
.hubdiagram .ssub { font-size: 11.5px; fill: #555; }
.hubdiagram .dot-green { fill: #2e7d32; } .hubdiagram .dot-yellow { fill: #c98a00; }
.hubdiagram .dot-red { fill: var(--red); } .hubdiagram .dot-grey { fill: #9a9a9a; }
.hubdiagram .hub rect { fill: #fff; stroke: var(--black); stroke-width: 3; }
.hubdiagram .hubt { font-size: 19px; font-weight: 800; fill: var(--black); }
.hubdiagram .hubs { font-size: 11.5px; font-family: var(--mono); fill: #555; }
.hublegend .sw { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: 4px; margin-right: 5px; }
.hublegend .sw-live { border-color: #2e7d32; } .hublegend .sw-stale { border-color: #c98a00; }
.hublegend .sw-error { border-color: var(--red); border-top-style: dotted; } .hublegend .sw-frozen { border-color: #9a9a9a; border-top-style: dashed; }
.srcnode-how { font-size: 12.5px; color: #333; margin-top: 6px; }
.hubdiagram path.edge { fill: none !important; }

/* declutter: 4-stat home strip, collapsible reference sections, home status list */
.hero-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .hero-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
details.more { background: #fff; padding: 12px 22px; margin: 0 0 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; min-width: 0; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 16.5px; }
details.more[open] > summary { margin-bottom: 10px; }
ul.stand { margin: 0; padding-left: 20px; max-width: 900px; }
ul.stand li { margin: 0 0 8px; }

/* home: the two catalogue cards share one layout, buttons line up at the bottom */
.grid-2 > .card.feature { align-items: stretch; }
.card.feature > div:last-child { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.card.feature .btnrow { margin-top: auto; padding-top: 14px; }

.page .panel ul { margin: 8px 0 14px; padding-left: 22px; list-style: disc; }
.page .panel ul li { margin: 5px 0; }
.page .panel ul + table { margin-top: 14px; }

/* the automated catalogue page: its one saved query (ranking) is only reached from links, not listed */
body.db-automated_catalog #queries, body.db-automated_catalog #queries + ul { display: none; }

/* sources page: per-source cards */
.srccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.srccard { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--st-grey); padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); min-width: 0; }
.srccard.st-green { border-left-color: var(--st-green); }
.srccard.st-yellow { border-left-color: var(--st-yellow); }
.srccard.st-red { border-left-color: var(--red); }
.srccard .srcnode-head { white-space: normal; flex-wrap: wrap; }
.srccard .srcnode-grid b { white-space: normal; }
.srccard-note { font-size: 13px; color: #333; margin-top: 6px; line-height: 1.4; }
.srccard-why { color: #666; }

.srctable .lic-cell { min-width: 240px; max-width: 420px; }
.srctable td:nth-child(2), .srctable td:nth-child(3), .srctable td:nth-child(4) { white-space: nowrap; }

.api-opts, .page details.more p { font-size: 14.5px; }
.page details.more pre.example { font-size: 12.5px; padding: 12px 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }

/* public static copy only */
.tag.soon { border-color: #888; color: #666; font-size: 10.5px; padding: 1px 6px; margin: 0 0 0 6px; vertical-align: 1px; }
.nav-soon { position: relative; color: #aaa; font-size: 14.5px; padding: 6px 0; border-bottom: 3px solid transparent; white-space: nowrap; cursor: default; }
.nav-soon small { position: absolute; left: 0; right: 0; top: 100%; margin-top: -5px; line-height: 1; text-align: center; font-size: 9px; letter-spacing: .6px; text-transform: uppercase; color: #aaa; }
@media (max-width: 760px) { .nav-soon { padding: 10px 0; border-bottom: 1px solid #e6e6e6; } .nav-soon small { position: static; display: inline; margin-left: 8px; } }
.btn.disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btnrow .tag.soon { align-self: center; }
