/* Felix brand tokens — from felix-powerbi-brand/felix-brand-web-guide.md */
:root {
  --felix-green: #09A501; --felix-avocado: #032B2B; --felix-broccoli: #055043; --felix-lime: #56D14F;
  --felix-peppermint: #B0F090; --felix-carrot: #FF6E00; --felix-zest: #FFFA00; --felix-berry: #DAB2FF;
  --felix-grape: #6647C4; --felix-black: #000; --felix-dough: #FAF6E6; --felix-white: #fff;

  --bg: var(--felix-dough); --surface: var(--felix-white); --ink: var(--felix-avocado); --ink-muted: var(--felix-broccoli);
  --ink-faint: #5d7a70; --brand: var(--felix-green); --header-bg: var(--felix-avocado); --on-header: var(--felix-white);
  --link: var(--felix-grape); --focus-ring: var(--felix-avocado); --rule: rgba(3,43,43,.12); --rule-soft: rgba(3,43,43,.07);
  --tint: rgba(176,240,144,.22); --code-bg: #F3F0E3;

  /* categorical: table types */
  --t-fact: var(--felix-green); --t-dim: var(--felix-grape); --t-bridge: var(--felix-carrot); --t-param: var(--felix-broccoli);
  --t-measures: #9b6fe8; --t-other: #7aa08f; --t-plumbing: #b9c4bf;

  --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 0 rgba(3,43,43,.06), 0 8px 24px rgba(3,43,43,.07);
  --font-sans: 'Google Sans Flex', 'Segoe UI', Arial, system-ui, sans-serif;
  --font-mono: 'Cascadia Code', 'SF Mono', Consolas, monospace;
  --header-h: 72px;
}
/* Dark mode: same brand hues, inverted neutrals. Green/lime/peppermint stay as accents on avocado. */
[data-theme="dark"] {
  --bg: #061f1f; --surface: #0b2b2a; --ink: #EAF3E8; --ink-muted: #B0F090; --ink-faint: #8fb59f;
  --header-bg: #021616; --on-header: #fff; --link: #DAB2FF; --focus-ring: var(--felix-lime);
  --rule: rgba(234,243,232,.16); --rule-soft: rgba(234,243,232,.09); --tint: rgba(86,209,79,.14); --code-bg: #0f3532;
  --t-param: #56D14F; --t-other: #9cc4b1; --shadow: 0 1px 0 rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}
[data-theme="dark"] .table th { background: #021616; }
[data-theme="dark"] .table tr:nth-child(even) td { background: rgba(86,209,79,.06); }
[data-theme="dark"] .chip { background: #1d4d3f; color: #EAF3E8; }
[data-theme="dark"] .chip.info { background: #4a3591; color: #fff; }
[data-theme="dark"] .chip.dark { background: #B0F090; color: #032B2B; }
[data-theme="dark"] .chip.ghost.on { background: #B0F090; color: #032B2B; border-color: #B0F090; }
[data-theme="dark"] .seg button.on { background: #B0F090; color: #032B2B; }
[data-theme="dark"] .folder-tree .f.on { background: #B0F090; color: #032B2B; }
[data-theme="dark"] .badge.layer { background: #1d4d3f; color: #EAF3E8; border-color: transparent; }
[data-theme="dark"] .badge.dl-n\/a, [data-theme="dark"] .flag.hidden { background: #1d4d3f; color: #B0F090; }
[data-theme="dark"] .badge.param { background: #56D14F; color: #032B2B; }
[data-theme="dark"] .btn-dark { background: #B0F090; color: #032B2B; }
[data-theme="dark"] .btn-secondary { border-color: #56D14F; }
[data-theme="dark"] pre.code .kw { color: #DAB2FF; }
[data-theme="dark"] pre.code .fn { color: #56D14F; }
[data-theme="dark"] pre.code .ref { color: #B0F090; }
[data-theme="dark"] pre.code .str { color: #FFB86B; }
[data-theme="dark"] .tcard rect.box, [data-theme="dark"] .ln-node rect { fill: #0b2b2a; stroke: rgba(234,243,232,.3); }
[data-theme="dark"] .tcard .col, [data-theme="dark"] .ln-node text, [data-theme="dark"] .cluster-node text { fill: #EAF3E8; }
[data-theme="dark"] .rel path, [data-theme="dark"] .ln-link, [data-theme="dark"] .cluster-link { stroke: rgba(234,243,232,.4); }
[data-theme="dark"] .erd-legend, [data-theme="dark"] .erd-hint { background: rgba(11,43,42,.92); }
[data-theme="dark"] .map-tip { background: rgba(6,31,31,.97); }
[data-theme="dark"] .map-side { border-left-color: var(--rule); }
[data-theme="dark"] .callout { background: #0f3532; }
[data-theme="dark"] .app-header .input { background: #0f3532; color: #fff; }
[data-theme="dark"] .app-nav a.active { background: #B0F090; color: #032B2B; }
.theme-toggle { color: var(--on-header); font-size: 18px; margin-left: 4px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 15px; line-height: 1.5; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
h1 { font-weight: 700; font-size: clamp(24px, 3vw, 34px); }
h2 { font-weight: 600; font-size: 20px; }
h3 { font-weight: 600; font-size: 16px; }
p { margin: 0 0 12px; }
b, strong { font-weight: 700; }
button { font-family: inherit; }

/* ---- header ---- */
.app-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 20px; height: var(--header-h);
  padding: 0 clamp(16px, 3vw, 40px); background: var(--header-bg); color: var(--on-header); border-bottom: 3px solid var(--felix-lime); }
.brand { display: flex; align-items: center; height: 100%; padding: 0 4px; }
.brand-logo { height: 42px; width: auto; display: block; }
.brand-mark { font-family: 'Google Sans Flex', sans-serif; font-weight: 800; font-size: 28px; color: #fff; letter-spacing: -0.03em; }
.app-title { display: flex; flex-direction: column; white-space: nowrap; }
.app-title-main { font-weight: 700; font-size: 17px; }
.app-title-sub { font-size: 12px; opacity: .8; }
.app-nav { display: flex; gap: 1px; margin-left: 4px; flex-wrap: nowrap; }
.app-nav a { color: var(--on-header); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; opacity: .85; white-space: nowrap; }
@media (max-width: 1400px) { .app-nav a { padding: 8px 8px; font-size: 13px; } .app-search { width: 260px; } }
@media (max-width: 1180px) { .app-title { display: none; } }
.app-nav a:hover { background: rgba(255,255,255,.08); opacity: 1; }
.app-nav a.active { background: var(--felix-green); color: var(--felix-avocado); opacity: 1; }
.app-search { margin-left: auto; position: relative; min-width: 260px; width: 360px; }
.input { width: 100%; background: var(--surface); color: var(--ink); border: 1.5px solid rgba(3,43,43,.25); border-radius: var(--radius-sm);
  padding: 9px 12px; font-family: var(--font-sans); font-size: 14px; }
.input:focus { border-color: var(--felix-green); outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.app-header .input { border-color: transparent; }
.search-results { position: absolute; top: 44px; right: 0; left: 0; background: var(--surface); color: var(--ink); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); max-height: 60vh; overflow: auto; padding: 6px; }
.search-results[hidden] { display: none; }
.search-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.search-item:hover, .search-item.active { background: var(--tint); }
.search-item .kind { font-size: 11px; font-weight: 700; color: var(--ink-muted); width: 68px; flex-shrink: 0; }
.search-item .sub { color: var(--ink-faint); font-size: 12px; margin-left: auto; }

/* ---- layout ---- */
.view { min-height: calc(100vh - var(--header-h) - 56px); padding: 24px clamp(16px, 3vw, 40px) 40px; max-width: 1600px; margin: 0 auto; }
.view.full { max-width: none; padding: 0; }
.app-footer { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; padding: 16px clamp(16px, 3vw, 40px);
  color: var(--ink-muted); font-size: 12.5px; font-weight: 600; border-top: 1px solid var(--rule); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--ink-muted); max-width: 820px; margin: 6px 0 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.split { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } .app-title-sub, .app-title-main { display: none; } .app-search { width: 220px; } }

/* ---- cards ---- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card.tight { padding: 12px 14px; }
.card-accent { width: 44px; height: 7px; border-radius: 3px; background: var(--brand); margin-bottom: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-weight: 700; font-size: 30px; line-height: 1; }
.stat .lbl { font-size: 12.5px; color: var(--ink-muted); font-weight: 600; }
.stat .sub { font-size: 12px; color: var(--ink-faint); }
.section { margin-top: 28px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--ink-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section-title .count { color: var(--ink-faint); font-weight: 600; }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.small { font-size: 12.5px; }

/* ---- chips & badges ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--felix-peppermint); color: var(--felix-avocado); border: 1.5px solid transparent; cursor: default; white-space: nowrap; }
.chip.click { cursor: pointer; }
.chip.click:hover { filter: brightness(.95); }
.chip.ghost { background: transparent; border-color: rgba(3,43,43,.25); color: var(--ink); }
.chip.ghost.on { background: var(--felix-avocado); color: #fff; border-color: var(--felix-avocado); }
.chip.warn { background: var(--felix-carrot); color: var(--felix-black); }
.chip.info { background: var(--felix-berry); color: var(--felix-avocado); }
.chip.dark { background: var(--felix-avocado); color: #fff; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; color: var(--felix-white); line-height: 1.4; }
.badge.fact { background: var(--t-fact); color: var(--felix-avocado); }
.badge.dim { background: var(--t-dim); }
.badge.bridge { background: var(--t-bridge); color: var(--felix-black); }
.badge.param { background: var(--t-param); }
.badge.measures { background: var(--t-measures); }
.badge.other { background: var(--t-other); }
.badge.plumbing { background: var(--t-plumbing); color: var(--felix-avocado); }
.badge.layer { background: var(--code-bg); color: var(--ink); border: 1px solid var(--rule); }
.badge.dl-ready { background: var(--felix-green); color: var(--felix-avocado); }
.badge.dl-near { background: var(--felix-peppermint); color: var(--felix-avocado); }
.badge.dl-materialise { background: var(--felix-carrot); color: var(--felix-black); }
.badge.dl-n\/a { background: var(--code-bg); color: var(--ink-muted); }
.flag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.flag.stub-blank, .flag.duplicate { background: var(--felix-carrot); color: var(--felix-black); }
.flag.no-reference { background: var(--felix-zest); color: var(--felix-avocado); }
.flag.indirect-only { background: var(--felix-berry); color: var(--felix-avocado); }
.flag.shared { background: var(--felix-peppermint); color: var(--felix-avocado); }
.flag.hidden { background: var(--code-bg); color: var(--ink-muted); }

/* ---- buttons ---- */
.btn { font-weight: 700; font-size: 14px; border-radius: var(--radius-sm); padding: 9px 16px; border: 2px solid transparent; cursor: pointer; line-height: 1; }
.btn-primary { background: var(--felix-green); color: var(--felix-avocado); }
.btn-dark { background: var(--felix-avocado); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--felix-green); }
.btn:hover { filter: brightness(.96); }
.btn-icon { padding: 6px 10px; background: transparent; color: inherit; border-color: transparent; font-size: 16px; }
.seg { display: inline-flex; background: var(--surface); border-radius: var(--radius-sm); padding: 3px; box-shadow: var(--shadow); }
.seg button { border: none; background: transparent; color: var(--ink); font-weight: 600; font-size: 13px; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--felix-avocado); color: #fff; }
select.input { width: auto; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { background: var(--felix-avocado); color: #fff; font-weight: 700; text-align: left; padding: 9px 12px; position: sticky; top: 0; }
.table th:first-child { border-radius: 8px 0 0 0; }
.table th:last-child { border-radius: 0 8px 0 0; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.table tr:nth-child(even) td { background: rgba(176,240,144,.14); }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--tint); }
.table-wrap { overflow: auto; max-height: 70vh; border-radius: 8px; }

/* ---- code blocks ---- */
pre.code { background: var(--code-bg); border-radius: var(--radius-sm); padding: 12px 14px; overflow: auto; font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.5; margin: 8px 0; white-space: pre-wrap; word-break: break-word; color: var(--ink); max-height: 420px; }
pre.code .kw { color: var(--felix-grape); font-weight: 700; }
pre.code .fn { color: var(--felix-broccoli); font-weight: 700; }
pre.code .ref { color: #0b6b05; }
pre.code .str { color: #9a4b00; }
pre.code .cm { color: var(--ink-faint); }
details { border-top: 1px solid var(--rule-soft); padding: 8px 0; }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; gap: 8px; align-items: center; }
details summary::before { content: "▸"; color: var(--ink-faint); font-size: 12px; transition: transform .15s; }
details[open] summary::before { transform: rotate(90deg); }
details summary::-webkit-details-marker { display: none; }

/* ---- drawer ---- */
.drawer { position: fixed; top: var(--header-h); right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: -8px 0 30px rgba(3,43,43,.15);
  z-index: 35; display: flex; flex-direction: column; border-left: 3px solid var(--felix-lime); }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.drawer-title { font-weight: 700; font-size: 17px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drawer-body { overflow: auto; padding: 16px 18px 40px; font-size: 14px; }
.drawer-body h4 { font-size: 12.5px; font-weight: 700; color: var(--ink-muted); margin: 18px 0 6px; }
.drawer-body h4:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-muted); font-weight: 600; }
.kv dd { margin: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 5px 0; border-bottom: 1px solid var(--rule-soft); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.link-btn { background: none; border: none; color: var(--link); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; text-align: left; }
.link-btn:hover { text-decoration-thickness: 2px; }
.wrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- overview ---- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: stretch; }
.hero .hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 1000px) { .hero { grid-template-columns: 1fr; } }
.hero .card p { font-size: 15px; }
.finding { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); align-items: flex-start; }
.finding:last-child { border-bottom: none; }
.finding .sev { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.finding .sev.warn { background: var(--felix-carrot); }
.finding .sev.info { background: var(--felix-grape); }
.finding .ttl { font-weight: 700; }
.finding .dtl { color: var(--ink-muted); font-size: 13px; }
.change { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px; }
.change .date { color: var(--ink-faint); white-space: nowrap; width: 84px; flex-shrink: 0; }
.change .obj { font-weight: 700; }
.change .kind { font-size: 11px; color: var(--ink-muted); margin-right: 6px; font-weight: 700; }
.change .note { color: var(--ink-muted); margin-top: 2px; }
.cluster-tile { display: flex; flex-direction: column; gap: 6px; cursor: pointer; border-left: 6px solid var(--brand); }
.cluster-tile:hover { transform: translateY(-1px); }
.cluster-tile .name { font-weight: 700; font-size: 15px; }
.cluster-tile .desc { color: var(--ink-muted); font-size: 12.5px; }
.cluster-tile .meta { font-size: 12px; color: var(--ink-faint); font-weight: 600; }

/* ---- ERD ---- */
.erd-stage { position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; height: calc(100vh - var(--header-h) - 190px); min-height: 520px; }
.erd-stage svg { width: 100%; height: 100%; display: block; cursor: grab; }
.erd-stage svg:active { cursor: grabbing; }
.erd-legend { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 12px; font-size: 12px; font-weight: 600; color: var(--ink-muted); background: rgba(255,255,255,.9); padding: 6px 10px; border-radius: 8px; flex-wrap: wrap; }
.erd-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.erd-hint { position: absolute; right: 14px; bottom: 12px; font-size: 12px; color: var(--ink-faint); background: rgba(255,255,255,.9); padding: 6px 10px; border-radius: 8px; }
.tcard rect.box { fill: #fff; stroke: rgba(3,43,43,.25); stroke-width: 1.2; rx: 10; }
.tcard.selected rect.box { stroke: var(--felix-avocado); stroke-width: 2.5; }
.tcard rect.head { rx: 10; }
.tcard text { font-family: var(--font-sans); }
.tcard .title { font-size: 13px; font-weight: 700; }
.tcard .col { font-size: 11px; fill: var(--ink); }
.tcard .col.key { font-weight: 700; }
.tcard .more { font-size: 10.5px; fill: var(--ink-faint); }
.rel path { fill: none; stroke: rgba(3,43,43,.45); stroke-width: 1.4; }
.rel.inactive path { stroke-dasharray: 5 4; stroke: rgba(3,43,43,.3); }
.rel.both path { stroke: var(--felix-grape); }
.rel.dim path, .tcard.dim { opacity: .18; }
.rel.hi path { stroke: var(--felix-carrot); stroke-width: 2.4; }
.rel .marker { fill: none; stroke: inherit; stroke-width: 1.4; }
.cluster-node circle { stroke: #fff; stroke-width: 3; }
.cluster-node text { font-family: var(--font-sans); font-weight: 700; font-size: 13px; fill: var(--ink); text-anchor: middle; }
.cluster-link { stroke: rgba(3,43,43,.35); fill: none; }

/* ---- measures ---- */
.folder-tree { font-size: 13.5px; }
.folder-tree .f { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.folder-tree .f:hover { background: var(--tint); }
.folder-tree .f.on { background: var(--felix-avocado); color: #fff; }
.folder-tree .f .n { color: inherit; opacity: .6; font-weight: 600; }
.folder-tree .f.sub { padding-left: 24px; }
.measure-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); cursor: pointer; align-items: center; }
.measure-row:hover { background: var(--tint); }
.measure-row .nm { font-weight: 700; }
.measure-row .ds { color: var(--ink-muted); font-size: 12.5px; }
.measure-row .use { font-size: 12px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; text-align: right; }
.dep-chain { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.dep-chain .col h5 { margin: 0 0 6px; font-size: 12px; color: var(--ink-muted); }
.dep-chain .arrow { align-self: center; color: var(--ink-faint); font-size: 22px; }

/* ---- usage map ---- */
.map-shell { display: grid; grid-template-columns: 1fr 300px; height: calc(100vh - var(--header-h) - 56px); }
.map-canvas { position: relative; background: var(--felix-avocado); overflow: hidden; }
.map-canvas canvas { display: block; width: 100%; height: 100%; }
.map-side { background: var(--surface); border-left: 1px solid var(--rule); overflow: auto; padding: 14px 16px; font-size: 13.5px; }
.map-side h3 { margin-bottom: 8px; }
.map-side .legend div { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 12.5px; }
.map-side .legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-side .rlist button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--ink); padding: 6px 8px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
.map-side .rlist button:hover, .map-side .rlist button.on { background: var(--tint); }
.map-side .rlist button.on { font-weight: 700; }
.map-tip { position: absolute; pointer-events: none; background: rgba(250,246,230,.97); color: var(--ink); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; box-shadow: var(--shadow); max-width: 320px; }
.map-tip b { display: block; }
.map-tip .k { color: var(--ink-muted); font-size: 11px; font-weight: 700; }
.map-toolbar { position: absolute; left: 14px; top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.map-toolbar .input { width: 240px; }
.map-toolbar .chip.ghost { border-color: rgba(255,255,255,.4); color: #fff; }
.map-toolbar .chip.ghost.on { background: var(--felix-lime); color: var(--felix-avocado); border-color: var(--felix-lime); }
.map-status { position: absolute; left: 14px; bottom: 12px; color: rgba(255,255,255,.8); font-size: 12px; font-weight: 600; }

/* ---- sources ---- */
.schema-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.obj-row { padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.obj-row:hover { background: var(--tint); }
.obj-row .nm { font-weight: 700; }
.obj-row .feeds { font-size: 12px; color: var(--ink-muted); }
.matrix td .badge { margin-right: 4px; }

/* ---- lineage ---- */
.lineage-stage { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; min-height: 520px; height: calc(100vh - var(--header-h) - 210px); position: relative; }
.lineage-stage svg { display: block; font-family: var(--font-sans); }
.ln-col-title { font-size: 12px; font-weight: 700; fill: var(--ink-muted); }
.ln-node rect { rx: 8; stroke: rgba(3,43,43,.25); stroke-width: 1; fill: #fff; cursor: pointer; }
.ln-node.focus rect { stroke: var(--felix-avocado); stroke-width: 2.5; }
.ln-node text { font-size: 12px; fill: var(--ink); pointer-events: none; }
.ln-node text.sub { font-size: 10.5px; fill: var(--ink-faint); }
.ln-node rect.bar { stroke: none; }
.ln-link { fill: none; stroke: rgba(3,43,43,.25); stroke-width: 1.4; }
.ln-link.hi { stroke: var(--felix-carrot); stroke-width: 2.2; }
.ln-node.dim, .ln-link.dim { opacity: .15; }

/* ---- health / history / glossary / impact ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.score-ring { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .track { fill: none; stroke: var(--rule); stroke-width: 12; }
.score-ring .arc { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.score-ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 38px; line-height: 1; }
.score-ring .num small { font-size: 11px; font-weight: 700; color: var(--ink-muted); margin-top: 4px; }
.score-row { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.bar { height: 10px; border-radius: 5px; background: var(--rule-soft); overflow: hidden; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--felix-green); }
.bar.warn > i { background: var(--felix-carrot); }
.bar.mid > i { background: var(--felix-zest); }
.comp { display: grid; grid-template-columns: 200px 1fr 60px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px; }
.comp .lbl { font-weight: 700; }
.comp .lbl small { display: block; font-weight: 600; color: var(--ink-faint); font-size: 11.5px; }
.comp .val { text-align: right; font-weight: 700; }
.comp .dtl { grid-column: 1 / -1; color: var(--ink-muted); font-size: 12.5px; margin-top: -4px; }
.sev { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.sev.warn { background: var(--felix-carrot); } .sev.info { background: var(--felix-grape); } .sev.error { background: #c62828; }
.cov-grid { display: grid; grid-template-columns: 160px 1fr 1fr 1fr; gap: 6px 12px; align-items: center; font-size: 13px; }
.cov-grid .h { font-size: 11.5px; font-weight: 700; color: var(--ink-muted); }
.cov-cell { display: flex; align-items: center; gap: 8px; }
.cov-cell .bar { flex: 1; }
.cov-cell span { width: 36px; text-align: right; font-weight: 700; font-size: 12px; }
.spark { width: 100%; height: 120px; display: block; }
.spark .line { fill: none; stroke: var(--felix-green); stroke-width: 2.5; }
.spark .area { fill: rgba(9,165,1,.12); }
.spark .dot { fill: var(--felix-avocado); stroke: #fff; stroke-width: 2; }
[data-theme="dark"] .spark .dot { fill: #B0F090; stroke: #0b2b2a; }
.spark .axis text { font-size: 10px; fill: var(--ink-faint); }
.spark .axis line, .spark .axis path { stroke: var(--rule); }
.growth-card .num { font-size: 26px; font-weight: 700; }
.growth-card .delta { font-size: 12.5px; font-weight: 700; }
.growth-card .delta.up { color: #0b6b05; } .growth-card .delta.down { color: #b34700; }
[data-theme="dark"] .growth-card .delta.up { color: #56D14F; } [data-theme="dark"] .growth-card .delta.down { color: #FFB86B; }
.cl-item { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px; align-items: baseline; }
.cl-item .act { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.cl-item .act.added { color: #0b6b05; } .cl-item .act.removed { color: #b34700; } .cl-item .act.changed, .cl-item .act.dax-changed, .cl-item .act.type-changed, .cl-item .act.definition-changed, .cl-item .act.layer-changed, .cl-item .act.moved { color: var(--felix-grape); } .cl-item .act.documented { color: var(--ink-muted); }
[data-theme="dark"] .cl-item .act.added { color: #56D14F; } [data-theme="dark"] .cl-item .act.removed { color: #FFB86B; } [data-theme="dark"] .cl-item .act.changed, [data-theme="dark"] .cl-item .act.dax-changed { color: #DAB2FF; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.bars > div { flex: 1; min-width: 3px; background: var(--felix-green); border-radius: 3px 3px 0 0; position: relative; }
.bars > div.fail { background: var(--felix-carrot); }
.bars > div:hover { filter: brightness(.85); }
.bars > div .tip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--felix-avocado); color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 2; margin-bottom: 4px; }
.bars > div:hover .tip { display: block; }
.term { padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.term:target, .term.hi { background: var(--tint); border-radius: var(--radius-sm); padding: 14px; }
.term h3 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.term .def { margin: 6px 0 8px; }
.status { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--code-bg); color: var(--ink-muted); }
.status.approved { background: var(--felix-green); color: var(--felix-avocado); }
.status.draft { background: var(--felix-zest); color: var(--felix-avocado); }
.status.planned { background: var(--felix-berry); color: var(--felix-avocado); } .status.in-progress { background: var(--felix-zest); color: var(--felix-avocado); }
.status.materialised, .status.ready { background: var(--felix-peppermint); color: var(--felix-avocado); } .status.switched { background: var(--felix-green); color: var(--felix-avocado); }
.status.wont-do { background: var(--code-bg); color: var(--ink-faint); }
.status.keep { background: var(--felix-peppermint); color: var(--felix-avocado); } .status.retire, .status.retired { background: var(--felix-carrot); color: var(--felix-black); }
.impact-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.impact-hero .card { border-top: 6px solid var(--felix-green); }
.impact-hero .card.hot { border-top-color: var(--felix-carrot); }
.impact-hero .card.zero { border-top-color: var(--rule); }
.impact-list li { padding: 6px 0; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.lens { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; border-left: 6px solid var(--felix-grape); cursor: pointer; }
.lens:hover { transform: translateY(-1px); }
.lens .name { font-weight: 700; }
.lens .desc { color: var(--ink-muted); font-size: 12.5px; }
.owner { font-size: 12px; color: var(--ink-muted); font-weight: 600; }
.card.stat.click { cursor: pointer; }
.card.stat.click:hover { transform: translateY(-1px); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.filter-row select.input, .filter-row input.input { padding: 6px 10px; font-size: 13px; }

.flag.u-hot { background: var(--felix-green); color: var(--felix-avocado); }
.flag.u-warm { background: var(--felix-zest); color: var(--felix-avocado); }
.flag.u-cold { background: var(--felix-grape); color: #fff; }
.flag.u-never { background: var(--code-bg); color: var(--ink-faint); }
.mini-spark { color: var(--felix-green); vertical-align: middle; }
.lh-map { width: 100%; height: min(72vh, 820px); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.lh-edge { stroke: var(--rule); stroke-width: 1; }
.cal-wrap { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; }
.cal-row { display: grid; grid-template-columns: 220px 1fr; gap: 8px; align-items: center; }
.cal-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-days { display: flex; gap: 2px; }
.cal-cell { width: 10px; height: 10px; border-radius: 2px; background: var(--rule-soft); display: inline-block; }
.cal-cell.ok { background: var(--felix-green); }
.cal-cell.fail { background: var(--felix-carrot); }
.cal-cell.cancel { background: var(--felix-zest); }
.cal-cell.none { background: var(--rule-soft); }
.heat { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.heat-row { display: flex; align-items: center; gap: 2px; }
.heat-lab { width: 36px; font-size: 11px; color: var(--ink-muted); font-weight: 700; }
.heat-cell { width: 18px; height: 14px; border-radius: 2px; background: var(--felix-green); }
.heat-h { width: 18px; text-align: center; font-size: 9px; color: var(--ink-faint); }
.app-nav a { font-size: 13px; padding: 6px 8px; }

/* ---- misc ---- */
.loading { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 100; color: var(--ink-muted); font-weight: 600; }
.loading[hidden] { display: none; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--felix-peppermint); border-top-color: var(--felix-green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--ink-faint); padding: 20px; text-align: center; }
.callout { border-left: 6px solid var(--felix-carrot); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; }
.callout.green { border-left-color: var(--felix-green); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(3,43,43,.2); border-radius: 5px; }
