/* Executive-summary layout + shared block components (R14: one component, every
   page composes it). Consumes tokens.css. */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 80px; }

/* ---- topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  border-bottom: 1px solid var(--rule); margin-bottom: 28px;
}
.topbar .row { max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: baseline; gap: 28px; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 20px;
  letter-spacing: -.01em; color: var(--ink); }
.brand b { color: var(--brand); }
.nav { display: flex; gap: 18px; font-size: var(--fs-sm); align-items: center; flex-wrap: wrap; }
.nav > a { color: var(--ink-2); } .nav > a:hover { color: var(--brand); }
/* v2-parity dropdown nav (Рынки▾ / Сканер▾ / Методология▾) */
.navgroup { position: relative; display: inline-flex; }
.navtrig { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-size: var(--fs-sm);
  color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.navtrig:hover, .navgroup:hover .navtrig, .navtrig[aria-current="true"] { color: var(--brand); }
.navtrig .caret { font-size: 9px; opacity: .7; }
.navmenu { position: absolute; top: 100%; left: -10px; z-index: 60; min-width: 200px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; display: none; flex-direction: column; gap: 1px; }
.navgroup:hover .navmenu, .navgroup:focus-within .navmenu { display: flex; }
.navmenu a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink-2);
  white-space: nowrap; font-size: var(--fs-sm); }
.navmenu a:hover { background: var(--wash, #f3f1ec); color: var(--brand); }
.navback { color: var(--ink-3); font-size: var(--fs-xs); }
.navback:hover { color: var(--brand); }
.topbar .live { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3);
  font-family: var(--font-mono); display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 0 var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,125,82,.5); } 70% { box-shadow: 0 0 0 6px transparent; } }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: end;
  padding-bottom: 26px; border-bottom: 1px solid var(--rule); margin-bottom: 28px; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-hero);
  line-height: 1.04; letter-spacing: -.02em; margin: 0 0 12px; }
.hero p { color: var(--ink-2); max-width: 44ch; margin: 0; }
.kpi-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); }
.kpi-card .lbl { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); display: flex; justify-content: space-between; }
.kpi-card .big { font-family: var(--font-mono); font-size: var(--fs-kpi); font-weight: 500;
  letter-spacing: -.02em; margin: 4px 0 10px; transition: background .06s; padding: 0 4px; border-radius: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--font-mono); font-size: var(--fs-sm); padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--rule-2); background: var(--paper); }
.chip .p { font-size: var(--fs-xs); color: var(--ink-3); margin-right: 5px; }
.chip.pos { color: var(--up); border-color: color-mix(in srgb, var(--up) 30%, var(--rule-2)); }
.chip.neg { color: var(--down); border-color: color-mix(in srgb, var(--down) 30%, var(--rule-2)); }

/* ---- block grid ---- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.block { grid-column: span 6; background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow); }
.block.wide { grid-column: span 12; } .block.third { grid-column: span 4; }
.block > h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600;
  margin: 0 0 2px; display: flex; align-items: center; gap: 8px; }
.block .sub { font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 12px; }

/* ---- badges + (i) ---- */
.badge { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; }
.badge.stale { color: var(--warn); background: var(--warn-bg); }
.badge.live { color: var(--up); background: var(--up-bg); }
.i { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--rule-2); color: var(--ink-3); font-size: 9px; cursor: pointer; font-style: normal; }
.i:hover { color: var(--brand); border-color: var(--brand); }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--rule-2); }
td { padding: 7px 8px; border-bottom: 1px solid var(--rule); font-size: var(--fs-body); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.r, th.r { text-align: right; }
.sec-tag { font-size: var(--fs-xs); color: var(--ink-3); }
.tick { font-family: var(--font-mono); font-weight: 500; }
.rank { font-family: var(--font-mono); color: var(--ink-3); }
.cap { font-family: var(--font-mono); }

/* ---- popup ---- */
.pop { position: fixed; z-index: 100; max-width: 380px; background: var(--paper);
  border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(38,33,26,.18);
  padding: 14px 16px; font-size: var(--fs-sm); display: none; }
.pop.show { display: block; }
.pop h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 13px; }
.pop code { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-2);
  display: block; background: var(--paper-2); padding: 6px 8px; border-radius: 6px; margin: 6px 0; white-space: pre-wrap; }
.pop .src { color: var(--ink-3); font-size: var(--fs-xs); }
.pop .delta { color: var(--up); font-weight: 600; }

/* ---- flash ---- */
.flash-up { animation: fu .7s ease-out; } .flash-dn { animation: fd .7s ease-out; }
@keyframes fu { 0% { background: var(--up-bg); } 100% { background: transparent; } }
@keyframes fd { 0% { background: var(--down-bg); } 100% { background: transparent; } }

/* ---- staggered load ---- */
.reveal { opacity: 0; transform: translateY(8px); animation: rv .5s ease-out forwards; }
@keyframes rv { to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .block, .block.third { grid-column: span 12; }
}


/* PG01 row 2 — global topbar typeahead search */
.gsearch{position:relative;margin-left:16px;min-width:240px}.gsearch input{width:100%;padding:6px 10px;border:1px solid var(--rule);border-radius:8px;background:var(--paper);color:var(--ink);font:inherit;font-size:13px}.gsearch-list{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:50;background:var(--paper);border:1px solid var(--rule);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.18);max-height:340px;overflow:auto}.gsearch-item{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:baseline;padding:7px 10px;text-decoration:none;color:var(--ink);border-bottom:1px solid var(--rule)}.gsearch-item:last-child{border-bottom:0}.gsearch-item.active,.gsearch-item:hover{background:var(--wash,#f3f1ec)}.gs-sub{color:var(--muted);font-size:11px}.gs-typ{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em}

/* ============================================================================
 * PG12-SCN /scaner/equity MASTER-DETAIL — 1:1 of v2 (table left + persistent
 * detail aside right with stacked cards). v3 design tokens only. The .scn-eq-md
 * card hosts a 2-col grid; the table block scrolls internally so the aside stays
 * in view. Below 900px it stacks to 1 column (mirrors the global block breakpoint
 * + v2's 920px fallback).
 * ============================================================================ */
.scn-eq-md { display: grid; grid-template-columns: 41% 59%; gap: 0; padding: 0; overflow: hidden; }
.scn-eq-md-detail { order: -1; }   /* Tony: detail (issuer/news/price) on the LEFT */
.scn-eq-md-table {
  min-width: 0;                       /* lets the table x-scroll instead of overflowing the grid */
  border-left: 1px solid var(--rule);
  padding: var(--pad);
  max-height: 78vh;
  overflow: auto;                     /* the table scrolls; the aside stays put */
}
.scn-eq-md-table > h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600; margin: 0 0 2px; display: flex; align-items: center; gap: 8px; }
.scn-eq-md-table #scn-eq-table { font-size: var(--fs-sm); }
.scn-eq-md-table tbody tr.sc-eq-row.is-selected { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--brand); }
.scn-eq-md-table tbody tr.sc-eq-row:hover { background: var(--wash, #f3f1ec); }

/* right: persistent detail aside */
.scn-eq-md-detail {
  min-width: 0;
  max-height: 78vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.scn-eq-card { border-bottom: 1px solid var(--rule); }
.scn-eq-card:last-child { border-bottom: 0; }
.scn-eq-card-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 16px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.scn-eq-card-title { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.scn-eq-card-sub { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scn-eq-card-body { padding: 12px 16px; font-size: var(--fs-sm); line-height: 1.5; }

/* issuer card */
.scn-eq-issuer-name { margin: 0 0 8px; font-size: var(--fs-body); font-weight: 600; }
.scn-eq-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.scn-eq-dl dt { color: var(--ink-2); white-space: nowrap; }
.scn-eq-dl dd { margin: 0; text-align: right; font-family: var(--font-mono); color: var(--ink); }

/* cost-of-equity headline */
.scn-eq-coe { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--brand); }

/* news list */
.scn-eq-news-item { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.scn-eq-news-item:last-child { border-bottom: 0; }
.scn-eq-news-item a { color: var(--ink); text-decoration: none; display: block; }
.scn-eq-news-item a:hover { color: var(--brand); text-decoration: underline; }
.scn-eq-news-meta { margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-3); font-family: var(--font-mono); }

@media (max-width: 900px) {
  .scn-eq-md { grid-template-columns: 1fr; }
  .scn-eq-md-table { border-right: 0; border-bottom: 1px solid var(--rule); max-height: 60vh; }
  .scn-eq-md-detail { max-height: none; }
}
