/* =============================================================
   shared.css  –  Common design system + navigation for all
   industry-chain map pages (ai · semi · robot · chain · pharma)
   · power-map uses power.css instead
   ============================================================= */

/* ── reset ───────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  * { animation: none !important; transition: none !important }
}

/* ── design tokens ───────────────────────────────────────────── */
:root {
  --bg:       #0E1116;
  --surface:  #151A22;
  --raised:   #1B2230;
  --line:     rgba(255, 255, 255, .08);
  --line2:    rgba(255, 255, 255, .16);
  --tx:       #E9ECF1;
  --tx2:      #A3ACBB;
  --tx3:      #69748A;
  --up:       #9D8CFF;
  --up-dim:   rgba(157, 140, 255, .14);
  --mid:      #3DD6C3;
  --mid-dim:  rgba(61, 214, 195, .13);
  --down:     #E8A45C;
  --down-dim: rgba(232, 164, 92, .14);
  --risk:     #F07A74;
  --risk-dim: rgba(240, 122, 116, .12);
  --ok:       #6FCF97;
  --sans:     'Noto Sans SC', 'Inter', system-ui, sans-serif;
  --serif:    'Noto Serif SC', 'Noto Serif', serif;
  --mono:     'IBM Plex Mono', monospace;
}

/* ── base ────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--mid);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--mid);
  outline-offset: 2px;
}

::selection { background: rgba(61, 214, 195, .2) }

/* ── layout ──────────────────────────────────────────────────── */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

.mono { font-family: var(--mono) }

/* ── navigation ──────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 17, 22, .90);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

nav .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
}

nav .brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--tx2);
  white-space: nowrap;
  flex-shrink: 0;
}
nav .brand b {
  color: var(--tx);
  font-weight: 600;
}

nav .links {
  display: flex;
  gap: 20px;
  margin-left: auto;
  flex-wrap: wrap;
}
nav .links a {
  font-size: 13px;
  color: var(--tx2);
  text-decoration: none;
  transition: color .18s;
}
nav .links a:hover { color: var(--tx) }

/* ── "switch map" dropdown ───────────────────────────────────── */
.map-dropdown {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.dropdown-trigger {
  background: #1B2230;
  color: var(--tx);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: var(--mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: .04em;
  transition: background .18s, border-color .18s;
  white-space: nowrap;
}
.dropdown-trigger:hover {
  background: rgba(255,255,255,.12);
  border-color: var(--tx2);
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.55);
  z-index: 200;
  min-width: 210px;
  padding: 5px 0;
}
.map-dropdown:hover .dropdown-menu,
.map-dropdown:focus-within .dropdown-menu { display: block }
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--tx2) !important;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.dropdown-menu a:hover {
  background: #1B2230;
  color: var(--tx) !important;
}
.dropdown-menu a.active {
  color: var(--mid) !important;
  font-weight: 500;
  background: rgba(61, 214, 195, .06);
}
/* home / hub link at top of dropdown */
.dropdown-menu a.home-link {
  color: var(--tx2) !important;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  padding-bottom: 10px;
  font-size: 12px;
  letter-spacing: .04em;
}
.dropdown-menu a.home-link:hover {
  color: var(--tx) !important;
  background: #1B2230;
}

/* ── language switcher ───────────────────────────────────────── */
.lang-switch { flex-shrink: 0 }
.lang-link {
  color: var(--tx2) !important;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--mono);
  text-decoration: none;
  transition: color .18s, border-color .18s, background .18s;
  white-space: nowrap;
}
.lang-link:hover {
  color: var(--mid) !important;
  border-color: var(--mid);
  background: rgba(61, 214, 195, .05);
}

/* ── hero ────────────────────────────────────────────────────── */
header.hero {
  padding: 64px 0 36px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--tx3);
  text-transform: uppercase;
  margin-bottom: 14px;
}

h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.3;
  letter-spacing: .01em;
}

h1 .accent { color: var(--mid) }

.hero p.sub {
  margin-top: 14px;
  max-width: 760px;
  color: var(--tx2);
  font-size: 15px;
}

.asof {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tx3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 12px;
}

.asof i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}

/* ── stats bar ───────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 40px 0 64px;
}

.stat {
  background: var(--surface);
  padding: 20px 20px 18px;
}

.stat .k {
  font-size: 12px;
  color: var(--tx3);
  margin-bottom: 8px;
}

.stat .v {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.stat .d {
  font-size: 12px;
  color: var(--tx2);
  margin-top: 6px;
}

/* ── section shell ───────────────────────────────────────────── */
section { padding: 56px 0 }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}

.sec-head .no {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--tx3);
}

h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.sec-desc {
  color: var(--tx2);
  font-size: 14px;
  max-width: 820px;
  margin-bottom: 30px;
}

/* ── chain legend ────────────────────────────────────────────── */
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--tx2);
}

.legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}

.legend .l-up i   { background: var(--up) }
.legend .l-mid i  { background: var(--mid) }
.legend .l-down i { background: var(--down) }

/* ── chain diagram ───────────────────────────────────────────── */
.chain {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 26px 24px 18px;
  overflow-x: auto;
}

.chain-flow {
  display: grid;
  grid-template-columns: 1fr 26px 1.45fr 26px 1fr;
  gap: 0;
  min-width: 860px;
  align-items: stretch;
}

.tier {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--tx3);
  margin-bottom: 4px;
}

.tier-label b { font-weight: 600 }
.tier.t-up   .tier-label b { color: var(--up) }
.tier.t-mid  .tier-label b { color: var(--mid) }
.tier.t-down .tier-label b { color: var(--down) }

.tier.t-mid .nodes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nodes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.nodes.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.node {
  cursor: pointer;
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: var(--raised);
  padding: 12px 14px;
  text-align: left;
  font-family: var(--sans);
  color: var(--tx);
  transition: border-color .15s, background .15s;
}

.t-up   .node { border-left-color: var(--up) }
.t-mid  .node { border-left-color: var(--mid) }
.t-down .node { border-left-color: var(--down) }

.node:hover { border-color: var(--line2) }
.node.on    { background: var(--up-dim) }
.t-mid  .node.on { background: var(--mid-dim) }
.t-down .node.on { background: var(--down-dim) }

.node.muted {
  cursor: default;
  border-left-color: var(--tx3);
  opacity: .85;
}
.node.muted:hover { border-color: var(--line) }

.node .n {
  font-size: 14px;
  font-weight: 600;
}

.node .t {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx2);
  margin-top: 4px;
  letter-spacing: .02em;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx3);
}

.flows {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  min-width: 860px;
  font-family: var(--mono);
  font-size: 12px;
}

.flows .f-prod { color: var(--mid) }
.flows .f-cash { color: var(--down) }

/* ── subchain ────────────────────────────────────────────────── */
.notebox {
  border: 1px dashed var(--line2);
  background: var(--surface);
  padding: 18px 20px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--tx2);
  line-height: 1.8;
}
.notebox b { color: var(--tx) }
.notebox .mono { color: var(--mid); font-size: 12.5px }

.subchain {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 20px;
  overflow-x: auto;
}

.subchain .sc-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--up);
  margin-bottom: 4px;
}

.subchain .sc-sub {
  font-size: 13px;
  color: var(--tx2);
  margin-bottom: 14px;
}

.sc-flow {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 840px;
}

.sc-flow .node { flex: 1; border-left-color: var(--up) }
.sc-flow .node.on { background: var(--up-dim) }
.sc-flow .node.dest { border-left-color: var(--mid) }
.sc-flow .node.dest.on { background: var(--mid-dim) }

.sc-arrow {
  display: flex;
  align-items: center;
  color: var(--tx3);
  flex: 0 0 auto;
}

.subchain .sc-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--tx3);
}

/* ── filters + search ────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
}

.fchip {
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--tx2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  transition: all .15s;
}
.fchip:hover { border-color: var(--line2); color: var(--tx) }
.fchip.on {
  color: var(--bg);
  background: var(--tx);
  border-color: var(--tx);
  font-weight: 500;
}

/* market badges (robot / chain / pharma maps) */
.mkt {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 7px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  color: var(--tx2);
  white-space: nowrap;
}
.mkt-us  { color: var(--mid);  border-color: rgba(61, 214, 195, .35) }
.mkt-hk  { color: var(--up);   border-color: rgba(157, 140, 255, .35) }
.mkt-a   { color: var(--down); border-color: rgba(232, 164, 92, .35) }
.mkt-ipo { color: var(--tx3);  border-style: dashed }

.mfilters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}

.card .top { flex-wrap: wrap }


.search {
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--tx);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 12px;
  width: 220px;
}
.search:focus { outline: 2px solid var(--mid); outline-offset: 1px }
.search::placeholder { color: var(--tx3) }

/* ── company cards ───────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

.card {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 18px 16px;
  text-align: left;
  font-family: var(--sans);
  color: var(--tx);
  transition: border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card:hover { border-color: var(--line2); transform: translateY(-2px) }

.card .top { display: flex; align-items: baseline; gap: 10px }

.card .tk {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
}

.card .nm { font-size: 14px; color: var(--tx2) }

.card .seg {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
}

.seg.s-up   { color: var(--up);   background: var(--up-dim) }
.seg.s-mid  { color: var(--mid);  background: var(--mid-dim) }
.seg.s-down { color: var(--down); background: var(--down-dim) }

.card .prod { font-size: 13px; color: var(--tx2); line-height: 1.6 }

.card .moat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--tx3);
}

.dots { display: inline-flex; gap: 3px }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2) }
.dots i.f { background: var(--mid) }

.card .more {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx3);
  margin-top: auto;
}
.card:hover .more { color: var(--mid) }

/* ── company detail modal ────────────────────────────────────── */
dialog {
  border: 1px solid var(--line2);
  background: var(--raised);
  color: var(--tx);
  max-width: 680px;
  width: calc(100% - 40px);
  padding: 0;
  margin: auto;
}
dialog::backdrop {
  background: rgba(8, 10, 14, .7);
  backdrop-filter: blur(2px);
}

.m-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--line);
}
.m-head .tk { font-family: var(--mono); font-size: 22px; font-weight: 600 }
.m-head .nm { font-size: 16px; color: var(--tx2) }

.m-close {
  margin-left: auto;
  cursor: pointer;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--tx2);
  font-family: var(--mono);
  font-size: 13px;
  padding: 4px 10px;
}
.m-close:hover { color: var(--tx); border-color: var(--line2) }

.m-body {
  padding: 20px 26px 26px;
  max-height: 70vh;
  overflow-y: auto;
}

.m-sec { margin-bottom: 20px }
.m-sec h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--tx3);
  margin-bottom: 8px;
  font-weight: 500;
}
.m-sec p { font-size: 14px; color: var(--tx); line-height: 1.8 }
.m-sec ul { list-style: none }
.m-sec ul li {
  font-size: 14px;
  padding: 6px 0 6px 16px;
  position: relative;
  color: var(--tx);
}
.m-sec ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 14px;
  width: 6px; height: 1px;
  background: var(--tx3);
}
.m-sec.m-risk ul li::before { background: var(--risk) }

.kvs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.kv { background: var(--surface); padding: 10px 14px }
.kv .k { font-size: 11px; color: var(--tx3) }
.kv .v { font-family: var(--mono); font-size: 14px; margin-top: 2px }

.m-etf {
  font-size: 13px;
  color: var(--tx2);
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

/* ── ETF table ───────────────────────────────────────────────── */
.etf-scroll { overflow-x: auto }

table.etf {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  font-size: 13.5px;
}
table.etf th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--tx3);
  text-align: left;
  font-weight: 500;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line2);
  background: var(--surface);
}
table.etf td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--tx2);
}
table.etf td:first-child {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
}
table.etf tr:last-child td { border-bottom: none }

.tag-warn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--risk);
  background: var(--risk-dim);
  border-radius: 3px;
  padding: 2px 7px;
  margin-left: 6px;
}

/* ── decision signals ────────────────────────────────────────── */
.sig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.sig {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
}
.sig .when {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--down);
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.sig .what { font-size: 14px; font-weight: 600; margin-bottom: 6px }
.sig .why  { font-size: 13px; color: var(--tx2); line-height: 1.65 }

/* ── risk matrix ─────────────────────────────────────────────── */
.risk-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.risk-box {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 20px;
}
.risk-box h3 {
  font-size: 15px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.risk-box h3 i { width: 9px; height: 9px; border-radius: 2px; display: inline-block }
.risk-box.sys h3 i { background: var(--risk) }
.risk-box.loc h3 i { background: var(--down) }

.risk-box ol { list-style: none; counter-reset: r }
.risk-box ol li {
  counter-increment: r;
  position: relative;
  padding: 8px 0 8px 32px;
  font-size: 13.5px;
  color: var(--tx2);
  border-top: 1px dashed var(--line);
}
.risk-box ol li:first-child { border-top: none }
.risk-box ol li::before {
  content: counter(r, decimal-leading-zero);
  position: absolute;
  left: 0; top: 9px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx3);
}
.risk-box ol li b { color: var(--tx); font-weight: 600 }

/* ── footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 56px;
  margin-top: 30px;
}
footer p {
  font-size: 12.5px;
  color: var(--tx3);
  max-width: 880px;
  line-height: 1.8;
}
footer p + p { margin-top: 10px }

/* ── responsive ──────────────────────────────────────────────── */
@media (max-width: 760px) {
  .risk-cols { grid-template-columns: 1fr }
  .search { width: 100%; margin-left: 0 }
}

@media (max-width: 600px) {
  .wrap { padding: 0 16px }

  header.hero { padding: 40px 0 28px }
  .hero p.sub { font-size: 14px }
  section { padding: 42px 0 }

  .stats { margin: 26px 0 38px }
  .cards { grid-template-columns: 1fr }
  .sig-grid { grid-template-columns: 1fr }
  .kvs { grid-template-columns: 1fr }

  .chain, .subchain { padding: 18px 16px 14px; overflow-x: visible }
  .m-head { padding: 18px 18px 14px }
  .m-body { padding: 18px 18px 22px }

  /* chain flow → vertical stack on small screens */
  .chain-flow {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
  }
  .tier.t-mid .nodes { grid-template-columns: 1fr }
  .flow-arrow { transform: rotate(90deg); min-height: 18px }
  .flows { flex-direction: column; gap: 8px; min-width: 0 }
  .sc-flow { flex-direction: column; align-items: stretch; min-width: 0 }
  .sc-arrow { justify-content: center; transform: rotate(90deg); min-height: 18px }
}

@media (max-width: 680px) {
  nav .wrap {
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px;
  }
  nav .brand { flex: 1 }
  nav .links {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 12px;
  }
  .map-dropdown { order: 1 }
  .lang-switch   { order: 2 }
}

/* ═══════════════════════════════════════════════════════════════════
   POWER-MAP  —  components unique to power-map.html and overrides
   for shared components when used in body.power-map context.
   body.power-map is set on <body> in power-map.html and en/power-map.html.
   ═══════════════════════════════════════════════════════════════════ */

/* ── extra design token ─────────────────────────────────────────────── */
/* --gold is used for ticker codes, moat stars, ETF labels in power-map */
:root { --gold: #E5C26B }

/* ── hero overrides ─────────────────────────────────────────────────── */
body.power-map header.hero {
  padding: 72px 0 58px;
  background:
    radial-gradient(1100px 500px at 75% -10%, rgba(61,214,195,.07), transparent 60%),
    radial-gradient(800px 420px at 10% 0%,  rgba(157,140,255,.06), transparent 55%);
}
body.power-map .eyebrow {
  color: var(--mid);
  letter-spacing: .14em;
  margin-bottom: 18px;
}
body.power-map .hero h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 900;
  line-height: 1.32;
}
body.power-map .hero .sub {
  color: var(--tx2);
  max-width: 860px;
  margin: 20px 0 14px;
  font-size: 15px;
}
body.power-map .asof {
  border-radius: 20px;
  border-color: var(--line2);
}
body.power-map .asof i {
  background: var(--mid);
  animation: pm-pulse 2.4s infinite;
}
@keyframes pm-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }

/* ── section shell overrides ────────────────────────────────────────── */
body.power-map section {
  padding: 62px 0;
  border-bottom: 1px solid var(--line);
}
body.power-map section h2 {
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 700;
  margin: 8px 0 10px;
}
.sec-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tx3);
  letter-spacing: .12em;
  text-transform: uppercase;
}
body.power-map .sec-desc b { color: var(--tx); font-weight: 500 }

/* ── stats overrides (rounded card style) ───────────────────────────── */
body.power-map .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 38px;
  background: transparent;
  border: none;
}
body.power-map .stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
body.power-map .stat b {
  display: block;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--tx);
}
body.power-map .stat b em {
  font-style: normal;
  font-size: 13px;
  color: var(--tx3);
  margin-left: 3px;
}
body.power-map .stat span { font-size: 12.5px; color: var(--tx2) }

/* ── chain diagram (row-based layout) ──────────────────────────────── */
body.power-map .tier { margin-bottom: 22px; display: block }
body.power-map .tier-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
body.power-map .tier-label b { font-family: var(--mono); font-size: 13px; letter-spacing: .1em }
body.power-map .tier-label span { font-size: 12.5px; color: var(--tx3) }

.chain-row { display: grid; gap: 10px }
.t-up   .chain-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) }
.t-mid  .chain-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) }
.t-down .chain-row { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) }

/* power-map node internals (no overall node override, inherits from global .node) */
.node .n-en {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--tx3);
  letter-spacing: .05em;
  display: block;
  margin: 1px 0 6px;
}
.node .n-cos {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx2);
  line-height: 1.7;
}

/* flow annotation below chain diagram */
.flow-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 26px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tx3);
  border-top: 1px dashed var(--line2);
  padding-top: 16px;
}
.flow-note b { font-weight: 500 }
.flow-note .f1 b { color: var(--mid)  }
.flow-note .f2 b { color: var(--down) }

/* ── investment theme cards ─────────────────────────────────────────── */
.themes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.theme {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  background: linear-gradient(160deg, var(--surface), var(--bg));
}
.theme h5 { font-size: 15px; margin-bottom: 6px }
.theme h5 i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: 1px;
}
.th-us h5 i { color: var(--mid);  border: 1px solid rgba(61,214,195,.4)  }
.th-cn h5 i { color: var(--down); border: 1px solid rgba(232,164,92,.4)  }
.th-dc h5 i { color: var(--up);   border: 1px solid rgba(157,140,255,.4) }
.theme p { font-size: 13px; color: var(--tx2) }

/* #filters and #mfilters layout */
#filters, .mfilters { display: flex; gap: 8px; flex-wrap: wrap }
#filters { margin: 4px 0 10px }
.mfilters { margin: 0 0 14px }

#count { font-family: var(--mono); font-size: 12px; color: var(--tx3); margin-bottom: 14px }

/* ── company card overrides (rounded, gold ticker, exact details) ───── */
body.power-map .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 19px 20px 17px;
}
body.power-map .card .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
body.power-map .card .tk  { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--gold) }
body.power-map .card .nm  { font-size: 15.5px; font-weight: 700; color: var(--tx) }

/* segment/market/position labels */
.segtag { font-size: 11px; color: var(--tx3); margin-left: auto; white-space: nowrap }
.pos { font-size: 13px; color: var(--tx2); border-left: 2px solid var(--line2); padding-left: 10px }

/* moat stars */
.moat { font-family: var(--mono); font-size: 12px; color: var(--gold); letter-spacing: 2px }
.moat span { color: var(--tx3); letter-spacing: 0; margin-left: 8px; font-size: 11px }

/* attribute badges */
.attr { font-size: 10.5px; font-family: var(--mono); padding: 1px 8px; border-radius: 4px; margin-left: 10px; letter-spacing: 0 }
.at-grow { color: var(--mid);  border: 1px solid rgba(61,214,195,.3)  }
.at-div  { color: var(--gold); border: 1px solid rgba(229,194,107,.3) }
.at-grid { color: var(--down); border: 1px solid rgba(232,164,92,.3)  }
.at-idc  { color: var(--up);   border: 1px solid rgba(157,140,255,.3) }

/* investment logic */
.logic { font-size: 13.5px; color: var(--tx2) }
.logic b { color: var(--tx); font-weight: 500 }

/* key metric chips */
.kpis { display: flex; flex-wrap: wrap; gap: 6px }
.kpi  { font-family: var(--mono); font-size: 11px; color: var(--tx2); background: var(--bg); border: 1px solid var(--line); padding: 3px 9px; border-radius: 5px }

/* risk footer in card */
.rsk { font-size: 12.5px; color: var(--tx3); border-top: 1px dashed var(--line); padding-top: 9px; margin-top: auto }
.rsk b { color: var(--risk); font-weight: 500; font-size: 12px }

/* ── ETF cards (power-map uses card layout, not table) ──────────────── */
.etf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 13px }

/* .etf as a div card (power-map); note: shared.css uses `table.etf` which is more specific */
body.power-map .etf {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px 19px;
}
body.power-map .etf .top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap }
body.power-map .etf .tk { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--gold) }
body.power-map .etf .nm { font-size: 14px; font-weight: 700 }
body.power-map .etf p   { font-size: 13px; color: var(--tx2) }

.etf-cat {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx3);
  letter-spacing: .1em;
  margin: 26px 0 12px;
  text-transform: uppercase;
}
.etf-cat:first-of-type { margin-top: 0 }

/* ── signals (numbered grid layout) ────────────────────────────────── */
.sig-list { display: flex; flex-direction: column; gap: 11px }

body.power-map .sig {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 19px;
}
.sig .no { font-family: var(--mono); font-size: 15px; color: var(--tx3); padding-top: 2px }
body.power-map .sig h5 { font-size: 14.5px; margin-bottom: 3px }
body.power-map .sig p  { font-size: 13px; color: var(--tx2) }
body.power-map .sig p b { color: var(--tx); font-weight: 500 }
.sig .dir { font-family: var(--mono); font-size: 11.5px; margin-top: 6px; color: var(--tx3) }
.sig .dir b { font-weight: 500 }
.sig .dir .g { color: var(--mid)  }
.sig .dir .r { color: var(--risk) }

/* ── risk table ─────────────────────────────────────────────────────── */
.rtable { width: 100%; border-collapse: collapse; font-size: 13px }
.rtable th {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--tx3);
  text-align: left;
  font-weight: 500;
  letter-spacing: .06em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line2);
}
.rtable td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--tx2);
}
.rtable td:first-child { color: var(--tx); font-weight: 500; white-space: nowrap }
.rtable td .lv { font-family: var(--mono); font-size: 11px; padding: 1px 8px; border-radius: 4px }
.lv-h { color: var(--risk); border: 1px solid rgba(240,122,116,.4) }
.lv-m { color: var(--down); border: 1px solid rgba(232,164,92,.4)  }
.rtable td .tks { font-family: var(--mono); font-size: 11.5px; color: var(--tx3) }
.rwrap { overflow-x: auto }

/* ── footer override ────────────────────────────────────────────────── */
body.power-map footer { padding: 42px 0 60px; margin-top: 0; border-top: none }
body.power-map footer p { max-width: 900px }

/* ── responsive overrides ───────────────────────────────────────────── */
@media (max-width: 720px) {
  body.power-map .sig { grid-template-columns: 1fr }
  .sig .no { display: none }
}
