/* Pulso Digital V3 — full product surface. Loaded after every legacy module. */

:root {
  --ui-navy: #0a2433;
  --ui-ink: #122c3c;
  --ui-copy: #4f6877;
  --ui-muted: #7e929e;
  --ui-line: #dfe8ed;
  --ui-wash: #f3f7f9;
  --ui-card: #fff;
  --ui-signal: #0a85ad;
  --ui-cyan: #4ed4f1;
  --ui-positive: #11846c;
  --ui-warning: #b66b16;
  --ui-danger: #bd4650;
}

/* Shared section grammar */
.page-section[data-ui="pulso-v3"]:not(#section-analyst) {
  animation: section-arrival .28s ease both;
}
.page-section:not(#section-overview):not(#section-analyst) > .page-heading {
  position: relative;
  min-height: 122px;
  margin: 0 0 18px;
  padding: 25px 28px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: linear-gradient(118deg, #fff 0%, #f6fafb 68%, #edf6f8 100%);
  box-shadow: 0 10px 30px rgba(19, 54, 70, .055);
}
.page-section:not(#section-overview):not(#section-analyst) > .page-heading::after {
  content: "";
  position: absolute;
  top: -55px;
  right: -38px;
  width: 240px;
  height: 180px;
  border: 1px solid rgba(36, 153, 190, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(36,153,190,.035), 0 0 0 58px rgba(36,153,190,.022);
}
.page-section > .page-heading h1 {
  margin: 5px 0 6px;
  color: var(--ui-ink);
  font-size: clamp(26px, 2.2vw, 36px);
  font-weight: 710;
  letter-spacing: -.045em;
  line-height: 1.05;
}
.page-section > .page-heading p { max-width: 720px; color: var(--ui-copy); font-size: 12px; }
.page-section .card,
.page-section .briefing-panel,
.page-section .engagement-card,
.page-section .territorial-intelligence,
.page-section .rp-levels,
.page-section .rp-catalog,
.page-section .rp-builder,
.page-section .rp-summary,
.page-section .rp-automation > article {
  border: 1px solid var(--ui-line) !important;
  border-radius: 15px !important;
  background: var(--ui-card) !important;
  box-shadow: 0 8px 26px rgba(15, 49, 65, .055) !important;
}
.page-section .card { padding: 20px; }
.page-section .card-heading { padding-bottom: 14px; border-bottom: 1px solid #eaf0f3; }
.page-section .card-heading h2 { margin-top: 4px; color: var(--ui-ink); font-size: 16px; letter-spacing: -.025em; }
.page-section .muted { color: var(--ui-muted); }
.page-section .method-pill,
.page-section .confidence-chip { border-color: #dbe7ec; border-radius: 999px; color: #426273; background: #f7fafb; }
.dashboard-grid { gap: 16px; margin-bottom: 16px; }
.component-list > div,
.insight-list > li { border-color: #e8eef2 !important; }

/* Navigation icon system */
.nav-icon svg { width: 14px; height: 14px; }
.nav-item.active .nav-icon svg { filter: drop-shadow(0 0 5px rgba(89, 214, 247, .3)); }
.nav-item[data-section="analyst"] .nav-icon { color: #b79df7; }
.nav-item[data-section="crisis"] .nav-icon { color: #e69aa0; }
.nav-item[data-section="reports"] .nav-icon { color: #8fc2d5; }

/* Reputation — analytical editorial layout */
#section-reputation .reputation-module:not(:empty) { margin-bottom: 18px; }
#section-reputation .rp-heading,
#section-conversation .ci-heading,
#section-topics .te-heading,
#section-crisis .cw-heading {
  position: relative;
  min-height: 150px;
  padding: 27px 29px !important;
  overflow: hidden;
  border: 1px solid var(--ui-line) !important;
  border-radius: 17px !important;
  background: linear-gradient(118deg,#fff,#f3f8fa) !important;
  box-shadow: 0 12px 34px rgba(14,49,66,.06) !important;
}
#section-reputation .rp-heading h1,
#section-conversation .ci-heading h1,
#section-topics .te-heading h1,
#section-crisis .cw-heading h1 { color: var(--ui-ink); font-size: clamp(28px,2.5vw,39px); letter-spacing: -.048em; }
#section-reputation .rp-heading::after,
#section-conversation .ci-heading::after,
#section-topics .te-heading::after,
#section-crisis .cw-heading::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 28px;
  width: 150px;
  height: 86px;
  opacity: .2;
  background: linear-gradient(165deg,transparent 46%,#1497bf 47% 49%,transparent 50%);
  clip-path: polygon(0 53%,15% 53%,21% 35%,28% 70%,36% 18%,44% 82%,52% 46%,61% 53%,71% 53%,78% 38%,85% 67%,91% 53%,100% 53%,100% 57%,91% 57%,85% 72%,78% 43%,71% 57%,61% 57%,52% 50%,44% 88%,36% 24%,28% 76%,21% 41%,15% 57%,0 57%);
}
#section-reputation .rp-card {
  border: 1px solid var(--ui-line) !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(15,49,65,.055) !important;
}
#section-reputation .rp-top-grid,
#section-reputation .rp-middle-grid,
#section-reputation .rp-bottom-grid { gap: 16px; }
#section-reputation .rp-overview { overflow: hidden; background: linear-gradient(145deg,#0a2635,#0c5063) !important; border-color: #164c60 !important; }
#section-reputation .rp-overview :is(h2,h3,strong) { color: #f2fbfd !important; }
#section-reputation .rp-overview :is(span,small,p) { color: #91b0bc !important; }
#section-reputation .rp-score { color: #f4fcfe !important; text-shadow: 0 8px 24px rgba(0,0,0,.18); }
#section-reputation .rp-toggles { padding: 4px; border: 1px solid #dbe6eb; border-radius: 10px; background: #eff4f6; }
#section-reputation .rp-toggles button { border-radius: 7px; }
#section-reputation .rp-toggles button.active { color: #12394b; background: #fff; box-shadow: 0 2px 7px rgba(15,48,63,.1); }
#section-reputation .score-layout { grid-template-columns: minmax(280px,.72fr) minmax(0,1.28fr); }
#section-reputation .score-feature {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  color: #edf9fc;
  border-color: #143e50 !important;
  background: linear-gradient(145deg, #0b2635, #0d4559) !important;
}
#section-reputation .score-feature::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -95px;
  width: 220px;
  height: 220px;
  border: 34px solid rgba(85, 209, 238, .08);
  border-radius: 50%;
}
#section-reputation .score-feature :is(h2,h3,strong) { color: #f2fbfd; }
#section-reputation .score-feature :is(p,small,span) { color: #91b1be; }
#section-reputation .explain-panel { background: linear-gradient(135deg,#fff,#f7fbfc) !important; }
#section-reputation .political-attribute-columns { gap: 14px; }
#section-reputation .attribute-column { border: 1px solid #e5ecef; border-radius: 12px; background: #fbfcfd; }
#section-reputation .attribute-column.positive { box-shadow: inset 0 3px #42aa8c; }
#section-reputation .attribute-column.negative { box-shadow: inset 0 3px #d56a72; }

/* Conversation — live newsroom */
#section-conversation { min-height: calc(100vh - 150px); }
#section-conversation .conversation-intelligence { position: relative; }
#section-conversation .ci-heading {
  color: #eaf8fc;
  border-color: #17485b !important;
  background: linear-gradient(120deg,#092532,#0d5064) !important;
  box-shadow: 0 20px 50px rgba(9,43,58,.14) !important;
}
#section-conversation .ci-heading h1 { color: #f2fbfd; }
#section-conversation .ci-heading :is(p,small,span) { color: #8fadb9; }
#section-conversation .ci-heading::after { opacity: .45; background-color: transparent; filter: drop-shadow(0 0 8px rgba(65,204,239,.4)); }
#section-conversation .ci-kpis { gap: 10px; margin: 14px 0 16px; }
#section-conversation .ci-kpi {
  min-height: 116px;
  border: 1px solid var(--ui-line) !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(15,49,65,.05) !important;
}
#section-conversation .ci-primary,
#section-conversation .ci-secondary { gap: 16px; }
#section-conversation .ci-card {
  border: 1px solid var(--ui-line) !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(15,49,65,.055) !important;
}
#section-conversation .ci-card > header { padding-bottom: 13px; border-bottom: 1px solid #e8eff2; }
#section-conversation .ci-network { border-radius: 12px; background: #0d2532; }
#section-conversation .ci-topic,
#section-conversation .ci-narrative { border-color: #e7eef1 !important; border-radius: 10px !important; }
#section-conversation :is(.conversation-hero,.ci-hero,.conversation-header) {
  overflow: hidden;
  border-radius: 18px !important;
  background: linear-gradient(125deg,#092431,#0b4d60) !important;
  box-shadow: 0 22px 55px rgba(9,43,58,.14) !important;
}
#section-conversation :is(.conversation-card,.ci-card,.conversation-panel) {
  border: 1px solid var(--ui-line) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(15,49,65,.055) !important;
}
#section-conversation :is(.conversation-metric,.ci-metric) { border-radius: 12px !important; background: #f6f9fa !important; }

/* Engagement — creation studio */
#section-engagement .engagement-studio { max-width: 1380px; margin: 0 auto; }
#section-engagement .engagement-hero {
  min-height: 190px;
  margin-bottom: 18px;
  padding: 32px;
  border: 1px solid rgba(95, 188, 216, .2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 20%, rgba(66, 199, 235, .22), transparent 26%),
    linear-gradient(125deg, #091f2c, #103f51);
  box-shadow: 0 22px 52px rgba(9, 38, 51, .14);
}
#section-engagement .engagement-hero h1 { max-width: 720px; color: #f2fbfd; font-size: clamp(28px,3vw,43px); letter-spacing: -.05em; }
#section-engagement .engagement-hero p { max-width: 650px; color: #8eacb8; }
#section-engagement .engagement-library-button { border-color: rgba(150,218,236,.18); border-radius: 11px; background: rgba(4,20,28,.32); backdrop-filter: blur(10px); }
#section-engagement .engagement-uploader { padding: 14px; }
#section-engagement .engagement-drop {
  min-height: 360px;
  border: 1px dashed #a9cbd7;
  border-radius: 13px;
  background: linear-gradient(145deg,#f8fbfc,#eff7f9);
}
#section-engagement .engagement-drop:hover { border-color: #2ca6cf; background: #eef9fc; transform: translateY(-2px); }
#section-engagement .engagement-drop b { box-shadow: 0 10px 25px rgba(10,133,173,.2); }

/* Mentions — evidence ledger */
#section-mentions .mentions-ledger { padding: 0; overflow: hidden; }
#section-mentions .filter-bar { padding: 14px; border-bottom: 1px solid var(--ui-line); background: #f8fafb; }
#section-mentions .search-box { min-width: min(340px,100%); border: 1px solid #d7e4e9; border-radius: 10px; background: #fff; }
#section-mentions .filter-bar select { min-height: 38px; border-color: #d7e4e9; background: #fff; }
#section-mentions .mention-row { min-height: 72px; padding: 13px 16px; border-bottom: 1px solid #e9eff2; transition: background .15s ease, transform .15s ease; }
#section-mentions .mention-row:hover { position: relative; z-index: 1; background: #f4f9fb; transform: translateX(3px); }
#section-mentions .mention-source { border: 1px solid #dce8ed; box-shadow: 0 3px 10px rgba(20,58,74,.06); }
#section-mentions .pagination { padding: 14px; border-top: 1px solid var(--ui-line); background: #fbfcfd; }

/* Topics — signal map */
#section-topics .topics-emotions-module { display: grid; gap: 16px; }
#section-topics .te-heading {
  color: #eaf8fc;
  border-color: #17485b !important;
  background: linear-gradient(120deg,#0a2634,#10566a) !important;
  box-shadow: 0 20px 50px rgba(9,43,58,.14) !important;
}
#section-topics .te-heading h1 { color: #f2fbfd; }
#section-topics .te-heading :is(p,small,span) { color: #91aeba; }
#section-topics .te-summary { gap: 10px; }
#section-topics .te-summary > * {
  border: 1px solid var(--ui-line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 7px 22px rgba(15,49,65,.05) !important;
}
#section-topics .te-grid { gap: 16px; }
#section-topics .te-panel {
  border: 1px solid var(--ui-line) !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(15,49,65,.055) !important;
}
#section-topics .te-topic-row,
#section-topics .te-emotion-row { border-bottom-color: #e8eef2 !important; }
#section-topics .te-bar { height: 7px; border-radius: 7px; background: #e8eff2; }
#section-topics :is(.topics-hero,.te-hero,.topics-header) {
  border: 1px solid #163f50 !important;
  border-radius: 18px !important;
  background: linear-gradient(120deg,#0a2634,#0c5064) !important;
  box-shadow: 0 20px 50px rgba(10,45,59,.13) !important;
}
#section-topics :is(.topics-card,.emotion-card,.te-card,.topic-panel) {
  border: 1px solid var(--ui-line) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(15,49,65,.055) !important;
}
#section-topics .topic-command-row { min-height: 52px; border-bottom: 1px solid #e8eef1; border-radius: 8px; }
#section-topics .topic-command-row:hover { border-color: #c9e1e9; background: #f3f9fb; }
#section-topics .topic-command-track { height: 7px; border: 0; background: #e8eff2; box-shadow: none; }
#section-topics .topic-command-track i { background: linear-gradient(90deg,#087fa8,#55cde8); }

/* Crisis — serious incident room */
#section-crisis .crisis-war-room { display: grid; gap: 16px; }
#section-crisis .cw-heading {
  color: #fff2f3;
  border-color: #5b3035 !important;
  background: linear-gradient(122deg,#24191c,#572a30) !important;
  box-shadow: 0 20px 50px rgba(79,30,36,.15) !important;
}
#section-crisis .cw-heading h1 { color: #fff6f7; }
#section-crisis .cw-heading :is(p,small,span) { color: #c39da1; }
#section-crisis .cw-heading::after { opacity: .34; background-color: transparent; filter: hue-rotate(150deg); }
#section-crisis .cw-stats { gap: 10px; }
#section-crisis .cw-stats > * {
  border: 1px solid #eadfe1 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 7px 22px rgba(77,35,42,.05) !important;
}
#section-crisis .cw-main,
#section-crisis .cw-dossier-grid { gap: 16px; }
#section-crisis .cw-panel {
  border: 1px solid #e9dfe1 !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(77,35,42,.055) !important;
}
#section-crisis .cw-incident { border-color: #eadfe1 !important; border-radius: 11px !important; }
#section-crisis .cw-incident.active { border-color: #d18a90 !important; background: #fff7f7 !important; box-shadow: inset 3px 0 #bf4c55; }
#section-crisis :is(.crisis-hero,.crisis-header,.cw-hero) {
  border: 1px solid rgba(206,103,111,.2) !important;
  border-radius: 18px !important;
  background: linear-gradient(122deg,#25191d,#51262c) !important;
  box-shadow: 0 22px 52px rgba(79,30,36,.14) !important;
}
#section-crisis :is(.crisis-card,.war-room-card,.cw-card,.crisis-panel) {
  border: 1px solid #eadfe1 !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 8px 26px rgba(77,35,42,.055) !important;
}
#section-crisis .crisis-stat { border-color: #eadfe1; background: #fff; box-shadow: 0 7px 22px rgba(91,42,48,.05); }
#section-crisis .crisis-stat::before { width: 3px; }

/* Polls — research desk */
#section-polls .forecast-hero { overflow: hidden; border-radius: 16px; }
#section-polls .candidate-ranking { border-radius: 12px; background: #f6f9fa; }
#section-polls .poll-table { overflow: hidden; border: 1px solid var(--ui-line); border-radius: 12px; }
#section-polls .poll-head { padding: 11px 13px; border-bottom: 1px solid var(--ui-line); background: #f3f7f9; }
#section-polls .poll-row { min-height: 52px; padding-inline: 13px; }
#section-polls .poll-row:hover { transform: none; border-color: transparent; border-radius: 0; background: #f2f8fa; }
#section-polls .poll-focus { border-color: #d6e5eb; background: #f6fafb; box-shadow: none; }

/* Electorate — geospatial command surface */
#section-electorate .electorate-hero { border-radius: 16px; overflow: hidden; }
#section-electorate .territorial-intelligence { overflow: hidden; }
#section-electorate .territorial-map-toolbar { padding: 20px; border-bottom: 1px solid #dce7ec; background: linear-gradient(180deg,#fff,#f7fafb); }
#section-electorate .geo-toolbar-controls input,
#section-electorate .geo-toolbar-controls select { min-height: 38px; border-color: #d4e1e7; background: #fff; }
#section-electorate .geo-layer-switch { padding: 3px; border: 1px solid #d8e4e9; border-radius: 10px; background: #edf3f5; }
#section-electorate .geo-layer-switch button { border-radius: 7px; }
#section-electorate .geo-layer-switch button.active { background: #fff !important; color: #12394d !important; box-shadow: 0 2px 7px rgba(21,57,73,.1) !important; }
#section-electorate .territorial-map-stage { background: #eaf1f4; }
#section-electorate .territorial-side-panel { border-left: 1px solid #d7e3e8; background: #f9fbfc; }
#section-electorate .event-planner-panel { margin: 14px; border: 1px solid #d8e5ea; border-radius: 13px; box-shadow: 0 12px 32px rgba(18,52,67,.08); }

/* Reports — product configurator */
#section-reports .rp-hero {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(96,185,210,.2);
  border-radius: 18px;
  background: linear-gradient(120deg,#092431,#0d4a5c);
  box-shadow: 0 22px 52px rgba(9,38,51,.14);
}
#section-reports .rp-hero h1 { color: #f2fbfd; font-size: clamp(30px,3vw,44px); letter-spacing: -.052em; }
#section-reports .rp-hero p { color: #8caab6; }
#section-reports .rp-hero-status { border-color: rgba(145,211,229,.13); background: rgba(3,18,26,.3); backdrop-filter: blur(10px); }
#section-reports .rp-level-grid { gap: 10px; }
#section-reports .rp-level { min-height: 116px; border: 1px solid #dfe8ed; border-radius: 11px; background: #f8fafb; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
#section-reports .rp-level:hover { border-color: #a9cdd9; transform: translateY(-3px); box-shadow: 0 10px 24px rgba(14,67,88,.08); }
#section-reports .rp-level.active { color: #eefaff; border-color: #0c6e90; background: linear-gradient(145deg,#0a3042,#0b6783); box-shadow: 0 13px 28px rgba(9,91,119,.18); }
#section-reports .rp-grid { gap: 12px; }
#section-reports .rp-product { border-radius: 12px !important; }
#section-reports .rp-workspace { gap: 16px; }
#section-reports .rp-summary { position: sticky; top: 76px; background: #f7fafb !important; }

/* Pulso AI — polish the existing dark experience */
#section-analyst.active { background: #090d13; }
#section-analyst::before { opacity: .42; background-size: 32px 32px; }
#section-analyst .analyst-page-bar { border-bottom-color: rgba(142,188,216,.1); background: rgba(8,13,19,.82); backdrop-filter: blur(18px); }
#section-analyst .analyst-console { border-color: rgba(141,184,210,.11); border-radius: 18px; background: linear-gradient(150deg,rgba(18,25,35,.96),rgba(11,16,24,.98)); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
#section-analyst .analyst-console-head { border-bottom-color: rgba(145,183,207,.08); }
#section-analyst .analyst-prompts button { border-radius: 999px; }
#section-analyst .analyst-composer { border-color: rgba(139,188,218,.16); border-radius: 16px; background: #171e28; }
#section-analyst .analyst-composer:focus-within { border-color: rgba(83,196,232,.4); box-shadow: 0 20px 48px rgba(0,0,0,.35),0 0 0 3px rgba(42,175,218,.07); }
#section-analyst #sendAnalyst { border-radius: 10px; background: linear-gradient(135deg,#1689b4,#0b6c91); }

@keyframes section-arrival {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .page-section:not(#section-overview):not(#section-analyst) > .page-heading { min-height: 108px; padding: 21px; }
  #section-reputation .score-layout { grid-template-columns: 1fr; }
  #section-engagement .engagement-hero,
  #section-reports .rp-hero { padding: 25px 22px; }
  #section-reports .rp-summary { position: static; }
}

@media (max-width: 620px) {
  .page-section .card { padding: 15px; }
  .page-section > .page-heading h1 { font-size: 27px; }
  #section-engagement .engagement-hero,
  #section-reports .rp-hero { min-height: 0; border-radius: 15px; }
  #section-engagement .engagement-drop { min-height: 280px; }
  #section-mentions .filter-bar { display: grid; grid-template-columns: 1fr; }
  #section-mentions .search-box { min-width: 0; }
  #section-electorate .territorial-map-toolbar { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .page-section[data-ui="pulso-v3"]:not(#section-analyst) { animation: none; }
  #section-engagement .engagement-drop,
  #section-reports .rp-level,
  #section-mentions .mention-row { transition: none; }
}
