:root {
  --bg: #090f18;
  --surface: #101a29;
  --surface-soft: #0f1827;
  --line: #22334c;
  --line-soft: #1a273c;
  --text: #eef3ff;
  --muted: #96a6c1;
  --primary: #3f86f7;
  --good: #0ed596;
  --bad: #ff607d;
  --neutral: #8797b1;
  --shadow: 0 24px 48px rgba(3, 8, 20, 0.52);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
}

body {
  font-family: "Inter", "Noto Sans KR", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(
      860px 420px at 6% -8%,
      rgba(55, 100, 176, 0.44),
      transparent 72%
    ),
    radial-gradient(
      900px 480px at 95% -4%,
      rgba(25, 172, 161, 0.31),
      transparent 74%
    ),
    var(--bg);
}

.ambient {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(72px);
}

.ambient-a {
  width: 360px;
  height: 360px;
  left: -120px;
  top: 18%;
  background: rgba(42, 96, 198, 0.58);
}

.ambient-b {
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -70px;
  background: rgba(37, 185, 153, 0.38);
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1220px;
  margin: 24px auto 40px;
  padding: 0 16px;
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(20, 30, 46, 0.96),
    rgba(14, 23, 37, 0.96)
  );
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(130deg, #3667de, #18b3ba);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 20px rgba(56, 127, 250, 0.35);
}

.brand-icon .material-symbols-outlined {
  font-size: 24px;
}

.brand h1 {
  margin: 0;
  font-size: 26px;
}

.brand p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* 관리자 설정 아이콘 — 눈에 띄지 않게 */
.admin-gear {
  position: absolute;
  top: 12px;
  right: 14px;
  color: #2a3650;
  text-decoration: none;
  line-height: 1;
  transition: color 0.3s;
  z-index: 2;
}

.admin-gear:hover {
  color: #4a5e7a;
}

.admin-gear .material-symbols-outlined {
  font-size: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.3fr)
    minmax(160px, 0.95fr)
    100px
    minmax(170px, 1fr)
    136px
    44px;
  gap: 10px;
  width: 100%;
  flex: 1 1 780px;
  min-width: 0;
  align-items: stretch;
}

.field {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #0c1522;
  padding: 8px 10px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field select,
.field input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.8;
}

.preset-field {
  padding: 8px;
}

.preset-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.preset-btn {
  border: 1px solid #2a3d5a;
  background: #121d2f;
  color: #9eb1cf;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  border-color: #4e78b5;
  color: #dbe9ff;
}

.preset-btn.active {
  background: linear-gradient(130deg, #2d67be, #2e8dbc);
  border-color: #4fa2ff;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(63, 133, 247, 0.28);
}

.date-inner {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  gap: 6px;
  align-items: center;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #2f415d;
  background: #162439;
  color: #deebff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn .material-symbols-outlined {
  font-size: 18px;
}

.run-btn {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(130deg, #3f85f7, #3ab6c5);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.run-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.refresh-scan-btn {
  border: 1px solid #2f7f56;
  border-radius: 10px;
  background: linear-gradient(130deg, #1f8d5d, #34b676);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.refresh-scan-btn .material-symbols-outlined {
  font-size: 18px;
}

.refresh-scan-btn:hover {
  filter: brightness(1.04);
}

.refresh-scan-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.help-btn {
  border: 1px solid #2f7f56;
  border-radius: 10px;
  background: linear-gradient(130deg, #1f8d5d, #34b676);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color 0.18s ease,
    filter 0.18s ease;
}

.help-btn:hover {
  border-color: #62d79a;
  filter: brightness(1.04);
}

.help-btn .material-symbols-outlined {
  font-size: 16px;
}

.mode-field {
  min-width: 0;
}

.topn-field {
  min-width: 0;
}

.status-panel {
  padding: 14px 16px;
}

.status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-left p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.status-icon {
  color: var(--primary);
}

.status-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge.idle {
  background: #22324a;
  color: #a6b9d9;
}

.badge.queued,
.badge.running {
  background: #204c84;
  color: #aed3ff;
}

.badge.done {
  background: #12483d;
  color: #90f4d4;
}

.badge.error {
  background: #4f2632;
  color: #ff9eb0;
}

/* ───── 개별 종목 검색 바 ───── */
.quick-search-bar {
  padding: 14px 20px 10px;
}

.qs-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  background: #0b1422;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 6px 12px;
  transition: border-color 0.2s;
}

.qs-inner:focus-within {
  border-color: var(--accent);
}

.qs-icon {
  color: #6a7f9c;
  font-size: 22px;
  flex-shrink: 0;
}

.qs-inner input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #e4ecfa;
  font-size: 14px;
  font-family: inherit;
  padding: 8px 0;
}

.qs-inner input::placeholder {
  color: #4a5e7a;
}

.qs-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #e95420, #d94010);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition:
    opacity 0.2s,
    transform 0.15s;
  flex-shrink: 0;
}

.qs-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.qs-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.qs-btn .material-symbols-outlined {
  font-size: 18px;
}

.qs-hint {
  margin: 6px 0 0 34px;
  font-size: 11px;
  color: #4a5e7a;
}

.favorite-panel {
  padding: 14px 16px;
}

.favorite-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.favorite-head h2 {
  margin: 0;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.favorite-head h2 .material-symbols-outlined {
  color: #ffd15f;
}

.favorite-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.favorite-actions > span {
  color: var(--muted);
  font-size: 13px;
}

.favorite-analyze-btn {
  border: 1px solid #6a4f1d;
  border-radius: 8px;
  background: linear-gradient(130deg, #9a6e16, #cf9220);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.favorite-analyze-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.favorite-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.favorite-search-row input {
  border: 1px solid #2f415d;
  border-radius: 8px;
  background: #0c1522;
  color: var(--text);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.favorite-search-row input:focus {
  border-color: #5a82be;
}

.favorite-search-row button {
  border: 1px solid #315c93;
  border-radius: 8px;
  background: #17335a;
  color: #d9e8ff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.favorite-search-row button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.favorite-search-result {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.favorite-search-item {
  border: 1px solid #2f4668;
  border-radius: 8px;
  background: #0f1b2d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
}

.favorite-search-item small {
  color: #8ea6c8;
}

.favorite-search-add {
  border: 1px solid #4d7a2b;
  border-radius: 8px;
  background: #1b3b1a;
  color: #cbeec6;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.favorite-search-add:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.favorite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.favorite-chip {
  border: 1px solid #3a4f72;
  border-radius: 999px;
  background: #111e32;
  color: #dce9ff;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.favorite-chip-code {
  color: #8ea6c8;
}

.favorite-chip .chip-btn {
  border: 0;
  background: transparent;
  color: #aecdff;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.favorite-chip .chip-btn.remove {
  color: #ff9aad;
}

.favorite-analysis {
  margin-top: 12px;
  border-top: 1px solid #20324a;
  padding-top: 10px;
}

.favorite-analysis-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.favorite-analysis-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.favorite-analysis-head strong {
  font-size: 13px;
}

.favorite-analysis-head span {
  color: var(--muted);
  font-size: 12px;
}

.favorite-analysis-toggle-btn {
  border: 1px solid #345173;
  border-radius: 8px;
  background: #162742;
  color: #cfe2ff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
}

.favorite-analysis-body.collapsed {
  display: none;
}

.favorite-analysis-list {
  display: grid;
  gap: 6px;
}

.favorite-analysis-item {
  border: 1px solid #2a3f5d;
  border-radius: 8px;
  background: #0f1a2c;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.favorite-analysis-meta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: #aac1e2;
  font-size: 12px;
}

.favorite-analysis-open {
  border: 1px solid #355a8e;
  border-radius: 8px;
  background: #183154;
  color: #d9e8ff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  cursor: pointer;
}

@keyframes spin-icon {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin-icon 1s linear infinite;
}

.progress-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: #0d1624;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #3175ef, #2ad1be);
  box-shadow: 0 0 14px rgba(66, 144, 255, 0.72);
  transition: width 0.25s ease;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 14px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 28px;
}

.table-panel {
  padding: 14px;
}

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.table-head h2 {
  margin: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-head .material-symbols-outlined {
  color: var(--primary);
}

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

.table-controls > span {
  color: var(--muted);
  font-size: 14px;
}

.grade-filters {
  display: flex;
  gap: 4px;
}

.formula-help-btn {
  border: 1px solid #2f7f56;
  border-radius: 8px;
  background: linear-gradient(130deg, #1f8d5d, #34b676);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  min-width: 54px;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.formula-help-btn:hover {
  filter: brightness(1.04);
}

.grade-filter-btn {
  border: 1px solid #2f415d;
  border-radius: 8px;
  background: #162439;
  color: #a6b9d9;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.grade-filter-btn:hover {
  border-color: #4a6da0;
}

.grade-filter-btn.active {
  background: linear-gradient(130deg, #3f85f7, #3ab6c5);
  border-color: transparent;
  color: #fff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #2f415d;
  border-radius: 8px;
  background: #0c1522;
  padding: 4px 10px;
}

.search-box .material-symbols-outlined {
  font-size: 18px;
  color: #8ea1c1;
}

.search-box input {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  width: 140px;
}

.search-box input::placeholder {
  color: #6a7f9c;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #2f415d;
  border-radius: 8px;
  background: #162439;
  color: #a6b9d9;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.export-btn:hover {
  border-color: #4a6da0;
  color: #dbe7fa;
}

.export-btn .material-symbols-outlined {
  font-size: 16px;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

th.sortable:hover {
  background: #1a2b42;
}

th.active-sort {
  background: #1a2b42;
  color: var(--primary);
}

.sort-arrow {
  font-size: 11px;
  margin-left: 2px;
}

.rsi-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.rsi-normal {
  background: #1c3a5a;
  color: #ace0ff;
}

.rsi-hot {
  background: #5b2934;
  color: #ff9db1;
}

.rsi-cold {
  background: #1c5a50;
  color: #9feeda;
}

.table-wrap {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #101a29;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #1e2c44;
  font-size: 14px;
}

th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a7b9d6;
  background: #121f33;
}

.stock-name strong {
  display: block;
  font-size: 15px;
}

.stock-name small {
  color: var(--muted);
}

.grade-pill {
  display: inline-block;
  min-width: 30px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.grade-s {
  background: #61561f;
  color: #ffe88f;
}

.grade-a {
  background: #1f4d79;
  color: #ace0ff;
}

.grade-b {
  background: #1c5a50;
  color: #9feeda;
}

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

.score-meter {
  width: 82px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #253953;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, #3d84f7, #35d2bf);
}

.change-up {
  color: var(--good);
  font-weight: 700;
}

.change-down {
  color: var(--bad);
  font-weight: 700;
}

.change-flat {
  color: var(--neutral);
  font-weight: 700;
}

.report-btn {
  border: 1px solid #36517b;
  border-radius: 8px;
  background: #162642;
  color: #d8e7ff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.favorite-btn {
  border: 1px solid #6b5122;
  border-radius: 8px;
  background: #1b1710;
  color: #e3c787;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

.favorite-btn.active {
  background: linear-gradient(130deg, #9a6e16, #cf9220);
  color: #fff;
  border-color: #d9a84e;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 26px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 16, 0.72);
  backdrop-filter: blur(4px);
}

.help-modal-card {
  position: relative;
  width: min(980px, calc(100vw - 16px));
  max-height: 92vh;
  overflow: auto;
  border: 1px solid #2b4263;
  border-radius: 14px;
  background: linear-gradient(180deg, #0f1727, #0b1422);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.56);
}

.help-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #22344d;
  background: rgba(9, 17, 31, 0.86);
  position: sticky;
  top: 0;
  z-index: 2;
}

.help-modal-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.help-modal-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #8ea1bf;
}

.help-close-btn {
  background: #15243a;
  border-color: #2f466a;
}

.help-modal-body {
  padding: 14px 18px 18px;
  display: grid;
  gap: 12px;
}

.help-section {
  border: 1px solid #233750;
  border-radius: 10px;
  background: #111d2d;
  padding: 12px;
}

.help-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #98beff;
}

.help-section p {
  margin: 0;
  font-size: 13px;
  color: #d8e5fa;
  line-height: 1.6;
}

.help-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.help-list li {
  font-size: 13px;
  line-height: 1.55;
  color: #c9d8ef;
}

.help-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.help-chip {
  border: 1px solid #32507b;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #d9e9ff;
  background: #132844;
}

.help-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.help-grid-item {
  border: 1px solid #263f60;
  border-radius: 8px;
  background: #0f1a2a;
  padding: 10px;
}

.help-grid-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #9ec3ff;
}

.help-grid-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #cfe2ff;
}

.help-formula {
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid #2a4061;
  background: #0d1829;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #d9e8ff;
  line-height: 1.55;
}

.report-modal {
  position: relative;
  width: min(1380px, calc(100vw - 16px));
  max-height: 94vh;
  overflow: auto;
  border: 1px solid #294567;
  border-radius: 12px;
  background:
    radial-gradient(
      1200px 420px at 0% 0%,
      rgba(56, 108, 198, 0.2),
      transparent 70%
    ),
    linear-gradient(180deg, #0f1724, #09111d);
  box-shadow: 0 32px 60px rgba(0, 0, 0, 0.56);
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #1f2f45;
  background: rgba(8, 16, 30, 0.66);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 3;
}

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

.report-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #173563;
  display: grid;
  place-items: center;
}

.report-icon .material-symbols-outlined {
  color: #83b1ff;
  font-size: 19px;
}

.report-title-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.report-title-line h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.report-title-line span {
  color: var(--muted);
  font-size: clamp(12px, 1.2vw, 18px);
}

.report-meta-line {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.chip {
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
  font-size: 12px;
}

.chip.up {
  background: #1b5f50;
  color: #8bf7ce;
}

.chip.down {
  background: #5b2934;
  color: #ff9db1;
}

.chip.flat {
  background: #38475d;
  color: #d4deee;
}

.report-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-wrap {
  text-align: center;
}

.rating-wrap span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.rating-wrap strong {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(140deg, #3d86f7, #5f91ff);
  box-shadow: 0 10px 16px rgba(60, 132, 248, 0.46);
}

.report-close {
  border: 0;
  background: transparent;
  color: #8ca4c7;
}

.report-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid #1f2f45;
  overflow-x: auto;
  background: rgba(8, 14, 27, 0.88);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 70px;
  z-index: 2;
}

.report-tab-btn {
  border: 0;
  background: transparent;
  color: #8093b1;
  padding: 11px 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.report-tab-btn.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.report-tab-panel {
  display: none;
}

.report-tab-panel.active {
  display: block;
  animation: panel-fade 0.28s ease;
}

.report-body {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(330px, 1fr);
  gap: 18px;
  padding: 18px;
}

.report-main {
  display: grid;
  gap: 16px;
}

.section-title {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(17px, 1.6vw, 24px);
  font-weight: 700;
  line-height: 1.2;
}

.section-title .material-symbols-outlined {
  color: #6ea1ff;
  font-size: 20px;
}

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

.validation-item {
  border: 1px solid #25374f;
  border-radius: 10px;
  padding: 11px;
  background: #121d2d;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.validation-item:hover {
  border-color: #33527b;
  transform: translateY(-1px);
}

.validation-item.vi-pass {
  border-left: 3px solid var(--good);
}

.validation-item.vi-fail {
  border-left: 3px solid var(--bad);
}

.validation-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.validation-label {
  font-size: 13px;
  color: #dbe6fa;
  font-weight: 600;
}

.validation-evidence {
  margin: 0;
  font-size: 12px;
  color: #8ea1c1;
  line-height: 1.4;
}

.validation-detail {
  margin: 0;
  font-size: 11px;
  color: #6a7f9c;
  line-height: 1.4;
}

.validation-badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.validation-badge.pass {
  background: #1a5b4e;
  color: #86f8cc;
}

.validation-badge.fail {
  background: #5b2934;
  color: #ff9db1;
}

.strategy-card {
  border: 1px solid #264974;
  border-radius: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #10233e, #0f1d31);
  box-shadow: inset 0 1px 0 rgba(126, 177, 255, 0.07);
}

.strategy-narrative {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #dbe7fa;
}

.strategy-metrics {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.strategy-metrics article {
  border: 1px solid #203855;
  border-radius: 8px;
  background: #0d1727;
  padding: 11px;
}

.strategy-metrics span {
  display: block;
  margin-bottom: 8px;
  color: #92a4c2;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.strategy-metrics strong {
  font-size: 13px;
  line-height: 1.4;
}

#strategyEntry {
  color: #8cb9ff;
}

#strategyTarget {
  color: #52efc1;
}

#strategyStop {
  color: #ff8397;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2f79ef;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.timeline-content strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.timeline-content p {
  margin: 0;
  font-size: 12px;
  color: #a9b9d3;
  line-height: 1.5;
}

.report-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.summary-card {
  border: 1px solid #3d67ab;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(145deg, #3c7ce1, #3366c0);
  box-shadow: 0 10px 22px rgba(21, 68, 142, 0.25);
}

.summary-card span {
  display: block;
  margin-bottom: 8px;
  color: #c3daff;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.summary-card p {
  margin: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.summary-card.dark-card {
  background: linear-gradient(180deg, #13223a, #0f1c30);
  border-color: #2a4469;
}

.summary-card.dark-card p {
  color: #dbe7fa;
}

.risk-card {
  border: 1px solid #2a3951;
  border-radius: 10px;
  padding: 12px;
  background: #0e1828;
  box-shadow: inset 0 1px 0 rgba(110, 150, 214, 0.08);
}

.risk-card h4 {
  margin: 0 0 10px;
  color: #ff6c86;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.risk-card ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 9px;
}

.risk-card li {
  color: #cad5ea;
  font-size: 13px;
  line-height: 1.55;
}

.trend-card {
  border: 1px solid #24444f;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(20, 152, 147, 0.18), rgba(7, 18, 32, 0.48)),
    #0d1827;
  height: 146px;
  position: relative;
  overflow: hidden;
  padding: 10px;
}

.trend-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 32%,
    rgba(73, 182, 187, 0.28) 45%,
    transparent 58%
  );
}

.trend-bars {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 28px;
  top: 10px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  z-index: 1;
}

.trend-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  position: relative;
}

.trend-bar-up {
  background: linear-gradient(180deg, #75efc8, #1f5a49);
}

.trend-bar-down {
  background: linear-gradient(180deg, #ff95ab, #5b2934);
}

.trend-ma-lines {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 28px;
  top: 10px;
  z-index: 2;
  pointer-events: none;
}

.trend-ma-lines svg {
  width: 100%;
  height: 100%;
}

.trend-current-marker {
  position: absolute;
  right: 46px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transform: translateY(50%);
  z-index: 3;
}

.trend-current-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(9, 18, 33, 0.8);
}

.trend-current-text {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.trend-current-marker.bullish .trend-current-dot {
  background: #75efc8;
}

.trend-current-marker.bullish .trend-current-text {
  background: rgba(31, 90, 73, 0.92);
  color: #9df1d8;
}

.trend-current-marker.bearish .trend-current-dot {
  background: #ff95ab;
}

.trend-current-marker.bearish .trend-current-text {
  background: rgba(91, 41, 52, 0.92);
  color: #ffb0c0;
}

.trend-status-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  z-index: 3;
  letter-spacing: 0.04em;
}

.trend-status-badge.bullish {
  background: #1f5a49;
  color: #9df1d8;
}

.trend-status-badge.bearish {
  background: #5b2934;
  color: #ffb0c0;
}

.trend-label {
  position: absolute;
  left: 12px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52ebc6;
}

.execute-btn {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(130deg, #3f84f7, #4b8ef8);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.report-footer {
  border-top: 1px solid #1f2f45;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #8da1bf;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-footer strong {
  color: #639cff;
  margin-left: 10px;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.data-card {
  border: 1px solid #25374f;
  border-radius: 10px;
  background: #121d2d;
  padding: 12px;
}

.data-card span {
  display: block;
  color: #8ea1c1;
  font-size: 12px;
  margin-bottom: 7px;
}

.data-card strong {
  font-size: 19px;
}

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

.investor-data-card {
  display: grid;
  gap: 6px;
}

.investor-data-card em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.investor-data-card small {
  color: #8ea1c1;
  font-size: 11px;
}

.investor-tone.positive {
  color: #75efc8;
}

.investor-tone.neutral {
  color: #b9cadf;
}

.investor-tone.caution {
  color: #ff95ab;
}

.investor-summary-box {
  display: grid;
  gap: 8px;
}

.investor-summary-box p {
  margin: 0;
  color: #d7e4f9;
  font-size: 14px;
  line-height: 1.55;
}

.investor-summary-box .investor-asof {
  color: #8ea1c1;
  font-size: 12px;
}

.investor-signal {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.investor-signal.positive {
  background: #1f5a49;
  color: #9df1d8;
}

.investor-signal.neutral {
  background: #22344d;
  color: #c8d7eb;
}

.investor-signal.caution {
  background: #5b2934;
  color: #ffb0c0;
}

/* ── 투자자 패널 확장 스타일 ── */

/* 카드 값 색상 */
.inv-value.positive {
  color: #75efc8;
}
.inv-value.neutral {
  color: #d7e4f9;
}
.inv-value.caution {
  color: #ff95ab;
}

/* 연속 매수/매도 스트릭 뱃지 */
.inv-streak {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.inv-streak.positive {
  background: #1f5a49;
  color: #9df1d8;
}
.inv-streak.neutral {
  background: #22344d;
  color: #c8d7eb;
}
.inv-streak.caution {
  background: #5b2934;
  color: #ffb0c0;
}

/* ── 일별 순매수 차트 ── */
.inv-daily-chart-wrap {
  background: #121d2d;
  border: 1px solid #25374f;
  border-radius: 10px;
  padding: 16px;
}

.inv-chart-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.inv-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #8ea1c1;
}
.inv-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.inv-legend-dot.foreign {
  background: #5b8def;
}
.inv-legend-dot.inst {
  background: #f5a623;
}
.inv-legend-dot.up-label {
  background: #75efc8;
}
.inv-legend-dot.down-label {
  background: #ff95ab;
}

.inv-chart-area {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 168px;
  border-bottom: 1px solid #25374f;
  padding-bottom: 4px;
}

.inv-chart-col {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 100%;
}

.inv-chart-values {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-height: 24px;
}

.inv-chart-val {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.inv-chart-val.foreign {
  color: #8cb7ff;
}

.inv-chart-val.inst {
  color: #ffd08a;
}

.inv-bar-group {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  justify-content: center;
}

.inv-bar {
  width: 40%;
  max-width: 22px;
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  background: #5b8def;
  transition: height 0.3s ease;
  cursor: default;
  position: relative;
}
.inv-bar.inst {
  background: #f5a623;
}
.inv-bar.up {
  opacity: 1;
}
.inv-bar.down {
  opacity: 0.55;
  background: #ff95ab;
}
.inv-bar.inst.down {
  background: #ff95ab;
  opacity: 0.55;
}
.inv-bar.inst.up {
  background: #f5a623;
}

.inv-chart-date {
  font-size: 10px;
  color: #8ea1c1;
  white-space: nowrap;
}

.inv-no-data {
  color: #8ea1c1;
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
  margin: 0;
}

/* ── 수급 심층 분석 ── */
.inv-deep-analysis {
  display: grid;
  gap: 10px;
}

.inv-deep-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #121d2d;
  border: 1px solid #25374f;
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 3px solid #25374f;
}
.inv-deep-item.positive {
  border-left-color: #75efc8;
}
.inv-deep-item.neutral {
  border-left-color: #5b8def;
}
.inv-deep-item.caution {
  border-left-color: #ff95ab;
}

.inv-deep-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
.inv-deep-item.positive .inv-deep-icon {
  color: #75efc8;
}
.inv-deep-item.neutral .inv-deep-icon {
  color: #5b8def;
}
.inv-deep-item.caution .inv-deep-icon {
  color: #ff95ab;
}

.inv-deep-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.inv-deep-content strong {
  font-size: 14px;
  color: #e8f0fe;
}
.inv-deep-content p {
  margin: 0;
  font-size: 13px;
  color: #8ea1c1;
  line-height: 1.5;
}

/* ── 종합 점수 게이지 ── */
.inv-score-gauge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.inv-score-bar {
  flex: 1;
  height: 8px;
  background: #1a2a40;
  border-radius: 999px;
  overflow: hidden;
}
.inv-score-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.inv-score-fill.positive {
  background: linear-gradient(90deg, #1f5a49, #75efc8);
}
.inv-score-fill.neutral {
  background: linear-gradient(90deg, #22344d, #5b8def);
}
.inv-score-fill.caution {
  background: linear-gradient(90deg, #5b2934, #ff95ab);
}

.inv-score-label {
  font-size: 13px;
  font-weight: 700;
  color: #d7e4f9;
  white-space: nowrap;
}

.insight-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.insight-list li {
  font-size: 15px;
  color: #cad7ee;
  line-height: 1.5;
}

.news-feed {
  display: grid;
  gap: 10px;
}

.news-item {
  border: 1px solid #283a55;
  border-radius: 10px;
  background: #111c2d;
  padding: 12px;
}

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

.news-tag {
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #1f4b81;
  color: #aed4ff;
}

.news-item time {
  font-size: 11px;
  color: #8ea1c1;
}

.news-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.news-link {
  color: #dce8fb;
  text-decoration: none;
}

.news-link:hover {
  color: #9cc4ff;
  text-decoration: underline;
}

.news-item p {
  margin: 0;
  color: #cfdcf1;
  font-size: 15px;
  line-height: 1.5;
}

.news-link-sub {
  color: #8fb5ee;
  text-decoration: none;
  font-size: 13px;
}

.news-link-sub:hover {
  text-decoration: underline;
}

.report-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  pointer-events: auto;
  background:
    radial-gradient(
      480px 220px at center,
      rgba(58, 119, 223, 0.26),
      transparent 72%
    ),
    rgba(7, 14, 28, 0.7);
  backdrop-filter: blur(5px);
  transition:
    opacity 0.24s ease,
    visibility 0.24s ease;
}

.report-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-orb {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 35% 30%,
      rgba(173, 214, 255, 0.9),
      rgba(52, 119, 243, 0.24) 52%,
      rgba(30, 70, 144, 0)
    ),
    conic-gradient(from 90deg, #51d7d1, #4e8ef8, #5f9cff, #51d7d1);
  box-shadow: 0 0 34px rgba(73, 144, 255, 0.45);
  animation: loading-spin 1.6s linear infinite;
}

.loading-copy p {
  margin: 0;
}

.loading-copy p:first-child {
  color: #f0f5ff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.loading-copy p:last-child {
  margin-top: 6px;
  color: #b6caea;
  font-size: 15px;
  font-weight: 600;
}

.loading-pulse-bars {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 22px;
}

.loading-pulse-bars span {
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #76d4f9, #5686f0);
  animation: loading-bars 0.9s ease-in-out infinite;
}

.loading-pulse-bars span:nth-child(2) {
  animation-delay: 0.1s;
}

.loading-pulse-bars span:nth-child(3) {
  animation-delay: 0.2s;
}

.loading-pulse-bars span:nth-child(4) {
  animation-delay: 0.3s;
}

.loading-pulse-bars span:nth-child(5) {
  animation-delay: 0.4s;
}

.chart-canvas {
  border: 1px solid #2a405f;
  border-radius: 10px;
  background: linear-gradient(180deg, #0f1f35, #0d1728);
  padding: 14px;
}

.daily-chart-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-chart-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #bfd1ec;
  font-size: 12px;
  font-weight: 600;
}

.legend-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.legend-item .dot.ma5 {
  background: #68d7b8;
}

.legend-item .dot.ma20 {
  background: #f5a86f;
}

.legend-item .dot.ma60 {
  background: #cdb98f;
}

.legend-item .dot.trend {
  background: #8bb2ff;
}

.daily-chart-asof {
  color: #91aacd;
  font-size: 12px;
}

.daily-chart-svg-wrap {
  width: 100%;
  height: 360px;
}

.daily-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
  overflow: hidden;
}

.daily-chart-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #8ea1c1;
  font-size: 12px;
  font-weight: 500;
}

.chart-empty {
  margin: 0;
  color: #9db2d2;
  font-size: 13px;
}

/* Report room restyle: warm, document-first modal — Claude-inspired refinement */
.report-modal {
  --report-ink: #1f1611;
  --report-ink-soft: #3a2f27;
  --report-muted: #8a7d70;
  --report-paper: #faf6ee;
  --report-panel: #ffffff;
  --report-panel-soft: #fbf6ec;
  --report-line: #e7dcc8;
  --report-line-soft: #efe6d4;
  --report-accent: #c96342;
  --report-accent-soft: #f3e1d7;
  --report-accent-dark: #1f1611;
  --report-good: #1c7a55;
  --report-good-soft: #e2f0e6;
  --report-bad: #b94a59;
  --report-bad-soft: #f6e1de;
  --report-blue: #315e8f;
  --report-radius-lg: 14px;
  --report-radius-md: 10px;
  --report-radius-sm: 6px;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1440px, calc(100vw - 72px));
  height: min(92vh, 980px);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid #d8caaf;
  border-radius: var(--report-radius-lg);
  background: var(--report-paper);
  color: var(--report-ink);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 24px 56px rgba(31, 18, 10, 0.22),
    0 4px 12px rgba(31, 18, 10, 0.08);
}

.report-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(720px 320px at 88% -8%, rgba(201, 99, 66, 0.07), transparent 62%),
    radial-gradient(420px 240px at -4% 110%, rgba(54, 29, 16, 0.05), transparent 70%);
}

.modal-backdrop {
  background:
    radial-gradient(760px 420px at 52% 10%, rgba(96, 61, 35, 0.18), transparent 72%),
    rgba(20, 12, 6, 0.78);
  backdrop-filter: blur(4px);
}

.report-header {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  padding: 28px 36px 22px;
  border-bottom: 1px solid var(--report-line);
  background: rgba(250, 246, 238, 0.88);
  backdrop-filter: blur(8px);
}

.report-title-wrap {
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.report-title-wrap > div {
  flex: 1;
  min-width: 0;
}

.report-icon {
  display: none;
}

.report-icon .material-symbols-outlined {
  color: var(--report-ink);
  font-size: 21px;
}

.report-title-wrap > div::before {
  content: "주식분석 리포트";
  display: block;
  margin: 0 0 8px;
  color: var(--report-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}

.report-title-line {
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.report-title-line h3 {
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", "Noto Serif KR", serif;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.report-title-line span {
  color: var(--report-muted);
  font-size: 15px;
  font-weight: 500;
}

.report-meta-line {
  margin-top: 10px;
  color: var(--report-ink-soft);
  font-size: 13px;
  gap: 10px;
  align-items: center;
}

.chip {
  border-radius: var(--report-radius-sm);
  padding: 3px 8px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.chip.up {
  background: var(--report-good-soft);
  border-color: rgba(28, 122, 85, 0.18);
  color: var(--report-good);
}

.chip.down {
  background: var(--report-bad-soft);
  border-color: rgba(185, 74, 89, 0.2);
  color: var(--report-bad);
}

.chip.flat {
  background: #eee7dc;
  border-color: #d8ccb6;
  color: #71665d;
}

.report-header::after {
  content: "원문 분석 화면의 정보는 유지하고, 의사결정에 필요한 등급, 근거, 위험, 다음 액션만 전면에 정리했습니다.";
  grid-column: 1 / -1;
  max-width: 760px;
  color: var(--report-muted);
  font-size: 13px;
  line-height: 1.65;
  margin-top: 4px;
}

.report-header-right {
  gap: 14px;
  align-items: center;
}

.rating-wrap {
  min-width: 74px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rating-wrap span {
  color: var(--report-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.rating-wrap strong {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 1px solid var(--report-ink);
  border-radius: var(--report-radius-sm);
  background: var(--report-panel);
  box-shadow: 0 1px 0 rgba(31, 22, 17, 0.04);
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.report-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--report-line);
  border-radius: var(--report-radius-sm);
  background: var(--report-panel);
  color: var(--report-ink-soft);
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.report-close:hover {
  border-color: var(--report-ink);
  background: var(--report-panel-soft);
  color: var(--report-ink);
}

.report-tabs {
  grid-column: 1;
  grid-row: 1 / 4;
  position: relative;
  top: auto;
  z-index: 1;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 4px;
  padding: 30px 18px 26px;
  border-right: 1px solid var(--report-line);
  border-bottom: 0;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(250, 246, 238, 0.6));
  backdrop-filter: none;
}

.report-tabs::before {
  content: "Report\A Room";
  white-space: pre-line;
  display: block;
  margin: 8px 8px 24px;
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.report-tabs::after {
  content: "투자자와 내부 의사결정권자가 같은 근거를 보도록 설계한 즉시분석 리포트.";
  display: block;
  margin: 22px 8px 0;
  padding-top: 18px;
  border-top: 1px solid var(--report-line-soft);
  color: var(--report-muted);
  font-size: 12px;
  line-height: 1.6;
}

.report-tab-btn {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border: 0;
  border-radius: var(--report-radius-sm);
  background: transparent;
  color: var(--report-ink-soft);
  padding: 0 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.report-tab-btn:hover {
  background: rgba(201, 99, 66, 0.06);
  color: var(--report-ink);
}

.report-tab-btn::before {
  color: var(--report-muted);
  font-family: "Material Symbols Outlined";
  font-size: 18px;
  line-height: 1;
  transition: color 0.15s ease;
}

.report-tab-btn[data-tab="supply"]::before {
  content: "bar_chart";
}

.report-tab-btn[data-tab="investor"]::before {
  content: "groups";
}

.report-tab-btn[data-tab="news"]::before {
  content: "article";
}

.report-tab-btn[data-tab="chart"]::before {
  content: "monitoring";
}

.report-tab-btn[data-tab="strategy"]::before {
  content: "trending_up";
}

.report-tab-btn::after {
  color: var(--report-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.report-tab-btn[data-tab="strategy"]::after {
  content: "요약";
}

.report-tab-btn[data-tab="supply"]::after,
.report-tab-btn[data-tab="investor"]::after,
.report-tab-btn[data-tab="news"]::after,
.report-tab-btn[data-tab="chart"]::after {
  content: "보기";
}

.report-tab-btn.active {
  background: var(--report-panel);
  color: var(--report-ink);
  font-weight: 600;
  box-shadow:
    0 1px 0 rgba(31, 22, 17, 0.04),
    0 1px 3px rgba(31, 22, 17, 0.06);
}

.report-tab-btn.active::before {
  color: var(--report-accent);
}

.report-tab-btn.active::after {
  content: "현재";
  color: var(--report-accent);
}

.report-tab-panel {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  overflow: auto;
  position: relative;
  z-index: 1;
}

.report-tab-panel.active {
  display: block;
  animation: panel-fade 0.22s ease;
}

.report-body {
  grid-template-columns: minmax(0, 1.32fr) minmax(320px, 0.78fr);
  gap: 22px;
  padding: 26px 36px 30px;
}

.report-main {
  gap: 26px;
}

.section-title {
  margin-bottom: 14px;
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", "Noto Serif KR", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .material-symbols-outlined {
  color: var(--report-accent);
  font-size: 20px;
}

.validation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  background: transparent;
}

.validation-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--report-line);
  border-radius: var(--report-radius-md);
  background: var(--report-panel);
  padding: 16px 18px;
  gap: 10px;
  min-height: auto;
  transform: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.validation-item:hover {
  border-color: #d6c6a8;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(31, 22, 17, 0.06);
  background: var(--report-panel);
}

.validation-item.vi-pass {
  border-left: 3px solid var(--report-good);
}

.validation-item.vi-fail {
  border-left: 3px solid var(--report-bad);
}

.validation-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.validation-label {
  color: var(--report-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.validation-evidence {
  color: var(--report-ink-soft);
  font-family: "JetBrains Mono", "Courier New", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  background: var(--report-panel-soft);
  border: 1px solid var(--report-line-soft);
  border-radius: var(--report-radius-sm);
  padding: 6px 8px;
  margin: 0;
  word-break: break-all;
}

.validation-detail {
  color: var(--report-ink-soft);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.validation-badge {
  border-radius: var(--report-radius-sm);
  padding: 3px 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.validation-badge.pass {
  background: var(--report-good-soft);
  border-color: rgba(28, 122, 85, 0.18);
  color: var(--report-good);
}

.validation-badge.fail {
  background: var(--report-bad-soft);
  border-color: rgba(185, 74, 89, 0.2);
  color: var(--report-bad);
}

.strategy-card,
.summary-card,
.risk-card,
.data-card,
.inv-daily-chart-wrap,
.inv-deep-item,
.news-item,
.chart-canvas {
  border: 1px solid var(--report-line);
  border-radius: var(--report-radius-md);
  background: var(--report-panel);
  color: var(--report-ink);
  box-shadow: none;
}

.strategy-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.strategy-narrative {
  color: var(--report-ink-soft);
  font-size: 14px;
  line-height: 1.75;
  margin: 0;
}

.strategy-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 0;
  background: transparent;
}

.strategy-metrics article {
  border: 1px solid var(--report-line-soft);
  border-radius: var(--report-radius-sm);
  background: var(--report-panel-soft);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strategy-metrics article:last-child {
  border-right: 1px solid var(--report-line-soft);
}

.strategy-metrics span,
.data-card span {
  color: var(--report-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strategy-metrics strong {
  color: var(--report-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

#strategyEntry,
#strategyTarget,
#strategyStop {
  color: var(--report-ink);
}

.timeline {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--report-line);
  margin-left: 12px;
  padding-left: 0;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  padding: 4px 0 16px;
  align-items: flex-start;
}

.timeline-dot {
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border: 1px solid var(--report-line);
  border-radius: 999px;
  background: var(--report-panel);
  color: var(--report-ink-soft);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 4px var(--report-paper);
}

.timeline-content {
  padding-top: 1px;
}

.timeline-content strong {
  display: block;
  color: var(--report-ink);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-content p {
  color: var(--report-ink-soft);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}

.report-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-card {
  padding: 18px 20px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 3px solid var(--report-accent);
  background:
    linear-gradient(180deg, var(--report-panel), var(--report-panel-soft));
}

.summary-card span,
.summary-card.dark-card span {
  color: var(--report-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.summary-card p,
.summary-card.dark-card p {
  color: var(--report-ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
  margin: 0;
}

#summaryText::first-letter {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.risk-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.risk-card h4 {
  margin: 0;
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", "Noto Serif KR", serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.risk-card h4 .material-symbols-outlined {
  color: var(--report-accent);
  font-size: 18px;
}

.risk-card ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-card li {
  color: var(--report-ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.trend-card {
  height: 168px;
  border: 1px solid var(--report-line);
  border-radius: var(--report-radius-md);
  background:
    linear-gradient(180deg, rgba(36, 119, 96, 0.08), rgba(255, 250, 242, 0.4)),
    var(--report-panel);
  overflow: hidden;
}

.trend-card::before {
  background: linear-gradient(110deg, transparent 36%, rgba(201, 99, 66, 0.1) 48%, transparent 60%);
}

.trend-bar-up {
  background: linear-gradient(180deg, #69b99b, #d7eadf);
}

.trend-bar-down {
  background: linear-gradient(180deg, #d4867a, #f1d8d2);
}

.trend-label,
.daily-chart-bottom,
.daily-chart-asof,
.legend-item,
.investor-summary-box .investor-asof,
.inv-legend-item,
.inv-chart-date,
.news-item time,
.news-link-sub {
  color: var(--report-muted);
}

.trend-status-badge {
  border-radius: var(--report-radius-sm);
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}

.trend-status-badge.bullish {
  background: var(--report-good-soft);
  border-color: rgba(28, 122, 85, 0.18);
  color: var(--report-good);
}

.trend-status-badge.bearish {
  background: var(--report-bad-soft);
  border-color: rgba(185, 74, 89, 0.2);
  color: var(--report-bad);
}

.execute-btn {
  height: 48px;
  border: 0;
  border-radius: var(--report-radius-md);
  background: var(--report-accent-dark);
  color: #fbf6ec;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(31, 22, 17, 0.12);
}

.execute-btn:hover {
  background: #2c1d14;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(31, 22, 17, 0.18);
}

.execute-btn .material-symbols-outlined {
  font-size: 18px;
}

.report-footer {
  grid-column: 2;
  grid-row: 3;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--report-line);
  background: rgba(250, 246, 238, 0.92);
  color: var(--report-muted);
  padding: 12px 36px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.report-footer > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-footer strong {
  color: var(--report-ink);
  font-weight: 600;
}

.data-grid {
  display: grid;
  gap: 10px;
  border: 0;
  background: transparent;
}

.data-card {
  border: 1px solid var(--report-line);
  border-radius: var(--report-radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--report-panel);
}

.data-card:nth-child(4n) {
  border-right: 1px solid var(--report-line);
}

.data-card strong {
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.insight-list li,
.investor-summary-box p,
.inv-deep-content p,
.news-item p {
  color: var(--report-ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.inv-deep-content strong,
.news-item strong,
.news-link {
  color: var(--report-ink);
  font-weight: 700;
}

.news-tag,
.investor-signal,
.inv-streak {
  border-radius: var(--report-radius-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
}

.chart-canvas {
  padding: 16px;
}

.daily-chart-svg {
  border-radius: var(--report-radius-sm);
}

.daily-chart-svg rect[fill="#101c2f"],
.daily-chart-svg rect[fill="#0e1829"] {
  fill: var(--report-panel-soft);
}

.report-loading-overlay {
  grid-column: 2;
  grid-row: 1 / 4;
  background:
    radial-gradient(520px 280px at center, rgba(201, 99, 66, 0.08), transparent 72%),
    rgba(250, 246, 238, 0.86);
  backdrop-filter: blur(5px);
}

.loading-orb {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--report-panel);
  border: 1px solid var(--report-line);
  box-shadow:
    0 0 0 6px rgba(201, 99, 66, 0.08),
    0 8px 24px rgba(31, 22, 17, 0.12);
}

.loading-copy p:first-child {
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", "Noto Serif KR", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.loading-copy p:last-child {
  color: var(--report-muted);
  font-size: 13px;
}

.loading-pulse-bars span {
  background: var(--report-accent);
  border-radius: 2px;
}

/* ── 조건 근거 / 투자자 수급 / 뉴스 / 차트 패널: 크림 테마 통합 ── */
.report-modal .data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-modal .data-card {
  background: var(--report-panel);
  border-color: var(--report-line);
  padding: 14px 16px;
}

.report-modal .data-card span {
  color: var(--report-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.report-modal .data-card strong {
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
}

.report-modal .investor-data-card em {
  color: var(--report-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-modal .investor-data-card small {
  color: var(--report-muted);
  font-size: 11px;
}

.report-modal .investor-tone.positive,
.report-modal .inv-value.positive,
.report-modal .inv-chart-val.foreign {
  color: var(--report-good);
}

.report-modal .investor-tone.neutral,
.report-modal .inv-value.neutral {
  color: var(--report-ink-soft);
}

.report-modal .investor-tone.caution,
.report-modal .inv-value.caution {
  color: var(--report-bad);
}

.report-modal .inv-chart-val.inst {
  color: #b8771f;
}

.report-modal .investor-signal,
.report-modal .inv-streak {
  border: 1px solid transparent;
  border-radius: var(--report-radius-sm);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  letter-spacing: 0.04em;
}

.report-modal .investor-signal.positive,
.report-modal .inv-streak.positive {
  background: var(--report-good-soft);
  border-color: rgba(28, 122, 85, 0.2);
  color: var(--report-good);
}

.report-modal .investor-signal.neutral,
.report-modal .inv-streak.neutral {
  background: var(--report-panel-soft);
  border-color: var(--report-line);
  color: var(--report-ink-soft);
}

.report-modal .investor-signal.caution,
.report-modal .inv-streak.caution {
  background: var(--report-bad-soft);
  border-color: rgba(185, 74, 89, 0.22);
  color: var(--report-bad);
}

.report-modal .investor-summary-box p {
  color: var(--report-ink);
  font-size: 14px;
  line-height: 1.7;
}

.report-modal .insight-list li {
  color: var(--report-ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

/* 일별 순매수 차트 */
.report-modal .inv-daily-chart-wrap {
  background: var(--report-panel);
  border: 1px solid var(--report-line);
  border-radius: var(--report-radius-md);
  padding: 16px 18px;
}

.report-modal .inv-chart-area {
  border-bottom: 1px solid var(--report-line-soft);
}

.report-modal .inv-legend-item {
  color: var(--report-muted);
  font-size: 11px;
  font-weight: 500;
}

.report-modal .inv-legend-dot.foreign,
.report-modal .inv-bar:not(.inst):not(.down) {
  background: #6a8fb8;
}

.report-modal .inv-legend-dot.inst,
.report-modal .inv-bar.inst {
  background: #c89058;
}

.report-modal .inv-legend-dot.up-label {
  background: var(--report-good);
}

.report-modal .inv-legend-dot.down-label {
  background: var(--report-bad);
}

.report-modal .inv-bar.down,
.report-modal .inv-bar.inst.down {
  background: #d49ba0;
  opacity: 0.85;
}

.report-modal .inv-chart-date,
.report-modal .inv-no-data {
  color: var(--report-muted);
  font-size: 10px;
}

/* 수급 심층 분석 */
.report-modal .inv-deep-item {
  background: var(--report-panel);
  border: 1px solid var(--report-line);
  border-left: 3px solid var(--report-line);
  border-radius: var(--report-radius-md);
  padding: 14px 16px;
  gap: 12px;
}

.report-modal .inv-deep-item.positive {
  border-left-color: var(--report-good);
}

.report-modal .inv-deep-item.neutral {
  border-left-color: var(--report-blue);
}

.report-modal .inv-deep-item.caution {
  border-left-color: var(--report-bad);
}

.report-modal .inv-deep-item.positive .inv-deep-icon {
  color: var(--report-good);
}

.report-modal .inv-deep-item.neutral .inv-deep-icon {
  color: var(--report-blue);
}

.report-modal .inv-deep-item.caution .inv-deep-icon {
  color: var(--report-bad);
}

.report-modal .inv-deep-content strong {
  color: var(--report-ink);
  font-size: 14px;
  font-weight: 700;
}

.report-modal .inv-deep-content p {
  color: var(--report-ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

/* 종합 점수 게이지 */
.report-modal .inv-score-bar {
  background: var(--report-panel-soft);
  border: 1px solid var(--report-line-soft);
}

.report-modal .inv-score-fill.positive {
  background: linear-gradient(90deg, #6db89a, var(--report-good));
}

.report-modal .inv-score-fill.neutral {
  background: linear-gradient(90deg, #9bb6d3, var(--report-blue));
}

.report-modal .inv-score-fill.caution {
  background: linear-gradient(90deg, #d4848e, var(--report-bad));
}

.report-modal .inv-score-label {
  color: var(--report-ink);
  font-size: 12px;
  font-weight: 700;
}

/* 뉴스 */
.report-modal .news-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-modal .news-item {
  background: var(--report-panel);
  border: 1px solid var(--report-line);
  border-radius: var(--report-radius-md);
  padding: 14px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.report-modal .news-item:hover {
  border-color: #d6c6a8;
  box-shadow: 0 4px 14px rgba(31, 22, 17, 0.06);
}

.report-modal .news-tag {
  background: var(--report-accent-soft);
  border: 1px solid rgba(201, 99, 66, 0.22);
  color: var(--report-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--report-radius-sm);
  padding: 3px 8px;
}

.report-modal .news-item time {
  color: var(--report-muted);
  font-size: 11px;
  font-weight: 500;
}

.report-modal .news-item strong {
  color: var(--report-ink);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.report-modal .news-link {
  color: var(--report-ink);
  text-decoration: none;
}

.report-modal .news-link:hover {
  color: var(--report-accent);
  text-decoration: underline;
}

.report-modal .news-link-sub {
  color: var(--report-accent);
  font-size: 12px;
  font-weight: 500;
}

.report-modal .news-item p {
  color: var(--report-ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

/* 차트 패널 */
.report-modal .chart-canvas {
  background: var(--report-panel);
  border: 1px solid var(--report-line);
  border-radius: var(--report-radius-md);
  padding: 18px;
}

.report-modal .legend-item {
  color: var(--report-ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.report-modal .legend-item .dot.ma5 {
  background: #1c7a55;
}

.report-modal .legend-item .dot.ma20 {
  background: var(--report-accent);
}

.report-modal .legend-item .dot.ma60 {
  background: #a98563;
}

.report-modal .legend-item .dot.trend {
  background: var(--report-blue);
}

.report-modal .daily-chart-asof {
  color: var(--report-muted);
  font-size: 11px;
  font-weight: 500;
}

.report-modal .daily-chart-bottom {
  color: var(--report-muted);
  font-size: 11px;
}

.report-modal .chart-empty {
  color: var(--report-muted);
}

/* 차트 지표 / 점수 분석 요약 카드의 metricList 항목 (em + strong) */
.report-modal .summary-card span:has(em) {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--report-line-soft);
  letter-spacing: 0;
  text-transform: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: inherit;
}

.report-modal .summary-card span:has(em):last-child {
  border-bottom: 0;
}

.report-modal .summary-card span > em {
  font-style: normal;
  color: var(--report-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-modal .summary-card span > strong {
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.report-modal .summary-card span.metric-forecast-up,
.report-modal .summary-card span.metric-forecast-down {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--report-line);
  border-bottom: 0;
}

.report-modal .summary-card span.metric-forecast-up > em,
.report-modal .summary-card span.metric-forecast-down > em {
  color: var(--report-accent);
  font-weight: 700;
}

.report-modal .summary-card span.metric-forecast-up > strong {
  color: var(--report-good);
  font-size: 14px;
}

.report-modal .summary-card span.metric-forecast-down > strong {
  color: var(--report-bad);
  font-size: 14px;
}

/* 사이드 카드(차트 지표 등)에서 첫 라벨(span:first-of-type) 강조 — chartStats 등 */
.report-modal .summary-card > span:first-of-type {
  margin-bottom: 4px;
}

/* 레벨 가이드 / 투자 시사점 / 관심 종목 등 사이드 ul */
.report-modal .risk-card ul li::marker {
  color: var(--report-accent);
}

/* 조건 메모 / 신호 분석 / 투자자 가이드 (insight-list 사이드) */
.report-modal .report-side .risk-card ul {
  padding-left: 18px;
}

.report-modal .report-side .risk-card li {
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  .report-modal {
    grid-template-columns: 220px minmax(0, 1fr);
    width: calc(100vw - 28px);
  }

  .report-tabs {
    padding: 24px 14px;
  }

  .report-tabs::before {
    font-size: 28px;
  }

  .report-body {
    grid-template-columns: 1fr;
    padding: 22px;
  }

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

@media (max-width: 760px) {
  .report-modal {
    display: block;
    width: calc(100vw - 8px);
    height: 100dvh;
    max-height: 100dvh;
    overflow: auto;
    border-radius: var(--report-radius-md);
  }

  .report-tabs {
    position: sticky;
    top: 0;
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--report-line);
    overflow-x: auto;
    background: var(--report-paper);
  }

  .report-tabs::before,
  .report-tabs::after,
  .report-tab-btn::after {
    display: none;
  }

  .report-tab-btn {
    display: inline-flex;
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .report-header {
    display: flex;
    flex-wrap: wrap;
    padding: 20px 18px;
  }

  .report-header::after {
    display: none;
  }

  .report-title-line h3 {
    font-size: 28px;
  }

  .report-body {
    padding: 18px;
    grid-template-columns: 1fr;
  }

  .strategy-metrics,
  .data-grid {
    grid-template-columns: 1fr;
  }

  .report-footer {
    padding: 12px 18px;
    flex-wrap: wrap;
  }
}

@media (max-width: 1080px) {
  .container {
    margin: 16px auto 30px;
    padding: 0 12px;
  }

  .topbar {
    padding: 14px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .run-btn {
    min-height: 44px;
  }

  .refresh-scan-btn {
    min-height: 44px;
  }

  .help-btn {
    min-height: 44px;
    justify-content: center;
  }

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

  .report-body {
    grid-template-columns: 1fr;
  }

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

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

  .table-controls {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .container {
    margin: 12px auto 24px;
    padding: 0 10px;
    gap: 10px;
  }

  .panel {
    border-radius: 12px;
  }

  .topbar {
    padding: 12px;
    gap: 10px;
  }

  .brand {
    width: 100%;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
  }

  .brand h1 {
    font-size: clamp(22px, 8vw, 30px);
  }

  .brand p {
    font-size: 13px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .field {
    padding: 7px 9px;
  }

  .field select,
  .field input {
    font-size: 14px;
  }

  .run-btn,
  .refresh-scan-btn {
    min-height: 42px;
  }

  .quick-search-bar {
    padding: 12px;
  }

  .qs-inner {
    flex-wrap: wrap;
    gap: 8px;
  }

  .qs-inner input {
    flex: 1 1 180px;
  }

  .qs-btn {
    margin-left: auto;
  }

  .qs-hint {
    margin-left: 0;
    padding-left: 2px;
    font-size: 10px;
  }

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

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

  .strategy-metrics {
    grid-template-columns: 1fr;
  }

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

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

  .report-modal {
    width: calc(100vw - 8px);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 10px;
  }

  .help-modal-card {
    width: calc(100vw - 8px);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 10px;
  }

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

  .report-tabs {
    top: 64px;
  }

  .report-title-line h3 {
    font-size: 25px;
  }

  .report-tab-btn {
    font-size: 13px;
  }

  .section-title {
    font-size: 18px;
  }

  .strategy-narrative,
  .summary-card p,
  .risk-card li,
  .news-item p {
    font-size: 14px;
  }

  .trend-current-marker {
    right: 36px;
  }

  .trend-current-text {
    font-size: 9px;
    padding: 1px 6px;
  }

  .loading-copy p:first-child {
    font-size: 20px;
  }

  .loading-copy p:last-child {
    font-size: 14px;
  }

  .grade-filters {
    order: -1;
    width: 100%;
  }

  .search-box {
    flex: 1;
  }

  .search-box input {
    width: 100%;
  }

  .table-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .search-box {
    flex: 1 1 100%;
    min-width: 0;
  }

  .search-box input {
    min-width: 0;
  }

  .table-wrap {
    margin: 0 -2px;
  }

  table {
    min-width: 700px;
  }

  th,
  td {
    padding: 10px 9px;
    font-size: 13px;
  }

  th {
    font-size: 10px;
  }

  .metric strong {
    font-size: 24px;
  }
}

@media (max-width: 1080px) {
  .daily-chart-svg-wrap {
    height: 320px;
  }
}

@media (max-width: 760px) {
  .daily-chart-svg-wrap {
    height: 280px;
  }

  .daily-chart-bottom {
    font-size: 11px;
  }

  .daily-chart-bottom span:nth-child(2) {
    display: none;
  }

  .daily-chart-legend {
    gap: 8px;
  }
}

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

@keyframes loading-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading-bars {
  0%,
  100% {
    height: 6px;
    opacity: 0.45;
  }
  50% {
    height: 22px;
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .modal {
    display: block;
    overflow: hidden;
  }

  .modal.hidden {
    display: none;
  }

  .report-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    margin: 0;
    border-radius: 0;
  }

  .report-tabs {
    top: 0;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--report-line);
    overflow-x: auto;
    background: var(--report-paper);
  }

  .report-tab-btn {
    font-size: 14px;
  }

  .report-title-line h3 {
    font-size: 36px;
  }
}

/* Report room tab refinements: remove leftover dark-panel styling inside each tab */
.report-modal .report-title-line h3,
.report-modal .section-title,
.report-modal .risk-card h4 {
  letter-spacing: 0;
}

.report-modal .section-title {
  margin-bottom: 16px;
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1.16;
}

.report-modal .section-title .material-symbols-outlined {
  color: var(--report-accent);
  font-size: 20px;
}

.report-modal .report-tab-btn::after {
  content: "보기";
}

.report-modal .report-tab-btn[data-tab="strategy"]::after {
  content: "요약";
}

.report-modal .report-tab-btn.active::after {
  content: "현재";
  color: var(--report-accent);
  font-weight: 700;
}

@media (min-width: 1181px) {
  .report-modal .report-body {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  }
}

.report-modal .summary-card.dark-card {
  border-color: var(--report-line);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(245, 236, 224, 0.96));
  box-shadow: none;
  color: var(--report-ink);
}

.report-modal .summary-card.dark-card span {
  color: var(--report-muted);
}

.report-modal .summary-card.dark-card p {
  color: var(--report-ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.72;
}

.report-modal .summary-card:not(.dark-card) p {
  font-size: 15px;
  line-height: 1.66;
  overflow-wrap: anywhere;
  word-break: normal;
}

.report-modal #summaryText::first-letter {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.report-modal .risk-card h4 {
  margin-bottom: 16px;
  font-size: clamp(24px, 2vw, 31px);
  line-height: 1.2;
}

.report-modal .risk-card h4 .material-symbols-outlined {
  font-size: 20px;
}

.report-modal .report-side {
  gap: 18px;
}

.report-modal .data-grid {
  background: transparent;
}

.report-modal .data-card {
  background: rgba(255, 250, 242, 0.76);
}

.report-modal .data-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(19px, 1.7vw, 25px);
  line-height: 1.18;
}

.report-modal .strategy-card,
.report-modal .summary-card,
.report-modal .risk-card,
.report-modal .data-card,
.report-modal .inv-daily-chart-wrap,
.report-modal .inv-deep-item,
.report-modal .news-item,
.report-modal .chart-canvas {
  background-color: var(--report-panel);
}

.report-modal .insight-list {
  padding-left: 0;
  list-style: none;
}

.report-modal .insight-list li {
  padding: 12px 14px;
  border: 1px solid var(--report-line);
  background: #f8f3ea;
  color: #3f362f;
}

.report-modal .investor-data-card small {
  color: var(--report-muted);
}

.report-modal .inv-value.positive,
.report-modal .investor-tone.positive,
.report-modal .inv-chart-val.foreign {
  color: var(--report-good);
}

.report-modal .inv-value.neutral,
.report-modal .investor-tone.neutral {
  color: #665b52;
}

.report-modal .inv-value.caution,
.report-modal .investor-tone.caution {
  color: var(--report-bad);
}

.report-modal .investor-signal,
.report-modal .inv-streak,
.report-modal .news-tag {
  border: 1px solid currentColor;
  background: transparent;
  font-weight: 700;
}

.report-modal .investor-signal.positive,
.report-modal .inv-streak.positive {
  background: #e6f1e9;
  color: var(--report-good);
}

.report-modal .investor-signal.neutral,
.report-modal .inv-streak.neutral {
  background: #eee7dc;
  color: #665b52;
}

.report-modal .investor-signal.caution,
.report-modal .inv-streak.caution {
  background: #f6e1dc;
  color: var(--report-bad);
}

.report-modal .inv-score-bar {
  border: 1px solid var(--report-line);
  background: #eadfce;
}

.report-modal .inv-score-fill.positive {
  background: linear-gradient(90deg, #94c7aa, var(--report-good));
}

.report-modal .inv-score-fill.neutral {
  background: linear-gradient(90deg, #d2c3af, #8f8174);
}

.report-modal .inv-score-fill.caution {
  background: linear-gradient(90deg, #e3a09e, var(--report-bad));
}

.report-modal .inv-score-label {
  color: var(--report-ink);
}

.report-modal .inv-daily-chart-wrap {
  background: var(--report-panel);
}

.report-modal .inv-chart-area {
  padding: 12px 0 6px;
  border-bottom: 1px solid var(--report-line);
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 40px,
    rgba(221, 210, 194, 0.55) 41px
  );
}

.report-modal .inv-legend-dot.foreign,
.report-modal .inv-bar {
  background: #315e8f;
}

.report-modal .inv-legend-dot.inst,
.report-modal .inv-bar.inst,
.report-modal .inv-bar.inst.up {
  background: #b87937;
}

.report-modal .inv-legend-dot.up-label {
  background: var(--report-good);
}

.report-modal .inv-legend-dot.down-label,
.report-modal .inv-bar.down,
.report-modal .inv-bar.inst.down {
  background: var(--report-bad);
}

.report-modal .inv-chart-val.inst {
  color: #9d612e;
}

.report-modal .inv-no-data {
  color: var(--report-muted);
}

.report-modal .inv-deep-item {
  background: var(--report-panel);
}

.report-modal .inv-deep-item.positive {
  border-left-color: var(--report-good);
}

.report-modal .inv-deep-item.neutral {
  border-left-color: #9f8b5f;
}

.report-modal .inv-deep-item.caution {
  border-left-color: var(--report-bad);
}

.report-modal .inv-deep-item.positive .inv-deep-icon {
  color: var(--report-good);
}

.report-modal .inv-deep-item.neutral .inv-deep-icon {
  color: #9f8b5f;
}

.report-modal .inv-deep-item.caution .inv-deep-icon {
  color: var(--report-bad);
}

.report-modal .news-item header {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--report-line);
}

.report-modal .news-tag {
  background: #f3e2d7;
  color: var(--report-accent);
}

.report-modal .news-link {
  color: var(--report-ink);
}

.report-modal .news-link:hover,
.report-modal .news-link-sub:hover {
  color: var(--report-accent);
}

.report-modal .news-link-sub {
  color: #9b573d;
  font-weight: 700;
}

.report-modal .chart-canvas {
  padding: 20px;
  background: var(--report-panel);
}

.report-modal .daily-chart-top {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--report-line);
}

.report-modal .daily-chart-svg-wrap {
  height: 390px;
  border: 1px solid var(--report-line);
  background: var(--report-panel);
}

.report-modal .daily-chart-svg {
  background: var(--report-panel);
}

.report-modal .legend-item .dot.ma5 {
  background: #2f927b;
}

.report-modal .legend-item .dot.ma20 {
  background: #c4753e;
}

.report-modal .legend-item .dot.ma60 {
  background: #9f8b5f;
}

.report-modal .legend-item .dot.trend {
  background: #6b8db7;
}

.report-modal #chartStats {
  display: grid;
  gap: 9px;
  margin: 0;
}

.report-modal #chartStats span {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(221, 210, 194, 0.75);
}

.report-modal #chartStats span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.report-modal #chartStats em {
  color: var(--report-muted);
  font-style: normal;
  font-size: 12px;
}

.report-modal #chartStats strong {
  color: var(--report-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.report-modal .trend-current-marker.bullish .trend-current-text {
  border: 1px solid #b8d8c6;
  background: #e6f1e9;
  color: var(--report-good);
}

.report-modal .trend-current-marker.bearish .trend-current-text {
  border: 1px solid #ddb6ae;
  background: #f6e1dc;
  color: var(--report-bad);
}

.report-modal .trend-current-marker.bullish .trend-current-dot {
  background: var(--report-good);
}

.report-modal .trend-current-marker.bearish .trend-current-dot {
  background: var(--report-bad);
}

@media (max-width: 1080px) {
  .report-modal .daily-chart-svg-wrap {
    height: 330px;
  }
}

@media (max-width: 760px) {
  .report-modal .section-title {
    font-size: 22px;
  }

  .report-modal .summary-card.dark-card p {
    font-size: 15px;
  }

  .report-modal #chartStats span {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .report-modal #chartStats strong {
    font-size: 17px;
  }
}
