/* Global Company Database — admin (V10). Tokens from spec §8.1 (light theme). */
:root {
  --color-ground: #F6F8F7; --color-surface: #FFFFFF; --color-surface-alt: #FAFBFB;
  --color-border: #E3E8E6; --color-border-strong: #D5DDDA; --color-divider: #EEF2F0;
  --color-text: #16201C; --color-text-2: #3D4A45; --color-muted: #5B6B65;
  --color-brand: #1E7A55; --color-brand-dark: #145C40; --color-brand-tint: #E7F3EE; --color-brand-row: #F0F8F4;
  --color-logo: #2F9E73;
  --color-ok-bg: #E7F3EE; --color-ok: #145C40;
  --color-warn-bg: #FFF4DB; --color-warn: #8A5A00;
  --color-bad-bg: #FDECEA; --color-bad: #B42318;
  --color-info-bg: #E8EEFC; --color-info: #1D4ED8;
  --color-neutral-bg: #F3F4F4;
  --hm-4: #1E7A55; --hm-3: #8CCBAE; --hm-2: #DDEFE6; --hm-1: #F3F4F4;
  --font: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--color-ground); color: var(--color-text); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--color-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--color-text-2); }
.mono, .fk { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--color-muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* header */
.hdr { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--color-text); text-decoration: none !important; min-width: 0; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--color-logo); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; flex: 0 0 32px; }
.word { font-weight: 700; font-size: 16px; }
.logo-img { display: block; height: 35px; width: auto; border-radius: 6px; }
.div { width: 1px; height: 22px; background: var(--color-border-strong); }
.prod { color: var(--color-text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.gsearch { position: relative; width: 340px; }
.gsearch input { width: 100%; height: 38px; border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 0 12px; font: inherit; background: var(--color-surface-alt); }
.gresults { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border: 1px solid var(--color-border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16,32,28,.12); z-index: 40; padding: 6px; max-height: 420px; overflow: auto; }
.gresults .gh { font-size: 11px; font-weight: 600; color: var(--color-muted); padding: 6px 8px 2px; text-transform: uppercase; letter-spacing: .05em; }
.gresults a { display: block; padding: 7px 8px; border-radius: 6px; color: var(--color-text); }
.gresults a:hover, .gresults a:focus { background: var(--color-brand-row); text-decoration: none; }
.pill-admin { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--color-brand-dark); background: var(--color-brand-tint); padding: 3px 10px; border-radius: 999px; }
.uname { font-weight: 500; white-space: nowrap; }
.pill-viewer { color: var(--color-info); background: var(--color-info-bg); }
.api-link { font-weight: 600; }
.btn.discover { min-height: 38px; color: var(--color-brand-dark); border-color: var(--color-brand); background: var(--color-brand-tint); font-weight: 600; }
.btn.discover:hover { background: var(--color-brand-row); }
.linkbtn { background: none; border: 0; color: var(--color-muted); font: inherit; cursor: pointer; padding: 6px; }
.menu-btn { display: none; height: 40px; width: 40px; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; font-size: 18px; cursor: pointer; }

/* layout */
.layout { display: flex; min-height: calc(100vh - 60px); }
.side { width: 248px; flex: 0 0 248px; background: var(--color-surface); border-right: 1px solid var(--color-border); padding: 14px 12px;
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.side .sec { font-size: 11px; font-weight: 600; letter-spacing: .07em; color: var(--color-muted); padding: 16px 10px 6px; }
.side .nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--color-text-2);
  font-weight: 500; min-height: 36px; }
.side .nav:hover { background: var(--color-surface-alt); text-decoration: none; color: var(--color-text); }
.side .nav.on { background: var(--color-brand-tint); color: var(--color-brand-dark); font-weight: 600; }
.side .nav.ext { color: var(--color-brand); font-weight: 600; border: 1px solid var(--color-border); margin-bottom: 4px; }
.badge-count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--color-neutral-bg); color: var(--color-text-2);
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.badge-count.hot { background: var(--color-bad); color: #fff; }
.content { flex: 1; min-width: 0; padding: 20px 28px 48px; outline: none; }

/* page header */
.crumb { font-size: 13px; color: var(--color-muted); margin-bottom: 6px; }
.crumb a { color: var(--color-muted); }
.ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ph p { margin: 4px 0 0; color: var(--color-muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.refreshed { font-size: 12.5px; color: var(--color-muted); }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--color-border-strong);
  background: #fff; color: var(--color-text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--color-surface-alt); }
.btn.primary { background: var(--color-brand); border-color: var(--color-brand); color: #fff; }
.btn.primary:hover { background: var(--color-brand-dark); }
.btn.danger { color: var(--color-bad); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
select, input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], textarea {
  min-height: 40px; border: 1px solid var(--color-border-strong); border-radius: 8px; padding: 0 10px; font: inherit; background: #fff; color: var(--color-text); }
textarea { padding: 8px 10px; min-height: 72px; width: 100%; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--color-text-2); }
.fbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.fbar .grow { flex: 1 1 260px; }
.fbar .grow input { width: 100%; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pill { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--color-border-strong); background: #fff; font: inherit;
  font-size: 13px; color: var(--color-text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pill .n { font-weight: 700; color: var(--color-muted); }
.pill.on { background: var(--color-brand-tint); border-color: var(--color-brand); color: var(--color-brand-dark); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--color-brand-tint); color: var(--color-brand-dark); border-radius: 999px;
  padding: 3px 4px 3px 10px; font-size: 12.5px; }
.chip button { border: 0; background: none; cursor: pointer; font-size: 15px; color: inherit; width: 22px; height: 22px; border-radius: 50%; }

/* cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 16px; color: inherit; }
a.kpi:hover { border-color: var(--color-brand); text-decoration: none; }
.kpi .l { font-size: 12.5px; color: var(--color-muted); font-weight: 500; }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; }
.kpi .s { font-size: 12.5px; color: var(--color-muted); }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h .sub { font-size: 12.5px; color: var(--color-muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
.grid2 > .card, .grid3 > .card, .grid-2-1 > .card, .grid-1-2 > .card { margin-bottom: 0; }
.mb { margin-bottom: 16px; }

/* tables */
.tw { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { position: sticky; top: 0; background: var(--color-surface-alt); text-align: left; font-weight: 600; font-size: 12.5px; color: var(--color-text-2);
  padding: 9px 10px; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td, table.t tr.sel td { background: var(--color-brand-row); }
table.t tr.off td { color: var(--color-muted); background: var(--color-surface-alt); }
table.t th.num, table.t td.num { text-align: right; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; flex-wrap: wrap; font-size: 13px; color: var(--color-muted); }

/* badges & bars */
.b { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--color-neutral-bg); color: var(--color-text-2); }
.b.ok { background: var(--color-ok-bg); color: var(--color-ok); } .b.warn { background: var(--color-warn-bg); color: var(--color-warn); }
.b.bad { background: var(--color-bad-bg); color: var(--color-bad); } .b.info { background: var(--color-info-bg); color: var(--color-info); }
.b.dash { background: #fff; border: 1px dashed var(--color-border-strong); color: var(--color-muted); font-weight: 500; }
.cc { font-family: var(--mono); font-size: 11.5px; font-weight: 700; background: var(--color-neutral-bg); border-radius: 4px; padding: 1px 5px; margin-right: 6px; color: var(--color-text-2); }
.pb { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.pb .track { flex: 1; height: 8px; background: var(--color-neutral-bg); border-radius: 4px; overflow: hidden; }
.pb .track i { display: block; height: 100%; background: var(--color-brand); border-radius: 4px; }
.pb .track i.warn { background: #D79A1E; } .pb .track i.bad { background: var(--color-bad); }
.pb span { font-size: 12.5px; min-width: 42px; text-align: right; }
.stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--color-neutral-bg); }
.stack i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--color-text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.hbar .track { height: 10px; background: var(--color-neutral-bg); border-radius: 5px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--color-brand); }
.hbar.grey .track i { background: #9AA7A2; }

/* stage cards */
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stage { border: 1px solid var(--color-border); border-radius: 10px; padding: 12px; background: var(--color-surface-alt); }
.stage .nm { font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.stage dl { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin: 0; font-size: 13px; }
.stage dt { color: var(--color-muted); } .stage dd { margin: 0; text-align: right; font-weight: 600; }

/* heatmap */
.hm { border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
.hm th { font-weight: 600; color: var(--color-text-2); padding: 4px 6px; text-align: left; white-space: nowrap; }
.hm td { min-width: 64px; height: 30px; text-align: center; border-radius: 4px; font-weight: 600; }
.hm .h4 { background: var(--hm-4); color: #fff; } .hm .h3 { background: var(--hm-3); color: var(--color-text); }
.hm .h2 { background: var(--hm-2); color: var(--color-text); } .hm .h1 { background: var(--hm-1); color: var(--color-text-2); }
.hm .nl { background: var(--color-warn-bg); color: var(--color-warn); } .hm .ns { background: var(--color-bad-bg); color: var(--color-bad); }
.hm .na { background: #fff; border: 1px dashed var(--color-border-strong); color: var(--color-muted); font-weight: 500; }

/* field chips */
.fchips { display: flex; flex-wrap: wrap; gap: 5px; }
.fchip { font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 6px; border: 1px solid transparent; }
.fchip.active { background: var(--color-ok-bg); color: var(--color-ok); } .fchip.nl { background: var(--color-warn-bg); color: var(--color-warn); }
.fchip.off { background: var(--color-info-bg); color: var(--color-info); } .fchip.na { border: 1px dashed var(--color-border-strong); color: var(--color-muted); }
.schip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--color-ok-bg); color: var(--color-ok); margin: 2px 4px 2px 0; }
.schip.off { background: var(--color-neutral-bg); color: var(--color-muted); }
.drift { display: block; margin-top: 4px; font-size: 12px; color: var(--color-warn); background: var(--color-warn-bg); border-radius: 6px; padding: 2px 8px; }

/* two-pane, drawer, states */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.split > .card { margin-bottom: 0; }
.sticky { position: sticky; top: 76px; }
.drawer-bg { position: fixed; inset: 0; background: rgba(16,32,28,.3); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; z-index: 51; padding: 20px 22px; overflow-y: auto;
  box-shadow: -12px 0 40px rgba(0,0,0,.15); }
.drawer .x { position: absolute; top: 14px; right: 14px; }
.state { text-align: center; padding: 36px 16px; color: var(--color-muted); }
.state b { display: block; color: var(--color-text); font-size: 15px; margin-bottom: 4px; }
.skel { background: linear-gradient(90deg, #EEF2F0 25%, #F6F8F7 37%, #EEF2F0 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel.row { height: 36px; margin: 8px 0; } .skel.card { height: 160px; margin-bottom: 16px; }
.loading { display: flex; align-items: center; gap: 10px; padding: 10px 2px 14px; color: var(--color-muted); font-size: 14px; font-weight: 500; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--color-brand-tint); border-top-color: var(--color-brand);
  animation: spin .8s linear infinite; flex: 0 0 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loadbar { position: fixed; top: 60px; left: 0; right: 0; height: 3px; z-index: 35; overflow: hidden; background: var(--color-brand-tint); }
.loadbar::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--color-brand);
  animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .spin, .loadbar::before, .skel { animation-duration: 3s; } }
.banner { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid var(--color-border); background: var(--color-surface-alt); }
.banner.warn { background: var(--color-warn-bg); border-color: #F1D9A0; color: var(--color-warn); }
.banner.info { background: var(--color-info-bg); border-color: #C9D6FA; color: var(--color-info); }
.banner.bad { background: var(--color-bad-bg); border-color: #F5C2BD; color: var(--color-bad); }
.toast { position: fixed; bottom: 22px; right: 22px; z-index: 60; background: var(--color-text); color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 420px; font-size: 13.5px; }
.toast.err { background: var(--color-bad); }
.savebar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--color-text); color: #fff; padding: 10px 16px; border-radius: 10px; margin-top: 12px; }
.savebar .btn { min-height: 34px; }
kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--color-border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--color-muted); } .kv dd { margin: 0; word-break: break-word; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.cmpc { border: 1px solid var(--color-border); border-radius: 10px; padding: 12px; }
.cmpc .lbl { font-size: 12px; color: var(--color-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.cmpc .val { font-size: 15px; font-weight: 600; margin: 6px 0; word-break: break-word; }
.radioc { display: block; border: 1px solid var(--color-border-strong); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.radioc:has(input:checked) { border-color: var(--color-brand); background: var(--color-brand-row); }
.qitem { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--color-divider); background: #fff; padding: 10px 12px; cursor: pointer; font: inherit; }
.qitem:hover, .qitem.on { background: var(--color-brand-row); }
.qitem .top { display: flex; justify-content: space-between; gap: 8px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.steps span { padding: 6px 12px; border-radius: 999px; background: var(--color-neutral-bg); font-size: 13px; color: var(--color-muted); }
.steps span.done { background: var(--color-ok-bg); color: var(--color-ok); } .steps span.cur { background: var(--color-brand); color: #fff; font-weight: 600; }
.drop { border: 2px dashed var(--color-border-strong); border-radius: 12px; padding: 26px; text-align: center; color: var(--color-muted); background: var(--color-surface-alt); }
.drop.over { border-color: var(--color-brand); background: var(--color-brand-row); }
.grid-map { overflow: auto; max-height: 70vh; border: 1px solid var(--color-border); border-radius: 10px; }
table.mg { border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.mg th, table.mg td { border-bottom: 1px solid var(--color-divider); border-right: 1px solid var(--color-divider); padding: 4px; background: #fff; }
table.mg thead th { position: sticky; top: 0; z-index: 2; background: var(--color-surface-alt); vertical-align: bottom; }
table.mg th.rot { height: 150px; width: 34px; }
table.mg th.rot div { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-family: var(--mono); font-size: 11.5px; font-weight: 500; }
table.mg th.src { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 240px; font-weight: 500; }
table.mg thead th.src { z-index: 3; }
table.mg tr.off th.src { color: var(--color-muted); }
table.mg tfoot td, table.mg tfoot th { position: sticky; bottom: 0; background: var(--color-surface-alt); font-weight: 600; text-align: center; }
.cell { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--color-border); background: #fff; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.cell.a { color: var(--color-brand); } .cell.nl { color: #D79A1E; } .cell.o { color: var(--color-info); }
.cell.dirty { outline: 2px dashed var(--color-text); outline-offset: 1px; }
.order li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 8px; margin-bottom: 6px; background: #fff; }
.order li.off { color: var(--color-muted); background: var(--color-surface-alt); }
.order li .rk { font-weight: 700; width: 26px; color: var(--color-muted); }
.order li .grow { flex: 1; }
.order { list-style: none; margin: 0; padding: 0; }

@media (max-width: 1280px) { .grid3 { grid-template-columns: 1fr 1fr; } .stages { grid-template-columns: repeat(3, minmax(0,1fr)); } .split { grid-template-columns: 1fr; } .sticky { position: static; } }
@media (max-width: 1024px) {
  .menu-btn { display: inline-grid; place-items: center; }
  .side { position: fixed; top: 60px; left: 0; z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: 8px 0 30px rgba(0,0,0,.12); }
  body.nav-open .side { transform: none; }
  .gsearch { width: 220px; } .uname, .prod, .div { display: none; } .btn.discover { padding: 0 10px; }
  .grid2, .grid3, .grid-2-1, .grid-1-2, .grid4 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
@media (max-width: 640px) { .gsearch { display: none; } .stages { grid-template-columns: 1fr 1fr; } .kv { grid-template-columns: 1fr; } .cmp { grid-template-columns: 1fr; } }

/* Fields & sources table */
table.t.fs-table { table-layout: fixed; }
table.t.fs-table th:nth-child(1) { width: 24%; } table.t.fs-table th:nth-child(2) { width: 17%; }
table.t.fs-table th:nth-child(3) { width: 12%; } table.t.fs-table th:nth-child(4) { width: 35%; } table.t.fs-table th:nth-child(5) { width: 12%; }
table.t.fs-table td { word-break: break-word; vertical-align: top; }
.src-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.src-chip { border: 0; cursor: pointer; font: inherit; font-size: 12px; margin: 0; }
.src-chip:hover { outline: 1.5px solid var(--color-brand); }
.src-chips .more-src { display: none; } .src-chips.open .more-src { display: inline-flex; }
.src-more { border: 1px dashed var(--color-border-strong); background: #fff; border-radius: 999px; font: inherit; font-size: 12px; padding: 2px 9px; cursor: pointer; color: var(--color-brand-dark); }
@media (max-width: 1024px) { table.t.fs-table { table-layout: auto; } }
table.t.src-table th:nth-child(1) { width: 21%; } table.t.src-table th:nth-child(2) { width: 11%; }
table.t.src-table th:nth-child(3) { width: 10%; } table.t.src-table th:nth-child(4) { width: 10%; }
table.t.src-table th:nth-child(5) { width: 8%; } table.t.src-table th:nth-child(6) { width: 10%; }
table.t.src-table th:nth-child(7) { width: 30%; }
table.t.src-table .fchip { white-space: nowrap; }
.linkbtn.src-name { color: var(--color-brand-dark); text-align: left; padding: 0; font-size: 14px; }
.linkbtn.src-name:hover { text-decoration: underline; }
table.t.esg-table th:nth-child(1) { width: 20%; } table.t.esg-table th:nth-child(2) { width: 11%; }
table.t.esg-table th:nth-child(3) { width: 12%; } table.t.esg-table th:nth-child(4) { width: 17%; }
table.t.esg-table th:nth-child(5) { width: 18%; } table.t.esg-table th:nth-child(6) { width: 10%; } table.t.esg-table th:nth-child(7) { width: 12%; }
table.t.esgq-table th:nth-child(1) { width: 46%; } table.t.esgq-table th:nth-child(2) { width: 15%; }
table.t.esgq-table th:nth-child(3) { width: 9%; } table.t.esgq-table th:nth-child(4) { width: 30%; }
table.t.esgs-table th:nth-child(1) { width: 26%; } table.t.esgs-table th:nth-child(2) { width: 11%; }
table.t.esgs-table th:nth-child(3) { width: 15%; } table.t.esgs-table th:nth-child(4) { width: 34%; } table.t.esgs-table th:nth-child(5) { width: 14%; }
.ctry-tabs { margin: 0 0 12px; flex-wrap: wrap; }
.ctry-h { margin: 18px 0 8px; font-size: 15px; } .ctry-h:first-of-type { margin-top: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border-strong); margin-bottom: 14px; }
.tab { padding: 10px 18px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; font: inherit; font-size: 16px; font-weight: 600; color: var(--color-muted); cursor: pointer; }
.tab:hover { color: var(--color-text, inherit); }
.tab.on { color: var(--color-brand-dark); border-bottom-color: var(--color-brand-dark); }
.tab .n { font-weight: 700; font-size: 13px; color: var(--color-muted); margin-left: 4px; }
ol.prio { margin: 0 0 8px; padding-left: 22px; } ol.prio li { padding: 6px 0; border-bottom: 1px solid var(--color-divider); }
.prio-a { float: right; display: inline-flex; gap: 4px; }
table.t.rn-table td { vertical-align: top; } table.t.rn-table td:nth-child(2) { word-break: break-word; max-width: 280px; }
.rn-table select { max-width: 220px; }
.rk-list { border-top: 1px solid var(--color-divider); }
.rk { padding: 8px 0; border-bottom: 1px solid var(--color-divider); display: grid; gap: 4px; }
.rk.on { background: var(--color-brand-row); margin: 0 -8px; padding: 8px; }
.rk-k { font-size: 12px; color: var(--color-muted); word-break: break-all; }
.rk-v { font-size: 14px; word-break: break-word; }
.rk .lk-ctl { display: flex; gap: 6px; } .rk .lk-ctl select { flex: 1; min-width: 0; }
.fchip .unl { border: 0; background: none; padding: 0 0 0 4px; cursor: pointer; color: var(--color-muted); font: inherit; }
.fchip .unl:hover { color: var(--color-bad); }
.rk-ln { display: flex; align-items: center; gap: 6px; }
.enr { display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; margin-bottom: 4px; }
table.t.fs-enr th:nth-child(1) { width: 22%; } table.t.fs-enr th:nth-child(2) { width: 13%; } table.t.fs-enr th:nth-child(3) { width: 10%; }
table.t.fs-enr th:nth-child(4) { width: 28%; } table.t.fs-enr th:nth-child(5) { width: 16%; } table.t.fs-enr th:nth-child(6) { width: 11%; }
label.chk { display: block; font-size: 14px; margin: 4px 0; } label.chk input { margin-right: 6px; }
.en-inputs { display: grid; grid-template-columns: 1fr; gap: 6px; } .en-inputs select { width: 100%; }
.en-ctry { display: flex; flex-wrap: wrap; gap: 2px 16px; max-height: 160px; overflow: auto; }
#en-f h3 { margin: 14px 0 6px; font-size: 15px; }
table.t.en-runs td { vertical-align: top; } table.t.en-runs td:last-child { max-width: 260px; }
.en-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; } .en-row .f { margin: 0; } .en-row #en-ids { min-width: 220px; }
.en-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.smp { border-top: 1px solid var(--color-border, #e5e5e5); padding: 8px 0; } .smp ul { margin: 4px 0 0; padding-left: 18px; } .smp li { margin: 3px 0; overflow-wrap: anywhere; }
table.t.en-res td { vertical-align: top; overflow-wrap: anywhere; } table.t.en-res td:nth-child(3) { max-width: 320px; }
table.t.en-per td:first-child { min-width: 220px; } table.t.en-per th, table.t.en-per td.num { white-space: nowrap; }
table.t.ag-runs td { vertical-align: top; overflow-wrap: anywhere; } table.t.ag-runs td:nth-child(2) { min-width: 220px; }
.ag-fix { display: grid; gap: 4px; margin-top: 6px; min-width: 180px; } .ag-fix input:not([type]) { width: 100%; }
#ag-ins { width: 100%; font: inherit; }

/* review queue: duplicate comparison */
table.t.cmp-table td { vertical-align: top; word-break: break-word; }
table.t.cmp-table tr.diff td { background: var(--color-bad-bg); }
table.t.cmp-table th:nth-child(1) { width: 24%; } table.t.cmp-table th:nth-child(4) { width: 16%; }

/* Duplicate companies (review queue): list and detail scroll on their own */
#qlist, #qdetail { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 1280px) { #qlist { position: static; max-height: 55vh; } #qdetail { position: static; max-height: none; overflow: visible; } }
table.t.cc-table tr.diff td { background: var(--color-warn-bg); }
table.t.cc-table td { vertical-align: top; }
