/* ═══════════════════════════════════════════════════════════
   Toss Invest–style Light Theme
   Clean, spacious, minimal — premium fintech feel
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #F2F4F6;
  --panel: #FFFFFF;
  --panel-2: #FFFFFF;
  --surface: #F2F4F6;
  --surface-2: #E8EBED;
  --line: #E5E8EB;
  --line-light: #F2F4F6;
  --text: #191F28;
  --text-secondary: #4E5968;
  --muted: #8B95A1;
  --accent: #3182F6;
  --accent-hover: #1B6AE5;
  --ok: #00C853;
  --neg-color: #F04452;
  --warn: #FF9F0A;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── App Shell ──────────────────────────────────────────── */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

/* ─── Sidebar ────────────────────────────────────────────── */

.side-nav {
  background: transparent;
  padding: 0 0 12px 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  border-radius: 0;
  margin-bottom: 8px;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.brand {
  margin: 0;
  margin-right: 12px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: none;
  flex-shrink: 0;
  width: 130px;
}

.brand-logo {
  width: 100%;
  display: block;
  border-radius: 6px;
  object-fit: contain;
}

.nav-btn {
  width: auto;
  margin: 0;
  text-align: left;
  border: none;
  color: var(--text-secondary);
  background: transparent;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 160ms ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-icon {
  width: 18px;
  display: inline-block;
  text-align: center;
  opacity: 0.7;
  font-size: 14px;
}

.nav-btn.active {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
}

.nav-btn:not(.active):hover {
  background: var(--surface);
  color: var(--text);
}

.side-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 0;
  border-top: none;
  flex-shrink: 0;
}

.side-actions button:not(.mascot-sidebar-btn) {
  border-radius: 8px;
  height: 30px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid var(--line);
  white-space: nowrap;
  background: var(--panel);
  box-shadow: none;
  transition: all 160ms ease;
  cursor: pointer;
  color: var(--text-secondary);
}

.side-actions button:not(.mascot-sidebar-btn):hover:not(:disabled) {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-secondary);
}

.side-actions button:not(.mascot-sidebar-btn):active:not(:disabled) {
  background: var(--line);
}

/* ─── Main Content ───────────────────────────────────────── */

.main-content {
  padding: 28px 32px;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ─── Market Ticker Strip ────────────────────────────────── */

.market-strip {
  overflow: hidden;
  margin-bottom: 12px;
  padding: 6px 0;
  border-radius: 16px;
  background: var(--panel);
  position: relative;
}

.market-strip::before,
.market-strip::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  z-index: 2;
  pointer-events: none;
}

.market-strip::before {
  left: 0;
  background: linear-gradient(90deg, var(--panel), transparent);
}

.market-strip::after {
  right: 0;
  background: linear-gradient(270deg, var(--panel), transparent);
}

.market-track {
  display: flex;
  width: max-content;
}

.market-track.animate {
  animation: market-ticker-roll 60s linear infinite;
}

.market-track.animate:hover {
  animation-play-state: paused;
}

.market-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 20px;
  min-width: 190px;
  border-right: 1px solid var(--line-light);
  transition: background 160ms ease;
}

.market-card:hover {
  background: var(--surface);
  border-radius: 12px;
}

.market-card:last-child {
  border-right: none;
}

.market-meta {
  min-width: 0;
}

.market-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.market-value {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.market-change {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.market-change.pos {
  color: var(--ok);
}

.market-change.neg {
  color: var(--neg-color);
}

.sparkline {
  display: block;
  width: 56px;
  height: 24px;
  flex-shrink: 0;
}

.sparkline-empty {
  width: 56px;
  height: 24px;
}

@keyframes market-ticker-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─── Header ─────────────────────────────────────────────── */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.badge {
  color: var(--muted);
  font-weight: 500;
  font-style: normal;
  font-size: 13px;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

/* ─── Panel (Card) ───────────────────────────────────────── */

.panel {
  background: var(--panel);
  border: none;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.upload-panel .controls {
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.refresh-btn {
  padding: 8px 14px;
  font-size: 13px;
}

.refresh-btn.side {
  width: 100%;
  color: var(--text-secondary);
}

.tutorial-launch-btn.side {
  width: 100%;
  color: var(--accent);
}

/* ─── Controls / Inputs ──────────────────────────────────── */

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.controls.compact {
  gap: 8px;
}

.topn-slider {
  width: 160px;
  padding: 0;
  border: none;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  background: linear-gradient(to right,
      var(--accent) 0%,
      var(--accent) var(--range-pct, 0%),
      var(--surface-2) var(--range-pct, 0%),
      var(--surface-2) 100%);
  outline: none;
}

.topn-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border-radius: 999px;
}

.topn-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #FFFFFF;
  margin-top: -7px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.topn-slider::-moz-range-track {
  height: 4px;
  background: transparent;
  border-radius: 999px;
}

.topn-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.controls.compact select {
  height: 38px;
  padding: 4px 12px;
  border-radius: 12px;
}

.range-bound {
  font-size: 12px;
  color: var(--muted);
  min-width: 36px;
}

input,
button,
select {
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
}

button {
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Meta / Info Row ────────────────────────────────────── */

.meta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.clear-btn {
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 12px;
}

.clear-btn:hover {
  background: var(--accent-hover);
}

.clear-btn.top {
  font-size: 13px;
  padding: 6px 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.clear-btn.top.show {
  opacity: 1;
  pointer-events: auto;
}

.clear-btn.side {
  width: auto;
  color: var(--text-secondary);
  opacity: 1;
  pointer-events: auto;
}

.clear-btn.side:hover {
  background: linear-gradient(to bottom, #ffffff, #ececec);
}

.side-actions button:not(.mascot-sidebar-btn):disabled {
  opacity: 0.4;
  cursor: default;
}

.unit-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px 2px;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px dashed var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
}

.upload-btn:hover {
  background: var(--surface-2);
}

.upload-name {
  color: var(--muted);
  font-size: 13px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── KPI Cards ──────────────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card .kpi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.kpi-card .kpi-value {
  font-size: 32px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.kpi-card .kpi-value.neg {
  color: var(--neg-color);
}

.kpi-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-card {
  min-height: 100px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.kpi-control {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.kpi-head {
  display: block;
  margin-bottom: 0;
}

.kpi-head select {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 10px;
  font-size: 12px;
  min-width: 88px;
  border-radius: 10px;
}

/* ─── Split Layout ───────────────────────────────────────── */

.split-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.split-2 .panel {
  min-height: 360px;
  min-width: 0;
  overflow: visible;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
}

.panel-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ─── Fund Flow Map ──────────────────────────────────────── */

.flowmap-panel {
  padding-bottom: 12px;
}

.flowmap-head {
  justify-content: space-between;
  align-items: center;
}

.flowmap-note {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.flowmap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.flowmap-toggle input {
  margin: 0;
}

.flowmap-canvas-wrap {
  width: 100%;
  overflow: auto;
  border: none;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1px var(--line);
}

.flowmap-canvas {
  display: block;
  width: 100%;
  min-width: 980px;
  height: auto;
}

.flowmap-tick {
  font-size: 10px;
  fill: var(--muted);
  font-weight: 500;
  font-family: "Pretendard Variable", "Pretendard", -apple-system, sans-serif;
  letter-spacing: -0.01em;
}

.flowmap-tick.neg {
  fill: var(--neg-color);
}

.flowmap-axis-title {
  font-size: 11px;
  fill: var(--text-secondary);
  font-weight: 700;
  font-family: "Pretendard Variable", "Pretendard", -apple-system, sans-serif;
  letter-spacing: -0.01em;
}

.flowmap-tooltip-title {
  font-size: 11px;
  fill: var(--text);
  font-weight: 700;
  font-family: "Pretendard Variable", "Pretendard", -apple-system, sans-serif;
}

.flowmap-tooltip-line {
  font-size: 10px;
  fill: var(--text-secondary);
  font-weight: 500;
  font-family: "Pretendard Variable", "Pretendard", -apple-system, sans-serif;
}

.flowmap-tooltip-bullet {
  fill: var(--muted);
  font-weight: 700;
}

.flowmap-tooltip-key {
  fill: var(--text-secondary);
  font-weight: 700;
}

.flowmap-tooltip-value {
  fill: var(--text);
  font-weight: 600;
}

.flowmap-empty {
  border: none;
  border-radius: 16px;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface);
}

/* ─── Pie Chart ──────────────────────────────────────────── */

.pie-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  overflow: visible;
  flex: 1;
  padding: 8px 0;
}

.pie-svg-container {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  justify-self: center;
}

.pie-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  padding-right: 16px;
}

@container (max-width: 420px) {
  .pie-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .pie-svg-container {
    max-width: 200px;
  }

  .legend {
    width: 220px;
  }
}

.legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.legend-item:hover,
.legend-item.hovered {
  background: var(--surface);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  transition: transform 160ms ease, border-radius 160ms ease;
}

.legend-item:hover .legend-dot,
.legend-item.hovered .legend-dot {
  border-radius: 50%;
  transform: scale(1.2);
}

.legend-item label,
.legend-item em {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: normal;
  cursor: pointer;
}

.legend-item label {
  font-weight: 600;
  color: var(--text);
}

.legend-item em {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.legend-item.selected {
  background: #EBF3FE;
}

.legend-item.selected .legend-dot {
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px currentColor;
}

/* ─── Section Head ───────────────────────────────────────── */

.section-head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}

.section-head > .panel-title {
  margin-right: 6px;
}

/* ─── Database ───────────────────────────────────────────── */

.db-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
  flex-wrap: wrap;
}

.db-search {
  min-width: 280px;
  padding-left: 36px;
  background: var(--surface);
  border: none;
  border-radius: 12px;
}

.db-search:focus {
  background: #FFFFFF;
  border: 1px solid var(--accent);
}

.search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  opacity: 0.45;
  pointer-events: none;
}

.segmented-toggle {
  display: inline-flex;
  padding: 3px;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  gap: 2px;
}

.segment-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.segment-btn.active {
  background: #FFFFFF;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.choose-columns-btn {
  padding: 8px 14px;
  font-size: 13px;
  background: var(--surface);
  border: none;
}

.choose-columns-btn:hover {
  background: var(--surface-2);
}

.db-inline-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.db-inline-filters select {
  height: 38px;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 13px;
  min-width: 145px;
  border: 1px solid var(--line);
}

/* ─── Column Picker ──────────────────────────────────────── */

.column-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  padding-top: 0;
}

.picker-group-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.picker-group-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  min-height: 32px;
}

.picker-group {
  border: none;
  border-radius: 16px;
  background: var(--surface);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100%;
}

.column-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.column-picker-popup {
  width: min(980px, 96vw);
  max-height: 86vh;
  background: #FFFFFF;
  border: none;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: auto;
}

.column-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex: 0 0 auto;
}

/* ─── Toggle Switch ──────────────────────────────────────── */

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
  font-size: 14px;
}

.switch-row > span:first-child {
  padding-left: 2px;
  color: var(--text-secondary);
  font-weight: 500;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch input:disabled + .slider {
  opacity: 0.35;
  cursor: not-allowed;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--surface-2);
  border-radius: 999px;
  transition: 0.2s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.switch input:checked + .slider {
  background-color: var(--accent);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* ─── Tables ─────────────────────────────────────────────── */

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: none;
  background: #FFFFFF;
  max-height: 420px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.summary-table-wrap {
  max-height: none;
  overflow: hidden;
}

.table-wrap.db {
  width: 100%;
  height: calc(100vh - 250px);
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.db-table {
  width: max-content;
  min-width: 100%;
}

.db-table th,
.db-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-table .sticky-col {
  position: sticky;
  z-index: 3;
}

.db-table td.sticky-col {
  background: #FFFFFF;
}

.db-table th.sticky-col {
  z-index: 5;
  background: #E8EBED;
}

.sticky-office {
  left: 0;
  min-width: 140px;
  max-width: 140px;
}

.sticky-ticker {
  left: 140px;
  min-width: 170px;
  max-width: 170px;
}

.sticky-name {
  left: 310px;
  min-width: 420px;
  max-width: 420px;
}

.db-table .col-keywords {
  min-width: 220px;
  max-width: 220px;
}

.db-panel {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line-light);
  padding: 10px 10px;
  text-align: center;
  white-space: nowrap;
}

.table th {
  position: sticky;
  top: 0;
  background: #E8EBED;
  cursor: pointer;
  z-index: 1;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.summary-table th,
.summary-table td {
  padding: 7px 10px;
}

.summary-table td {
  font-size: 12.5px;
  line-height: 1.25;
}

.clickable {
  cursor: pointer;
}

.clickable:hover {
  background: #F8FAFB;
}

.table .txt {
  text-align: center;
}

.summary-dimension-filter {
  cursor: pointer;
  transition: color 120ms ease;
}

.summary-dimension-filter:hover,
.summary-dimension-filter:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(49, 130, 246, 0.3);
  outline: none;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.neg {
  color: var(--neg-color);
  font-weight: 600;
}

.total-row td {
  font-weight: 700;
  background: var(--surface);
}

.summary-highlight td {
  background: #EBF3FE;
  border-top: 1px solid #C4DAFB;
  border-bottom: 1px solid #C4DAFB;
}

.summary-highlight td:first-child {
  border-left: 1px solid #C4DAFB;
}

.summary-highlight td:last-child {
  border-right: 1px solid #C4DAFB;
}

.error {
  color: var(--neg-color);
  margin-top: 8px;
}

/* ─── News Section ───────────────────────────────────────── */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.news-section {
  margin-bottom: 14px;
}

/* --- News Tabs --- */
.news-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: 14px;
  padding: 3px;
  border: none;
  box-shadow: none;
}

.news-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  font-family: inherit;
  border-radius: 12px;
}

.news-tab-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
}

.news-tab-btn.active {
  color: #FFFFFF;
  background: var(--accent);
  box-shadow: none;
  transform: none;
  text-shadow: none;
  border: none;
  font-weight: 700;
}

.news-tab-icon {
  font-size: 17px;
}

.news-tab-panel {
  border-radius: 20px;
  margin-bottom: 0;
  height: calc(100vh - 290px);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
  background: #FFFFFF;
  border: none;
}

@keyframes newsTabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.news-tab-content {
  animation: newsTabFadeIn 0.2s ease-out;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- FT News Cards --- */
.ft-news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 4px 4px 4px 0;
  flex: 1 1 auto;
}

.ft-news-card {
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--surface);
  border: none;
  transition: background 0.15s;
}

.ft-news-card:hover {
  background: var(--surface-2);
}

.econ-news-card {
  border-left: none;
}

.econ-news-card:hover {
  background: var(--surface-2);
}

.ft-card-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.ft-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.ft-card-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
}

.ft-card-bullets li {
  position: relative;
  padding-left: 14px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}

.ft-card-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.ft-card-actions {
  display: flex;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ft-pdf-link,
.ft-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 10px;
  background: #EBF3FE;
  transition: background 0.15s;
}

.ft-pdf-link:hover,
.ft-source-link:hover {
  background: #D6E7FD;
}

/* --- Tiger News --- */
.tiger-news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
  flex: 1 1 auto;
  align-content: start;
}

.tiger-news-list.fill-height {
  grid-auto-rows: 1fr;
}

.tiger-news-list.fill-height .tiger-news-card {
  height: 100%;
}

.news-card.tiger-news-card {
  min-height: auto;
  padding: 14px 18px;
  border-radius: 16px;
  border: none;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  box-shadow: none;
}

.news-card.tiger-news-card:hover {
  background: var(--surface-2);
}

.tiger-news-trigger {
  width: 100%;
  text-align: left;
}

.tiger-news-tags {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.tiger-news-source {
  border: none;
  background: #EBF3FE;
  color: var(--accent);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}

.tiger-news-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tiger-news-summary {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card {
  display: block;
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  min-height: 170px;
  box-shadow: none;
  transition: background 160ms ease, transform 160ms ease;
}

.news-card:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: none;
  border-color: transparent;
}

.news-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.news-title::before {
  content: "🗞️";
  font-size: 15px;
  line-height: 1;
}

.news-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
  white-space: normal;
  overflow: visible;
}

.news-url {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

/* --- Google News --- */
.google-news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  flex: 1 1 auto;
  align-content: start;
}

.google-news-card {
  min-height: auto;
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  border-left: none;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.google-news-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.google-news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
  max-width: 100%;
}

.google-news-time {
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.google-news-time::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4285F4;
  flex-shrink: 0;
}

.google-news-source {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  max-width: 65%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.google-news-card .news-title {
  display: block;
  position: relative;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.45;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  padding-left: 0;
  max-width: 100%;
}

.google-news-card .news-title::before {
  display: none;
}

/* --- Naver Finance News --- */
.naver-news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  flex: 1 1 auto;
  align-content: start;
}

.naver-news-card {
  min-height: auto;
  width: 100%;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--line-light);
  background: transparent;
  box-shadow: none;
  transition: background 160ms ease;
}

.naver-news-card:last-child {
  border-bottom: none;
}

.naver-news-card:hover {
  background: var(--surface);
}

.naver-news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
  max-width: 100%;
}

.naver-news-time {
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.naver-news-time::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #03C75A;
  flex-shrink: 0;
}

.naver-news-source {
  border: none;
  background: #E8F5E9;
  color: #2E7D32;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.naver-news-card .news-title {
  display: block;
  position: relative;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  min-width: 0;
  padding-left: 0;
  max-width: 100%;
}

.naver-news-card .news-title::before {
  display: none;
}

/* --- Other News Split Layout --- */
.other-news-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.other-news-column {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.other-news-column:first-child {
  padding-right: 16px;
  border-right: 1px solid var(--line-light);
}

.other-news-column:last-child {
  padding-left: 16px;
}

.other-news-column-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 4px 10px;
  margin-bottom: 10px;
  border-bottom: none;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.other-news-column .google-news-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  gap: 10px;
  padding: 2px;
}

.other-news-column .naver-news-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  gap: 0;
}

@media (max-width: 900px) {
  .other-news-split {
    grid-template-columns: 1fr;
  }
  .other-news-column:first-child {
    padding-right: 0;
    border-right: none;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-light);
    margin-bottom: 16px;
  }
  .other-news-column:last-child {
    padding-left: 0;
  }
}

/* ─── Modals ─────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: flex-end;
  z-index: 9999;
  backdrop-filter: blur(6px);
}

.news-modal-backdrop {
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.tiger-news-modal {
  width: min(920px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: #FFFFFF;
  border: none;
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.tiger-news-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tiger-news-modal-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.tiger-news-modal-meta {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tiger-news-modal-body {
  color: var(--text-secondary);
  background: var(--surface);
  border: none;
  border-radius: 16px;
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: keep-all;
}

.tiger-news-modal-body p {
  margin: 0 0 12px;
}

.tiger-news-modal-body p:last-child {
  margin-bottom: 0;
}

.tiger-news-modal-link {
  display: block;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.detail-modal {
  width: min(480px, 92vw);
  background: #FFFFFF;
  border-left: none;
  padding: 0;
  overflow: auto;
  font-size: 14px;
  font-family: inherit;
  box-shadow: -8px 0 48px rgba(0, 0, 0, 0.14);
  position: relative;
}

/* ── Close button (floating) ── */
.dm-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s, color 0.15s;
}

.dm-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ── Hero header area ── */
.dm-hero {
  padding: 32px 28px 24px;
  background: linear-gradient(180deg, #F6F8FA 0%, #FFFFFF 100%);
}

.dm-ticker-badge {
  display: inline-block;
  background: var(--text);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.dm-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.3;
}

.dm-subtitle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.dm-subtitle-chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  padding: 4px 12px;
  border-radius: 8px;
}

/* ── Sections ── */
.dm-section {
  padding: 20px 28px;
  border-top: 1px solid var(--line);
}

.dm-section-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Info rows (key-value list) ── */
.dm-info-list {
  display: flex;
  flex-direction: column;
}

.dm-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
  gap: 16px;
}

.dm-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dm-info-row:first-child {
  padding-top: 0;
}

.dm-info-key {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.dm-info-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ── Tags ── */
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-tag-chip {
  border: none;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.12s;
}

.product-tag-chip:hover {
  background: var(--surface-2);
}

/* ── Description ── */
.dm-description {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ── Legacy (column picker still uses these) ── */
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.icon-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.icon-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.detail-grid .full {
  grid-column: 1 / -1;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ─── AI Report ──────────────────────────────────────────── */

.report-section {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 200px);
}

.report-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
  padding: 80px 24px;
  text-align: center;
}

.report-empty-icon {
  font-size: 56px;
  line-height: 1;
}

.report-empty-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 400px;
  line-height: 1.6;
}

.report-generate-btn {
  margin-top: 8px;
  padding: 14px 40px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.report-generate-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.report-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 24px;
  color: var(--text-secondary);
}

.report-loading p {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.report-loading-sub {
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--muted) !important;
}

.report-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--surface);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: reportSpin 0.9s linear infinite;
}

@keyframes reportSpin {
  to { transform: rotate(360deg); }
}

.report-content-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.report-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.report-modal-date {
  font-size: 13px;
  color: var(--muted);
  font-style: normal;
}

.report-regenerate-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.report-regenerate-btn:hover:not(:disabled) {
  background: var(--surface-2);
}

.report-content {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ===== Structured Report Styles ===== */

.rpt-section {
  margin-bottom: 32px;
}

.rpt-section-hdr {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 12px 16px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  margin-bottom: 14px;
}

.rpt-table-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
}

.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}

.rpt-table thead th {
  background: #E8EBED;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.rpt-table thead th:first-child { border-radius: 8px 0 0 0; }
.rpt-table thead th:last-child { border-radius: 0 8px 0 0; }

.rpt-th-text { text-align: left; }
.rpt-th-num { text-align: right; }
.rpt-th-center { text-align: center; }

.rpt-table tbody tr {
  border-bottom: 1px solid var(--line-light);
  transition: background 0.12s;
}
.rpt-table tbody tr:hover { background: #F8FAFB; }
.rpt-table tbody tr:nth-child(even) { background: #FAFBFC; }
.rpt-table tbody tr:nth-child(even):hover { background: #F5F6F8; }

.rpt-table td {
  padding: 8px 12px;
  white-space: nowrap;
  color: var(--text-secondary);
}

.rpt-text {
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

.rpt-num { text-align: right; }
.rpt-center { text-align: center; }

.rpt-mono {
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
}

.rpt-bold { font-weight: 600; }

.rpt-pos,
.rpt-table td.rpt-pos {
  color: var(--ok);
  font-weight: 600;
}

.rpt-neg,
.rpt-table td.rpt-neg {
  color: var(--neg-color);
  font-weight: 600;
}

.rpt-direction {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.rpt-dir-in {
  color: var(--ok);
  background: #E8FAF0;
}

.rpt-dir-out {
  color: var(--neg-color);
  background: #FEE8EA;
}

.rpt-table-narrow { table-layout: auto; width: auto; }
.rpt-table-narrow td, .rpt-table-narrow th { padding: 8px 10px; }
.rpt-sparkline { display: block; }

/* Section 6 fixed column widths */
.rpt-table-s6 { table-layout: fixed; width: 100%; }
.rpt-col-rank { width: 40px; }
.rpt-col-ticker { width: 140px; }
.rpt-col-fname { width: auto; }
.rpt-col-cat { width: 130px; }
.rpt-col-fee { width: 90px; }
.rpt-col-aum { width: 130px; }
.rpt-col-flow { width: 130px; }

.rpt-commentary {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 12px 0 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  border-radius: 0 12px 12px 0;
}

.rpt-comment-para { margin: 0 0 8px 0; }
.rpt-comment-para:last-child { margin-bottom: 0; }

.rpt-comment-bullets {
  margin: 6px 0 10px 0;
  padding-left: 18px;
  list-style: none;
}

.rpt-comment-bullets li {
  position: relative;
  padding-left: 12px;
  margin-bottom: 6px;
  line-height: 1.65;
}

.rpt-comment-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.rpt-comment-bullets li:last-child { margin-bottom: 0; }

.rpt-empty-note {
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
  padding: 8px 0;
}

.rpt-office-group { margin-bottom: 20px; }

.rpt-office-subhdr {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  padding-left: 2px;
}

.rpt-news-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.rpt-news-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rpt-news-tab:hover {
  background: var(--surface-2);
}

.rpt-news-tab-active {
  background: var(--accent);
  color: #fff;
}

.rpt-news-tab-active:hover {
  background: var(--accent-hover);
}

.rpt-news-tab-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 6px;
  border-radius: 10px;
}

.rpt-news-tab-active .rpt-news-tab-count {
  background: rgba(255, 255, 255, 0.25);
}

.rpt-news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rpt-news-item {
  background: var(--surface);
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.rpt-news-link {
  display: block;
  cursor: pointer;
}

.rpt-news-link:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.rpt-news-link:hover .rpt-news-arrow {
  opacity: 1;
  color: var(--accent);
}

.rpt-news-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.rpt-news-arrow {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.4;
  transition: all 0.15s ease;
}

.rpt-news-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #FFF3E0;
  color: #E65100;
  padding: 2px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.rpt-news-tag-econ { background: #FEE8EA; color: var(--neg-color); }
.rpt-news-tag-google { background: #EBF3FE; color: var(--accent); }
.rpt-news-tag-tiger { background: #FFF3E0; color: #E65100; }
.rpt-news-tag-naver { background: #E8FAF0; color: #00873D; }

.rpt-news-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.rpt-news-bullets {
  margin: 6px 0 0 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.rpt-news-bullets li { margin-bottom: 3px; }

.rpt-footer {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ===== Chat Input Bar ===== */

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.chat-input-field {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  background: #FFFFFF;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.chat-input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.1);
}

.chat-input-field:disabled { opacity: 0.4; }

.chat-input-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.chat-input-send:hover:not(:disabled) { background: var(--accent-hover); }
.chat-input-send:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* ===== Chat Report Interface ===== */

.chat-report-section {
  min-height: calc(100vh - 200px);
  background: #FFFFFF;
  border: none;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: var(--accent);
  color: #fff;
  border-bottom: none;
}

.chat-header-avatar {
  font-size: 22px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-header-name {
  font-size: 15px;
  font-weight: 700;
}

.chat-header-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 22px;
  flex: 1;
  overflow-y: auto;
  background: var(--surface);
}

.chat-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 85%;
  animation: chatFadeIn 0.3s ease;
}

@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bot { align-self: flex-start; }
.chat-user { align-self: flex-end; flex-direction: row-reverse; }

.chat-avatar {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: 50%;
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-text {
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.chat-bot .chat-text {
  background: #FFFFFF;
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.chat-user .chat-text {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.chat-choices { display: flex; flex-wrap: wrap; gap: 8px; }

.chat-choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

.chat-choice-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.chat-choice-btn:hover {
  background: #EBF3FE;
  transform: translateY(-1px);
}

.chat-back-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.chat-back-btn:hover {
  color: var(--accent);
  background: #EBF3FE;
}

.chat-loading-msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  background: #FFFFFF;
  border-radius: 20px;
  border-bottom-left-radius: 6px;
}

.chat-loading-msg-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  animation: fadeInMsg 0.5s ease-in-out;
}

@keyframes fadeInMsg {
  0% { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.chat-loading-dots { display: flex; gap: 5px; }

.chat-loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: chatDotPulse 1.2s ease-in-out infinite;
}

.chat-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatDotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== AI Mascot Sidebar Assistant ===== */

.mascot-sidebar-btn.mascot-3d {
  position: relative;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), filter 0.25s;
  padding: 0;
  animation: mascotFloat3d 3.5s ease-in-out infinite;
  filter: drop-shadow(0 3px 8px rgba(49, 130, 246, 0.2));
}

.mascot-sidebar-btn.mascot-3d:hover {
  transform: scale(1.12) translateY(-2px);
  filter: drop-shadow(0 6px 16px rgba(49, 130, 246, 0.3));
  animation-play-state: paused;
}

.mascot-sidebar-btn.mascot-3d:active {
  transform: scale(1.04);
}

@keyframes mascotFloat3d {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(0.5deg); }
  50% { transform: translateY(-5px) rotate(0deg); }
  75% { transform: translateY(-3px) rotate(-0.5deg); }
}

.mascot-robot-svg {
  width: 34px;
  height: 34px;
}

.mascot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--neg-color);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  line-height: 1;
}

/* Speech bubble greeting */
.mascot-sidebar-slot {
  display: flex;
  align-items: center;
  margin: 0;
}

.mascot-speech-bubble {
  position: relative;
  background: var(--text);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  text-align: center;
  cursor: pointer;
  margin-bottom: 10px;
  animation: bubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mascot-speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--text);
}

@keyframes bubblePop {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

.mascot-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8999;
}

.mascot-popover {
  position: fixed;
  right: 32px;
  bottom: 16px;
  width: 500px;
  height: 660px;
  max-height: calc(100vh - 32px);
  background: #FFFFFF;
  border: none;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  z-index: 9001;
  animation: mascotPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes mascotPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.mascot-pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #FFFFFF;
  color: var(--text);
  border-bottom: none;
}

.mascot-pop-title {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.mascot-pop-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-pop-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  border-radius: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-pop-close:hover {
  color: var(--text);
  background: var(--surface);
}

.mascot-pop-tabs {
  display: flex;
  padding: 0 16px;
  gap: 2px;
  background: var(--surface);
  margin: 0 16px;
  border-radius: 10px;
  padding: 3px;
}

.mascot-pop-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
}

.mascot-pop-tab:hover { color: var(--text-secondary); }
.mascot-pop-tab.active {
  color: var(--text);
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mascot-tab-badge {
  font-size: 9px;
  font-weight: 800;
  background: var(--neg-color);
  color: #fff;
  padding: 1px 5px;
  border-radius: 8px;
  line-height: 1.2;
}

.mascot-pop-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 8px;
  background: linear-gradient(180deg, #FAFBFF 0%, #F4F6FB 100%);
}

/* Chat tab */
.mascot-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mascot-chat-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 60px 20px;
  letter-spacing: -0.01em;
}

.mascot-chat-msg { display: flex; }
.mascot-chat-user { justify-content: flex-end; }
.mascot-chat-bot { justify-content: flex-start; }

.mascot-chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: break-word;
}

.mascot-chat-user .mascot-chat-bubble {
  background: linear-gradient(135deg, #5B9EF4 0%, #3182F6 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}

.mascot-chat-bot .mascot-chat-bubble {
  background: #FFFFFF;
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid #E8EDF3;
}

.mascot-chat-bot .mascot-chat-bubble p { margin: 0 0 4px 0; line-height: 1.6; }
.mascot-chat-bot .mascot-chat-bubble p:last-child { margin-bottom: 0; }
.mascot-chat-bot .mascot-chat-bubble strong { font-weight: 700; color: var(--text); }
.mascot-chat-bot .mascot-chat-bubble .mc-list { margin: 4px 0 6px 0; padding-left: 18px; }
.mascot-chat-bot .mascot-chat-bubble .mc-list li { margin-bottom: 3px; line-height: 1.55; }
.mascot-chat-bot .mascot-chat-bubble .mc-gap { height: 6px; }

.mascot-chat-bot .mascot-chat-bubble .mc-code {
  background: var(--surface-2);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "Consolas", "Monaco", monospace;
}

.mascot-chat-typing {
  animation: typingPulse 1s ease-in-out infinite;
  font-weight: 700;
  letter-spacing: 2px;
}

@keyframes typingPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.mascot-chat-chips {
  display: flex;
  gap: 6px;
  padding: 8px 16px 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.mascot-chat-chips::-webkit-scrollbar { display: none; }

.mascot-chip {
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #EEF3FF 0%, #E4EDFD 100%);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: #3B6CB5;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.mascot-chip:hover {
  background: linear-gradient(135deg, #D8E4FD 0%, #C8D8F8 100%);
  color: #1B4FA0;
}

.mascot-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: none;
  background: transparent;
}

.mascot-chat-input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid #DCE3EE;
  border-radius: 14px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  background: #FFFFFF;
  color: var(--text);
}

.mascot-chat-input:focus {
  border-color: #7AABF5;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.08);
}

.mascot-chat-send {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #5B9EF4 0%, #3182F6 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(49, 130, 246, 0.25);
}

.mascot-chat-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #4A8DE8 0%, #1B6AE5 100%);
  box-shadow: 0 4px 12px rgba(49, 130, 246, 0.35);
  transform: translateY(-1px);
}
.mascot-chat-send:disabled { opacity: 0.3; cursor: default; box-shadow: none; }

/* Alerts tab */
.mascot-alerts-list {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mascot-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: #FFF8EE;
  border: none;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #6B4000;
}

.mascot-alert-msg { flex: 1; }

.mascot-alert-dismiss {
  background: none;
  border: none;
  color: #C88A00;
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}

.mascot-alert-dismiss:hover { color: #8B5E00; }

.mascot-alerts-legend {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.mascot-alert-criteria {
  font-size: 11px;
  color: #C88A00;
  margin-top: 2px;
}

/* Help/Guide tab */
.mascot-help-list {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mascot-help-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
}

.mascot-help-item:hover { background: var(--surface-2); }

.mascot-help-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.mascot-help-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Header actions row */
.mascot-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tutorial button in header */
.mascot-tutorial-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.mascot-tutorial-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Tutorial overlay */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9500;
}

.side-nav:has(.tutorial-highlight) {
  position: relative;
  z-index: 9600;
}

.nav-btn.tutorial-highlight {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.3);
  animation: tutorialPulse 1.5s ease-in-out infinite;
}

.nav-btn.tutorial-highlight:not(.active) {
  background: #EBF3FE;
  color: var(--accent);
}

@keyframes tutorialPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(49, 130, 246, 0.15); }
}

[data-theme="gx"] .nav-btn.tutorial-highlight:not(.active) {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

[data-theme="gx"] .nav-btn.tutorial-highlight {
  box-shadow: 0 0 0 3px rgba(255, 84, 0, 0.4);
  animation: tutorialPulseGx 1.5s ease-in-out infinite;
}

.tutorial-highlight-target {
  position: relative;
  z-index: 9600;
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.3);
  animation: tutorialPulse 1.5s ease-in-out infinite;
}

[data-theme="gx"] .tutorial-highlight-target {
  box-shadow: 0 0 0 3px rgba(255, 84, 0, 0.4);
  animation: tutorialPulseGx 1.5s ease-in-out infinite;
}

@keyframes tutorialPulseGx {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 84, 0, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255, 84, 0, 0.2); }
}

/* Tutorial tooltip */
.tutorial-tooltip {
  position: fixed;
  transform: translateY(-50%);
  z-index: 9700;
  background: #FFFFFF;
  border: none;
  border-radius: 20px;
  padding: 18px 20px;
  width: 270px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  animation: tooltipSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.tutorial-tooltip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 9px solid #FFFFFF;
  filter: drop-shadow(-2px 0 3px rgba(0, 0, 0, 0.04));
}

.tutorial-tooltip-left::before {
  right: auto;
  left: 100%;
  border-right: none;
  border-left: 9px solid #FFFFFF;
  filter: drop-shadow(2px 0 3px rgba(0, 0, 0, 0.04));
}

.tutorial-tooltip-bottom {
  transform: none;
  animation: tooltipSlideInBottom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.tutorial-tooltip-bottom::before {
  right: auto;
  left: 50%;
  top: auto;
  bottom: 100%;
  transform: translateX(-50%);
  border-top: none;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 9px solid #FFFFFF;
  filter: drop-shadow(0 -2px 3px rgba(0, 0, 0, 0.04));
}

@keyframes tooltipSlideIn {
  0% { opacity: 0; transform: translateY(-50%) translateX(10px); }
  100% { opacity: 1; transform: translateY(-50%) translateX(0); }
}

@keyframes tooltipSlideInBottom {
  0% { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.tutorial-tooltip-icon { font-size: 22px; margin-bottom: 4px; }

.tutorial-tooltip-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.tutorial-tooltip-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tutorial-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tutorial-tooltip-step {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.tutorial-tooltip-actions { display: flex; gap: 8px; }

.tutorial-tooltip-skip {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
}

.tutorial-tooltip-skip:hover { color: var(--text-secondary); }

.tutorial-tooltip-next {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.tutorial-tooltip-next:hover { background: var(--accent-hover); }

/* ─── Theme Switcher ─────────────────────────────────────── */

.theme-switcher {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border-radius: 10px;
  padding: 3px;
}

.theme-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.theme-btn:hover {
  color: var(--text-secondary);
}

.theme-btn.active {
  background: #FFFFFF;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ═══════════════════════════════════════════════════════════
   GX Design Theme — Global X brand colors
   Primary: #FF5400 (orange), Dark: #002F37 (deep teal)
   ═══════════════════════════════════════════════════════════ */

[data-theme="gx"] {
  --bg: #F5F5F0;
  --panel: #FFFFFF;
  --panel-2: #FFFFFF;
  --surface: #EDEDE8;
  --surface-2: #E2E2DC;
  --line: #DDDDD6;
  --line-light: #EDEDE8;
  --text: #002F37;
  --text-secondary: #2A5058;
  --muted: #577880;
  --accent: #FF5400;
  --accent-hover: #E04A00;
  --ok: #00A86B;
  --neg-color: #D63A3A;
  --warn: #E89A00;
}

/* Navigation Bar */
[data-theme="gx"] .side-nav {
  background: #002F37;
  border-bottom: none;
  border-radius: 14px;
  padding: 8px 16px;
  margin-bottom: 16px;
}

[data-theme="gx"] .nav-btn {
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="gx"] .nav-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="gx"] .nav-btn.active {
  background: #FF5400;
  color: #FFFFFF;
}

[data-theme="gx"] .nav-icon {
  opacity: 0.85;
}

[data-theme="gx"] .side-actions button:not(.mascot-sidebar-btn) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="gx"] .side-actions button:not(.mascot-sidebar-btn):hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="gx"] .side-actions button:not(.mascot-sidebar-btn):active:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="gx"] .tutorial-launch-btn.side {
  color: #FF8A50;
}

/* Theme switcher in GX */
[data-theme="gx"] .theme-btn.active {
  background: #FFFFFF;
  color: #002F37;
}

/* Market strip */
[data-theme="gx"] .market-strip {
  box-shadow:
    0 0 12px rgba(255, 84, 0, 0.35),
    0 0 30px rgba(255, 84, 0, 0.20),
    0 0 60px rgba(255, 84, 0, 0.10);
}

/* Panel / Cards */
[data-theme="gx"] .panel {
  box-shadow: 0 1px 3px rgba(0, 47, 55, 0.06);
}

/* KPI */
[data-theme="gx"] .kpi-card .kpi-value.neg {
  color: var(--neg-color);
}

/* Table headers */
[data-theme="gx"] thead th {
  background: #003B45;
  color: #FFFFFF;
  font-weight: 700;
  letter-spacing: 0.02em;
}

[data-theme="gx"] thead th:hover {
  background: #004D5A;
}

/* Table rows */
[data-theme="gx"] tbody tr:hover td {
  background: #F0EFE8;
}

[data-theme="gx"] .total-row td {
  background: #E8E7E0;
}

/* Sticky header in DB */
[data-theme="gx"] .db-table thead th {
  background: #003B45;
  color: #FFFFFF;
}

/* Section head tabs */
[data-theme="gx"] .section-tab.active {
  background: #002F37;
  color: #FFFFFF;
}

/* News tabs */
[data-theme="gx"] .news-tab.active {
  background: #FF5400;
  color: #FFFFFF;
}

/* DB inline filters */
[data-theme="gx"] .db-search {
  border-color: var(--line);
  background: #FFFFFF;
  color: var(--text);
}

[data-theme="gx"] .db-search:focus {
  border-color: #FF5400;
  box-shadow: 0 0 0 3px rgba(255, 84, 0, 0.08);
}

[data-theme="gx"] .db-inline-filters select {
  border-color: var(--line);
  background: #FFFFFF;
  color: var(--text);
}

[data-theme="gx"] .col-picker-btn {
  border-color: var(--line);
  color: var(--text);
}

/* Product detail modal */
[data-theme="gx"] .dm-ticker-badge {
  background: #002F37;
  color: #FFFFFF;
}

[data-theme="gx"] .dm-hero {
  background: linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 100%);
}

[data-theme="gx"] .dm-section-label {
  color: #FF5400;
}

/* AI Assistant */
[data-theme="gx"] .mascot-sidebar-btn.mascot-3d {
  filter: drop-shadow(0 3px 8px rgba(255, 84, 0, 0.2));
}

[data-theme="gx"] .mascot-speech-bubble {
  background: #FFFFFF;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 47, 55, 0.12);
}

[data-theme="gx"] .mascot-speech-bubble::after {
  border-top-color: #FFFFFF;
}

[data-theme="gx"] .mascot-pop-tab.active {
  color: #002F37;
}

[data-theme="gx"] .mascot-chat-user .mascot-chat-bubble {
  background: linear-gradient(135deg, #FF7A33 0%, #FF5400 100%);
}

[data-theme="gx"] .mascot-chat-send {
  background: linear-gradient(135deg, #FF7A33 0%, #FF5400 100%);
  box-shadow: 0 2px 8px rgba(255, 84, 0, 0.25);
}

[data-theme="gx"] .mascot-chat-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #FF6A1A 0%, #E04A00 100%);
  box-shadow: 0 4px 12px rgba(255, 84, 0, 0.35);
}

[data-theme="gx"] .mascot-chip {
  background: linear-gradient(135deg, #FFF0E6 0%, #FFE4D1 100%);
  color: #CC4400;
}

[data-theme="gx"] .mascot-chip:hover {
  background: linear-gradient(135deg, #FFE4D1 0%, #FFD4B8 100%);
  color: #AA3800;
}

[data-theme="gx"] .mascot-chat-input:focus {
  border-color: #FF5400;
  box-shadow: 0 0 0 3px rgba(255, 84, 0, 0.08);
}

/* Legend selected */
[data-theme="gx"] .legend-item.selected {
  background: #FFF0E6;
}

/* Scatter / Flow map */
[data-theme="gx"] .flowmap-toolbar select {
  border-color: var(--line);
}

/* Sparkline colors stay the same — they are inline */

/* Column picker */
[data-theme="gx"] .col-toggle.on {
  background: #002F37;
  border-color: #002F37;
}

/* Links */
[data-theme="gx"] a {
  color: #FF5400;
}

[data-theme="gx"] a:hover {
  color: #E04A00;
}

/* Tutorial */
[data-theme="gx"] .tutorial-tooltip-next {
  background: #FF5400;
}

[data-theme="gx"] .tutorial-tooltip-next:hover {
  background: #E04A00;
}

/* Report Agent Chat — GX */
[data-theme="gx"] .chat-header {
  background: #002F37;
}

[data-theme="gx"] .chat-choice-btn {
  color: #002F37;
  border: 1px solid var(--line);
}

[data-theme="gx"] .chat-choice-btn:hover {
  background: #E8F0EC;
  color: #002F37;
}

/* ─── Responsive ─────────────────────────────────────────── */

/* ─── Tablet (iPad landscape ~1024-1366px) ──────────────── */

@media (max-width: 1366px) {
  .legend-item {
    padding: 3px 6px;
    font-size: 11px;
    gap: 5px;
    grid-template-columns: 8px 1fr auto;
  }

  .legend-item label {
    font-size: 11px;
  }

  .legend-item em {
    font-size: 10px;
  }

  .legend-dot {
    width: 8px;
    height: 8px;
  }

  .split-2 .panel {
    min-height: 280px;
  }
}

/* ─── Tablet (iPad portrait ~768-1100px) + smaller ────── */

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-card .kpi-value {
    font-size: 24px;
  }

  .split-2 {
    grid-template-columns: 1fr;
  }

  .split-2 .panel {
    min-height: auto;
  }

  .market-strip { overflow: auto; }
  .market-track.animate { animation: none; }
  .column-picker { grid-template-columns: 1fr; }

  .legend-item {
    padding: 4px 8px;
    font-size: 11px;
  }

  .db-search { min-width: 220px; }
  .db-head-left { flex-wrap: wrap; }
  .db-inline-filters select { min-width: 180px; }

  .mascot-popover {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: 8px;
    height: 70vh;
  }

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

  .news-tab-panel {
    height: auto;
    min-height: 0;
  }

  .tiger-news-list,
  .google-news-list,
  .ft-news-list,
  .naver-news-list {
    overflow: visible;
    padding-right: 0;
  }

  .table-wrap.db {
    height: calc(100vh - 280px);
    max-height: calc(100vh - 280px);
  }

  .main-content {
    max-width: 100vw;
    padding: 20px 16px;
  }

  .news-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .news-tab-btn {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 13px;
  }

  .title {
    font-size: 22px;
  }

  .header {
    flex-wrap: wrap;
  }
}

/* ─── Small tablet / large phone (portrait iPad mini etc.) */

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


  .rpt-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .chat-bubble {
    max-width: 92%;
  }
}