/* The FAIR Librarian – design system
   Corporate palette: RCPE Red #E6224F · Lipstick Red #B31C3F · Yankees Blue #1C213B
   Lavender Grey #666CA1 (charts) · Steel Grey #717171 · Silver Dust #A4A4A4 · Cloud Grey #DADADA
   Typography: Montserrat only – titles 500, subheadings 600, body 400, highlights 800 */
:root {
  --red: #E6224F; --red-2: #B31C3F; --navy: #1C213B; --lavender: #666CA1; --steel: #717171; --silver: #A4A4A4; --cloud: #DADADA;
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F6F6F7; --line: #E6E6E8; --line-2: #DADADA;
  --text: #1C213B; --muted: #717171; --faint: #A4A4A4; --ink: #1C213B; --accent: var(--red); --accent-hover: var(--red-2); --accent-soft: #FDEBEF;
  --ok: #2E7D5B; --ok-bg: #EAF5EF; --warn: #9A6400; --warn-bg: #FBF3E3; --bad: #B31C3F; --bad-bg: #FBE9ED; --info: #666CA1; --info-bg: #EFF0F7; --neutral-bg: #F1F1F3;
  --topbar: #FFFFFF; --topbar-text: #1C213B; --topbar-muted: #717171;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(28,33,59,.05); --shadow-lg: 0 18px 48px rgba(28,33,59,.18);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #12152A; --surface: #1C213B; --surface-2: #232947; --line: #2C3254; --line-2: #3A4166;
  --text: #F2F2F5; --muted: #A4A4A4; --faint: #7D7F8E; --ink: #FFFFFF; --accent-soft: rgba(230,34,79,.14);
  --ok: #6FCF9F; --ok-bg: rgba(111,207,159,.12); --warn: #E8B45A; --warn-bg: rgba(232,180,90,.12); --bad: #FF6F8E; --bad-bg: rgba(230,34,79,.16); --info: #A9AEE0; --info-bg: rgba(102,108,161,.22); --neutral-bg: #262C4B;
  --topbar: #1C213B; --topbar-text: #FFFFFF; --topbar-muted: #A4A4A4;
  --shadow: 0 1px 2px rgba(0,0,0,.25); --shadow-lg: 0 18px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-weight: 400; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
a { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.hero-links a, .ac a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-weight: 500; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 600; } h3 { font-size: .98rem; font-weight: 600; }
b, strong { font-weight: 600; }
code, .mono { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: .86em; letter-spacing: .01em; }
svg.ic { width: 1.05em; height: 1.05em; vertical-align: -0.16em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px; padding: 10px 28px; background: var(--topbar); color: var(--topbar-text); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--topbar-text) !important; text-decoration: none !important; }
.brand-mark svg { width: 34px; height: 34px; display: block; }
.brand-text b { display: block; font-size: 1.02rem; font-weight: 600; letter-spacing: -.005em; }
.brand-text small { display: block; color: var(--topbar-muted); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.mainnav { display: flex; gap: 2px; margin-left: 14px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a { color: var(--topbar-muted) !important; padding: 8px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; position: relative; }
.mainnav a:hover { color: var(--topbar-text) !important; background: var(--surface-2); }
.mainnav a.active { color: var(--topbar-text) !important; font-weight: 600; }
.mainnav a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 2px; background: var(--accent); border-radius: 2px; }
.badge-count { background: var(--accent); color: #fff; border-radius: 999px; font-size: .66rem; font-weight: 700; padding: 0 6px; min-width: 18px; text-align: center; line-height: 1.6; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: transparent; border: 1px solid var(--line-2); color: var(--topbar-text); width: 36px; height: 36px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.btn-tour { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.btn-tour:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.role-switch { position: relative; }
.role-btn { display: flex; align-items: center; gap: 9px; background: transparent; border: 1px solid var(--line-2); color: var(--topbar-text); padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; font: inherit; }
.role-btn:hover { border-color: var(--accent); }
.role-btn .who { text-align: left; line-height: 1.15; } .role-btn .who b { font-weight: 600; font-size: .86rem; } .role-btn .who small { display: block; color: var(--topbar-muted); font-size: .68rem; }
.role-chip { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.role-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 350px; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 8px; display: none; }
.role-menu.open { display: block; }
.role-menu .rm-head { padding: 6px 10px 8px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.role-opt { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; background: none; width: 100%; text-align: left; font: inherit; color: inherit; }
.role-opt:hover { background: var(--surface-2); }
.role-opt.current { border-color: var(--accent); background: var(--accent-soft); }
.role-opt p { margin: 2px 0 0; font-size: .76rem; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .72rem; color: #fff; background: var(--navy); flex: none; letter-spacing: .02em; }
:root[data-theme="dark"] .avatar { background: #3A4166; }
.avatar.sm { width: 24px; height: 24px; font-size: .6rem; }

main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 28px 48px; outline: none; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 16px 28px; color: var(--faint); font-size: .74rem; border-top: 1px solid var(--line); }

/* generic */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px 22px; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: border-color .15s, background .15s, color .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary, .btn-gold { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.btn-primary:hover, .btn-gold:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn-ok { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .btn-ok { background: #F2F2F5; border-color: #F2F2F5; color: var(--navy); }
.btn-ok:hover { color: #fff; opacity: .9; } :root[data-theme="dark"] .btn-ok:hover { color: var(--navy); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-ghost { border-color: transparent; background: transparent; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .84rem; } .xs { font-size: .74rem; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; flex-wrap: wrap; }
.section-title h2 { font-weight: 600; font-size: 1.15rem; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--neutral-bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.gold { background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); cursor: pointer; background: transparent; font-family: inherit; }
.tag::before { content: '#'; color: var(--accent); }
.tag.plain::before { content: none; }
.tag:hover { border-color: var(--accent); color: var(--accent); }
.kv { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: .82rem; } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: var(--surface-2); }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.input, select.input, textarea.input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label.fl { display: block; font-size: .7rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .07em; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.7rem; }

/* hero & search */
.hero { padding: 64px 20px 40px; text-align: center; }
.hero .eyebrow { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.2rem, 4.8vw, 3.4rem); color: var(--ink); }
.hero h1 em { font-style: normal; font-weight: 800; color: var(--accent); }
.hero p.lead { color: var(--muted); max-width: 720px; margin: 14px auto 32px; font-size: 1.02rem; }
.searchbox { position: relative; max-width: 820px; margin: 0 auto; text-align: left; }
.sb-inner { display: flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 14px; padding: 6px 6px 6px 18px; border: 1px solid var(--line-2); box-shadow: 0 6px 28px rgba(28,33,59,.07); transition: border-color .15s, box-shadow .15s; }
:root[data-theme="dark"] .sb-inner { box-shadow: 0 6px 28px rgba(0,0,0,.35); }
.sb-inner:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sb-inner > .ic { color: var(--faint); width: 20px; height: 20px; }
.sb-inner input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.02rem; padding: 11px 6px; color: var(--text); min-width: 0; }
.sb-inner input::placeholder { color: var(--faint); }
.sb-inner .btn { border-radius: 10px; }
.searchbox.compact { max-width: none; } .searchbox.compact .sb-inner { box-shadow: none; border-radius: 12px; }
.ac { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 40; padding: 6px; max-height: 470px; overflow: auto; }
.ac-group { padding: 8px 10px 4px; font-size: .64rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.ac-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.ac-item.sel, .ac-item:hover { background: var(--surface-2); }
.ac-item .ac-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ac-item b { font-weight: 600; } .ac-item small { display: block; color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 640px; }
.ac-foot { padding: 8px 10px; font-size: .72rem; color: var(--faint); border-top: 1px solid var(--line); margin-top: 4px; }
.hero-links { margin-top: 18px; font-size: .84rem; color: var(--muted); } .hero-links a { font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 14px; margin-top: 8px; }
.stat { padding: 18px 20px; }
.stat .v { font-size: 1.7rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .78rem; }
.browse { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; }
.browse a, .pill, a.pill { text-decoration: none; }
.browse a { display: block; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text) !important; text-decoration: none !important; transition: border-color .15s, transform .15s; }
.browse a:hover { border-color: var(--accent); transform: translateY(-1px); }
.browse .bi { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 12px; color: var(--accent); background: var(--accent-soft); }
.browse b { display: block; font-weight: 600; } .browse small { color: var(--muted); }

/* results */
.results-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 24px; margin-top: 18px; }
.facets { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; padding: 16px; }
.facet { border-bottom: 1px solid var(--line); padding: 12px 0; } .facet:last-child { border: 0; }
.facet h4 { margin: 0 0 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.facet button { display: flex; justify-content: space-between; gap: 8px; width: 100%; background: none; border: 0; padding: 4px 6px; border-radius: 6px; font: inherit; font-size: .83rem; color: var(--text); cursor: pointer; text-align: left; }
.facet button:hover { background: var(--surface-2); } .facet button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.facet button span:last-child { color: var(--faint); font-size: .76rem; font-variant-numeric: tabular-nums; }
.understood { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: .82rem; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 7px 3px 10px; font-size: .78rem; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip button { background: none; border: 0; cursor: pointer; color: var(--faint); padding: 0 2px; font-size: 1rem; line-height: 1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .count { font-weight: 600; } .toolbar select { width: auto; padding: 6px 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--surface); border: 0; padding: 6px 11px; cursor: pointer; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 500; display: inline-flex; gap: 5px; align-items: center; }
.seg button.on { background: var(--navy); color: #fff; } :root[data-theme="dark"] .seg button.on { background: #F2F2F5; color: var(--navy); }
.res-list { border-top: 1px solid var(--line); }
.res { padding: 18px 4px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 16px; border-bottom: 1px solid var(--line); }
.res h3 { font-size: 1rem; font-weight: 600; }
.ticon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: .62rem; font-weight: 700; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); letter-spacing: .04em; text-align: center; line-height: 1; flex: none; }
.res h3 a, .ecard h3 a, .req a b { text-decoration: none; } .res h3 a:hover, .ecard h3 a:hover { color: var(--accent) !important; }
.res .nm { font-size: .72rem; color: var(--faint); margin: 2px 0 6px; word-break: break-all; font-variant-numeric: tabular-nums; }
.res .meta { display: flex; flex-wrap: wrap; gap: 2px 0; font-size: .8rem; color: var(--muted); align-items: center; margin-top: 4px; }
.res .meta > span + span::before { content: '·'; margin: 0 8px; color: var(--faint); }
.res .meta a { color: var(--muted); text-decoration: none; } .res .meta a:hover { color: var(--accent); }
.res .meta a { font-weight: 500; }
.res .meta .ic { color: var(--faint); }
.res .side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.res-main { min-width: 0; }
.res .sum { font-size: .84rem; margin: 8px 0 4px; color: var(--text); }
.lockline { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 6px; } .lockline .ic { color: var(--accent); }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }

/* entity cards */
.ecard { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.ecard h3 a { color: var(--text) !important; }
.eq-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }

/* dataset page */
.ds-head { padding: 24px 26px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; }
.ds-head h1 { font-size: 1.55rem; margin: 10px 0 4px; }
.ds-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 230px; }
.locked { border: 1px dashed var(--line-2); background: var(--surface-2); border-radius: var(--radius); padding: 24px; display: flex; gap: 16px; align-items: flex-start; }
.locked > .ic { width: 26px; height: 26px; color: var(--accent); }
.mask { background: repeating-linear-gradient(45deg, var(--line), var(--line) 6px, var(--surface-2) 6px, var(--surface-2) 12px); color: transparent; border-radius: 4px; user-select: none; }
.fair { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.fair .f { padding: 14px; border-radius: 10px; background: var(--surface-2); }
.fair .f b { font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.bar { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; } .bar i { display: block; height: 100%; background: var(--accent); }
.path { font-size: .78rem; background: var(--surface-2); border: 1px solid var(--line); padding: 9px 11px; border-radius: 8px; word-break: break-all; font-variant-numeric: tabular-nums; }
.graph { width: 100%; max-width: 860px; margin: 0 auto; height: auto; display: block; }
.graph text { font-family: var(--font); font-size: 11px; fill: var(--text); }
.graph .node { cursor: pointer; } .graph .node:hover rect { stroke: var(--red) !important; stroke-width: 2; }
.graph line { stroke: var(--line-2); stroke-width: 1.4; }
.legal-banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; align-items: flex-start; border: 1px solid transparent; }
.legal-banner.ok { background: var(--ok-bg); color: var(--ok); } .legal-banner.warn { background: var(--warn-bg); color: var(--warn); } .legal-banner.bad { background: var(--bad-bg); color: var(--bad); }
.legal-banner p { margin: 2px 0 0; color: var(--text); font-size: .84rem; }

/* requests */
.stepper { display: flex; align-items: center; margin: 14px 0 8px; }
.step { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--faint); flex: none; }
.step .sd { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: .68rem; }
.step.done { color: var(--text); } .step.done .sd { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .step.done .sd { background: #F2F2F5; border-color: #F2F2F5; color: var(--navy); }
.step.cur { color: var(--accent); font-weight: 600; } .step.cur .sd { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step.rej { color: var(--bad); font-weight: 600; } .step.rej .sd { background: var(--bad); border-color: var(--bad); color: #fff; }
.step-line { flex: 1; height: 1.5px; background: var(--line-2); margin: 0 8px; min-width: 18px; } .step-line.done { background: var(--navy); }
:root[data-theme="dark"] .step-line.done { background: #F2F2F5; }
.req { padding: 18px 20px; margin-bottom: 12px; }
.outcome { margin-top: 10px; padding: 10px 12px; border-radius: 8px; font-size: .84rem; display: flex; gap: 8px; align-items: flex-start; }
.outcome.ok { background: var(--ok-bg); } .outcome.ok > .ic { color: var(--ok); }
.outcome.bad { background: var(--bad-bg); } .outcome.bad > .ic { color: var(--bad); }
.outcome.exp { background: var(--neutral-bg); } .outcome.exp > .ic { color: var(--muted); }
.hist { margin: 10px 0 0; padding: 0; list-style: none; font-size: .78rem; color: var(--muted); border-left: 2px solid var(--line); }
.hist li { padding: 2px 0 2px 12px; }
.filters-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters-inline button { border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; }
.filters-inline button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.hstats { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }

/* ontology */
.concept-list { max-height: 640px; overflow: auto; }
.concept-item { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--text); }
.concept-item b { font-weight: 600; }
.concept-item:hover, .concept-item.on { background: var(--surface-2); }
.concept-item.on { box-shadow: inset 3px 0 0 var(--accent); }
.concept-item small { display: block; color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.syn { display: flex; flex-wrap: wrap; gap: 5px; }
.syn span { background: var(--surface-2); border: 1px solid var(--line); padding: 2px 9px; border-radius: 6px; font-size: .78rem; }
.ask-box { max-width: 860px; margin: 0 auto; }
.ask-box textarea { font-size: 1.02rem; min-height: 64px; resize: vertical; }
.answer { margin-top: 18px; padding: 22px 24px; border-left: 3px solid var(--accent); }
.qbox { font-size: .9rem; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 12px 14px; border-radius: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; word-break: break-word; }
.qbox code { color: var(--text); font-size: .9rem; }
.explain { margin: 12px 0 0; padding: 0; list-style: none; }
.explain li { display: grid; grid-template-columns: minmax(150px, 280px) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.explain code { color: var(--accent); font-weight: 600; }

/* modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(12,14,28,.55); z-index: 200; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: min(620px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(900px, 100%); }
.modal-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h2 { font-size: 1.05rem; flex: 1; }
.modal-b { padding: 18px 22px; } .modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .85rem; max-width: 380px; display: flex; gap: 10px; align-items: center; animation: slidein .25s; border-left: 3px solid var(--red); }
:root[data-theme="dark"] .toast { background: #F2F2F5; color: var(--navy); }
.toast .ic { color: var(--red); }
@keyframes fade { from { opacity: 0; } } @keyframes slidein { from { transform: translateY(12px); opacity: 0; } }
.progress { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; } .progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.filter-panel { margin-top: 10px; padding: 18px 20px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px 14px; }

/* tour */
.tour-spot { position: fixed; z-index: 900; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10,12,26,.74), 0 0 0 2px var(--red); pointer-events: none; transition: all .35s cubic-bezier(.4,.1,.2,1); }
.tour-block { position: fixed; inset: 0; z-index: 899; }
.tour-card { position: fixed; z-index: 901; width: min(400px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 18px 20px 14px; transition: top .35s, left .35s; }
.tour-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.tour-card p { margin: 0 0 12px; color: var(--muted); font-size: .86rem; }
.tour-card .tprog { height: 3px; background: var(--line); border-radius: 9px; overflow: hidden; margin-bottom: 10px; } .tour-card .tprog i { display: block; height: 100%; background: var(--red); }
.tour-card .tstep { font-size: .66rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

@media (max-width: 1520px) { .role-btn .who small { display: none; } .mainnav a { padding: 8px 10px; } .mainnav a.active::after { left: 10px; right: 10px; } }
@media (max-width: 1320px) { .brand-text small { display: none; } .hide-md { display: none; } .role-btn .who { display: none; } }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, 1fr); } .browse { grid-template-columns: repeat(3, 1fr); } .filter-grid { grid-template-columns: repeat(2, 1fr); } .g4, .hstats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; } .mainnav { order: 3; width: 100%; margin: 0; flex: none; } .mainnav a.active::after { bottom: -2px; } .hide-sm { display: none; }
  main { padding: 18px 16px; } .hero { padding: 36px 4px 28px; } .results-layout { grid-template-columns: minmax(0,1fr); } .facets { position: static; max-height: 240px; } .sb-inner { padding-left: 10px; } .sb-inner .btn { padding: 8px 10px; }
  .g2, .g3 { grid-template-columns: 1fr; } .ds-head { grid-template-columns: 1fr; } .browse { grid-template-columns: repeat(2, 1fr); } .stats { grid-template-columns: repeat(2, 1fr); }
  .res { grid-template-columns: 36px minmax(0,1fr); } .res .ticon { width: 36px; height: 36px; } .res .side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .role-btn .who { display: none; } .explain li { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } .fair { grid-template-columns: repeat(2, 1fr); }
}

/* v3 components */
.demo-chip { margin-left: 4px; font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 5px; padding: 1px 6px; align-self: center; }
.mode-toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); margin: 0 auto 12px; }
.searchbox:not(.compact) { text-align: center; } .searchbox:not(.compact) .sb-inner, .searchbox .ac { text-align: left; }
.mode-toggle button { border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 500; color: var(--muted); padding: 6px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.mode-toggle button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.stat-line { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 28px; margin-top: 26px; color: var(--muted); font-size: .84rem; }
.stat-line b { color: var(--ink); font-weight: 800; font-size: 1rem; margin-right: 4px; }
.open-promo { display: flex; align-items: center; gap: 16px; padding: 18px 22px; margin-top: 16px; text-decoration: none !important; color: var(--text) !important; }
.open-promo:hover { border-color: var(--accent); }
.open-promo .bi { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); flex: none; }
.open-promo p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.facets { padding: 4px 0; } .facets.card { border: 0; }
.facet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.switch-row { display: flex; gap: 8px; align-items: center; font-size: .84rem; font-weight: 500; padding: 8px 0 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row input { accent-color: var(--red); width: 16px; height: 16px; }
.cnt { font-size: .72rem; color: var(--faint); font-weight: 500; margin-left: 2px; }
.input-sm { padding: 6px 10px; font-size: .82rem; width: auto; }
.tabs .input-sm, .tabs .seg, .tabs .btn { align-self: center; margin-bottom: 6px; }
.btn-xs { padding: 2px 6px; font-size: .72rem; }
.ds-head { padding: 0 0 22px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; border-bottom: 0; }
.ds-head h1 { font-size: 1.5rem; margin: 0 0 2px; }
.ds-actions { min-width: 220px; }
.ds-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.kv-tight { grid-template-columns: minmax(96px, 36%) 1fr; gap: 6px 12px; }
.callout { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.callout p { margin: 2px 0 0; }
.fair-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.fair-mini span { font-size: .7rem; font-weight: 700; color: var(--muted); }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 18px 0 22px; }
.steps3 > div { background: var(--surface); padding: 14px 16px; }
.steps3 b { display: block; font-weight: 600; font-size: .86rem; } .steps3 span { color: var(--muted); font-size: .8rem; }
.landing { max-width: 1080px; margin: 0 auto; }
.landing-head { padding: 8px 0 26px; }
.landing-head h1 { font-size: 1.8rem; margin: 12px 0 6px; }
.landing-head .row { margin-top: 16px; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.file-list li .mono { flex: 1; word-break: break-all; }
.cite { font-size: .84rem; padding: 12px 14px; background: var(--surface-2); border-radius: 8px; margin: 10px 0; }
.checklist { list-style: none; padding: 0; margin: 12px 0 0; }
.checklist li { display: flex; gap: 8px; align-items: center; font-size: .86rem; padding: 4px 0; } .checklist li.ok .ic { color: var(--ok); }
a.ecard { text-decoration: none !important; color: var(--text) !important; transition: border-color .15s; } a.ecard:hover { border-color: var(--accent); }
.ecard-foot { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.ecard-foot b { color: var(--ink); }
@media (max-width: 860px) { .ds-grid, .steps3 { grid-template-columns: 1fr; } .stat-line { gap: 6px 16px; } }
.input.input-sm, select.input.input-sm { width: auto; padding: 6px 10px; font-size: .82rem; }
.tabs { align-items: center; }
.seg button { padding: 6px 9px; }

/* EHDS module */
.sim-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin: 16px 0 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface); font-size: .84rem; color: var(--muted); }
.sim-banner b { color: var(--text); } .sim-banner > .ic { color: var(--accent); margin-top: 2px; }
.ehds-kpis .stat .v { font-size: 1.35rem; }
.arch { width: 100%; height: auto; display: block; margin-top: 12px; }
.arch-box rect { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.2; }
.arch-box.own rect { fill: var(--accent-soft); stroke: var(--red); }
.arch-box.eu rect { stroke: var(--lavender); stroke-dasharray: 4 3; }
.arch-box .t { font: 600 12.5px var(--font); fill: var(--text); } .arch-box .s { font: 400 10.5px var(--font); fill: var(--muted); }
.arch-arrow line { stroke: var(--silver); stroke-width: 1.3; } .arch-arrow text { font: 500 10px var(--font); fill: var(--muted); } .arch .ah { fill: var(--silver); }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 6px; right: 6px; top: 6px; height: 2px; background: var(--line-2); }
.tl-item { position: relative; font-size: .78rem; color: var(--muted); }
.tl-item b { display: block; color: var(--text); font-weight: 600; margin-top: 10px; } .tl-item span { display: block; line-height: 1.4; }
.tl-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--silver); position: relative; }
.tl-item.past .tl-dot { background: var(--navy); border-color: var(--navy); } :root[data-theme="dark"] .tl-item.past .tl-dot { background: #F2F2F5; border-color: #F2F2F5; }
.tl-item.sim .tl-dot { background: var(--red); border-color: var(--red); }
.ehds-list { display: grid; gap: 12px; }
.ehds-ds { padding: 18px 20px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; }
.ehds-ds h3 { margin: 6px 0 4px; } .ehds-ds p { margin: 0 0 8px; }
.ehds-ds-side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 150px; }
.ehds-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .78rem; color: var(--muted); } .ehds-facts b { color: var(--ink); }
.qlabel { color: var(--accent); letter-spacing: 2px; font-size: .8rem; }
.cc { display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--text); }
.ehds-callout { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--lavender); border-radius: 10px; font-size: .84rem; color: var(--text) !important; text-decoration: none !important; background: var(--surface); }
.ehds-callout:hover { border-color: var(--accent); } .ehds-callout > .ic:first-child { color: var(--lavender); } .ehds-callout span { flex: 1; }
.wiz-steps { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 18px; }
.wiz-steps span { font-size: .76rem; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.wiz-steps span.on { background: var(--accent); color: #fff; font-weight: 600; } .wiz-steps span.done { color: var(--text); }
.choice { cursor: pointer; display: flex; flex-direction: column; gap: 4px; } .choice input { display: none; } .choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ehds-spe { grid-template-columns: minmax(0,1fr) minmax(0,1fr); margin-bottom: 16px; }
.out-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .ehds-ds, .ehds-spe { grid-template-columns: 1fr; } .timeline { grid-template-columns: 1fr 1fr; } .timeline::before { display: none; } }
.arch .arch-lbl { font: 500 10px var(--font); fill: var(--muted); }

/* ontology structure */
.lead-sm { color: var(--accent); font-size: 1.05rem; margin: 4px 0 18px; }
.chain { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; }
.chain-box { border: 1.5px solid var(--red); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); }
.chain-box h3 { color: var(--accent); font-size: 1rem; }
.chain-box ul { list-style: none; margin: 12px 0 0; padding: 0; }
.chain-box li { padding: 6px 0 6px 16px; position: relative; border-top: 1px solid var(--line); font-size: .86rem; }
.chain-box li::before { content: '›'; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.chain-box li a { text-decoration: none; font-weight: 500; } .chain-box li span { display: block; font-size: .74rem; color: var(--muted); }
.chain-arrow { align-self: center; color: var(--accent); font-size: 1.6rem; font-weight: 800; }
.cross-bar { margin-top: 14px; padding: 12px 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; font-size: .88rem; }
.cross-bar b { margin-right: 6px; } .cross-bar a { text-decoration: none; } .cross-bar .sep { color: var(--faint); }
.stack { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stack-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; background: var(--navy); color: #fff; }
:root[data-theme="dark"] .stack-top { background: #2C3254; }
.stack-top b { font-weight: 800; font-size: 1.05rem; } .stack-top span { font-size: .82rem; opacity: .85; }
.stack-mods { display: grid; grid-template-columns: repeat(5, 1fr); }
.stack-mod { padding: 14px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; } .stack-mod:last-child { border-right: 0; }
.stack-mod b { font-weight: 700; } .stack-mod > span:nth-of-type(1) { font-size: .84rem; }
.stack-mod.own { background: var(--accent-soft); } .stack-mod.own b { color: var(--accent); }
.stack-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 2px; font-size: .8rem; } .stack-foot b { color: var(--ink); }
.mod { display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); vertical-align: 1px; }
.mod-FIND { border-color: var(--red); color: var(--accent); } .mod-ChEBI { color: var(--lavender); border-color: var(--lavender); } .mod-QUDT { color: var(--steel); }
@media (max-width: 1100px) { .chain { grid-template-columns: 1fr 1fr; } .chain-arrow { display: none; } .stack-mods { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .chain, .stack-mods { grid-template-columns: 1fr; } }
