/* Executive command center v2 (2026-10-14) — scoped to #module-executive.
   Existing tokens only; no gradients, glows or coloured left borders. Calm,
   dense, neutral surfaces; the one accent is for focus and the primary action. */

#module-executive { --ex-ease: cubic-bezier(.2,.8,.2,1); --ex-dur: 180ms; }
#module-executive .ex-n, #module-executive .exec-tile-val, #module-executive .exec-delta,
#module-executive time, #module-executive .exec-updated { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Language pairs: the shell owns html[data-lang]; these scoped rules keep the
   module correct before/without it (no data-lang -> both, spaced). */
html[data-lang="en"] #module-executive [lang="zh"], html[data-lang="zh"] #module-executive [lang="en"] { display: none !important; }
html:not([data-lang]) #module-executive > .module-header [lang="zh"]:not(:first-child)::before,
html:not([data-lang]) #module-executive .exec-kpis [lang="zh"]:not(:first-child)::before,
html:not([data-lang]) #module-executive #execWeekText [lang="zh"]:not(:first-child)::before { content: " "; }
#module-executive [lang="zh"] { font-family: var(--font-cn); }
#module-executive .ex-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── icons ── */
#module-executive .exec-ico { display: inline-flex; width: 16px; height: 16px; flex: 0 0 16px; color: currentColor; }
#module-executive .exec-ico svg { width: 16px; height: 16px; display: block; }

/* ── header: scope segmented control + updated + refresh ── */
#module-executive > .module-header { align-items: center; flex-wrap: wrap; gap: 12px 16px; }
#module-executive .exec-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-left: auto; }
#module-executive .exec-updated { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
#module-executive .exec-seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius); }
#module-executive .exec-seg [role="radio"] { min-height: 28px; padding: 4px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); font: 500 13px/1.2 var(--font-ui); cursor: pointer; white-space: nowrap; transition: background-color var(--ex-dur) var(--ex-ease), color var(--ex-dur) var(--ex-ease); }
#module-executive .exec-seg [role="radio"]:hover { color: var(--text-primary); }
#module-executive .exec-seg [role="radio"][aria-checked="true"] { background: var(--card-bg); color: var(--text-primary); box-shadow: 0 0 0 1px var(--border-light); }
#module-executive .exec-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 12px; font: 500 13px/1.2 var(--font-ui); color: var(--text-primary); background: transparent; border: 1px solid var(--border-light); border-radius: var(--radius); cursor: pointer; transition: background-color var(--ex-dur) var(--ex-ease), border-color var(--ex-dur) var(--ex-ease), color var(--ex-dur) var(--ex-ease); }
#module-executive .exec-btn:hover { background: var(--bg-hover); }
#module-executive .exec-btn.exec-ghost { border-color: transparent; color: var(--text-secondary); }
#module-executive .exec-btn.exec-ghost:hover { color: var(--text-primary); }
#module-executive .exec-btn[aria-busy="true"] { cursor: progress; opacity: .75; }
#module-executive .exec-btn[aria-busy="true"] .exec-ico { animation: ex-spin 900ms linear infinite; }
#module-executive button:focus-visible, #module-executive a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#module-executive .exec-sys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 16px; font-size: 12px; color: var(--text-secondary); }

/* ── KPI strip ── */
#module-executive .exec-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
#module-executive .exec-tile { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 112px; padding: 12px; text-align: left; color: var(--text-primary); background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; font: inherit; cursor: pointer; transition: background-color var(--ex-dur) var(--ex-ease), border-color var(--ex-dur) var(--ex-ease); }
#module-executive a.exec-tile, #module-executive button.exec-tile { text-decoration: none; }
#module-executive .exec-tile:hover { background: var(--bg-hover); border-color: var(--border-light); }
#module-executive .exec-tile-top { display: flex; align-items: flex-start; gap: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 500; min-width: 0; }
#module-executive .exec-tile-label { min-width: 0; line-height: 1.3; overflow-wrap: break-word; }
#module-executive .exec-tile-val { font-size: 24px; font-weight: 600; line-height: 1.15; color: var(--text-primary); letter-spacing: 0; }
#module-executive .exec-tile-val small { font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-left: 2px; }
#module-executive .exec-tile-val.is-none { color: var(--text-muted); font-weight: 400; }
#module-executive .exec-tile-foot { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 6px; margin-top: auto; min-height: 24px; }
#module-executive .exec-delta { font-size: 12px; color: var(--text-secondary); line-height: 1.35; min-width: 0; overflow-wrap: break-word; word-break: normal; }
#module-executive .exec-delta.is-worse { color: var(--red); }
#module-executive .exec-delta.is-better { color: var(--green); }
#module-executive .exec-spark { flex: 0 0 auto; width: 64px; height: 24px; color: var(--text-muted); }
#module-executive .exec-spark polyline { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#module-executive .exec-spark circle { fill: var(--text-primary); }
#module-executive .exec-tile.is-error { cursor: default; }
#module-executive .exec-tile-err { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
#module-executive .exec-tile-retry { align-self: flex-start; min-height: 28px; padding: 3px 10px; font-size: 12px; }

/* ── skeleton + empty ── */
#module-executive .exec-skel { background: var(--bg-tertiary); border-color: transparent; border-radius: 10px; animation: ex-pulse 1.2s ease-in-out infinite alternate; cursor: default; }
@keyframes ex-pulse { from { opacity: .45; } to { opacity: 1; } }
@keyframes ex-spin { to { transform: rotate(360deg); } }
@keyframes ex-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#module-executive .exec-kpis[aria-busy="false"] .exec-tile { animation: ex-in var(--ex-dur) var(--ex-ease); }

/* ── cards ── */
#module-executive .exec-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 0 0 16px; min-width: 0; }
#module-executive .exec-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#module-executive .exec-h { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-primary); letter-spacing: 0; text-transform: none; }
#module-executive .exec-count { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
#module-executive .exec-count:empty { display: none; }
#module-executive .exec-skel-row { height: 44px; margin: 8px 0; border-radius: 6px; }
#module-executive .exec-dot-sep { color: var(--text-muted); margin: 0 4px; }
#module-executive .exec-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-right: 6px; border-radius: 9999px; font-size: 12px; font-weight: 500; border: 1px solid var(--border-light); color: var(--text-secondary); white-space: nowrap; }
#module-executive .exec-pill-bad { color: var(--red); }

/* ── attention list ── */
#module-executive .exec-att-list { list-style: none; margin: 0; padding: 0; }
#module-executive .exec-att-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 4px; border-bottom: 1px solid var(--border); transition: background-color var(--ex-dur) var(--ex-ease); }
#module-executive .exec-att-row:last-child { border-bottom: 0; }
#module-executive .exec-att-row:hover { background: var(--bg-hover); }
#module-executive .exec-att-ico { color: var(--text-secondary); display: grid; place-items: center; }
#module-executive .exec-att-row[data-kind="risk"] .exec-att-ico { color: var(--red); }
#module-executive .exec-att-title { margin: 0; font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.4; overflow-wrap: anywhere; }
#module-executive .exec-title-cn { color: var(--text-secondary); font-weight: 400; margin-left: 4px; }
#module-executive .exec-att-meta { margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); line-height: 1.5; display: flex; flex-wrap: wrap; align-items: center; }
#module-executive .exec-att-act { white-space: nowrap; }
#module-executive .exec-att-toggle { margin-top: 8px; }
#module-executive .exec-empty { padding: 24px 12px; text-align: center; }
#module-executive .exec-empty-ico { display: inline-grid; color: var(--green); margin-bottom: 8px; }
#module-executive .exec-empty-ico .exec-ico, #module-executive .exec-empty-ico svg { width: 24px; height: 24px; flex-basis: 24px; }
#module-executive .exec-empty p { margin: 0; }
#module-executive .exec-empty-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
#module-executive .exec-empty-sub { margin-top: 4px !important; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
#module-executive .exec-error .exec-btn { margin-top: 12px; }

/* ── portfolio pulse (div-based table, stacks on mobile) ── */
#module-executive .exec-muted { color: var(--text-muted); }
#module-executive .exec-prow { display: grid; grid-template-columns: minmax(140px, 1.6fr) minmax(80px, .8fr) minmax(130px, 1.2fr) minmax(110px, 1fr) minmax(120px, 1fr); align-items: center; gap: 12px; min-height: 44px; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-primary); }
#module-executive .exec-phead { min-height: 32px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
#module-executive .exec-prow:last-child { border-bottom: 0; }
#module-executive .exec-pcell { min-width: 0; font-variant-numeric: tabular-nums; }
#module-executive .exec-link { padding: 0; background: none; border: 0; color: var(--text-primary); font: 500 14px/1.3 var(--font-ui); text-align: left; cursor: pointer; }
#module-executive .exec-link:hover { text-decoration: underline; text-underline-offset: 3px; }
#module-executive .exec-ready { display: inline-flex; align-items: center; gap: 8px; }
#module-executive .exec-ready b { font-weight: 500; min-width: 36px; }
#module-executive .exec-bar { width: 64px; height: 6px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; display: inline-block; }
#module-executive .exec-bar i { display: block; height: 100%; background: var(--text-secondary); border-radius: 3px; transition: width var(--ex-dur) var(--ex-ease); }
#module-executive .exec-trend { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); }
#module-executive .exec-none-toggle { margin-top: 8px; }
#module-executive .exec-none-toggle[aria-expanded="true"] .exec-ico { transform: rotate(180deg); }
#module-executive .exec-none-toggle .exec-ico { transition: transform var(--ex-dur) var(--ex-ease); }
#module-executive .exec-none-list { list-style: none; margin: 4px 0 0; padding: 0 0 0 4px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-secondary); }
#module-executive .exec-pnote { margin: 8px 4px; }

/* ── activity feed ── */
#module-executive .exec-act-list { list-style: none; margin: 0; padding: 0; }
#module-executive .exec-act-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
#module-executive .exec-act-row:last-child { border-bottom: 0; }
#module-executive .exec-act-ico { color: var(--text-secondary); display: grid; place-items: center; padding-top: 1px; }
#module-executive .exec-act-line { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; overflow-wrap: anywhere; }
#module-executive .exec-act-line strong { color: var(--text-primary); font-weight: 500; }
#module-executive .exec-act-tag { margin-left: 4px; font-size: 12px; color: var(--text-muted); }
#module-executive .exec-act-detail { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; overflow-wrap: anywhere; }
#module-executive .exec-act-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; padding-top: 2px; }

/* ── This week (one sentence row) ── */
#module-executive .exec-week { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 10px 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
#module-executive .exec-week-ico { color: var(--text-secondary); padding-top: 1px; }
#module-executive .exec-week-text { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#module-executive .exec-week-text strong { color: var(--text-primary); font-weight: 600; margin-right: 6px; }
#module-executive .exec-skel-line { display: inline-block; width: 320px; max-width: 100%; height: 14px; vertical-align: middle; border-radius: 6px; }
/* Superseded legacy cards stay in the DOM (ids are pinned by gates) but never show. */
#module-executive [data-superseded] { display: none !important; }

/* Inline Lucide glyphs used by Executive renderers living in js/app.js */
#module-executive .exec-ico-inline { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; flex: 0 0 14px; }
#module-executive .idea-action-btn .exec-ico-inline { margin-right: 4px; }
#module-executive .ecosystem-card .state-icon { display: inline-flex; vertical-align: middle; }
#module-executive .evidence-trend-delta .exec-ico-inline { margin-right: 2px; }

/* ── responsive ── */
@media (max-width: 1280px) {
  #module-executive .exec-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  #module-executive .exec-actions { margin-left: 0; width: 100%; }
  #module-executive .exec-seg { width: 100%; }
  #module-executive .exec-seg [role="radio"] { flex: 1 1 0; min-height: 44px; }
  #module-executive .exec-btn { min-height: 44px; flex: 1 1 auto; justify-content: center; }
  #module-executive .exec-updated { flex: 1 1 100%; }
  #module-executive .exec-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #module-executive .exec-tile { min-height: 104px; padding: 12px 10px; }
  #module-executive .exec-tile-val { font-size: 20px; }
  #module-executive .exec-tile-retry { min-height: 44px; }
  #module-executive .exec-card { padding: 12px; }
  #module-executive .exec-att-row { grid-template-columns: 24px minmax(0, 1fr); padding: 12px 0; }
  #module-executive .exec-att-act { grid-column: 2; justify-self: stretch; justify-content: center; }
  #module-executive .exec-phead { display: none; }
  #module-executive .exec-prow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 0; }
  #module-executive .exec-pname { grid-column: 1 / -1; }
  #module-executive .exec-pname .exec-link { min-height: 44px; display: inline-flex; align-items: center; }
  #module-executive .exec-pcell[data-l-en]::before { content: attr(data-l-en); display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
  html[data-lang="zh"] #module-executive .exec-pcell[data-l-en]::before { content: attr(data-l-zh); }
  #module-executive .exec-none-toggle { min-height: 44px; }
  #module-executive .exec-act-row { grid-template-columns: 24px minmax(0, 1fr); }
  #module-executive .exec-act-time { grid-column: 2; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #module-executive *, #module-executive *::before, #module-executive *::after { animation: none !important; transition: none !important; }
}
html[data-reduce-motion="on"] #module-executive *, html[data-reduce-motion="on"] #module-executive *::before { animation: none !important; transition: none !important; }
