:root {
  --bg-top: #08131f;
  --bg-bottom: #0d1b2a;
  --panel: rgba(248, 250, 252, 0.05);
  --panel-soft: rgba(255, 255, 255, 0.025);
  --panel-border: rgba(2, 6, 23, 0.12);
  --ring-outer: rgba(2, 6, 23, 0.16);
  --ring-inner: rgba(255, 255, 255, 0.06);
  --shadow-soft: 0 18px 40px rgba(2, 6, 23, 0.22);
  --text-main: #f8fafc;
  --text-sub: #9fb0c2;
  --accent-oil: #ffb703;
  --accent-ship: #34c3ff;
  --accent-price: #ff6b6b;
  --radius-panel: 22px;
  --radius-card: 18px;
  --radius-inner: 14px;
  --font-display: "InterVariable", "Inter var", "Inter", "SF Pro Display", "SF Pro TC",
    "PingFang TC", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "InterVariable", "Inter var", "Inter", "SF Pro Text", "SF Pro TC",
    "PingFang TC", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "SF Mono", "Roboto Mono", ui-monospace, monospace;
  --font-size-body: clamp(16px, 0.95vw, 19px);
  --font-size-caption: clamp(12px, 0.72vw, 14px);
  --font-size-section-title: clamp(20px, 1.45vw, 27px);
  --font-size-hero: clamp(32px, 4.7vw, 58px);
  --font-size-stat: clamp(23px, 2.2vw, 34px);
  --line-height-body: 1.45;
  --line-height-tight: 1.12;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-feature-settings: "ss02" 0, "cv08" 1, "cv11" 1;
  background:
    radial-gradient(circle at 10% 10%, rgba(21, 64, 104, 0.36) 0%, transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(15, 118, 110, 0.14) 0%, transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body.consent-required {
  padding-bottom: 132px;
}

.layout {
  width: min(1360px, calc(100vw - 20px));
  margin: 18px auto 28px;
  display: grid;
  gap: 16px;
  position: relative;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

.layout::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04)) 0 0 / 1px 100% no-repeat,
    linear-gradient(to right, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.035)) 55% 0 / 1px 100% no-repeat,
    linear-gradient(to right, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04)) 100% 0 / 1px 100% no-repeat;
  opacity: 0.65;
}

.layout > * {
  min-width: 0;
  position: relative;
  z-index: 1;
}

#compareStudioPanel { order: 20; }
#marketStressPanel { order: 21; }
#gdeltPanel { order: 22; }
#trumpVixPanel { order: 23; }
#conflictMapPanel { order: 40; }
#passageDestPanel { order: 41; }
#table12hPanel { order: 50; }
#dailyConflictPanel { order: 51; }
#signalDetailPanel { order: 52; }
#pointDetailPanel { order: 53; }
#metaPanel { order: 60; }
#attackEventsPanel { order: 61; }
#newsTransitPanel { order: 62; }
#privacyPanel { order: 70; }

.hero {
  padding: 26px 6px 10px;
  display: grid;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8ea3b8;
  font-size: 12px;
  font-weight: 500;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(280px, 1.6fr);
  gap: 28px;
  align-items: start;
}

.hero-title-block {
  max-width: none;
  min-width: 0;
}

.hero-copy-block {
  max-width: 40ch;
  justify-self: end;
  padding-top: 8px;
}

h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--font-size-hero);
  font-weight: 650;
  letter-spacing: -0.042em;
  line-height: var(--line-height-tight);
  text-wrap: nowrap;
  white-space: nowrap;
}

.subtitle {
  margin: 0;
  color: var(--text-sub);
  font-size: clamp(15px, 0.98vw, 18px);
  letter-spacing: -0.012em;
  line-height: 1.95;
  text-wrap: pretty;
}

.section-inline-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.section-inline-head h2 {
  margin: 0;
  color: var(--text-main);
  font-size: var(--font-size-section-title);
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.028em;
}

.section-inline-head .section-desc {
  margin: 0;
  color: var(--text-sub);
  font-weight: 500;
  font-size: clamp(14px, 0.8vw, 16px);
  text-wrap: balance;
  line-height: 1.6;
}

.fanpage-float {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #1877f2;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  white-space: nowrap;
}

.fanpage-float:hover {
  background: #1366d4;
}

#facebookLeadBtn.fanpage-float {
  position: fixed !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 12px)) !important;
  left: auto !important;
  top: auto !important;
}

body.consent-required .fanpage-float {
  bottom: calc(max(76px, calc(env(safe-area-inset-bottom) + 12px)) + 92px);
}

.panel {
  background: var(--panel, rgba(8, 24, 44, 0.8));
  border: 0;
  border-radius: var(--radius-panel);
  backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 1px var(--ring-outer),
    inset 0 0 0 1px var(--ring-inner),
    var(--shadow-soft);
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
}
.panel:hover {
  box-shadow:
    0 0 0 1px rgba(52, 195, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 22px 48px rgba(2, 6, 23, 0.24);
}

.panel:not(:last-child)::after {
  content: "";
  position: absolute;
  left: -100vw;
  right: -100vw;
  bottom: -9px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.035) 20%, rgba(255, 255, 255, 0.035) 80%, transparent);
  pointer-events: none;
}

.controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto;
  gap: 10px;
  padding: 14px;
  align-items: end;
}

.controls label {
  display: grid;
  gap: 6px;
  font-size: clamp(13px, 0.78vw, 15px);
  color: var(--text-sub);
}

.status-overview {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.status-overview-head {
  display: grid;
  gap: 4px;
}

.status-overview-head h2 {
  margin: 0;
  font-size: clamp(18px, 1.3vw, 24px);
}

.status-overview-head p {
  margin: 0;
  color: var(--text-sub);
  font-size: clamp(12px, 0.76vw, 14px);
}

.status-overview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekly-watch-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.weekly-watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 12px;
}

.weekly-watch-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(2, 6, 23, 0.1);
}

.weekly-watch-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.weekly-watch-block-head h3 {
  margin: 0;
  font-size: clamp(16px, 1vw, 19px);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.weekly-watch-tags,
.weekly-watch-scenario-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekly-watch-headline,
.weekly-watch-summary,
.weekly-watch-bias {
  margin: 0;
}

.weekly-watch-headline {
  font-size: clamp(18px, 1.15vw, 22px);
  font-weight: 620;
  letter-spacing: -0.02em;
}

.weekly-watch-summary,
.weekly-watch-bias {
  color: var(--text-sub);
  font-size: clamp(13px, 0.84vw, 15px);
  line-height: 1.7;
}

.weekly-watch-stats,
.weekly-watch-score-grid {
  display: grid;
  gap: 10px;
}

.weekly-watch-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.weekly-watch-score-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weekly-watch-transit-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.weekly-watch-transit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekly-watch-transit-reality .stat {
  min-height: 88px;
}

.weekly-watch-transit-reality .stat-value {
  font-size: clamp(18px, 1.4vw, 24px);
}

.weekly-watch-panel .stat {
  min-height: 96px;
  padding: 14px;
}

.weekly-watch-panel .stat-label {
  line-height: 1.5;
}

.weekly-watch-panel .stat-value {
  font-size: clamp(20px, 1.6vw, 28px);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: clamp(12px, 0.76vw, 14px);
  line-height: 1.2;
  white-space: nowrap;
}

.status-chip strong {
  font-weight: 700;
}

.status-chip.official {
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.36);
  background: rgba(22, 101, 52, 0.34);
}

.status-chip.estimate {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.42);
  background: rgba(120, 53, 15, 0.34);
}

.status-chip.warning {
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.36);
}

.status-chip.neutral {
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.34);
  background: rgba(30, 64, 175, 0.22);
}

.range-control {
  display: grid;
  gap: 6px;
}

.range-title {
  margin: 0;
  font-size: clamp(13px, 0.78vw, 15px);
  color: var(--text-sub);
}

.range-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.range-btn {
  padding: 8px 10px;
  min-width: 56px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-weight: 700;
  line-height: 1;
}

.range-btn.active {
  background: linear-gradient(145deg, #0d7fbb, #0d5e8d);
  border-color: transparent;
}

.range-tip {
  margin: 0;
  color: var(--text-sub);
  font-size: clamp(12px, 0.74vw, 14px);
}

select,
input,
button {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 9px 14px;
  min-height: 38px;
  font: inherit;
  box-shadow:
    0 0 0 1px rgba(2, 6, 23, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

button {
  cursor: pointer;
  background: linear-gradient(145deg, rgba(13, 127, 187, 0.92), rgba(8, 96, 141, 0.96));
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}

button.ghost {
  background: rgba(255, 255, 255, 0.06);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.stat {
  padding: 18px 16px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.032));
  border-radius: var(--radius-card);
  box-shadow:
    0 0 0 1px rgba(2, 6, 23, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 10px 24px rgba(2, 6, 23, 0.14);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  cursor: default;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(52, 195, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 34px rgba(2, 6, 23, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.064), rgba(255, 255, 255, 0.036));
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  background: var(--accent, var(--accent-ship));
  border-radius: 0 2px 2px 0;
  opacity: 0.8;
}

.stat-label {
  margin: 0;
  color: var(--text-sub);
  font-size: clamp(13px, 0.8vw, 15px);
  line-height: 2.0;
}

.stat-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--font-size-stat);
  font-weight: 620;
  letter-spacing: -0.032em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

#warRiskRateRange,
#warRiskCostPerBarrel,
#warRiskShareOfPrice,
#officialDestinationCoverage {
  font-size: clamp(18px, 1.7vw, 28px);
  line-height: 1.2;
}

.chart-panel {
  padding: 16px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "main signal";
  gap: 10px 12px;
  align-items: stretch;
}

.chart-head {
  grid-area: head;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 2px 4px 10px;
  width: 100%;
  max-width: 100%;
}

.chart-head > * {
  min-width: 0;
}

.chart-tip {
  margin: 0;
  color: var(--text-sub);
  font-size: clamp(13px, 0.8vw, 15px);
  line-height: 2.0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.range-control-chart {
  justify-items: end;
  gap: 4px;
  flex: 0 1 min(58vw, 620px);
  min-width: 0;
  max-width: 100%;
}

.range-control-chart .range-title {
  font-size: 0.78rem;
}

.range-control-chart .range-toolbar {
  justify-content: flex-end;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.range-control-chart .range-btn {
  padding: 7px 9px;
  min-width: 54px;
}

.range-control-signal {
  justify-items: start;
  width: 100%;
}

.range-control-signal .range-toolbar {
  justify-content: flex-start;
}

.chart-frame {
  height: clamp(320px, 50vh, 500px);
  border-radius: calc(var(--radius-panel) - 8px);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 12px 12px 0 12px;
  background: rgba(2, 6, 23, 0.25);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.main-chart-frame {
  grid-area: main;
  min-width: 0;
}

.signal-chart-block {
  grid-area: signal;
  min-width: 0;
  padding-left: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
  position: relative;
}

.signal-chart-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.signal-chart-block h2 {
  margin: 0;
  font-size: var(--font-size-section-title);
  font-family: var(--font-display);
  font-weight: 620;
  letter-spacing: -0.028em;
}

#hormuzChart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100% !important;
}

#signalLayerChart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100% !important;
}

.point-detail {
  padding: 16px;
}

.point-detail h2 {
  margin: 0 0 10px;
  font-size: var(--font-size-section-title);
  font-family: var(--font-display);
  font-weight: 620;
  letter-spacing: -0.028em;
}

.point-detail-content {
  color: var(--text-sub);
  font-size: clamp(14px, 0.92vw, 16px);
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
}

.detail-grid p {
  margin: 0;
  padding: 8px 10px;
  border-radius: calc(var(--radius-card) - 6px);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(2, 6, 23, 0.1);
}

.detail-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-sub);
  font-size: clamp(12px, 0.72vw, 13px);
}

.detail-attacks {
  margin-top: 10px;
}

.detail-attacks p {
  margin: 0 0 6px;
}

.detail-attacks ul {
  margin: 0;
  padding-left: 18px;
}

.detail-attacks li {
  margin: 4px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-note {
  color: var(--text-sub);
}

.meta {
  padding: 14px 16px;
}

.meta p {
  margin: 4px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-small {
  color: var(--text-sub);
  font-size: clamp(12px, 0.76vw, 14px);
  line-height: 2.0;
}

.meta-small a {
  color: #8fd3ff;
}

.privacy-panel {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.privacy-panel h2 {
  margin: 0;
  font-size: var(--font-size-section-title);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.privacy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.privacy-link {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1;
}

.privacy-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.privacy-status {
  color: var(--text-sub);
  font-size: 0.9rem;
}

.consent-banner {
  position: fixed;
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 50;
  background: rgba(8, 24, 44, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.4);
}

.consent-banner[hidden] {
  display: none;
}

.consent-text {
  margin: 0 0 8px;
  color: #d9ebff;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.consent-actions a {
  color: #9fd9ff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.9rem;
}

.attacks {
  padding: 12px;
  max-height: 260px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  overflow: hidden;
}

.attacks h2 {
  margin: 0 0 10px;
  font-size: var(--font-size-section-title);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

#attackEventList {
  margin: 0;
  padding-left: 18px;
  color: var(--text-sub);
  overflow: auto;
}

#newsTransitEventList {
  margin: 0;
  padding-left: 18px;
  color: var(--text-sub);
  overflow: auto;
}

#attackEventList li {
  margin: 6px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#newsTransitEventList li {
  margin: 6px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table-panel {
  padding: 12px;
}

.data-table-panel h2 {
  margin: 0;
  font-size: var(--font-size-section-title);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.table-note {
  margin: 4px 0 10px;
  color: var(--text-sub);
  font-size: clamp(13px, 0.8vw, 15px);
  line-height: 1.4;
}

.table-wrap {
  max-height: 360px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: calc(var(--radius-panel) - 8px);
  background: rgba(255, 255, 255, 0.024);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(2, 6, 23, 0.08);
}

.series-table-wrap {
  max-height: 360px;
}

.data-table {
  width: max-content;
  min-width: 1210px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: clamp(13px, 0.82vw, 15px);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.data-table col.col-time {
  width: 170px;
}

.data-table col.col-count {
  width: 105px;
}

.data-table col.col-volume {
  width: 115px;
}

.data-table col.col-price {
  width: 125px;
}

.data-table col.col-ratio {
  width: 110px;
}

.data-table col.col-fair-price {
  width: 135px;
}

.data-table col.col-attack {
  width: 90px;
}

.data-table col.col-news {
  width: 130px;
}

.data-table col.col-impact {
  width: 130px;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th:nth-child(n + 2),
.data-table td:nth-child(n + 2) {
  text-align: right;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #133556;
  color: #d7ecff;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.data-table th:first-child {
  left: 0;
  z-index: 3;
}

.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(11, 38, 63, 0.96);
}

.data-table tr {
  cursor: pointer;
}

.data-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
  background: rgba(52, 195, 255, 0.12);
}

.data-table tbody tr.active {
  background: rgba(255, 183, 3, 0.2);
}

.signal-layer-panel {
  display: grid;
  gap: 10px;
}

.interactive-wrap {
  display: none;
  gap: 10px;
}

.interactive-wrap.visible {
  display: grid;
}

.signal-chart-frame {
  height: clamp(320px, 48vh, 500px);
}

@media (min-width: 1180px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .chart-panel {
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  }
}

@media (max-width: 1040px) {
  .weekly-watch-grid {
    grid-template-columns: 1fr;
  }

  .weekly-watch-transit-stats {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "main"
      "signal";
    gap: 10px;
  }

  .signal-chart-block {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-left: 0;
    padding-top: 10px;
  }
}

.signal-corr-wrap {
  max-height: 260px;
}

.signal-corr-table {
  min-width: 780px;
}

.signal-daily-wrap {
  max-height: 340px;
}

.signal-daily-table {
  min-width: 1700px;
}

.map-panel {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.map-head h2 {
  margin: 0;
  font-size: var(--font-size-section-title);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#mapDayRange {
  width: min(240px, 35vw);
  min-width: 120px;
}

#mapDayLabel {
  color: var(--text-sub);
  font-size: 0.86rem;
  white-space: nowrap;
}

.conflict-map {
  width: 100%;
  height: clamp(280px, 48vh, 420px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.map-summary {
  margin: 0;
  color: var(--text-sub);
  font-size: clamp(13px, 0.8vw, 15px);
  overflow-wrap: anywhere;
}

.pie-panel {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.pie-panel h2 {
  margin: 0;
  font-size: var(--font-size-section-title);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.pie-frame {
  height: clamp(280px, 44vh, 420px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

#passageDestChart {
  width: 100%;
  height: 100% !important;
}

.pie-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-sub);
}

.pie-list li {
  margin: 6px 0;
  overflow-wrap: anywhere;
}

.daily-table-wrap {
  max-height: 340px;
}

.daily-table {
  width: max-content;
  min-width: 1410px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: clamp(13px, 0.82vw, 15px);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.daily-table th,
.daily-table td {
  padding: 9px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-table th:first-child,
.daily-table td:first-child {
  text-align: left;
}

.daily-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #133556;
  color: #d7ecff;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.daily-table th:first-child {
  left: 0;
  z-index: 3;
}

.daily-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(11, 38, 63, 0.96);
}

.daily-table tr {
  cursor: pointer;
}

.daily-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.daily-table tbody tr:hover {
  background: rgba(52, 195, 255, 0.12);
}

.daily-table tbody tr.active {
  background: rgba(94, 243, 140, 0.16);
}

body.app-mode {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body.app-mode .layout {
  width: 100%;
  max-width: 100%;
  margin: 0;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 14px
    max(8px, env(safe-area-inset-left));
}

body.app-mode .chart-panel {
  grid-template-columns: 1fr;
  grid-template-areas:
    "head"
    "main"
    "signal";
  gap: 10px;
}

body.app-mode .signal-chart-block {
  border-left: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 0;
  padding-top: 10px;
}

body.app-mode .hero {
  padding: 10px 2px 0;
}

body.app-mode .fanpage-float {
  right: max(10px, env(safe-area-inset-right));
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 10px));
  font-size: 0.92rem;
}

body.app-mode #facebookLeadBtn.fanpage-float {
  right: max(10px, env(safe-area-inset-right)) !important;
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 10px)) !important;
}

body.app-mode .stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.app-mode .stat-label {
  font-size: 13px;
}

body.app-mode .stat-value {
  font-size: clamp(22px, 5.2vw, 30px);
}

body.app-mode .chart-head {
  flex-direction: column;
  align-items: stretch;
}

body.app-mode .range-control-chart {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  justify-items: start;
}

body.app-mode .range-toolbar {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

body.app-mode .range-btn {
  min-height: 38px;
  padding: 9px 11px;
}

body.app-mode .chart-frame {
  height: min(50vh, 360px);
}

body.app-mode .table-wrap {
  max-height: none;
  overflow: visible;
  border: none;
  background: transparent;
}

body.app-mode .series-table-wrap {
  max-height: min(56vh, 420px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

body.app-mode .data-table {
  min-width: 0;
  width: 100%;
  display: block;
}

body.app-mode .daily-table-wrap {
  max-height: none;
  overflow: visible;
  border: none;
  background: transparent;
}

body.app-mode .daily-table {
  min-width: 0;
  width: 100%;
  display: block;
}

body.app-mode .daily-table thead {
  display: none;
}

body.app-mode .daily-table tbody {
  display: grid;
  gap: 8px;
}

body.app-mode .daily-table tr {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

body.app-mode .daily-table td {
  border-bottom: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 8px;
  display: block;
  white-space: normal;
  text-align: left !important;
  overflow: visible;
  text-overflow: clip;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.app-mode .daily-table td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 2px;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.2;
}

body.app-mode .daily-table td:first-child {
  position: static;
  left: auto;
  z-index: auto;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

body.app-mode .daily-table tbody tr.active {
  outline: 1px solid rgba(94, 243, 140, 0.65);
  background: rgba(94, 243, 140, 0.14);
}

body.app-mode .data-table colgroup,
body.app-mode .data-table thead {
  display: none;
}

body.app-mode .data-table tbody {
  display: grid;
  gap: 8px;
}

body.app-mode .data-table tr {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

body.app-mode .data-table td {
  border-bottom: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 8px;
  display: block;
  white-space: normal;
  text-align: left !important;
  overflow: visible;
  text-overflow: clip;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.app-mode .data-table td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 2px;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.2;
}

body.app-mode .data-table td:first-child {
  font-weight: 600;
}

body.app-mode .data-table td:first-child::before {
  content: "時間";
}

body.app-mode .data-table td[colspan] {
  justify-content: center;
}

body.app-mode .data-table td[colspan]::before {
  content: "";
}

body.app-mode .data-table th:first-child,
body.app-mode .data-table td:first-child {
  position: static;
  left: auto;
  z-index: auto;
  background: rgba(255, 255, 255, 0.08);
}

body.app-mode .data-table tbody tr.active {
  outline: 1px solid rgba(255, 183, 3, 0.55);
  background: rgba(255, 183, 3, 0.12);
}

body.app-mode .point-detail-content,
body.app-mode .attacks {
  max-height: 240px;
}

@media (max-width: 820px) {
  body:not(.app-mode) .layout {
    width: 100%;
    max-width: 100%;
    margin: 0;
    gap: 10px;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 14px
      max(8px, env(safe-area-inset-left));
  }

  body:not(.app-mode) .hero {
    padding: 10px 2px 0;
  }

  body:not(.app-mode) .fanpage-float {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(72px, calc(env(safe-area-inset-bottom) + 10px));
    font-size: 0.92rem;
  }

  body:not(.app-mode) #facebookLeadBtn.fanpage-float {
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(72px, calc(env(safe-area-inset-bottom) + 10px)) !important;
  }

  body:not(.app-mode) .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.app-mode) .chart-head {
    flex-direction: column;
    align-items: stretch;
  }

  body:not(.app-mode) .range-control-chart {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    justify-items: start;
  }

  body:not(.app-mode) .range-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body:not(.app-mode) .chart-frame {
    height: min(50vh, 360px);
  }

  body:not(.app-mode) .table-wrap {
    max-height: none;
    overflow: visible;
    border: none;
    background: transparent;
  }

  body:not(.app-mode) .series-table-wrap {
    max-height: min(54vh, 380px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
  }

  body:not(.app-mode) .data-table {
    min-width: 0;
    width: 100%;
    display: block;
  }

  body:not(.app-mode) .data-table colgroup,
  body:not(.app-mode) .data-table thead {
    display: none;
  }

  body:not(.app-mode) .data-table tbody {
    display: grid;
    gap: 8px;
  }

  body:not(.app-mode) .data-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
  }

  body:not(.app-mode) .data-table td {
    border-bottom: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 8px;
    display: block;
    white-space: normal;
    text-align: left !important;
    overflow: visible;
    text-overflow: clip;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body:not(.app-mode) .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.2;
  }

  body:not(.app-mode) .data-table td:first-child {
    font-weight: 600;
  }

  body:not(.app-mode) .data-table td:first-child::before {
    content: "時間";
  }

  body:not(.app-mode) .data-table td[colspan] {
    justify-content: center;
  }

  body:not(.app-mode) .data-table td[colspan]::before {
    content: "";
  }

  body:not(.app-mode) .data-table th:first-child,
  body:not(.app-mode) .data-table td:first-child {
    position: static;
    left: auto;
    z-index: auto;
    background: rgba(255, 255, 255, 0.08);
  }

  body:not(.app-mode) .data-table tbody tr.active {
    outline: 1px solid rgba(255, 183, 3, 0.55);
    background: rgba(255, 183, 3, 0.12);
  }

  body:not(.app-mode) .daily-table-wrap {
    max-height: none;
    overflow: visible;
    border: none;
    background: transparent;
  }

  body:not(.app-mode) .daily-table {
    min-width: 0;
    width: 100%;
    display: block;
  }

  body:not(.app-mode) .daily-table thead {
    display: none;
  }

  body:not(.app-mode) .daily-table tbody {
    display: grid;
    gap: 8px;
  }

  body:not(.app-mode) .daily-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
  }

  body:not(.app-mode) .daily-table td {
    border-bottom: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 8px;
    display: block;
    white-space: normal;
    text-align: left !important;
    overflow: visible;
    text-overflow: clip;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body:not(.app-mode) .daily-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.2;
  }

  body:not(.app-mode) .daily-table td:first-child {
    position: static;
    left: auto;
    z-index: auto;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
  }

  body:not(.app-mode) .daily-table tbody tr.active {
    outline: 1px solid rgba(94, 243, 140, 0.65);
    background: rgba(94, 243, 140, 0.14);
  }
}

@media (hover: none) and (pointer: coarse) {
  body:not(.app-mode) .layout {
    width: 100%;
    max-width: 100%;
    margin: 0;
    gap: 10px;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 14px
      max(8px, env(safe-area-inset-left));
  }

  body:not(.app-mode) .hero {
    padding: 10px 2px 0;
  }

  body:not(.app-mode) .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.app-mode) .chart-head {
    flex-direction: column;
    align-items: stretch;
  }

  body:not(.app-mode) .range-control-chart {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    justify-items: start;
  }

  body:not(.app-mode) .range-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body:not(.app-mode) .chart-frame {
    height: min(50vh, 360px);
  }

  body:not(.app-mode) .table-wrap {
    max-height: none;
    overflow: visible;
    border: none;
    background: transparent;
  }

  body:not(.app-mode) .series-table-wrap {
    max-height: min(54vh, 380px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
  }

  body:not(.app-mode) .data-table {
    min-width: 0;
    width: 100%;
    display: block;
  }

  body:not(.app-mode) .data-table colgroup,
  body:not(.app-mode) .data-table thead {
    display: none;
  }

  body:not(.app-mode) .data-table tbody {
    display: grid;
    gap: 8px;
  }

  body:not(.app-mode) .data-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
  }

  body:not(.app-mode) .data-table td {
    border-bottom: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 8px;
    display: block;
    white-space: normal;
    text-align: left !important;
    overflow: visible;
    text-overflow: clip;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body:not(.app-mode) .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.2;
  }

  body:not(.app-mode) .data-table td:first-child {
    font-weight: 600;
  }

  body:not(.app-mode) .data-table td:first-child::before {
    content: "時間";
  }

  body:not(.app-mode) .data-table td[colspan]::before {
    content: "";
  }

  body:not(.app-mode) .data-table th:first-child,
  body:not(.app-mode) .data-table td:first-child {
    position: static;
    left: auto;
    z-index: auto;
    background: rgba(255, 255, 255, 0.08);
  }

  body:not(.app-mode) .daily-table-wrap {
    max-height: none;
    overflow: visible;
    border: none;
    background: transparent;
  }

  body:not(.app-mode) .daily-table {
    min-width: 0;
    width: 100%;
    display: block;
  }

  body:not(.app-mode) .daily-table thead {
    display: none;
  }

  body:not(.app-mode) .daily-table tbody {
    display: grid;
    gap: 8px;
  }

  body:not(.app-mode) .daily-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
  }

  body:not(.app-mode) .daily-table td {
    border-bottom: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 8px;
    display: block;
    white-space: normal;
    text-align: left !important;
    overflow: visible;
    text-overflow: clip;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body:not(.app-mode) .daily-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.2;
  }

  body:not(.app-mode) .daily-table td:first-child {
    position: static;
    left: auto;
    z-index: auto;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
  }
}

@media (max-width: 920px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .weekly-watch-stats,
  .weekly-watch-score-grid {
    grid-template-columns: 1fr;
  }

  .weekly-watch-transit-stats {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .chart-frame {
    height: 340px;
  }

  .data-table {
    font-size: 0.82rem;
  }
}

@media (max-width: 560px) {
  body.consent-required {
    padding-bottom: 176px;
  }

  .layout {
    width: min(1200px, calc(100vw - 8px));
    margin: 10px auto 18px;
    gap: 10px;
  }

  .hero {
    padding: 12px 2px 0;
  }

  .subtitle {
    font-size: 1.02rem;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .chart-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .range-control-chart {
    justify-items: start;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
  }

  .range-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .range-btn {
    flex: 0 0 auto;
    min-width: 58px;
    min-height: 38px;
    padding: 9px 11px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
  }

  .stat {
    padding: 10px;
  }

  .stat-label {
    font-size: 13px;
    line-height: 1.35;
  }

  .stat-value {
    font-size: clamp(21px, 5.2vw, 29px);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .chart-frame {
    height: 300px;
  }

  .chart-tip {
    font-size: 0.94rem;
  }

  .table-note {
    font-size: 0.94rem;
  }

  .map-head {
    flex-direction: column;
    align-items: stretch;
  }

  .map-controls {
    flex-wrap: wrap;
    align-items: center;
  }

  #mapDayRange {
    width: 100%;
    min-width: 0;
  }

  .table-wrap {
    max-height: 300px;
  }

  .data-table th,
  .data-table td {
    padding: 7px 8px;
    font-size: 0.82rem;
  }

  .data-table {
    min-width: 1110px;
  }

  .attacks {
    max-height: 220px;
  }

  .privacy-actions {
    align-items: stretch;
  }

  .privacy-link,
  #privacySettingsBtn {
    width: 100%;
    text-align: center;
  }

  .privacy-status {
    width: 100%;
  }

  .consent-actions button {
    flex: 1 1 130px;
  }
}

@media (display-mode: standalone) {
  :root {
    --font-size-body: 17px;
    --font-size-caption: 13px;
    --font-size-section-title: clamp(22px, 3.4vw, 30px);
    --font-size-hero: clamp(36px, 6.6vw, 62px);
    --font-size-stat: clamp(24px, 4.8vw, 36px);
  }

  .subtitle {
    font-size: clamp(17px, 2.8vw, 22px);
  }

  .chart-tip,
  .table-note {
    font-size: 0.92rem;
  }

  .data-table th,
  .data-table td {
    font-size: 0.86rem;
  }
}

/* ══════════════════════════════════════════════════════════════════
   川普社群 × VIX 恐懼貪婪分析層
   ══════════════════════════════════════════════════════════════════ */

.trump-vix-panel {
  grid-column: 1 / -1;
}

/* 頂部摘要晶片列 */
.trump-vix-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tv-meta-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  color: var(--color-caption, #94a3b8);
  white-space: nowrap;
}
.tv-meta-chip strong {
  color: var(--color-text, #e2e8f0);
  font-weight: 700;
}
.tv-meta-chip em {
  color: #f59e0b;
  font-style: normal;
}

/* 圖表容器 */
.trump-vix-chart-wrap {
  position: relative;
  height: 300px;
  margin-bottom: 1.5rem;
}

/* 近期貼文標題 */
.trump-posts-section h3 {
  font-size: 0.9rem;
  color: var(--color-caption, #94a3b8);
  margin: 0 0 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* 貼文列表 */
.tv-posts-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tv-post-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  transition: background 0.15s;
}
.tv-post-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.tv-post-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.tv-post-date {
  font-size: 0.76rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* 情緒徽章 */
.tv-post-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.tv-badge-fear        { background: rgba(220, 50, 50, 0.25); color: #f87171; border: 1px solid rgba(220,50,50,0.4); }
.tv-badge-fear-mild   { background: rgba(234,100,60,0.2);  color: #fb923c; border: 1px solid rgba(234,100,60,0.35); }
.tv-badge-greed       { background: rgba(34,170,90,0.22);  color: #4ade80; border: 1px solid rgba(34,170,90,0.4); }
.tv-badge-greed-mild  { background: rgba(60,150,80,0.18);  color: #86efac; border: 1px solid rgba(60,150,80,0.35); }
.tv-badge-neutral     { background: rgba(100,120,140,0.18); color: #94a3b8; border: 1px solid rgba(100,120,140,0.3); }

.tv-post-cats {
  font-size: 0.72rem;
  color: #64748b;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-post-link {
  font-size: 0.75rem;
  color: #60a5fa;
}
.tv-post-link a {
  color: inherit;
  text-decoration: none;
}
.tv-post-link a:hover {
  text-decoration: underline;
}

.tv-post-text {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
  word-break: break-word;
}

/* 響應式 */
@media (max-width: 600px) {
  .hero { padding: 12px 4px 10px; }
  .hero-split { grid-template-columns: 1fr; gap: 12px; }
  .hero-title-block,
  .hero-copy-block { max-width: none; justify-self: stretch; padding-top: 0; }
  h1 {
    text-wrap: balance;
    white-space: normal;
  }
  .controls { grid-template-columns: 1fr; }
  .status-overview { padding: 12px; }
  .status-overview-tags { gap: 7px; }
  .status-chip { white-space: normal; }
  .weekly-watch-panel { padding: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px; min-height: 90px; }
  .stat-label { font-size: 13px; }
  .stat-value { font-size: 1.4rem; }
  
  #openCompareModalBtn {
    padding: 16px 12px !important;
    font-size: 1.05rem !important;
    white-space: normal !important;
    text-align: center;
    line-height: 1.3;
  }

  .trump-vix-chart-wrap {
    height: 240px;
  }
  .tv-meta-chip {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }
}


/* Compare Studio */
.compare-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.compare-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.compare-chip.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--chip-color, #fff);
  box-shadow: 0 0 12px var(--chip-color-alpha, rgba(255,255,255,0.2));
}
.compare-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, #fff);
}
.corr-tag {
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.corr-tag b { color: #fff; }

/* Modal Overlay */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
  pointer-events: none;
}
.modal-overlay.active {
  opacity: 1; pointer-events: auto;
}
.modal-content {
  width: 90%; max-width: 520px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  transform: translateY(20px); transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 0;
  background: var(--bg-top, rgba(9, 26, 47, 0.95));
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-body {
  padding: 20px; overflow-y: auto; flex: 1;
}
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.close-btn {
  background: transparent; border: none; color: #a8bfd8; font-size: 1.8rem; line-height: 1; padding: 0 4px; cursor: pointer; transition: color 0.15s;
}
.close-btn:hover { color: #fff; }

@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
  }
  .modal-body .compare-chips {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
    scroll-snap-type: none !important;
  }
  .modal-body .compare-chip {
    padding: 8px 12px;
    font-size: 0.85rem;
    scroll-snap-align: none !important;
  }
  .modal-header h3 {
    font-size: 1.1rem;
  }
  #applyCompareModalBtn {
    padding: 14px;
    font-size: 1rem;
  }
  
  .compare-toolbar-wrap {
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px !important;
    width: 100%;
    overflow: hidden;
    margin-top: 4px;
  }
  #compareRangeToolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 6px;
    min-width: 0 !important;
    width: 100%;
  }
  #compareRangeToolbar::-webkit-scrollbar { display: none; }
  #compareRangeToolbar { -ms-overflow-style: none; scrollbar-width: none; }
  #compareRangeToolbar .range-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: 48px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   GDELT 地緣緊張指數 + AISStream AIS 缺口偵測
   ══════════════════════════════════════════════════════════════════ */

.gdelt-panel {
  grid-column: 1 / -1;
}

.market-stress-panel {
  grid-column: 1 / -1;
}

.market-stress-kpi-row {
  margin-bottom: 0.65rem;
}

.market-stress-meta {
  margin: 0 0 0.85rem;
  color: #a8bfd8;
  font-size: 0.9rem;
  line-height: 1.5;
}

.market-stress-range-toolbar {
  margin-bottom: 0.9rem;
}

.market-stress-chart-wrap {
  position: relative;
  height: 320px;
  margin-bottom: 1rem;
}

.market-stress-sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.market-stress-source-card {
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.market-stress-source-card strong {
  color: #f8fafc;
}

.market-stress-source-card p {
  margin: 0.3rem 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.45;
}

.market-stress-source-card .source-date {
  display: inline-block;
  margin-top: 0.25rem;
  color: #fbbf24;
  font-size: 0.74rem;
}

/* 來源標籤 badge */
.panel-source-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(59,130,246,0.18);
  border: 1px solid rgba(59,130,246,0.35);
  color: #93c5fd;
  vertical-align: middle;
  margin-left: 0.5rem;
}
.panel-source-badge a { color: inherit; text-decoration: underline; }

/* GDELT KPI 行 */
.gdelt-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.gdelt-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  min-width: 130px;
  border-left: 3px solid var(--kpi-color, #64748b);
}

.gdelt-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--kpi-color, #e2e8f0);
  line-height: 1;
}

.gdelt-kpi-label {
  font-size: 0.78rem;
  color: #e2e8f0;
  font-weight: 600;
}

.gdelt-kpi-sub {
  font-size: 0.7rem;
  color: #64748b;
}

/* GDELT 圖表容器 */
.gdelt-chart-wrap {
  position: relative;
  height: 280px;
  margin-bottom: 1rem;
}

/* AIS 缺口偵測區塊 */
.ais-gap-section {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.ais-gap-section h3 {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.ais-gap-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ais-kpi {
  font-size: 0.8rem;
  color: #94a3b8;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
}
.ais-kpi strong { color: #e2e8f0; }

.ais-gap-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ais-vessel-section {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1rem;
  margin-top: 1rem;
}

.ais-vessel-section h3 {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.ais-vessel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.ais-vessel-card {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
}

.ais-vessel-card.is-core {
  border-color: rgba(52,195,255,0.45);
  box-shadow: inset 0 0 0 1px rgba(52,195,255,0.1);
}

.ais-vessel-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.ais-vessel-card-head h4 {
  margin: 0;
  font-size: 1rem;
  color: #f8fafc;
  line-height: 1.25;
}

.ais-vessel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(52,195,255,0.16);
  border: 1px solid rgba(52,195,255,0.3);
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.ais-vessel-id {
  margin: 0 0 0.6rem;
  color: #a8bfd8;
  font-size: 0.78rem;
}

.ais-vessel-meta-list {
  display: grid;
  gap: 0.42rem;
}

.ais-vessel-meta-list span {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  color: #d9e6f2;
  font-size: 0.82rem;
}

.ais-vessel-meta-list strong {
  color: #8fb5d7;
  font-weight: 600;
}

.ais-gap-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #94a3b8;
}
.ais-gap-row.gap-critical {
  background: rgba(220,38,38,0.12);
  border-left: 3px solid #ef4444;
}
.ais-gap-row.gap-warning {
  background: rgba(234,88,12,0.10);
  border-left: 3px solid #f97316;
}
.gap-name { color: #e2e8f0; font-weight: 600; min-width: 120px; }
.gap-minutes { color: #f97316; font-weight: 600; }

@media (max-width: 600px) {
  .market-stress-chart-wrap { height: 240px; }
  .market-stress-sources { grid-template-columns: 1fr; }
  .ais-vessel-grid { grid-template-columns: 1fr; }
  .gdelt-chart-wrap { height: 220px; }
  .gdelt-kpi { min-width: 100px; }
  .gdelt-kpi-value { font-size: 1.3rem; }
}
