/* =========================================================================
   StockForum /analysis — B "데이터 워크벤치" scoped styles
   Loaded AFTER legacy styles.css. Every rule is scoped under .analysis-workbench
   (root class of the analysis page). Shares the parent theme contract vars
   (--wb-*) from workbench.css; each use carries a fallback so this file is
   safe standalone. Flat thin rules, compact workbench, serif title / tabular
   data contrast. No layout behavior for other pages.
   ========================================================================= */

/* ----- root ---------------------------------------------------------------- */
.analysis-workbench {
  background: var(--wb-bg, #fff);
  color: var(--wb-text, #202b33);
  font-family: "Noto Sans CJK KR", "Apple SD Gothic Neo", sans-serif;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 42px;
  min-width: 0;
}

/* ----- identity header (real snapshot, upfront) ---------------------------- */
.analysis-workbench .wb-identity {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--wb-text, #202b33);
  min-width: 0;
}
.analysis-workbench .wb-identity-name { min-width: 0; }
.analysis-workbench .wb-title {
  margin: 0 0 2px;
  font-family: var(--wb-serif, "Noto Serif KR", "Noto Serif CJK KR", Georgia, serif);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}
.analysis-workbench .wb-ticker-line {
  margin: 0;
  font-size: 12px;
  color: var(--wb-muted, #6c7b85);
}
.analysis-workbench .wb-ticker-code {
  font-family: Arial, "Noto Sans CJK KR", sans-serif;
  font-variant-numeric: tabular-nums;
}
.analysis-workbench .wb-asof { color: var(--wb-muted, #6c7b85); }
.analysis-workbench .wb-quote {
  text-align: right;
  min-width: 0;
}
.analysis-workbench .wb-quote-num {
  display: inline-block;
  font-family: Arial, "Noto Sans CJK KR", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -1px;
}
.analysis-workbench .wb-quote-change { margin-left: 12px; font-size: 14px; }
.analysis-workbench .wb-quote-change.up { color: #168161; }
.analysis-workbench .wb-quote-change.down { color: #b53f42; }
.analysis-workbench .wb-quote-placeholder {
  font-size: 13px;
  color: var(--wb-muted, #6c7b85);
}
.analysis-workbench .wb-kr-note {
  flex-basis: 100%;
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--wb-muted, #6c7b85);
}

/* ----- top-level quiet links ------------------------------------------------ */
.analysis-workbench .wb-toplevel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 0 0;
  font-size: 12px;
}
.analysis-workbench .wb-toplevel a {
  color: var(--wb-accent, #33545f);
  text-decoration: none;
}
.analysis-workbench .wb-toplevel a:hover { text-decoration: underline; }

/* ----- setup bar (compact real inputs) -------------------------------------- */
.analysis-workbench .wb-setup {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--wb-line, #dbe1e5);
  min-width: 0;
}
.analysis-workbench .wb-setup-inputs {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.analysis-workbench .wb-setup-inputs > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--wb-muted, #6c7b85);
}
.analysis-workbench .wb-setup-inputs input {
  border: 1px solid var(--wb-line, #dbe1e5);
  border-radius: 3px;
  padding: 8px 10px;
  background: var(--wb-bg, #fff);
  color: var(--wb-text, #202b33);
  font: inherit;
  min-width: 0;
}
.analysis-workbench .wb-setup-inputs input:focus {
  outline: 2px solid var(--wb-accent, #33545f);
  outline-offset: 1px;
}

.analysis-workbench .wb-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.analysis-workbench .wb-actions > button {
  border: 1px solid var(--wb-text, #202b33);
  background: var(--wb-text, #202b33);
  color: var(--wb-bg, #fff);
  border-radius: 3px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}
.analysis-workbench .wb-actions > button:hover { background: #101315; }
.analysis-workbench .wb-actions > button:disabled {
  color: var(--wb-muted, #6c7b85);
  background: transparent;
  border-color: var(--wb-line, #dbe1e5);
  cursor: not-allowed;
}
.analysis-workbench .wb-compare-hint {
  font-size: 11px;
  color: var(--wb-accent, #33545f);
}

/* ONE range selector — flat text chips, active = serif-weight underline */
.analysis-workbench .wb-range {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.analysis-workbench .wb-range-label {
  font-size: 11px;
  color: var(--wb-muted, #6c7b85);
}
.analysis-workbench .wb-range .range-shortcuts {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.analysis-workbench .wb-range .range-shortcut-button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--wb-muted, #6c7b85);
  font-size: 12px;
  padding: 7px 9px;
  cursor: pointer;
}
.analysis-workbench .wb-range .range-shortcut-button:hover {
  color: var(--wb-text, #202b33);
  background: var(--wb-soft, #f7f9fa);
}
.analysis-workbench .wb-range .range-shortcut-button.active {
  font-weight: 700;
  color: var(--wb-text, #202b33);
  border-bottom: 2px solid var(--wb-text, #202b33);
}

/* ----- two-column workspace: main chart first, quiet facts sidebar ---------- */
.analysis-workbench .wb-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 32px;
  align-items: start;
  margin-top: 18px;
  min-width: 0;
}
.analysis-workbench .wb-main { min-width: 0; }

/* chart toolbar keeps legacy behavior, flattened */
.analysis-workbench .chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 10px;
}
.analysis-workbench .chart-secondary-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.analysis-workbench .chart-mode-toggle { display: flex; gap: 2px; }
.analysis-workbench .chart-mode-button {
  border: 1px solid var(--wb-line, #dbe1e5);
  background: var(--wb-bg, #fff);
  color: var(--wb-muted, #6c7b85);
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.analysis-workbench .chart-mode-button.active {
  color: var(--wb-text, #202b33);
  border-color: var(--wb-text, #202b33);
  font-weight: 700;
}
.analysis-workbench .chart-mode-button:disabled { color: var(--wb-muted, #6c7b85); opacity: 0.55; cursor: not-allowed; }

/* collapsed indicator disclosure — flat band above the chart */
.analysis-workbench .analysis-indicator-panel {
  border-top: 1px solid var(--wb-line, #dbe1e5);
  border-bottom: 1px solid var(--wb-line, #dbe1e5);
  margin: 4px 0 12px;
  padding: 8px 0;
  font-size: 12px;
}
.analysis-workbench .analysis-indicator-panel summary {
  cursor: pointer;
  color: var(--wb-muted, #6c7b85);
  display: flex;
  gap: 8px;
  align-items: center;
}
.analysis-workbench .analysis-indicator-panel .indicator-chip-group {
  display: flex;
  flex-wrap: wrap;
  overflow-x: visible;
  gap: 7px;
  padding-top: 10px;
}
.analysis-workbench .analysis-indicator-panel .indicator-chip {
  border: 1px solid var(--wb-line, #dbe1e5);
  background: var(--wb-bg, #fff);
  color: var(--wb-text, #202b33);
  font-size: 11px;
  border-radius: 3px;
  padding: 5px 9px;
  cursor: pointer;
}
.analysis-workbench .analysis-indicator-panel .indicator-chip.active {
  background: var(--wb-text, #202b33);
  color: var(--wb-bg, #fff);
  border-color: var(--wb-text, #202b33);
}

/* the chart itself leads the results column */
.analysis-workbench .chart-wrapper { min-width: 0; }
.analysis-workbench .analysis-empty-state {
  border: 1px solid var(--wb-line, #dbe1e5);
  border-radius: 3px;
}

/* stat strip: selected-period performance, directly under the chart */
.analysis-workbench .analysis-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--wb-line, #dbe1e5);
  border-bottom: 1px solid var(--wb-line, #dbe1e5);
  margin: 18px 0 14px;
  padding: 13px 0;
}
.analysis-workbench .analysis-summary-item {
  padding: 0 16px;
  border-left: 1px solid var(--wb-line, #dbe1e5);
  min-width: 0;
}
.analysis-workbench .analysis-summary-item:first-child { padding-left: 0; border-left: 0; }
.analysis-workbench .analysis-summary-item span {
  display: block;
  font-size: 11px;
  color: var(--wb-muted, #6c7b85);
  margin-bottom: 4px;
}
.analysis-workbench .analysis-summary-item strong {
  font-family: Arial, "Noto Sans CJK KR", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.5px;
}

/* detailed module cards — flat, separated by thin rules, full data preserved */
.analysis-workbench .analysis-module-card {
  border: 0;
  border-top: 1px solid var(--wb-line, #dbe1e5);
  border-radius: 0;
  margin: 0;
  padding: 16px 0;
  background: transparent;
}
.analysis-workbench .analysis-module-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}
.analysis-workbench .analysis-module-status { font-size: 12px; color: var(--wb-muted, #6c7b85); }
.analysis-workbench .analysis-module-status.is-error { color: #b53f42; }

/* tables: tabular numerals, thin row rules, internal scroll allowed */
.analysis-workbench .table-container,
.analysis-workbench .metrics-table-wrap,
.analysis-workbench .benchmark-table,
.analysis-workbench .per-band-table {
  min-width: 0;
}
.analysis-workbench .table-container { overflow-x: auto; }
.analysis-workbench .metrics-table-wrap { overflow-x: auto; }
.analysis-workbench .metrics-panel,
.analysis-workbench .metrics-panel-header { min-width: 0; }
.analysis-workbench .metrics-panel-header p { font-size: 12px; color: var(--wb-muted, #6c7b85); }

/* quiet facts sidebar — editorial index style (sans font, hairline hierarchy) */
.analysis-workbench .wb-side {
  border-left: 1px solid var(--wb-line, #dbe1e5);
  padding-left: 24px;
  min-width: 0;
}
.analysis-workbench .wb-facts-section { margin: 0 0 28px; }
.analysis-workbench .wb-facts-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.analysis-workbench .wb-facts-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--wb-line, #dbe1e5);
}
.analysis-workbench .wb-facts-empty { font-size: 12px; color: var(--wb-muted, #6c7b85); }
.analysis-workbench .wb-side .etf-compose-toggle {
  border: 0;
  background: none;
  padding: 0 0 2px;
  color: var(--wb-text, #202b33);
  font-weight: 700;
  border-bottom: 1px solid var(--wb-text, #202b33);
  border-radius: 0;
}
/* ETF 구성종목: 표 → 시안 C 넘버링 리스트 구성 (순위·종목명·비중만) */
.analysis-workbench .wb-side .etf-compose-table thead { display: none; }
.analysis-workbench .wb-side .etf-compose-table,
.analysis-workbench .wb-side .etf-compose-table tbody,
.analysis-workbench .wb-side .etf-compose-table tr,
.analysis-workbench .wb-side .etf-compose-table td {
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  width: auto;
}
.analysis-workbench .wb-side .etf-compose-table { width: 100%; }
.analysis-workbench .wb-side .etf-compose-table tbody { counter-reset: etfrank; }
.analysis-workbench .wb-side .etf-compose-table tr {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #e8edf0;
}
.analysis-workbench .wb-side .etf-compose-table tr:last-child { border-bottom: 0; }
.analysis-workbench .wb-side .etf-compose-table td.etf-compose-num:first-child {
  flex: none;
  width: 20px;
  font-size: 0;
}
.analysis-workbench .wb-side .etf-compose-table td.etf-compose-num:first-child::before {
  counter-increment: etfrank;
  content: counter(etfrank, decimal-leading-zero);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #a5b3be;
}
.analysis-workbench .wb-side .etf-compose-table td:nth-child(4),
.analysis-workbench .wb-side .etf-compose-table td:nth-child(5) { display: none; }
.analysis-workbench .wb-side .etf-compose-table td.etf-compose-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--wb-text, #202b33);
}
.analysis-workbench .wb-side .etf-compose-table td.etf-compose-num:not(:first-child) {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--wb-text, #202b33);
  font-family: Arial, "Noto Sans CJK KR", sans-serif;
  font-variant-numeric: tabular-nums;
}
.analysis-workbench .wb-side .etf-compose-note { font-size: 11px; color: var(--wb-muted, #6c7b85); }
/* 공시 이력: 시안 C 구성 — 장식 아이콘 숨김, 날짜+라벨 행 */
.analysis-workbench .wb-side .event-icon { display: none; }
/* 팔로우 링크: 화살표 (팔로우 중 상태 제외) */
.analysis-workbench .wb-side .analysis-top-actions .follow-ticker-button:not(.active)::after {
  content: " →";
}

/* legacy snapshot-header blocks restyled inside the sidebar (data untouched) */
.analysis-workbench .wb-side .snapshot-header {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 12px;
  box-shadow: none;
}
.analysis-workbench .wb-side .snapshot-price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.analysis-workbench .wb-side .snapshot-last-close {
  font-family: Arial, "Noto Sans CJK KR", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.analysis-workbench .wb-side .snapshot-day-change { font-size: 13px; }
.analysis-workbench .wb-side .snapshot-day-change.up { color: #168161; }
.analysis-workbench .wb-side .snapshot-day-change.down { color: #b53f42; }
.analysis-workbench .wb-side .snapshot-asof {
  display: block;
  width: 100%;
  font-size: 11px;
  color: var(--wb-muted, #6c7b85);
}
.analysis-workbench .wb-side .snapshot-range-block {
  display: block;
  margin: 8px 0 0;
}
.analysis-workbench .wb-side .snapshot-range-block > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  border-bottom: 1px solid #e8edf0;
  padding: 8px 0;
}
.analysis-workbench .wb-side .snapshot-range-block dt { color: var(--wb-muted, #6c7b85); font-weight: 400; }
.analysis-workbench .wb-side .snapshot-range-block dd {
  margin: 0;
  font-family: Arial, "Noto Sans CJK KR", sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
}
.analysis-workbench .wb-side .price-basis-note { font-size: 11px; color: var(--wb-muted, #6c7b85); }

.analysis-workbench .wb-side .analysis-top-actions { margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.analysis-workbench .wb-side .analysis-top-actions .ghost-button {
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0 0 2px;
  border-radius: 0;
  color: var(--wb-text, #202b33);
  font-weight: 700;
  border-bottom: 1px solid var(--wb-text, #202b33);
}
.analysis-workbench .wb-side .analysis-top-actions .ghost-button:hover {
  background: none;
  color: var(--wb-accent, #33545f);
  border-bottom-color: var(--wb-accent, #33545f);
}
.analysis-workbench .wb-side .analysis-top-actions .ghost-button.active { color: var(--wb-accent, #33545f); border-bottom-color: var(--wb-accent, #33545f); }

/* events list inside sidebar — compact disclosure rows */
.analysis-workbench .wb-side .analysis-module-card { padding: 12px 0; }
.analysis-workbench .wb-side .events-wrap { min-width: 0; }
.analysis-workbench .wb-side .events-list { list-style: none; margin: 0; padding: 0; }
.analysis-workbench .wb-side .event-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  border-bottom: 0;
  padding: 7px 0;
  flex-wrap: wrap;
}
.analysis-workbench .wb-side .event-row:not(:last-child) {
  border-bottom: 1px solid #e8edf0;
}
.analysis-workbench .wb-side .event-date {
  font-family: Arial, "Noto Sans CJK KR", sans-serif;
  font-variant-numeric: tabular-nums;
  color: #a5b3be;
  white-space: nowrap;
}
.analysis-workbench .wb-side .event-label { min-width: 0; overflow-wrap: anywhere; color: var(--wb-text, #202b33); font-weight: 500; }
.analysis-workbench .wb-side .event-desc { color: var(--wb-muted, #6c7b85); }
.analysis-workbench .wb-side .event-link { color: var(--wb-accent, #33545f); }
.analysis-workbench .wb-side .events-source-note { font-size: 11px; color: var(--wb-muted, #6c7b85); }

/* generic flat notes */
.analysis-workbench .analysis-basis-note { font-size: 11px; color: var(--wb-muted, #6c7b85); line-height: 1.7; }
.analysis-workbench .indicator-disclaimer { font-size: 11px; color: var(--wb-muted, #6c7b85); }

/* comparison flow keeps its own column width (sidebar stays quiet) */
.analysis-workbench .compare-ticker-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.analysis-workbench .compare-ticker-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}
.analysis-workbench .compare-ticker-row > :first-child { flex: 1 1 240px; min-width: 0; }

/* ----- dark mode (html.dark overrides from shared contract) ----------------- */
html.dark .analysis-workbench {
  background: var(--wb-bg, #14181b);
  color: var(--wb-text, #e7ebec);
}
html.dark .analysis-workbench .wb-identity { border-bottom-color: var(--wb-text, #e7ebec); }
html.dark .analysis-workbench .wb-actions > button { background: var(--wb-text, #e7ebec); color: var(--wb-bg, #14181b); border-color: var(--wb-text, #e7ebec); }
html.dark .analysis-workbench .wb-actions > button:hover { background: #fff; }
html.dark .analysis-workbench .wb-quote-change.up { color: #4cc29a; }
html.dark .analysis-workbench .wb-quote-change.down { color: #e08d90; }

/* =========================================================================
   Mobile 390px — single column, no page overflow, tables scroll internally
   ========================================================================= */
@media (max-width: 390px) {
  .analysis-workbench {
    max-width: 100%;
    padding: 14px 14px 32px;
    min-width: 0;
    overflow-x: hidden;
  }
  .analysis-workbench .wb-identity { flex-direction: column; align-items: flex-start; gap: 6px; }
  .analysis-workbench .wb-title { font-size: 25px; }
  .analysis-workbench .wb-quote { text-align: left; }
  .analysis-workbench .wb-quote-num { font-size: 25px; }
  .analysis-workbench .wb-setup-inputs { flex-direction: column; align-items: stretch; }
  .analysis-workbench .wb-setup-inputs > label { width: 100%; }
  .analysis-workbench .wb-setup-inputs input { width: 100%; }
  .analysis-workbench .wb-columns { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .analysis-workbench .wb-main { min-width: 0; }
  .analysis-workbench .wb-side,
  .analysis-workbench .wb-facts {
    border-left: 0;
    border-top: 1px solid var(--wb-line, #dbe1e5);
    padding: 16px 0 0;
    min-width: 0;
  }
  .analysis-workbench .statstrip,
  .analysis-workbench .analysis-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .analysis-workbench .analysis-summary-item { padding: 0 14px; min-width: 0; }
  .analysis-workbench .analysis-summary-item:nth-child(3) { border-left: 0; padding-left: 0; }
  .analysis-workbench .analysis-summary-item strong { font-size: 19px; }
  .analysis-workbench .table-container,
  .analysis-workbench .metrics-table-wrap { overflow-x: auto; max-width: 100%; min-width: 0; }
  .analysis-workbench .metrics-table,
  .analysis-workbench table { min-width: 0; }
  .analysis-workbench .wb-range .range-shortcuts { max-width: 100%; min-width: 0; }
  .analysis-workbench .wb-range .range-shortcut-button { min-height: 44px; min-width: 44px; }
  .analysis-workbench .wb-actions > button { min-height: 44px; }
  .analysis-workbench .compare-ticker-row { flex-wrap: wrap; }
  .analysis-workbench .compare-ticker-row > :first-child { flex: 1 1 100%; min-width: 0; }
}

/* Live integration: override legacy root/label spacing, not analytical behavior. */
.analysis-workbench { padding: 24px 0 42px; }
.analysis-workbench .wb-identity { margin-bottom: 10px; }
.analysis-workbench .wb-toplevel { padding: 0; margin: 0 0 7px; min-height: 20px; }
.analysis-workbench .wb-columns { margin-top: 12px; }
.analysis-workbench .chart-toolbar { margin: 0 0 8px; padding: 0 0 8px; min-height: 42px; }
.analysis-workbench .chart-secondary-controls label { display:flex; flex-direction:row; align-items:center; gap:8px; margin:0; line-height:1.5; }
.analysis-workbench .chart-secondary-controls select { width:auto; min-height:34px; margin:0; padding:6px 24px 6px 8px; font-size:12px; }
.analysis-workbench .chart-wrapper { margin-top:10px; padding:12px; border-radius:0; box-shadow:none; }
.analysis-workbench .wb-facts .snapshot-price-block { display:none; }
@media(min-width:1000px) {
  .analysis-workbench .wb-setup { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:10px 16px; padding:10px 0 14px; align-items:end; }
  .analysis-workbench .wb-setup-inputs { grid-column:1; flex-wrap:nowrap; }
  .analysis-workbench .wb-actions { grid-column:2; align-self:end; }
  .analysis-workbench .wb-actions > button { min-height:38px; font-size:12px; padding:8px 11px; white-space:nowrap; }
  .analysis-workbench .wb-range { grid-column:1 / -1; min-height:36px; }
  .analysis-workbench .wb-range .range-shortcut-button { min-height:32px; padding:5px 9px; }
  .analysis-workbench .wb-setup > .compare-ticker-list { grid-column:1 / -1; }
}
@media(max-width:700px) {
  .analysis-workbench { padding:18px 0 32px; }
  .analysis-workbench .wb-setup-inputs { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
  .analysis-workbench .wb-setup-inputs > :first-child { grid-column:1 / -1; }
  .analysis-workbench .wb-setup-inputs input { font-size:16px; min-height:44px; }
  .analysis-workbench .wb-identity { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; }
  .analysis-workbench .wb-identity:has(.wb-quote.is-empty) { grid-template-columns:1fr; }
  .analysis-workbench .wb-kr-note { grid-column:1 / -1; }
  .analysis-workbench .wb-quote { text-align:right; }
  .analysis-workbench .wb-quote-change { display:block; margin-left:0; }
  .analysis-workbench .wb-toplevel { display:none; }
  .analysis-workbench .wb-range { display:block; width:100%; }
  .analysis-workbench .wb-range-label { display:none; }
  .analysis-workbench .wb-range .range-shortcuts { display:flex; flex-wrap:nowrap; gap:0; width:100%; overflow-x:auto; }
  .analysis-workbench .wb-range .range-shortcut-button { flex:0 0 44px; width:44px; min-width:44px; max-width:44px; padding:5px 4px; }
  .analysis-workbench .chart-toolbar { flex-wrap:nowrap; gap:6px; }
  .analysis-workbench .chart-primary-controls { flex:0 1 auto; width:auto; min-width:0; }
  .analysis-workbench .chart-secondary-controls { flex:1 1 auto; width:auto; min-width:0; gap:6px; justify-content:flex-end; flex-wrap:nowrap; }
  .analysis-workbench .chart-mode-button { width:auto; min-width:36px; min-height:40px; padding:5px 6px; }
  .analysis-workbench .eps-toggle-button { min-height:40px; width:auto; font-size:11px; padding:5px 7px; }
  .analysis-workbench .chart-secondary-controls label { font-size:11px; gap:4px; }
  .analysis-workbench .chart-secondary-controls select { min-height:40px; padding:5px 20px 5px 6px; }
}


/* 2026-11-20: 소스·기준시각 배지(공통) — 카드 상단 '출처 · 기준' 통일 표기 */
.wb-src-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.1rem 0 0.6rem;
  padding: 0.18rem 0.62rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(248, 250, 252, 0.6);
  max-width: 100%;
}
.wb-src-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1d4ed8;
}
.wb-src-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.dark .wb-src-badge {
  border-color: rgba(148, 163, 184, 0.24);
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.5);
}
html.dark .wb-src-dot {
  background: #60a5fa;
}

/* 2026-11-20: R3 역방향 ETF 섹션 */
.reverse-etf-list { list-style: none; margin: 0.2rem 0 0; padding: 0; }
.reverse-etf-list li { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; padding: 0.42rem 0; border-bottom: 1px solid rgba(148, 163, 184, 0.18); font-size: 0.9rem; }
.reverse-etf-list li:last-child { border-bottom: 0; }
.reverse-etf-list a { color: var(--ink, #111827); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reverse-etf-list a:hover { color: var(--brand-strong, #1d4ed8); text-decoration: underline; }
.reverse-etf-weight { color: var(--muted, #64748b); font-variant-numeric: tabular-nums; white-space: nowrap; }
.reverse-etf-section .wb-facts-empty { margin-top: 0.35rem; }

/* 2026-11-23: 비교분석 ETF 구성종목 통합비교 테이블.
   규칙: 페이지 overflow 없음 — 가로 스크롤은 .etf-cmp-scroll 래퍼 안으로만,
   첫 열(종목명) sticky, 셀 숫자는 tabular-nums. 모바일 긴 ETF명은 헤더 내 줄바꿈. */
.analysis-workbench .etf-cmp-section { margin-top: 1.1rem; min-width: 0; }
.analysis-workbench .etf-cmp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin: 0.55rem 0 0; min-width: 0; }
.analysis-workbench .etf-cmp-sort { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--wb-muted, #64748b); font-weight: 700; min-width: 0; }
.analysis-workbench .etf-cmp-sort select {
  min-height: 30px; padding: 0.15rem 0.5rem; border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4); background: var(--wb-surface, #fff);
  color: var(--wb-text, #0f172a); font-size: 0.8rem; font-weight: 700; max-width: 100%;
}
.analysis-workbench .etf-cmp-meta { font-size: 0.8rem; color: var(--wb-muted, #64748b); font-weight: 700; }
.analysis-workbench .etf-cmp-status { margin: 0.6rem 0 0; color: var(--wb-muted, #64748b); font-size: 0.84rem; font-weight: 700; }
.analysis-workbench .etf-cmp-status.is-error { color: #b91c1c; }
.analysis-workbench .etf-cmp-hint { margin: 0.25rem 0 0; color: var(--wb-muted, #64748b); font-size: 0.8rem; }
.analysis-workbench .etf-cmp-retry { width: auto; min-height: 32px; padding: 0.2rem 0.9rem; margin-top: 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 800; }
.analysis-workbench .etf-cmp-more { width: auto; min-height: 32px; padding: 0.2rem 1rem; margin-top: 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 800; }
.analysis-workbench .etf-cmp-scroll { overflow-x: auto; margin-top: 0.65rem; min-width: 0; -webkit-overflow-scrolling: touch; }
.analysis-workbench .etf-cmp-table { min-width: 560px; border-collapse: collapse; width: max-content; font-size: 0.84rem; }
.analysis-workbench .etf-cmp-table th,
.analysis-workbench .etf-cmp-table td { padding: 0.42rem 0.6rem; border-bottom: 1px solid rgba(148, 163, 184, 0.22); text-align: left; vertical-align: top; }
.analysis-workbench .etf-cmp-table thead th { color: var(--wb-muted, #64748b); font-size: 0.76rem; font-weight: 800; white-space: normal; }
.analysis-workbench .etf-cmp-table th.etf-cmp-name,
.analysis-workbench .etf-cmp-table td.etf-cmp-stockname {
  position: sticky; left: 0; z-index: 1;
  background: var(--wb-surface, #fff);
  min-width: 148px; max-width: 260px;
  border-right: 1px solid rgba(148, 163, 184, 0.3);
}
.analysis-workbench .etf-cmp-table td.etf-cmp-stockname { font-weight: 700; color: var(--wb-text, #0f172a); overflow-wrap: anywhere; }
.analysis-workbench .etf-cmp-table .etf-cmp-col { min-width: 118px; max-width: 168px; }
.analysis-workbench .etf-cmp-table .etf-cmp-ename { display: block; font-weight: 800; color: var(--wb-text, #0f172a); font-size: 0.78rem; overflow-wrap: anywhere; }
.analysis-workbench .etf-cmp-table .etf-cmp-easof { display: block; font-weight: 600; font-size: 0.68rem; color: var(--wb-muted, #64748b); margin-top: 0.1rem; white-space: nowrap; }
.analysis-workbench .etf-cmp-table .etf-cmp-emiss { display: inline-block; margin-top: 0.15rem; padding: 0.06rem 0.4rem; border-radius: 999px; font-size: 0.66rem; font-weight: 800; color: #92400e; background: rgba(251, 191, 36, 0.18); border: 1px solid rgba(251, 191, 36, 0.4); white-space: nowrap; }
.analysis-workbench .etf-cmp-table .etf-cmp-count { min-width: 76px; }
.analysis-workbench .etf-cmp-table .etf-cmp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analysis-workbench .etf-cmp-table .etf-cmp-num.is-nodata { text-align: left; }
.analysis-workbench .etf-cmp-table .etf-cmp-flat { color: var(--wb-muted, #94a3b8); }
.analysis-workbench .etf-cmp-table .etf-cmp-nodata { display: inline-block; font-size: 0.68rem; font-weight: 700; color: #92400e; white-space: nowrap; }
.analysis-workbench .etf-cmp-table .etf-cmp-countcell { color: var(--wb-muted, #64748b); font-weight: 700; }
.analysis-workbench .etf-cmp-table tr.etf-cmp-cashrow td { color: var(--wb-muted, #64748b); background: rgba(148, 163, 184, 0.07); }
.analysis-workbench .etf-cmp-table tr.etf-cmp-cashrow td.etf-cmp-stockname { background: #f1f5f9; }
.analysis-workbench .etf-cmp-note { margin: 0.5rem 0 0; color: var(--wb-muted, #64748b); font-size: 0.74rem; line-height: 1.5; overflow-wrap: anywhere; }
html.dark .analysis-workbench .etf-cmp-sort select { background: rgba(15, 23, 42, 0.7); color: var(--wb-text, #e7ebec); }
html.dark .analysis-workbench .etf-cmp-table th.etf-cmp-name,
html.dark .analysis-workbench .etf-cmp-table td.etf-cmp-stockname { background: #161b22; }
html.dark .analysis-workbench .etf-cmp-table tr.etf-cmp-cashrow td.etf-cmp-stockname { background: #1d2430; }
html.dark .analysis-workbench .etf-cmp-table .etf-cmp-emiss,
html.dark .analysis-workbench .etf-cmp-table .etf-cmp-nodata { color: #fbbf24; }
html.dark .analysis-workbench .etf-cmp-status.is-error { color: #f87171; }

@media (max-width: 640px) {
  .analysis-workbench .etf-cmp-table th.etf-cmp-name,
  .analysis-workbench .etf-cmp-table td.etf-cmp-stockname { min-width: 118px; max-width: 170px; }
  .analysis-workbench .etf-cmp-table .etf-cmp-col { min-width: 104px; max-width: 150px; }
}
