/* PIF Portfolio Dashboard — institutional finance dashboard in the visual language of pif.gov.sa:
   white top bar, deep-green header band, gold highlights, light-grey canvas, white cards with
   subtle borders, compact Montserrat (local, OFL) standing in for PIF's proprietary "Fund". */
@font-face { font-family: "Montserrat"; font-weight: 300; font-display: swap; src: url(../lib/fonts/montserrat-latin-300.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url(../lib/fonts/montserrat-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url(../lib/fonts/montserrat-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(../lib/fonts/montserrat-latin-600.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(../lib/fonts/montserrat-latin-700.woff2) format("woff2"); }

:root {
  --teal: #005c4d;        /* PIF primary green */
  --teal-dark: #004237;
  --forest: #0f2e29;      /* header band */
  --green: #398148;
  --aqua: #0eb599;
  --gold: #c4984f;
  --gold-ink: #7d5a1f;
  --gold-soft: #f6efe2;
  --cream: #faf6ee;
  --canvas: #f5f6f5;
  --card: #ffffff;
  --ink: #262626;
  --ink-2: #4d4d4d;
  --muted: #747474;
  --line: #e4e7e5;
  --line-2: #d2d6d3;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --focus: #15909c;
  /* entity-type colours (dots, donut) */
  --c-sub: #005c4d;
  --c-assoc: #c4984f;
  --c-jv: #0eb599;
  --c-port: #5b6f8f;
  --c-none: #9aa3a0;
  --wrap: 1440px;
  --top-h: 64px;
  --font: "Montserrat", "Segoe UI", system-ui, -apple-system, Tahoma, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--canvas); color: var(--ink); font: 400 13.5px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; }
a { color: var(--teal); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; z-index: 99; background: #fff; padding: 6px 10px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* ================= top bar (white, like pif.gov.sa) ================= */
.top { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 28px; height: var(--top-h); max-width: var(--wrap); margin: 0 auto; padding: 0 28px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--teal); flex: none; }
.brand-word { font-weight: 600; font-size: 28px; letter-spacing: -.5px; line-height: 1; }
.brand-sub { border-inline-start: 1px solid var(--line-2); padding-inline-start: 10px; font-size: 10.5px; line-height: 1.25; color: var(--gold); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.nav a { color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap; padding: 21px 12px 19px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--teal); }
.nav a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.nav a.soon { color: #9a9a9a; }
.nav a .soon-dot { font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-inline-start: 5px; vertical-align: 1px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--canvas); color: var(--teal); }
.menu { display: none; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--ink); border-radius: 999px; padding: 7px 18px; background: none; cursor: pointer; font-size: 12.5px; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.pill:hover { border-color: var(--teal); color: var(--teal); }
.pill.sm { padding: 5px 14px; font-size: 12px; }
.pill.teal { border-color: var(--teal); color: var(--teal); }
.pill.solid { background: var(--teal); border-color: var(--teal); color: #fff; }
.pill.solid:hover { background: var(--teal-dark); }
.pill.on-dark { border-color: rgba(255,255,255,.55); color: #fff; }
.pill.on-dark:hover { background: #fff; color: var(--forest); }

/* ================= deep-green header band ================= */
.band { background: var(--forest); color: #fff; position: relative; overflow: hidden; }
.band::after { content: ""; position: absolute; inset-inline-end: -90px; top: -150px; width: 380px; height: 380px; border-radius: 50%; border: 1px solid rgba(196,152,79,.3); pointer-events: none; }
.band .wrap { display: flex; align-items: center; gap: 24px; padding-top: 20px; padding-bottom: 20px; position: relative; z-index: 1; flex-wrap: wrap; }
.band-title { flex: 1 1 auto; min-width: 0; }
.band-title .crumbs { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.band-title .crumbs a { color: var(--gold); text-decoration: none; }
.band-title .crumbs a:hover { text-decoration: underline; }
.band-title h1 { margin: 0; font-size: 24px; font-weight: 400; letter-spacing: -.01em; line-height: 1.25; }
.band-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-d { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); color: rgba(255,255,255,.9); white-space: nowrap; }
.chip-d.gold { border-color: rgba(196,152,79,.7); color: #e7cf9f; }
.chip-d i { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); display: inline-block; }
.band .search { flex: 0 1 360px; }
.band .search input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.band .search input::placeholder { color: rgba(255,255,255,.6); }
.band .search input:focus { background: #fff; color: var(--ink); border-color: #fff; }
.band .search .s-ico { color: rgba(255,255,255,.7); }

/* ================= search ================= */
.search { position: relative; }
.search input { width: 100%; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; padding: 9px 16px 9px 38px; font-size: 13px; }
[dir="rtl"] .search input { padding: 9px 38px 9px 16px; }
.search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,92,77,.12); }
.search .s-ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: flex; }
.results { position: absolute; top: calc(100% + 6px); inset-inline: 0; min-width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.16); z-index: 60; max-height: 60vh; overflow: auto; padding: 5px; color: var(--ink); }
.results button { display: flex; width: 100%; gap: 10px; align-items: baseline; text-align: start; background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.results button[aria-selected="true"], .results button:hover { background: var(--cream); }
.results .r-name { flex: 1; min-width: 0; font-weight: 500; }
.results .r-meta { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.results .r-empty { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }

/* ================= layout & cards ================= */
main { outline: none; min-height: 70vh; }
.page { padding-top: 20px; padding-bottom: 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
.card-h h3 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.card-b { padding: 12px 16px 16px; }
.grid { display: grid; gap: 16px; }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 320px; }
.mt { margin-top: 16px; }
.hint { color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: none; padding: 3px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.ki { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 10px; background: var(--gold-soft); border-inline-start: 3px solid var(--gold); border-radius: 0 6px 6px 0; font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[dir="rtl"] .ki { border-radius: 6px 0 0 6px; }
.ki b { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); flex: none; }
.ki span { overflow: hidden; text-overflow: ellipsis; }
.chart { width: 100%; height: 290px; }

/* ================= KPI strip ================= */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { padding: 14px 18px; border-inline-end: 1px solid var(--line); min-width: 0; }
.kpi:last-child { border: 0; }
.kpi .k-label { font-size: 11.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; }
.kpi .k-val { display: block; font-size: 26px; font-weight: 500; color: var(--teal); letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; white-space: nowrap; }
.kpi .k-note { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delta { font-weight: 600; }
.delta.up { color: var(--green); }
.delta.down { color: #b3261e; }

/* ================= key insights side panel ================= */
.insights { list-style: none; margin: 0; padding: 0; }
.insights li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45; }
.insights li:first-child { border-top: 0; padding-top: 2px; }
.insights li .n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ================= structure preview ================= */
.sp { padding: 18px 16px 18px; }
.sp-root { display: flex; justify-content: center; }
.sp-trunk { width: 2px; height: 18px; background: var(--teal); margin: 0 auto; }
.sp-bus { height: 2px; background: var(--teal); margin: 0 calc(100% / 12); }
.sp-cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.sp-col { position: relative; padding-top: 14px; }
.sp-col::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 14px; background: var(--teal); }
.sp-box { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-top: 3px solid var(--c); border-radius: 8px; padding: 10px 10px 9px; text-align: center; }
.sp-box:hover { border-color: var(--teal); border-top-color: var(--c); box-shadow: 0 6px 16px rgba(0,92,77,.08); }
.sp-box strong { display: block; font-size: 22px; font-weight: 500; color: var(--teal); line-height: 1.1; }
.sp-box span { display: block; font-size: 11.5px; font-weight: 500; margin-top: 4px; line-height: 1.3; }

/* ================= PIF box (org-chart root) ================= */
.rootbox { display: inline-flex; flex-direction: column; align-items: center; background: var(--forest); color: #fff; border-radius: 10px; padding: 12px 26px; text-align: center; box-shadow: 0 8px 22px rgba(15,46,41,.22); position: relative; }
.rootbox strong { font-size: 15px; font-weight: 600; }
.rootbox span { font-size: 12px; color: rgba(255,255,255,.75); margin-top: 2px; }
.rootbox .rb-gold { position: absolute; top: 0; inset-inline: 22px; height: 3px; background: var(--gold); border-radius: 0 0 3px 3px; }

/* ================= tables ================= */
.tbl-wrap { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dt th { text-align: start; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: #fafbfa; }
table.dt th.r, table.dt td.r { text-align: end; }
table.dt th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.dt th button:hover { color: var(--teal); }
table.dt th[aria-sort] button { color: var(--teal); }
table.dt td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.dt tbody tr { cursor: pointer; }
table.dt tbody tr:hover { background: var(--cream); }
table.dt td.name { font-weight: 500; }
table.dt .dot { margin-inline-end: 8px; }

/* ================= dots, tags, quality icon ================= */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--c-none); }
.dot.subsidiary { background: var(--c-sub); }
.dot.associate { background: var(--c-assoc); }
.dot.JV { background: var(--c-jv); }
.dot.portfolio_investment { background: var(--c-port); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 500; padding: 1px 7px; border-radius: 4px; background: #eef1ef; color: var(--ink-2); white-space: nowrap; line-height: 1.6; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag.pool { background: var(--gold-soft); color: var(--gold-ink); }
.tag.tick { background: rgba(0,92,77,.08); color: var(--teal); font-weight: 600; }
.tag.y24 { background: #ececec; color: #6b6b6b; font-weight: 600; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.qi { font-size: 10px; line-height: 1; color: var(--teal); flex: none; cursor: help; }
.qi.q-medium { color: #6d8f86; }
.qi.q-low { color: #b0b0b0; }

/* ================= clickable numbers, tooltips, popover ================= */
.num { all: unset; cursor: pointer; border-bottom: 1px dotted currentColor; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num:hover { color: var(--teal); }
.num:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tip { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid currentColor; color: var(--muted); font-size: 9.5px; font-weight: 700; cursor: help; margin-inline-start: 5px; background: none; padding: 0; line-height: 1; }
.tip:hover, .tip:focus-visible { color: var(--teal); }
.popover { position: fixed; z-index: 80; width: min(390px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.18); padding: 14px 16px; font-size: 13px; color: var(--ink); }
.popover h4 { margin: 0 0 8px; font-size: 10.5px; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.popover .p-close { position: absolute; top: 6px; inset-inline-end: 10px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.popover .src { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.popover .src:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.popover .src-doc { font-weight: 600; }
.popover .src-meta { color: var(--ink-2); font-size: 12px; }
.popover .src-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; font-weight: 600; }
.popover .src-note { color: var(--ink-2); font-size: 12px; margin-top: 4px; }
.popover .warn { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 6px 8px; font-size: 11.5px; margin-top: 6px; }
.hovertip { position: fixed; z-index: 90; pointer-events: none; background: var(--forest); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 6px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.2); }

/* ================= structure page ================= */
.toolbar { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; }
.toolbar .search { flex: 1 1 260px; max-width: 360px; }
.toolbar .spacer { flex: 1; }
.chk { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.chk input { accent-color: var(--teal); }
.legend-card .card-b { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; align-items: start; }
.lg-k { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 5px; white-space: nowrap; }
.lg-v { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lg-type { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-inline-end: 10px; color: var(--ink-2); }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 3px 11px; font-size: 12px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.fchip b { font-weight: 600; color: var(--ink); }
.fchip:hover { border-color: var(--teal); color: var(--teal); }
.fchip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.fchip[aria-pressed="true"] b { color: #fff; }
.fchip.gold[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); }

.org { margin-top: 18px; }
.org-root { text-align: center; }
.org-trunk { width: 2px; height: 22px; background: var(--teal); margin: 0 auto; }
.org-bus { height: 2px; background: var(--teal); margin: 0 calc(100% / (var(--cols) * 2)); }
.cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(210px, 1fr)); gap: 12px; align-items: start; }
.col { position: relative; padding-top: 16px; min-width: 0; }
.col::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 16px; background: var(--teal); }
.col-h { width: 100%; text-align: start; background: #fff; border: 1px solid var(--line-2); border-top: 3px solid var(--c); border-radius: 8px; padding: 10px 12px; cursor: pointer; display: block; }
.col-h:hover { border-color: var(--teal); border-top-color: var(--c); }
.col-h .ch-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.col-h .ch-name { font-size: 12.5px; font-weight: 600; }
.col-h .ch-n { font-size: 24px; font-weight: 500; color: var(--teal); line-height: 1; }
.col-h .ch-meta { display: block; font-size: 11px; color: var(--ink-2); margin-top: 6px; }
.col-h .ch-tog { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.col-body { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 72vh; overflow-y: auto; padding: 2px 3px 6px 2px; scrollbar-width: thin; }
.col.closed .col-body { display: none; }
.ecard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; position: relative; }
.ecard:hover { border-color: var(--teal); box-shadow: 0 4px 12px rgba(0,92,77,.07); }
.ecard.sel { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(0,92,77,.18); }
.ecard.hit { background: #fffbef; border-color: var(--gold); }
.ec-top { display: flex; align-items: flex-start; gap: 7px; }
.ec-top .dot { margin-top: 6px; }
.ec-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.35; overflow-wrap: break-word; hyphens: auto; }
.ec-right { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.ec-pct { flex: none; font-size: 13px; font-weight: 600; color: var(--teal); font-variant-numeric: tabular-nums; }
.ec-pct.na { color: var(--muted); font-weight: 500; }
.ec-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 5px; padding-inline-start: 15px; }
.drill { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; background: var(--gold); cursor: pointer; flex: none; box-shadow: 0 0 0 3px var(--gold-soft); }
.drill:hover { background: var(--gold-ink); }
.ec-sub { display: inline-flex; align-items: center; gap: 5px; margin: 6px 0 0 15px; border: 0; background: none; padding: 2px 0; font-size: 12px; font-weight: 600; color: var(--teal); cursor: pointer; }
[dir="rtl"] .ec-sub { margin: 6px 15px 0 0; }
.ec-sub .ar { display: inline-block; transition: transform .15s; font-size: 10px; }
.ec-sub[aria-expanded="true"] .ar { transform: rotate(90deg); }
.ec-kids { margin: 6px 0 2px 6px; padding-inline-start: 8px; border-inline-start: 2px solid var(--line-2); display: flex; flex-direction: column; gap: 5px; }
.ec-kids .ecard { padding: 6px 8px; background: #fbfcfb; }
.col-empty { font-size: 12px; color: var(--muted); padding: 10px 4px; }
.defs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 24px; }
.defs div { font-size: 12.5px; color: var(--ink-2); }
.defs b { display: block; color: var(--ink); font-weight: 600; font-size: 12.5px; }
.pn { display: flex; gap: 8px; }

/* ================= side panel ================= */
.panel { position: fixed; top: var(--top-h); inset-inline-end: 0; bottom: 0; width: min(430px, 100vw); background: #fff; border-inline-start: 1px solid var(--line); box-shadow: -10px 0 34px rgba(0,0,0,.12); z-index: 45; transform: translateX(105%); transition: transform .2s ease; overflow-y: auto; }
[dir="rtl"] .panel { transform: translateX(-105%); }
.panel.open { transform: none !important; }
.panel:not(.open) { visibility: hidden; transition: transform .2s ease, visibility 0s .2s; }
.p-head { background: var(--forest); color: #fff; padding: 16px 18px 14px; position: relative; }
.p-head .p-type { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 6px; }
.p-head h2 { margin: 4px 36px 0 0; font-size: 18px; font-weight: 500; line-height: 1.3; }
[dir="rtl"] .p-head h2 { margin: 4px 0 0 36px; }
.p-head .p-ar { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 2px; }
.p-head .p-close { position: absolute; top: 12px; inset-inline-end: 12px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: none; color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.p-head .p-close:hover { background: rgba(255,255,255,.12); }
.p-head .p-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.p-head .tag { background: rgba(255,255,255,.12); color: #fff; }
.p-head .tag.pool { background: rgba(196,152,79,.25); color: #f1dcb3; }
.p-body { padding: 14px 18px 30px; }
.p-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-kpis div { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.p-kpis span { display: flex; align-items: center; font-size: 11px; color: var(--muted); font-weight: 500; }
.p-kpis strong { display: block; font-size: 21px; font-weight: 500; color: var(--teal); line-height: 1.25; }
.p-kpis strong.na { font-size: 13px; color: var(--muted); padding-top: 4px; }
.p-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin: 18px 0 8px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; }
.chain a { cursor: pointer; font-weight: 500; }
.chain .sep { color: var(--muted); }
.chain .cpct { font-size: 11.5px; color: var(--ink-2); }
dl.facts { display: grid; grid-template-columns: 42% 1fr; gap: 6px 12px; margin: 0; font-size: 12.5px; }
dl.facts dt { color: var(--muted); display: flex; align-items: center; }
dl.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
table.fin { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.fin th, table.fin td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: end; }
table.fin th:first-child, table.fin td:first-child { text-align: start; }
table.fin th { color: var(--muted); font-weight: 600; font-size: 10.5px; letter-spacing: .06em; }
.also { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.also li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.note { font-size: 12px; color: var(--ink-2); background: var(--canvas); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }
.p-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 44; }

/* ================= coming soon ================= */
.soon-card { padding: 36px; max-width: 720px; border-top: 3px solid var(--gold); }
.soon-card h2 { margin: 0 0 6px; font-weight: 400; font-size: 22px; }

/* ================= footer ================= */
.foot { background: var(--forest); color: rgba(255,255,255,.7); font-size: 12px; }
.foot .wrap { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }
.foot strong { color: #fff; font-weight: 600; }

/* ================= responsive ================= */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-inline-end: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .g-main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1120px) {
  .menu { display: grid; }
  .top-actions { margin-inline-start: auto; }
  .nav { position: absolute; top: 100%; inset-inline: 0; background: #fff; flex-direction: column; gap: 0; padding: 6px 20px 14px; box-shadow: 0 12px 24px rgba(0,0,0,.1); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); }
  .g-3 { grid-template-columns: 1fr 1fr; }
  .g-3 > :last-child { grid-column: 1 / -1; }
  .org-scroll { overflow-x: auto; padding-bottom: 8px; }
  .cols { min-width: calc(var(--cols) * 220px); }
  .defs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .wrap, .top-inner { padding-left: 14px; padding-right: 14px; }
  .brand-sub { display: none; }
  .band .wrap { gap: 12px; }
  .band .search { flex-basis: 100%; }
  .band-title h1 { font-size: 20px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi, .kpi:nth-child(3) { border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .kpi:nth-child(2n) { border-inline-end: 0; }
  .kpi .k-val { font-size: 21px; }
  .g-3 { grid-template-columns: 1fr; }
  .sp-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .sp-bus { display: none; }
  .legend-card .card-b { grid-template-columns: 1fr; gap: 4px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .lg-k { padding-top: 8px; }
  .defs { grid-template-columns: 1fr; }
  .ki { white-space: normal; }
  #tbl table.dt th:nth-child(2), #tbl table.dt td:nth-child(2), #tbl table.dt th:nth-child(3), #tbl table.dt td:nth-child(3), #tbl table.dt th:nth-child(7), #tbl table.dt td:nth-child(7) { display: none; }
  table.dt td, table.dt th { padding: 8px 8px; }
  .chk { white-space: normal; }
  .panel { top: auto; height: 88vh; width: 100vw; border-radius: 16px 16px 0 0; transform: translateY(105%) !important; border-inline-start: 0; overflow: auto; }
  .panel.open { transform: none !important; }
  .popover { left: 12px !important; right: 12px !important; bottom: 12px; top: auto !important; width: auto; }
}
@media print { .top, .panel, .popover, .toolbar { display: none; } }

/* ================= round 3: compare, companies, watchlist, downloads ================= */
.cap { margin: 10px 16px 0; font-size: 11.5px; color: var(--muted); }
.sp .cap { margin: 12px 0 0; text-align: center; }
.dl { display: inline-flex; gap: 6px; flex: none; }
.dl .pill { padding: 4px 12px; font-size: 11.5px; }
.na { color: #9a9a9a; font-style: normal; }
.tag.hv { background: #ececec; color: #5f5f5f; }
.fchip.muted { border-style: dashed; }
.fchip.on { background: rgba(0,92,77,.07); border-color: var(--teal); color: var(--teal); cursor: default; }
.fchip.on button { border: 0; background: none; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 4px; color: var(--teal); }
.co-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.co-filters .co-q { flex: 1 1 240px; max-width: 320px; }
.fsel { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.fsel select { border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; background: #fff; color: var(--ink); max-width: 220px; font-weight: 500; letter-spacing: 0; }
.co-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; }
.co-bar .spacer { flex: 1; }
.co-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag[class*="flag-"] { font-weight: 600; }
.tag.flag-pb, .tag.flag-cv { background: #fde8e6; color: #9b1c12; }
.tag.flag-lt50, .tag.flag-gt50 { background: var(--gold-soft); color: var(--gold-ink); }
.tag.flag-fs, .tag.flag-ye, .tag.flag-exit, .tag.flag-uncl { background: var(--warn-soft); color: var(--warn); }
.tag.flag-y2024 { background: #ececec; color: #5f5f5f; }
table.dt td { vertical-align: top; }

/* panel extras */
.panel { width: min(560px, 100vw); }
.p-ratios { grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
.p-trend { width: 100%; height: 170px; }
.p-cmp { margin-top: 4px; }

/* comparison */
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px; font-weight: 500; background: #fff; }
.cchip i { width: 8px; height: 8px; border-radius: 50%; }
.cchip.me { border-color: var(--teal); background: rgba(0,92,77,.06); padding-inline-end: 10px; }
.cchip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 2px; }
.cchip button:hover { color: #b3261e; }
.cmp-add { max-width: 320px; margin-bottom: 10px; }
.cmp-add input { padding-top: 7px; padding-bottom: 7px; font-size: 12.5px; }
.cmp-tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.cmp { font-size: 12.5px; }
table.cmp th, table.cmp td { padding: 7px 10px; white-space: nowrap; }
table.cmp th { text-transform: none; letter-spacing: 0; font-size: 11.5px; color: var(--ink); }
table.cmp th a { color: inherit; text-decoration: none; cursor: pointer; }
table.cmp th a:hover { color: var(--teal); }
table.cmp tbody tr { cursor: default; }
table.cmp tbody tr:hover { background: none; }
table.cmp td:first-child { color: var(--ink-2); font-weight: 500; }
table.cmp .selcol { background: rgba(0,92,77,.06); }
table.cmp th.selcol { box-shadow: inset 0 3px 0 var(--teal); }
table.cmp td.best { background: #e5f4ea; color: #1e6b36; font-weight: 600; }
table.cmp td.worst { background: #fbe9e7; color: #9b1c12; }
table.cmp td.selcol.best { background: #d6eedd; }
table.cmp td.selcol.worst { background: #f7dcd8; }
.cmp-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.cmp-charts.compact { grid-template-columns: 1fr; gap: 10px; }
.cmp-charts h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cchart { width: 100%; height: 260px; }
.cmp-charts.compact .cchart { height: 200px; }
.cmp-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.cmp-foot .hint { flex: 1 1 200px; font-size: 11.5px; }
.p-cmp .ki { white-space: normal; }
@media (max-width: 1120px) { .cmp-charts { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .co-filters .fsel { flex: 1 1 45%; }
  .co-filters .fsel select { max-width: none; width: 100%; }
  .co-filters .co-q { max-width: none; flex-basis: 100%; }
  .p-ratios { grid-template-columns: repeat(3, 1fr); }
}

/* ================= structure v3: hierarchical tree ================= */
.st-card { padding: 20px 16px 18px; }
.t2-root { text-align: center; }
.rootbox { border: 0; cursor: pointer; font: inherit; }
.t2-trunk { width: 2px; height: 22px; background: var(--teal); margin: 0 auto; }
.t2-scroll { overflow-x: auto; padding-bottom: 6px; }
.t2 { position: relative; }
.t2-bus { position: absolute; top: 0; height: 2px; background: var(--teal); }
.t2-grid { display: grid; align-items: start; }
.br { position: relative; padding: 18px 6px 0; min-width: 0; }
.br::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 18px; background: var(--teal); }
.l1 { display: block; width: 100%; text-align: start; background: #fff; border: 1px solid var(--line-2); border-top: 4px solid var(--c); border-radius: 10px; padding: 12px 14px 10px; cursor: pointer; box-shadow: 0 4px 14px rgba(15,46,41,.06); font: inherit; color: var(--ink); }
.l1:hover { border-color: var(--teal); border-top-color: var(--c); }
.l1-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.l1-name { font-size: 14.5px; font-weight: 600; }
.l1-n { font-size: 28px; font-weight: 500; color: var(--teal); line-height: 1; }
.l1-meta { display: block; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.l1-fig { display: block; font-size: 12px; color: var(--ink); margin-top: 3px; font-weight: 500; }
.l1-tog { display: block; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.br.closed .l1 { background: #fafbfa; }
.stem { width: 2px; height: 18px; background: var(--teal); margin: 0 auto; }
.sub-wrap { position: relative; }
.sub-bus { position: absolute; top: 0; height: 2px; background: var(--teal); }
.subgrid { display: grid; align-items: start; }
.subgrid .col { padding: 16px 5px 0; }
.col-h .l1-fig { font-size: 11px; }
/* rails: every card hangs off its branch */
.rail { border-inline-start: 2px solid #cfe0da; margin-inline-start: 12px; padding-inline-start: 12px; }
.col-body.rail { margin-top: 0; padding-top: 10px; }
.br > .col-body.rail { margin-inline-start: 14px; }
.rail > .ecard { position: relative; }
.rail > .ecard::before { content: ""; position: absolute; inset-inline-start: -14px; top: 17px; width: 12px; height: 2px; background: #cfe0da; }
.ec-kids.rail { margin: 6px 0 2px 4px; border-inline-start-color: #dfe7e3; padding-inline-start: 10px; }
.ec-kids.rail > .ecard::before { inset-inline-start: -12px; width: 10px; background: #dfe7e3; }
.ec-fig { font-size: 11px; color: var(--muted); margin-inline-start: auto; white-space: nowrap; }
.ec-fig .num { color: var(--ink-2); }
.ecard.sub .ec-name { font-size: 12.5px; }

/* outline view */
.outline { font-size: 13px; }
.o-head, .orow, .ogrp { display: flex; align-items: center; gap: 8px; }
.o-head { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 8px 34px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.o-head span:nth-child(2) { flex: 1; }
.outline ul { list-style: none; margin: 0; padding: 0; }
.outline ul ul { margin-inline-start: 18px; padding-inline-start: 8px; border-inline-start: 1px solid #dfe7e3; }
.o-root > li > ul { border: 0; margin-inline-start: 6px; }
.orow { padding: 6px 10px; border-radius: 6px; cursor: pointer; min-height: 36px; }
.orow:hover { background: var(--cream); }
.orow.sel { background: rgba(0,92,77,.08); box-shadow: inset 3px 0 0 var(--teal); }
.orow.hit { background: #fffbef; }
.orow.root { font-weight: 600; font-size: 14px; color: var(--teal); cursor: pointer; }
.o-tw { width: 22px; height: 22px; flex: none; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--muted); display: grid; place-items: center; padding: 0; }
.o-tw .ar { display: inline-block; transition: transform .15s; font-size: 11px; }
.o-tw[aria-expanded="true"] .ar { transform: rotate(90deg); }
[dir="rtl"] .o-tw .ar { transform: scaleX(-1); }
.o-tw:hover { background: #fff; color: var(--teal); }
.o-tw.leaf { visibility: hidden; }
.o-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-n { font-size: 11px; color: var(--muted); font-weight: 500; }
.o-tags { display: flex; gap: 4px; flex: none; }
.o-fig { width: 110px; text-align: end; flex: none; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }
.o-pct { width: 64px; text-align: end; flex: none; font-weight: 600; color: var(--teal); font-variant-numeric: tabular-nums; }
.o-eff { width: 70px; text-align: end; flex: none; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.o-head .o-pct, .o-head .o-eff { color: var(--muted); font-weight: 700; }
.orow .drill, .drill-sp { width: 12px; height: 12px; flex: none; }
.o-head span:last-child { width: 40px; }
.ogrp { padding: 7px 10px; margin: 4px 0; border-radius: 8px; background: #f3f6f4; border-inline-start: 4px solid var(--c); }
.ogrp.l2 { background: #f8faf9; }
.o-gname { border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; padding: 0; color: var(--ink); text-align: start; }
.o-gn { font-size: 12px; font-weight: 700; color: var(--teal); background: #fff; border-radius: 999px; padding: 1px 9px; }
.o-gmeta { margin-inline-start: auto; font-size: 11.5px; color: var(--ink-2); }
.o-empty { padding: 6px 12px; }
@media (max-width: 760px) {
  .o-tags, .o-fig, .o-head .o-fig, .o-gmeta { display: none; }
  .o-pct { width: 52px; } .o-eff { width: 56px; }
  .outline ul ul { margin-inline-start: 10px; padding-inline-start: 4px; }
  .orow { padding: 6px 4px; }
}
/* website link in panel */
.p-web { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: #fff; font-size: 12.5px; font-weight: 600; text-decoration: none; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 5px 12px; }
.p-web:hover { background: #fff; color: var(--forest); }
.p-web-src { font-size: 10.5px; color: rgba(255,255,255,.6); margin-inline-start: 8px; }
.p-web-src a { color: rgba(255,255,255,.75); }

/* structure v3 — compact cards */
.st-card .ecard { padding: 8px 9px; }
.st-card .ec-name { hyphens: manual; overflow-wrap: normal; word-break: normal; }
.st-card .ec-tags { padding-inline-start: 15px; align-items: center; }
.ec-end { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; }
.ec-end .ec-fig { margin: 0; }
.rail { margin-inline-start: 8px; padding-inline-start: 10px; }
.rail > .ecard::before { inset-inline-start: -12px; width: 10px; }
.br { padding: 18px 4px 0; }
.subgrid .col { padding: 16px 4px 0; }
.seg button { white-space: nowrap; }
.l1-name, .ch-name { overflow-wrap: normal; }

.o-trunk { height: 14px; }
.o-head span:first-child { width: 22px; flex: none; }
.o-head { padding-inline-start: 26px; }
.o-root > li > ul { border: 0; margin: 0; padding: 0; }
@media (max-width: 760px) {
  .o-eff, .orow .qi, .o-head .o-eff { display: none; }
  .o-name { white-space: normal; overflow: visible; line-height: 1.3; }
  .orow { align-items: flex-start; }
  .orow .o-tw, .orow .dot { margin-top: 2px; }
  .ogrp { flex-wrap: wrap; }
}

/* ================= data upload, versions, changes ================= */
.vbanner { background: var(--gold-soft); border-bottom: 1px solid #e8d7b4; color: var(--gold-ink); font-size: 13px; font-weight: 500; }
.vbanner .wrap { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.vbanner .vb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.vbanner span:nth-child(2) { flex: 1; }
.vbanner .pill { border-color: var(--gold-ink); color: var(--gold-ink); background: #fff; }
.dv-top { grid-template-columns: 1fr 1fr; }
.dv-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed var(--line-2); border-radius: 12px; padding: 20px; cursor: pointer; text-align: center; background: #fafbfa; }
.dropzone:hover, .dropzone.over { border-color: var(--teal); background: rgba(0,92,77,.04); }
.dropzone .dz-ico { font-size: 22px; color: var(--teal); }
.dv-h { font-size: 14px; font-weight: 600; margin: 4px 0 10px; }
.vsum { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.vs { font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.vs.ok { background: #e5f4ea; color: #1e6b36; }
.vs.bad { background: #fde8e6; color: #9b1c12; }
.vs.warnc { background: var(--warn-soft); color: var(--warn); }
.tag.err { background: #fde8e6; color: #9b1c12; font-weight: 600; }
.vtbl { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table.dt.small { font-size: 12.5px; }
table.dt.small td, table.dt.small th { padding: 6px 10px; }
table.dt.small tbody tr { cursor: default; }
tr.error td { background: #fff7f6; }
.blocked { background: #fde8e6; color: #9b1c12; padding: 10px 14px; border-radius: 8px; font-weight: 500; margin: 12px 0 0; }
.okmsg { background: #e5f4ea; color: #1e6b36; padding: 12px 14px; border-radius: 8px; font-weight: 500; margin: 0; }
.okmsg a { margin-inline-start: 10px; }
.diff-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.dchip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 12px; font-size: 12.5px; color: var(--ink); text-decoration: none; background: #fff; }
.dchip b { font-size: 18px; font-weight: 600; color: var(--teal); }
.dchip.neg b { color: #9b1c12; }
.dchip.zero { opacity: .5; }
.dchip:hover { border-color: var(--teal); }
.dsec { font-size: 13px; font-weight: 600; margin: 18px 0 8px; color: var(--ink); }
.dsec span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.dv-apply { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.dv-apply input { border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 13px; min-width: 240px; }
.pill.danger { border-color: #d9a39d; color: #9b1c12; }
.pill.danger:hover { background: #fde8e6; }
.pill[disabled] { opacity: .45; cursor: not-allowed; }
tr.active td { background: rgba(0,92,77,.05); }
td.acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.ch-pick { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ch-pick select { min-width: 260px; max-width: none; }
.ch-arrow { font-size: 20px; color: var(--muted); padding-bottom: 6px; }
@media (max-width: 700px) { .dv-top { grid-template-columns: 1fr; } .ch-pick select { min-width: 0; width: 100%; } .ch-pick .fsel { flex: 1 1 100%; } }

/* ================= structure filter bar (v4) ================= */
.fbar { position: sticky; top: var(--top-h); z-index: 25; padding: 10px 14px 0; box-shadow: 0 6px 18px rgba(15,46,41,.06); }
.fb-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fb-q { flex: 0 1 240px; min-width: 180px; }
.fb-q input { padding-top: 7px; padding-bottom: 7px; }
.fb-types { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.tchip b { font-weight: 700; color: var(--ink); }
.tchip:hover { border-color: var(--teal); }
.tchip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.tchip.on b { color: #fff; }
.tchip.on .dot { box-shadow: 0 0 0 2px #fff; }
.fb-sel { appearance: none; -webkit-appearance: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 30px 6px 12px; font-size: 12.5px; font-weight: 500; cursor: pointer; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23262626' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 12px center; max-width: 210px; color: var(--ink); }
[dir="rtl"] .fb-sel { padding: 6px 12px 6px 30px; background-position: left 12px center; }
.fb-sel.on { border-color: var(--teal); background-color: rgba(0,92,77,.06); color: var(--teal); }
.fb-row .spacer { flex: 1; }
.fb-acts { display: inline-flex; gap: 6px; align-items: center; }
.fb-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 0 10px; margin-top: 10px; border-top: 1px solid var(--line); min-height: 40px; }
.fb-active .spacer { flex: 1; }
.fb-active #st-count { font-size: 11.5px; }
.linkbtn { border: 0; background: none; color: var(--teal); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 6px; }
.linkbtn:hover { text-decoration: underline; }
.keystrip { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 11.5px; color: var(--ink-2); padding: 0 2px 12px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
.keystrip > span { display: inline-flex; align-items: center; gap: 6px; }
.keystrip .ks-t { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.keystrip .drill { width: 10px; height: 10px; box-shadow: none; cursor: default; }
.keystrip .kpct { color: var(--teal); font-size: 12px; }
@media (max-width: 1060px) { .fbar { position: static; } }
@media (max-width: 700px) {
  .fb-q { flex: 1 1 100%; }
  .fb-sel { flex: 1 1 45%; max-width: none; }
  .fb-acts { flex-wrap: wrap; }
  .fb-row .spacer { display: none; }
}

/* ================= companies column picker ================= */
.colpick { position: relative; }
.cp-panel { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.14); padding: 12px 14px; width: 420px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.cp-g { display: flex; flex-direction: column; gap: 4px; }
.cp-t { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 4px; }
.cp-i { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 3px 0; }
.cp-i input { accent-color: var(--teal); }
.cp-foot { grid-column: 1 / -1; display: flex; gap: 10px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
th .u { font-size: 9.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
@media (max-width: 700px) { .cp-panel { width: min(92vw, 360px); grid-template-columns: 1fr; } }

sup.calc { font-size: 9px; color: var(--gold-ink); font-weight: 700; margin-inline-start: 2px; cursor: help; }
@media (max-width: 700px) { .cp-panel { position: fixed; top: 120px; left: 12px; right: 12px; width: auto; max-height: 70vh; overflow: auto; } }

/* ================= profile quick links (website + FS) ================= */
.qlinks { display: flex; gap: 8px; margin: 0 44px 14px 0; flex-wrap: wrap; }
[dir="rtl"] .qlinks { margin: 0 0 14px 44px; }
.qlink { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.35); color: #fff; text-decoration: none; min-width: 0; }
.qlink:hover { background: #fff; color: var(--forest); border-color: #fff; }
.qlink svg { flex: none; color: var(--gold); }
.qlink:hover svg { color: var(--teal); }
.qlink span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.qlink b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.qlink small { font-size: 11px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.qlink.off { opacity: .45; cursor: help; border-style: dashed; }
.qlink.off:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.35); }
.qlink.off svg { color: rgba(255,255,255,.7); }
.qfs { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.qlink-src { font-size: 10.5px; color: rgba(255,255,255,.7); padding-inline-start: 12px; }
.qlink-src:hover { color: #fff; }
@media (max-width: 420px) { .qlink { padding: 7px 10px 7px 8px; } .qlink small { max-width: 110px; } }
/* panel: never wider than the screen */
.panel { overflow-x: hidden; }
.p-body, .p-head { min-width: 0; }
.p-kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.p-ratios { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.also li { flex-wrap: wrap; }
.p-head .p-ar { overflow-wrap: anywhere; }
.cmp-charts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cmp-charts.compact { grid-template-columns: minmax(0, 1fr); }
.cmp-charts > div, .p-cmp, .p-trend, .cchart { min-width: 0; max-width: 100%; overflow: hidden; }
@media (max-width: 1120px) { .cmp-charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .panel { left: 0; right: 0; width: auto; max-width: 100%; } }

/* ================= profile icons (below name & sector) ================= */
.qicons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.qicon { display: inline-flex; align-items: center; gap: 10px; background: #fff; color: var(--ink); text-decoration: none; border-radius: 12px; padding: 7px 14px 7px 9px; min-width: 0; box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform .12s, box-shadow .12s; }
.qicon:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.qicon .qi-svg { flex: none; }
.qicon span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.qicon b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.qicon small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.qicon.off { background: rgba(255,255,255,.14); color: rgba(255,255,255,.75); box-shadow: none; cursor: help; }
.qicon.off small { color: rgba(255,255,255,.55); }
.qicon.off:hover { transform: none; box-shadow: none; }
.qlinks { display: none; }

/* ================= phone fixes ================= */
/* header band must not clip the search results list */
.band { overflow: visible; background: var(--forest) radial-gradient(circle at calc(100% + 90px) -150px, transparent 188px, rgba(196,152,79,.3) 189px, rgba(196,152,79,.3) 190px, transparent 191px) no-repeat; }
.band::after { display: none; }
.band .results { z-index: 70; }
@media (max-width: 700px) {
  .results { min-width: 0; max-height: 55vh; }
  /* company sheet: above the top bar, sized to the visible screen (phone browser bars excluded) */
  .panel { z-index: 80; top: auto; bottom: 0; height: 88vh; height: 88dvh; max-height: calc(100dvh - 12px); }
  .backdrop { z-index: 79; }
  .qicon { flex: 1 1 140px; }
  .qicon small { max-width: none; }
}

@media (max-width: 700px) {
  /* iPhone Safari zooms into inputs smaller than 16px, which breaks the layout */
  input[type="search"], input[type="text"], select, .search input, .fb-sel, .fsel select { font-size: 16px !important; }
}
@media (max-width: 700px) { .qicon b { white-space: normal; line-height: 1.2; } .qicon { padding-inline-end: 10px; } }

/* profile icons — compact size */
.qicons { gap: 8px; margin-top: 12px; }
.qicon { gap: 7px; padding: 4px 11px 4px 6px; border-radius: 9px; box-shadow: 0 1px 5px rgba(0,0,0,.14); }
.qicon .qi-svg { height: 24px; width: auto; }
.qicon b { font-size: 12px; }
.qicon small { font-size: 10.5px; }
@media (max-width: 700px) { .qicon { flex: 0 1 auto; } .qicon b { white-space: nowrap; } }
