:root {
  color-scheme: light;
  --green: #0bad5c;
  --green-dark: #078348;
  --green-soft: #eaf8f0;
  --ink: #101612;
  --muted: #707a73;
  --line: #e8ece9;
  --surface: #ffffff;
  --canvas: #f3f6f4;
  --positive: #e54b52;
  --negative: #317ac5;
  --shadow: 0 18px 50px rgba(20, 40, 28, .09);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}

.company-footer {
  width: min(calc(100% - 24px), 896px);
  margin: 0 auto;
  padding: 24px 32px 34px;
  border-top: 1px solid #dce3df;
  background: #edf1ef;
  color: #65716a;
  font-size: 12px;
  line-height: 1.8;
  text-align: left;
  word-break: keep-all;
}
.company-footer p { margin: 0; }
.company-footer strong { color: #3f4b45; font-weight: 750; }
.company-footer-meta { display: inline-block; white-space: nowrap; }
.company-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 3px !important;
}
.company-footer-links > * { white-space: nowrap; }
.company-footer-links > * + *::before {
  margin: 0 6px;
  color: #9aa49e;
  content: "|";
}
.company-footer-links-label { color: #4b5851; font-weight: 700; }
.company-footer-links a {
  color: #425b4d;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #a8b5ae;
  text-underline-offset: 2px;
}
.company-footer-links a:hover { color: var(--green-dark); text-decoration-color: currentColor; }
.company-footer-links + p { margin-top: 2px; }

@media (max-width: 760px) {
  .company-footer {
    width: calc(100% - 24px);
    margin-top: 0;
    padding: 20px 16px 28px;
    font-size: 11px;
    line-height: 1.75;
  }
}

* { box-sizing: border-box; }

/* 짧은 페이지에서도 스크롤바 공간을 유지해 공통 헤더의 가로 위치가 흔들리지 않게 한다. */
html { overflow-y: scroll; scrollbar-gutter: stable; }

/* hidden 속성은 .data-status 같은 display 규칙보다 항상 우선한다. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-weight: 500;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 12% -8%, rgba(11, 173, 92, .12), transparent 30rem),
    var(--canvas);
}

button { font: inherit; }

.app-shell {
  width: min(100% - 28px, 520px);
  margin: 26px auto;
  padding: 22px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(214, 223, 217, .85);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.page-panel[hidden] { display: none; }

.primary-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.tab {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #535b55;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.tab-wide { display: none; }
.tab.is-active { color: #fff; border-color: var(--green); background: var(--green); }
.tab:disabled { opacity: .72; }

.page-header { margin: 30px 2px 23px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.page-header h1 { margin: 0; font-size: clamp(25px, 7vw, 34px); letter-spacing: -.045em; }
.page-header > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }

.switcher { display: grid; gap: 0; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf8; }
.switcher.two { grid-template-columns: 1fr 1fr; }
.switch { display: grid; place-items: center; min-height: 43px; border: 0; border-radius: 9px; color: #5d665f; background: transparent; font-weight: 800; text-decoration: none; }
.switch.is-active { color: #fff; background: linear-gradient(135deg, var(--green), #08a455); box-shadow: 0 6px 15px rgba(11, 173, 92, .2); }
.switch.is-disabled { cursor: not-allowed; color: #9aa19c; }
.soon { display: inline-block; margin-left: 4px; padding: 2px 5px; border-radius: 5px; background: #ecefec; font-size: 9px; vertical-align: 1px; }

.filter-row { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.segmented { display: flex; gap: 5px; }
.segmented button {
  min-width: 72px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #667069;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: .16s ease;
}
.segmented.compact button { min-width: 45px; padding: 0 8px; }
.segmented button:hover { border-color: #b8d8c6; }
.segmented button.is-active { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 5px 12px rgba(11, 173, 92, .18); }
.supply-modes { display: grid; grid-template-columns: repeat(3, 1fr); margin: 10px 0 7px; }
.supply-modes button { width: 100%; }

.data-status { display: flex; align-items: center; gap: 7px; min-height: 28px; color: var(--muted); font-size: 11px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.flow-card { margin-top: 12px; padding: 19px 17px 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 7px 23px rgba(16, 22, 18, .035); }
.card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.card-kicker { color: #99a19b; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.card-heading h2 { margin: 3px 0 0; font-size: 16px; letter-spacing: -.025em; }
.legend { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.legend.positive { color: var(--positive); background: #fff0f1; }
.legend.negative { color: var(--negative); background: #edf5fd; }

.ranking-list { margin: 0; padding: 0; list-style: none; }
.ranking-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 62px; border-bottom: 1px solid #f0f2f0; }
.ranking-row:last-child { border-bottom: 0; }
.theme-link { cursor: pointer; border-radius: 8px; transition: background .16s ease, transform .16s ease; }
.theme-link:hover { background: #f6fbf8; transform: translateX(2px); }
.theme-link:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.etf-link { cursor: pointer; border-radius: 8px; transition: background .16s ease, transform .16s ease; }
.etf-link:hover { background: #f6fbf8; transform: translateX(2px); }
.etf-link:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.stock-link { cursor: pointer; border-radius: 8px; transition: background .16s ease, transform .16s ease; }
.stock-link:hover { background: #f6fbf8; transform: translateX(2px); }
.stock-link:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.rank { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--green); font-size: 12px; font-weight: 900; box-shadow: 0 4px 9px rgba(11, 173, 92, .18); }
.rank-copy, .rank-value { min-width: 0; }
.rank-copy strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.rank-copy small, .rank-value small { display: block; margin-top: 3px; color: #929a94; font-size: 10px; }
.rank-value { text-align: right; }
.rank-value strong { display: block; font-size: 14px; }
.ranking-row.inflow .rate { color: var(--positive); }
.ranking-row.outflow .rate { color: var(--negative); }
.empty { padding: 28px 0; color: var(--muted); text-align: center; font-size: 13px; }

.momentum-section { margin-top: 17px; }
.section-heading { margin-bottom: 10px; }
.section-heading h2 { margin: 3px 0 0; font-size: 16px; letter-spacing: -.025em; }
.theme-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-rank-card {
  min-width: 0;
  padding: 15px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 7px 23px rgba(16, 22, 18, .035);
}
.theme-rank-card .rank { width: 28px; height: 28px; }
.theme-rank-card > strong {
  display: block;
  min-height: 38px;
  margin-top: 13px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
}
.theme-rank-card small { display: block; margin-top: 7px; color: #929a94; font-size: 9px; line-height: 1.35; }
.theme-rank-card b { display: block; margin-top: 6px; font-size: 19px; letter-spacing: -.035em; }
.positive-value { color: var(--positive); }
.negative-value { color: var(--negative); }
.theme-empty { grid-column: 1 / -1; margin: 0; }
.momentum-row .rank-value strong { color: var(--positive); }
.momentum-row.outflow .rank-value strong { color: var(--negative); }
.momentum-row .rank-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supply-row { min-height: 68px; }
.supply-row .rank-value { max-width: 185px; }
.supply-row .breakdown { white-space: nowrap; }
.supply-row.inflow .amount { color: var(--positive); }
.supply-row.outflow .amount { color: var(--negative); }

.constituent-market-row { justify-content: flex-start; margin-bottom: 10px; }
.constituent-market-row .segmented button:disabled { cursor: not-allowed; opacity: .62; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.constituent-sentence-filter {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfb;
}
.constituent-query {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}
.constituent-query select {
  width: 88px;
  height: 39px;
  padding: 0 34px 0 11px;
  border: 1px solid #cfe7d9;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}
#constituent-return-period { width: 118px; min-width: 118px; }
.constituent-query-second { display: inline-flex; align-items: center; gap: 8px; }
.constituent-query-note { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.constituent-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin: 11px 0 3px; }
.constituent-toolbar > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.constituent-row .primary-value { color: var(--positive); }
.constituent-row.outflow .primary-value { color: var(--negative); }
.constituent-row .rank-value { min-width: 105px; }
.card-more {
  display: block;
  width: fit-content;
  margin: 7px auto 0;
  padding: 9px 13px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}
.card-more:hover { color: #fff; border-radius: 8px; background: var(--green); }
.card-more span { display: inline-block; margin-left: 4px; transition: transform .2s; }
.card-more[aria-expanded="true"] span { transform: rotate(90deg); }
.card-more[hidden] { display: none; }

.notice {
  margin-top: 13px;
  padding: 11px 13px;
  border: 1px solid #edf0ee;
  border-radius: 10px;
  color: #818a84;
  background: #f8f9f8;
  font-size: 10px;
  line-height: 1.55;
}
.notice p { position: relative; margin: 0; padding-left: 15px; }
.notice p::before { position: absolute; left: 0; content: "ⓘ"; color: #9ba39d; }

.all-ranking { width: 100%; min-height: 46px; margin-top: 14px; border: 1px solid var(--green); border-radius: 11px; color: var(--green-dark); background: #fff; font-weight: 900; }
.all-ranking:hover { color: #fff; background: var(--green); }
.all-ranking span { display: inline-block; margin-left: 8px; transition: transform .2s; }
.all-ranking[aria-expanded="true"] span { transform: rotate(90deg); }
.journey-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 8px 0;
  padding: 11px 16px;
  border-radius: 11px;
  color: #fff;
  background: var(--green);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.journey-cta:hover { background: var(--green-dark); box-shadow: 0 7px 16px rgba(11, 173, 92, .16); transform: translateY(-1px); }
.journey-cta:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }
.constituent-journey-cta { margin-top: 14px; }
.all-card { max-height: 520px; overflow: auto; }

footer { margin-top: 17px; padding: 13px 4px 0; border-top: 1px solid var(--line); color: #8d958f; font-size: 10px; line-height: 1.6; }
footer p { margin: 0; }

.detail-shell { max-width: 620px; }
.detail-header { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; }
.detail-header .eyebrow { margin-top: 3px; }
.detail-header h1 { margin: 0; font-size: clamp(24px, 7vw, 32px); letter-spacing: -.045em; }
.detail-header p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.back-link {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--green-dark);
  text-decoration: none;
  font-size: 25px;
  line-height: 1;
}
.back-link:hover, .back-link:focus-visible { background: var(--green-soft); outline: none; }

.detail-control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.control-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.detail-periods { width: fit-content; }
.detail-control-grid > div:last-child .detail-periods { margin-left: auto; }
.detail-periods button { flex: 0 0 58px; width: 58px; min-width: 58px; padding-inline: 5px; white-space: nowrap; }

.theme-summary-card {
  margin-top: 15px;
  padding: 10px 17px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 7px 23px rgba(16, 22, 18, .035);
}
.summary-metrics { display: grid; grid-template-columns: 1fr 1fr; }
.summary-metrics article { min-width: 0; padding: 15px 13px; text-align: center; }
.summary-metrics article + article { border-left: 1px solid var(--line); }
.summary-metrics span { display: block; color: #707a73; font-size: 11px; }
.summary-metrics strong { display: block; margin-top: 7px; font-size: clamp(24px, 7vw, 32px); letter-spacing: -.045em; }
.summary-metrics small { display: block; min-height: 15px; margin-top: 5px; color: var(--green-dark); font-size: 10px; }
.signal-pill {
  width: fit-content;
  margin: 0 auto;
  padding: 7px 22px;
  border: 1px solid #d6ede0;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 900;
}

.insight-callout {
  position: relative;
  margin-top: 13px;
  padding: 13px 15px 13px 42px;
  border: 1px solid #dcefe4;
  border-radius: 11px;
  color: #335944;
  background: #f2fbf6;
  font-size: 11px;
  line-height: 1.55;
}
.insight-callout::before {
  position: absolute;
  top: 11px;
  left: 13px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  content: "!";
  font-weight: 900;
}

.theme-table-head, .theme-etf-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(75px, .65fr) minmax(75px, .65fr);
  align-items: center;
  gap: 8px;
}
.theme-table-head { padding: 9px 0 7px; border-bottom: 1px solid var(--line); color: #929a94; font-size: 9px; }
.theme-table-head span:not(:first-child) { text-align: right; }
.theme-etf-row { min-height: 68px; border-bottom: 1px solid #f0f2f0; }
.theme-etf-row:last-child { border-bottom: 0; }
.theme-etf-row > strong { text-align: right; font-size: 13px; }
.theme-etf-identity { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; }
.theme-etf-identity strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.theme-etf-identity small { display: block; margin-top: 3px; color: #979f99; font-size: 9px; }
.muted-value { color: var(--muted); }

.supply-bar-list { padding: 6px 0 9px; }
.supply-bar-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 72px; align-items: center; gap: 10px; min-height: 45px; }
.supply-bar-row > strong { font-size: 12px; }
.supply-bar-row > b { text-align: right; font-size: 12px; }
.supply-bar-track { position: relative; height: 22px; overflow: hidden; border-radius: 4px; background: linear-gradient(90deg, #f8faf9 0 49.7%, #dfe5e1 49.7% 50.3%, #f8faf9 50.3%); }
.supply-bar-track span { position: absolute; top: 4px; width: var(--bar-size); height: 14px; border-radius: 3px; }
.supply-bar-track .is-positive { left: 50%; background: var(--positive); }
.supply-bar-track .is-negative { right: 50%; background: var(--negative); }
.theme-notice { margin-top: 13px; }

.stock-detail-header { grid-template-columns: 38px minmax(0, 1fr); }
.stock-title-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.stock-title-row h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-title-row > span { flex: 0 0 auto; color: #8c958f; font-size: 11px; font-weight: 800; }
.stock-detail-header.no-back { margin-bottom: 0; }
.stock-detail-header .data-status { min-height: 24px; margin-top: 12px; }
.context-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.context-pills span {
  padding: 5px 9px;
  border: 1px solid #dce4df;
  border-radius: 999px;
  color: #5f6962;
  background: #fff;
  font-size: 9px;
  font-weight: 800;
}
.stock-summary-card { margin-top: 12px; }
.stock-weight-card { padding-bottom: 17px; }
.weight-progress { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 13px 4px 5px; }
.weight-progress strong { font-size: clamp(22px, 6vw, 29px); letter-spacing: -.04em; }
.weight-progress span { color: var(--green); font-size: 25px; font-weight: 900; }
.stock-weight-card > p { margin: 6px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.card-description { margin: 0 0 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.stock-etf-head, .stock-etf-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(72px, .55fr) minmax(96px, .75fr);
  align-items: center;
  gap: 8px;
}
.stock-etf-head { padding: 8px 0 7px; border-bottom: 1px solid var(--line); color: #929a94; font-size: 9px; }
.stock-etf-head span:not(:first-child) { text-align: right; }
.stock-etf-row { min-height: 72px; border-bottom: 1px solid #f0f2f0; }
.stock-etf-row:last-child { border-bottom: 0; }
.stock-etf-row > strong { text-align: right; font-size: 13px; }
.stock-etf-identity { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.stock-etf-identity strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.stock-etf-identity small { display: block; margin-top: 3px; overflow: hidden; color: #8f9892; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.stock-etf-weight { text-align: right; }
.stock-etf-weight strong { display: block; font-size: 11px; white-space: nowrap; }
.stock-etf-weight small { display: block; margin-top: 3px; font-size: 9px; }
.stock-chart-card { padding-bottom: 15px; }
.chart-currency { color: var(--muted); font-size: 9px; font-weight: 900; }
.chart-legend { display: flex; justify-content: flex-end; gap: 12px; margin: -1px 0 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.chart-legend span::before { display: inline-block; width: 13px; height: 2px; margin: 0 4px 2px 0; content: ""; vertical-align: middle; }
.chart-legend .ma10::before { background: #f0a43a; }
.chart-legend .ma20::before { background: #7b65cf; }
.chart-legend .ma60::before { background: #159a73; }
.stock-chart-wrap { width: 100%; overflow: hidden; border: 1px solid #eef1ef; border-radius: 10px; background: #fbfcfb; }
#stock-chart { display: block; width: 100%; height: auto; min-height: 250px; }
.chart-grid { stroke: #e8edea; stroke-width: 1; }
.chart-axis-label { fill: #8a948d; font-size: 9px; font-weight: 700; }
.candle-up { fill: var(--positive); stroke: var(--positive); stroke-width: 1; }
.candle-down { fill: var(--negative); stroke: var(--negative); stroke-width: 1; }
.volume-up { fill: rgba(229, 75, 82, .28); }
.volume-down { fill: rgba(49, 122, 197, .28); }
.ma-line { stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ma-line.ma10 { stroke: #f0a43a; }
.ma-line.ma20 { stroke: #7b65cf; }
.ma-line.ma60 { stroke: #159a73; }
.chart-description { margin: 8px 0 0; color: var(--muted); text-align: right; font-size: 9px; }
.stock-external-link { display: grid; place-items: center; text-decoration: none; }

@media (min-width: 680px) {
  .app-shell { width: min(100% - 40px, 760px); padding: 28px; }
  .primary-tabs { grid-template-columns: repeat(4, 1fr); }
  .tab-wide { display: grid; }
  .flow-card { padding-inline: 22px; }
}

@media (max-width: 430px) {
  .app-shell { width: 100%; min-height: 100vh; margin: 0; padding: 18px 15px 24px; border: 0; border-radius: 0; }
  .filter-row { align-items: flex-start; flex-direction: column; }
  .filter-row > div { width: 100%; }
  .segmented button { flex: 1; }
  .momentum-periods button { min-width: 0; padding-inline: 4px; }
  .theme-podium { gap: 7px; }
  .theme-rank-card { padding: 13px 9px; }
  .theme-rank-card > strong { font-size: 12px; }
  .theme-rank-card b { font-size: 16px; }
  .supply-row .rank-value { max-width: 155px; }
  .supply-row .breakdown { font-size: 9px; }
  .detail-control-grid { grid-template-columns: 1fr; gap: 10px; }
  .detail-control-grid > div { min-width: 0; }
  .theme-summary-card { padding-inline: 8px; }
  .summary-metrics article { padding-inline: 7px; }
  .summary-metrics strong { font-size: 24px; }
  .signal-pill { padding-inline: 15px; }
  .theme-table-head, .theme-etf-row { grid-template-columns: minmax(0, 1.3fr) 72px 72px; gap: 5px; }
  .theme-etf-identity { grid-template-columns: 24px minmax(0, 1fr); gap: 6px; }
  .theme-etf-identity strong { font-size: 11px; }
  .supply-bar-row { grid-template-columns: 38px minmax(0, 1fr) 65px; gap: 7px; }
  .constituent-market-row { flex-direction: row; }
  .constituent-sentence-filter { padding: 14px 12px; }
  .constituent-query { gap: 7px 6px; font-size: 12px; }
  .constituent-query-second { flex-basis: 100%; gap: 6px; }
  .constituent-row .rank-value { min-width: 92px; }
  .stock-etf-head, .stock-etf-row { grid-template-columns: minmax(0, 1.25fr) 70px 88px; gap: 5px; }
  .stock-etf-identity { grid-template-columns: 24px minmax(0, 1fr); gap: 6px; }
  .stock-etf-identity strong { font-size: 11px; }
  .stock-etf-row > strong { font-size: 11px; }
  .weight-progress { gap: 12px; }
  #stock-chart { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* 2026-09 공통 UI 개편: 페이지 폭, 로고, 내비게이션, 가독성을 한 규격으로 통일 */
@font-face {
  font-family: "Pretendard Variable";
  src: url("fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #08aa59;
  --green-dark: #057a40;
  --green-soft: #eaf8f0;
  --ink: #142019;
  --muted: #68756d;
  --line: #e1e8e3;
  --surface: #ffffff;
  --canvas: #f1f6f3;
  --shadow: 0 18px 48px rgba(24, 52, 35, .08);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}

body {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -.012em;
  background:
    radial-gradient(circle at 12% -10%, rgba(8, 170, 89, .11), transparent 34rem),
    var(--canvas);
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(8, 170, 89, .28);
  outline-offset: 2px;
}

.app-shell,
.detail-shell {
  width: min(calc(100% - 32px), 1040px);
  max-width: 1040px;
  margin: 24px auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid rgba(210, 222, 214, .9);
  border-radius: 26px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
}

.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 42px);
  margin-bottom: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.brand-link {
  display: block;
  width: fit-content;
  border-radius: 12px;
}

/* logo.png의 투명 캔버스는 유지하고 실제 로고 영역만 화면에 표시한다. */
.brand-logo-frame {
  position: relative;
  display: block;
  width: 90px;
  aspect-ratio: 851 / 490;
  overflow: hidden;
}

.brand-logo-frame img {
  position: absolute;
  top: -54.7%;
  left: -10.23%;
  width: 120.57%;
  max-width: none;
  height: auto;
}

.primary-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.tab,
.tab-wide {
  display: grid;
  min-width: 0;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  white-space: normal;
}

.tab:hover { color: var(--green-dark); border-color: #9fd5b7; background: #f4fbf7; }
.tab.is-active:hover { color: #fff; border-color: var(--green); background: var(--green); }

.page-header { margin: 0 2px 26px; }
.page-header h1 {
  font-size: clamp(28px, 4.2vw, 36px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.eyebrow { margin-bottom: 7px; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.page-header > p:last-child { margin-top: 10px; font-size: 15px; line-height: 1.6; }

.switcher { padding: 4px; border-radius: 14px; }
.switch { min-height: 46px; border-radius: 10px; font-size: 14px; font-weight: 650; }
.soon { font-size: 12px; }

.filter-row { align-items: center; margin: 20px 0 14px; }
.segmented { gap: 7px; }
.segmented button {
  min-width: 82px;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
}
.segmented.compact button { min-width: 54px; padding-inline: 11px; }
.supply-modes { margin-top: 12px; }

.data-status { min-height: 34px; gap: 9px; font-size: 13px; }
.pulse { width: 8px; height: 8px; }

.flow-card,
.theme-summary-card {
  margin-top: 16px;
  padding: 23px 24px 12px;
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(16, 32, 22, .04);
}
.theme-summary-card { padding-bottom: 18px; }
.card-heading { margin-bottom: 10px; }
.card-kicker { font-size: 12px; font-weight: 650; letter-spacing: .1em; }
.card-heading h2, .section-heading h2 { font-size: 20px; font-weight: 720; line-height: 1.3; }
.legend { flex: 0 0 auto; padding: 5px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }

.ranking-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; min-height: 72px; }
.rank { width: 28px; height: 28px; font-size: 13px; font-weight: 700; }
.rank-copy strong, .rank-value strong { font-size: 15px; line-height: 1.35; }
.rank-copy small, .rank-value small { margin-top: 4px; font-size: 12px; line-height: 1.4; }
.empty { padding: 34px 0; font-size: 14px; }

.momentum-section { margin-top: 22px; }
.theme-podium { gap: 14px; }
.theme-rank-card { padding: 20px 18px 18px; border-radius: 16px; }
.theme-rank-card > strong { min-height: 44px; margin-top: 15px; font-size: 15px; }
.theme-rank-card small { margin-top: 8px; font-size: 12px; }
.theme-rank-card b { font-size: 23px; }

.constituent-sentence-filter { margin-top: 16px; padding: 20px; border-radius: 16px; }
.constituent-query { gap: 10px; font-size: 15px; font-weight: 600; }
.constituent-query select { width: 96px; height: 44px; font-size: 14px; font-weight: 600; }
#constituent-return-period { width: 132px; min-width: 132px; }
.constituent-query-note { margin-top: 12px; font-size: 13px; }
.constituent-toolbar { margin-top: 14px; }
.constituent-toolbar > span { font-size: 13px; font-weight: 600; }
.constituent-row .rank-value { min-width: 128px; }
.card-more { padding: 11px 16px; font-size: 13px; font-weight: 700; }

.notice { margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 13px; }
.all-ranking { min-height: 50px; margin-top: 16px; border-radius: 12px; font-size: 14px; font-weight: 700; }
footer { margin-top: 22px; padding-top: 16px; font-size: 12px; }

.detail-header {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}
.detail-header h1 { font-size: clamp(27px, 4vw, 35px); font-weight: 750; line-height: 1.2; }
.detail-header p:last-child { margin-top: 8px; font-size: 15px; }
.back-link { width: 40px; height: 40px; font-size: 28px; }

.detail-control-grid { gap: 24px; margin-top: 20px; }
.control-label { margin-bottom: 9px; font-size: 13px; font-weight: 650; }
.detail-periods button { flex-basis: 64px; width: 64px; min-width: 64px; }

.summary-metrics article { padding: 19px 16px; }
.summary-metrics span { font-size: 14px; }
.summary-metrics strong { margin-top: 8px; font-size: clamp(28px, 5vw, 36px); }
.summary-metrics small { margin-top: 6px; font-size: 12px; }
.signal-pill { padding: 8px 22px; font-size: 13px; font-weight: 650; }
.insight-callout { padding: 15px 18px 15px 47px; border-radius: 12px; font-size: 14px; }
.insight-callout::before { top: 14px; left: 15px; font-weight: 700; }

.theme-table-head, .stock-etf-head { font-size: 12px; }
.theme-etf-row { min-height: 76px; }
.theme-etf-row > strong, .stock-etf-row > strong { font-size: 14px; }
.theme-etf-identity strong, .stock-etf-identity strong { font-size: 14px; }
.theme-etf-identity small, .stock-etf-identity small { font-size: 12px; }
.supply-bar-row { grid-template-columns: 54px minmax(0, 1fr) 92px; min-height: 52px; }
.supply-bar-row > strong, .supply-bar-row > b { font-size: 14px; }

.stock-title-row > span { font-size: 13px; font-weight: 600; }
.context-pills span { padding: 6px 10px; font-size: 12px; font-weight: 600; }
.weight-progress strong { font-size: clamp(25px, 5vw, 32px); }
.stock-weight-card > p, .card-description { font-size: 13px; }
.stock-etf-row { min-height: 78px; }
.stock-etf-weight strong { font-size: 13px; }
.stock-etf-weight small { font-size: 12px; }
.chart-currency, .chart-legend, .chart-description { font-size: 12px; }
.chart-axis-label { font-size: 11px; }

@media (max-width: 760px) {
  .app-shell,
  .detail-shell { width: min(calc(100% - 24px), 680px); margin: 12px auto; padding: 24px; border-radius: 22px; }
  .site-header { grid-template-columns: 1fr; gap: 16px; margin-bottom: 28px; padding-bottom: 22px; }
  .brand-logo-frame { width: 78px; }
  .primary-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tab { min-height: 44px; }
  .theme-podium { gap: 10px; }
  .flow-card, .theme-summary-card { padding-inline: 20px; }
}

@media (max-width: 560px) {
  .page-header h1, .detail-header h1 { font-size: 27px; }
  .page-header > p:last-child, .detail-header p:last-child { font-size: 14px; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .filter-row > div { width: 100%; }
  .segmented button { flex: 1 1 0; min-width: 0; }
  .detail-control-grid { grid-template-columns: 1fr; gap: 14px; }
  .detail-control-grid > div:last-child .detail-periods { margin-left: auto; }
  .theme-podium { grid-template-columns: 1fr; }
  .theme-rank-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; }
  .theme-rank-card > strong { min-height: 0; margin: 0; }
  .theme-rank-card small { margin: 0; }
  .theme-rank-card b { margin: 0; font-size: 20px; }
  .summary-metrics article { padding-inline: 9px; }
  .summary-metrics span { font-size: 13px; }
  .signal-pill { max-width: 100%; text-align: center; }
  .constituent-query-second { flex-basis: 100%; }
}

@media (max-width: 430px) {
  .app-shell,
  .detail-shell { width: 100%; min-height: 100vh; margin: 0; padding: 18px 16px 28px; border: 0; border-radius: 0; }
  .site-header { margin-bottom: 24px; padding-bottom: 18px; }
  .brand-logo-frame { width: 74px; }
  .tab { padding-inline: 7px; font-size: 13px; }
  .flow-card, .theme-summary-card { padding: 19px 15px 10px; }
  .card-heading h2, .section-heading h2 { font-size: 18px; }
  .ranking-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; }
  .rank-copy strong, .rank-value strong { font-size: 14px; }
  .rank-copy small, .rank-value small { font-size: 12px; }
  .detail-periods button { flex-basis: 62px; width: 62px; min-width: 62px; }
  .theme-table-head, .theme-etf-row { grid-template-columns: minmax(0, 1.25fr) 76px 76px; }
  .stock-etf-head, .stock-etf-row { grid-template-columns: minmax(0, 1.15fr) 78px 94px; }
  .supply-bar-row { grid-template-columns: 45px minmax(0, 1fr) 77px; }
  .constituent-row .rank-value { min-width: 108px; }
}

/* 네 개 피너츠 참고 화면의 표현 체계에 맞춘 최종 정렬 */
:root {
  --green: #009b59;
  --green-dark: #007944;
  --green-soft: #eaf8f1;
  --ink: #111713;
  --muted: #66736b;
  --line: #dce4df;
  --canvas: #ffffff;
  --positive: #ef4450;
  --negative: #2878ce;
}

body { font-size: 15px; font-weight: 430; background: #fff; }

.app-shell,
.detail-shell {
  width: min(100%, 920px);
  max-width: 920px;
  margin: 0 auto;
  padding: 0 12px 40px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.site-header {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  margin: 0 16px;
  padding: 24px 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand-logo-frame { width: 84px; }
.primary-tabs { gap: 5px; }
.tab,
.tab-wide {
  min-height: 44px;
  padding: 8px 12px;
  border-color: transparent;
  border-radius: 999px;
  color: #536158;
  background: transparent;
  font-size: 14px;
  font-weight: 570;
}
.tab:hover { border-color: transparent; background: #f1f5f3; }
.tab.is-active { border-color: var(--green); background: var(--green); font-weight: 680; }

.page-panel {
  margin-top: 0;
  padding: 32px;
  border-bottom: 0;
  background: #f5f8f6;
}
.page-header { margin: 0 0 24px; }
.page-header h1 { font-size: clamp(28px, 4vw, 32px); font-weight: 680; line-height: 1.28; }
.page-header > p:last-child { color: #6e7972; font-size: 14px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 620; letter-spacing: .04em; }

.switcher { border: 0; border-radius: 14px; background: #edf2ef; }
.switch { color: #667269; font-weight: 600; }
.switch.is-active { background: var(--green); box-shadow: none; }
.switch small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; opacity: .72; }
#constituent-pool-filter .constituent-pool-option { position: relative; min-width: 0; }
#constituent-pool-filter .switch { width: 100%; min-height: 64px; padding-right: 38px; padding-left: 38px; }
.pool-help-trigger {
  position: absolute;
  z-index: 2;
  top: 43px;
  left: calc(50% + 34px);
  display: grid;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  border: 1px solid #a7b2ab;
  border-radius: 50%;
  color: #68756d;
  background: rgba(255, 255, 255, .78);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}
.pool-help-trigger:hover,
.pool-help-trigger:focus-visible {
  border-color: var(--green-dark);
  color: var(--green-dark);
  background: #fff;
  outline: none;
}
.constituent-pool-option:has(.switch.is-active) .pool-help-trigger {
  border-color: rgba(255, 255, 255, .82);
  color: #fff;
  background: rgba(0, 91, 50, .2);
}
.constituent-pool-option:has(.switch.is-active) .pool-help-trigger:hover,
.constituent-pool-option:has(.switch.is-active) .pool-help-trigger:focus-visible {
  background: rgba(0, 69, 38, .36);
}
.constituent-pool-help {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  margin: 10px 0 16px;
  padding: 15px 18px;
  border: 1px solid #cfe6da;
  border-radius: 13px;
  background: #edf9f3;
}
.constituent-pool-help strong {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.65;
}
.constituent-pool-help p {
  margin: 0;
  color: #59675f;
  font-size: 13px;
  line-height: 1.65;
}

.segmented button {
  border-color: #d5ddd8;
  color: #616d65;
  background: #fff;
  font-weight: 570;
  box-shadow: none;
}
.segmented button.is-active { background: var(--green); box-shadow: none; }

.data-status { color: #647168; font-size: 12px; }
.flow-card,
.theme-summary-card,
.theme-rank-card {
  border-color: var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: none;
}
.card-kicker { color: #75827a; font-size: 12px; font-weight: 520; letter-spacing: .02em; }
.card-heading h2, .section-heading h2 { font-size: 21px; font-weight: 660; letter-spacing: -.025em; }
.rank { background: #00b76a; box-shadow: none; font-weight: 650; }
.ranking-row { border-color: #dfe5e1; }
.rank-copy strong { font-weight: 620; }
.rank-value strong { font-weight: 620; }

.overview-callout {
  margin-top: 20px;
  padding: 20px;
  border-radius: 17px;
  color: var(--ink);
  background: #e9f8f1;
}
.overview-callout span { display: block; margin-bottom: 9px; color: var(--green-dark); font-size: 13px; font-weight: 650; }
.overview-callout strong { display: block; font-size: 18px; font-weight: 630; line-height: 1.55; }
.stock-overview-card { padding: 22px 24px 0; }
.stock-overview-card .stock-overview-label { margin-bottom: 8px; }
.stock-overview-card .stock-overview-title { font-size: clamp(18px, 3vw, 23px); line-height: 1.45; }
.stock-overview-context { margin: 6px 0 20px; color: #65726a; font-size: 13px; line-height: 1.5; }
.stock-overview-metrics {
  display: grid;
  grid-template-columns: 1.25fr .85fr 1fr;
  border-top: 1px solid #c6dfd2;
}
.stock-overview-metrics article { min-width: 0; padding: 20px 18px 22px; }
.stock-overview-metrics article:first-child { padding-left: 0; }
.stock-overview-metrics article:last-child { padding-right: 0; }
.stock-overview-metrics article + article { border-left: 1px solid #c6dfd2; }
.stock-overview-metrics article > span {
  display: block;
  margin: 0 0 7px;
  color: #66736b;
  font-size: 13px;
  font-weight: 540;
}
.stock-overview-metrics article > strong {
  display: block;
  font-size: clamp(23px, 4vw, 30px);
  font-weight: 660;
  line-height: 1.25;
  letter-spacing: -.035em;
}
.stock-overview-metrics article > small {
  display: block;
  margin-top: 4px;
  color: #68756d;
  font-size: 12px;
}
.stock-overview-weight-values { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.stock-overview-weight-values strong { font-size: clamp(22px, 3.5vw, 29px); font-weight: 660; letter-spacing: -.035em; }
.stock-overview-weight-values b { color: var(--green-dark); font-size: 24px; font-weight: 650; }
.stock-overview-weight > small.positive-value,
.stock-overview-weight > small.negative-value { font-weight: 600; }

.theme-podium { margin-top: 12px; }
.theme-rank-card { background: #edf1ef; }
.all-ranking { border-color: transparent; color: var(--ink); background: #edf1ef; }
.all-ranking:hover { color: var(--ink); background: #e4eae6; }
.notice { border-color: transparent; background: #f0f3f1; }

.detail-shell { padding-bottom: 40px; background: #f5f8f6; }
.detail-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -12px 28px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.detail-masthead-back { color: var(--ink); font-size: 14px; font-weight: 580; text-decoration: none; }
.detail-masthead .brand-logo-frame { width: 76px; }
.detail-header.no-back { display: block; margin: 0 16px 20px; }
.detail-header.no-back > div { min-width: 0; }
.detail-header h1 { font-size: clamp(30px, 5vw, 38px); font-weight: 650; }
.detail-control-grid,
.theme-summary-card,
.overview-callout,
.detail-shell > .flow-card,
.detail-shell > .notice,
.detail-shell > footer,
.detail-shell > .data-status { margin-right: 16px; margin-left: 16px; }
.detail-control-grid {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.control-label { font-size: 13px; font-weight: 540; }
.detail-periods { width: 100%; padding: 3px; border-radius: 12px; background: #eef2ef; }
.detail-periods button { flex: 1 1 0; width: auto; min-width: 0; border: 0; background: transparent; }
.detail-control-grid > div:last-child .detail-periods { margin-left: 0; }
.theme-overview { margin-top: 22px; }
.theme-summary-card .signal-pill { display: none; }
.summary-metrics strong { font-weight: 620; }
.insight-callout { border-color: #cfe8da; background: #eff9f4; }

.constituent-sentence-filter { background: #fff; }
.constituent-query { font-weight: 570; }
.constituent-query select { font-weight: 560; }
.constituent-toolbar { justify-content: space-between; }

@media (max-width: 760px) {
  .app-shell,
  .detail-shell { width: min(100%, 920px); margin: 0 auto; padding: 0 12px 32px; border-radius: 0; }
  .site-header { grid-template-columns: 1fr; gap: 14px; margin: 0 16px; padding: 20px 0 14px; }
  .brand-logo-frame { width: 76px; }
  .primary-tabs { grid-template-columns: repeat(4, max-content); justify-content: space-between; gap: 2px; }
  .tab { min-height: 42px; padding: 7px 4px; font-size: 11.5px; white-space: nowrap; }
  .page-panel { padding: 28px 16px 34px; }
  .flow-card, .theme-summary-card { padding-inline: 16px; }
  .detail-masthead { margin: 0 -12px 26px; padding: 20px 28px 16px; }
}

@media (max-width: 560px) {
  .page-header h1 { font-size: 28px; }
  .detail-header h1 { font-size: 32px; }
  .theme-podium { grid-template-columns: 1fr; }
  .theme-rank-card { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .detail-control-grid { grid-template-columns: 1fr; }
  .detail-control-grid > div:last-child .detail-periods { width: 75%; margin-left: auto; }
  .overview-callout strong { font-size: 17px; }
  .stock-overview-card { padding: 18px 18px 0; }
  .stock-overview-metrics { grid-template-columns: 1fr 1fr; }
  .stock-overview-metrics article { padding: 16px 12px 18px; }
  .stock-overview-metrics article:first-child {
    grid-column: 1 / -1;
    padding-left: 0;
    border-bottom: 1px solid #c6dfd2;
  }
  .stock-overview-metrics article:nth-child(2) { padding-left: 0; border-left: 0; }
  .stock-overview-metrics article:last-child { padding-right: 0; }
  .stock-overview-metrics article > strong { font-size: 23px; }
  .constituent-pool-help { grid-template-columns: 1fr; gap: 3px; padding: 14px 15px; }
}

@media (max-width: 430px) {
  .app-shell,
  .detail-shell { padding: 0 12px 28px; }
  .site-header { margin-inline: 16px; }
  .primary-tabs { gap: 1px; }
  .tab { min-height: 40px; padding-inline: 2px; font-size: 11px; }
  .page-panel { padding-inline: 16px; }
  .detail-masthead { padding-inline: 20px; }
  .detail-header.no-back,
  .detail-control-grid,
  .theme-summary-card,
  .overview-callout,
  .detail-shell > .flow-card,
  .detail-shell > .notice,
  .detail-shell > footer,
  .detail-shell > .data-status { margin-right: 4px; margin-left: 4px; }
  .detail-periods button { font-size: 13px; }
  .overview-callout { padding: 18px; }
  .stock-overview-card { padding-bottom: 0; }
}

/* 참고 URL의 필터·요약·순위 표현을 그대로 맞춘 세부 구성 */
.page-description {
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.supply-filter-grid {
  display: grid;
  grid-template-columns: 1.05fr .9fr 1.35fr;
  gap: 14px;
  margin-top: 20px;
}
.theme-flow-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 14px;
  margin: 20px 0 14px;
}
.theme-flow-filter-grid .segmented { width: 100%; }
.theme-flow-filter-grid .segmented button { flex: 1 1 0; min-width: 0; }
.flow-view-switcher {
  width: min(100%, 520px);
  border: 0;
  background: #edf1ef;
}
.flow-view-switcher .switch.is-active {
  color: var(--green-dark);
  background: #fff;
  box-shadow: 0 4px 12px rgba(16, 22, 18, .08);
}
.theme-flow-overview { position: relative; padding: 18px 24px; }
.theme-flow-overview > span { margin-bottom: 6px; }
.theme-flow-overview > strong { font-size: 20px; }
.theme-flow-overview > p { margin: 6px 0 0; color: #607067; font-size: 13px; }
.theme-flow-overview .theme-flow-opposite {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #c6dfd2;
}
.theme-flow-ranking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 16px;
  margin-top: 18px;
}
.theme-flow-ranking-grid > .flow-card {
  margin-top: 0;
  padding: 20px 16px 8px;
  border: 0;
  border-radius: 18px;
  background: #fff;
}
.theme-flow-ranking-grid .card-heading { min-height: 34px; border-bottom: 1px solid var(--line); }
.theme-flow-ranking-grid .card-heading h2 { margin: 0; font-size: 17px; }
.theme-flow-ranking-grid .ranking-row { min-height: 72px; }
.theme-flow-ranking-grid .rank { width: 24px; height: 24px; }
.theme-flow-ranking-grid .rank-value .rate { font-size: 14px; }
.theme-flow-ranking-grid .rank-value .amount { font-size: 10px; white-space: nowrap; }
.supply-filter-group { min-width: 0; }
.supply-filter-group .control-label { margin-bottom: 8px; }
.supply-filter-group .segmented { width: 100%; }
.market-filter-help {
  margin: 8px 0 0;
  color: #7b8780;
  font-size: 11px;
  font-weight: 450;
  line-height: 1.5;
}
.supply-filter-group .segmented button {
  flex: 1 1 0;
  min-width: 0;
  padding-right: 5px;
  padding-left: 5px;
  white-space: nowrap;
}
.supply-modes { display: flex; margin: 0; }

.strong-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
  align-items: end;
  gap: 14px;
  margin: 20px 0 14px;
}
.strong-filter-group { min-width: 0; }
.strong-filter-group .control-label {
  display: block;
  margin-bottom: 8px;
}
.strong-filter-group .segmented { width: 100%; }
.strong-filter-group .segmented button {
  flex: 1 1 0;
  min-width: 0;
  padding-right: 5px;
  padding-left: 5px;
  white-space: nowrap;
}

.constituent-status-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 3px;
}
.constituent-status-toolbar .constituent-toolbar { margin: 0; }
.constituent-status-toolbar .segmented button {
  min-width: 78px;
  white-space: nowrap;
}

.supply-overview-card {
  padding-block: 16px;
}
.supply-overview-card > span { margin-bottom: 6px; }
.supply-overview-card .supply-overview-summary {
  overflow: hidden;
  margin: 0;
  line-height: 1.55;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.supply-overview-card .supply-overview-summary > span {
  display: inline;
  margin: 0;
  color: #536158;
  font-size: 14px;
  font-weight: 450;
}
.supply-overview-card .supply-overview-summary > strong {
  display: inline;
  margin-left: 3px;
  font-size: 19px;
  font-weight: 650;
}
.overview-total { display: flex; align-items: baseline; gap: 9px; margin-top: 11px; }
.overview-total small { color: #607067; font-size: 13px; }
.overview-total b { color: var(--positive); font-size: 30px; font-weight: 650; letter-spacing: -.035em; }
.overview-total b.is-negative { color: var(--negative); }
.supply-netbuy-help {
  margin: 5px 0 0;
  color: #718078;
  font-size: 11px;
  line-height: 1.5;
}

#supply-content > .flow-card {
  margin-top: 24px;
  padding: 24px;
  border: 0;
  border-radius: 18px;
  background: #fff;
}
#supply-content > .flow-card .legend { display: none; }
#supply-content > .flow-card .rank {
  width: 22px;
  color: #56655c;
  background: transparent;
}
#supply-content > .flow-card .ranking-row { min-height: 82px; }
#supply-content > .flow-card .card-heading { margin-bottom: 6px; }
#supply-content > .flow-card .card-kicker { margin-top: 3px; }

#flow-page .overview-callout,
#strong-page > .overview-callout {
  margin-right: 0;
  margin-left: 0;
}

#strong-page > .flow-card,
#strong-page > .momentum-section {
  margin-top: 24px;
  padding: 20px;
  border: 0;
  border-radius: 18px;
  background: #fff;
}

#strong-page > .flow-card > .all-ranking { margin: 18px 0 8px; }
#strong-page > .flow-card > .journey-cta { margin: 0 0 8px; }

/* 테마 상세 참고 화면: 제목 옆 기간 선택, 낮은 지표 카드, 하단 2열 구성 */
.theme-detail-shell .theme-hero-layout {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(420px, 1.6fr);
  align-items: start;
  gap: 34px;
  margin: 0 16px;
}
.theme-detail-shell .theme-hero-heading { min-width: 0; }
.theme-detail-shell .detail-header.no-back { margin: 0; }
.theme-detail-shell .detail-header.no-back > div { width: 100%; }
.theme-detail-shell .detail-header p:last-child { display: none; }
.theme-detail-shell .theme-hero-heading > .data-status {
  min-height: 24px;
  margin: 12px 0 0;
  line-height: 1.45;
}
.theme-detail-shell .detail-control-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 14px;
  border-radius: 15px;
}
.theme-detail-shell .detail-control-grid > div { min-width: 0; }
.theme-detail-shell .control-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 540;
}
.theme-detail-shell .detail-periods {
  width: 100%;
  gap: 0;
}
.theme-detail-shell .detail-periods button {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 38px;
  padding-inline: 4px;
  font-size: 12px;
}

.theme-detail-shell > .theme-summary-card {
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}
.theme-detail-shell .theme-summary-card .summary-metrics article {
  display: flex;
  min-height: 94px;
  padding: 12px;
  flex-direction: column;
  justify-content: center;
}
.theme-detail-shell .theme-summary-card .summary-metrics strong {
  order: 1;
  margin-top: 0;
  font-size: clamp(28px, 4vw, 32px);
}
.theme-detail-shell .theme-summary-card .summary-metrics span {
  order: 2;
  margin-top: 3px;
  font-size: 12px;
}
.theme-detail-shell .theme-summary-card .summary-metrics small { display: none; }

.theme-detail-shell .theme-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.44fr) minmax(300px, 1fr);
  align-items: stretch;
  gap: 16px;
  margin: 16px 16px 0;
}
.theme-detail-shell .theme-content-grid > .flow-card {
  height: 100%;
  margin: 0;
  padding: 20px;
  border-radius: 18px;
}
.theme-detail-shell .theme-content-grid .card-heading h2 { font-size: 18px; }
.theme-detail-shell .theme-content-grid .theme-etf-row { min-height: 64px; }
.theme-detail-shell .theme-supply-card {
  display: flex;
  flex-direction: column;
}
.theme-detail-shell .theme-supply-card .supply-bar-list {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: repeat(3, minmax(58px, 1fr));
  padding: 8px 0 4px;
}
.theme-detail-shell .theme-content-grid .supply-bar-row {
  grid-template-columns: 38px minmax(0, 1fr) 68px;
  gap: 8px;
  min-height: 58px;
}
.theme-detail-shell .theme-content-grid .supply-bar-row > strong,
.theme-detail-shell .theme-content-grid .supply-bar-row > b { font-size: 12px; }
.theme-detail-shell .theme-content-grid .supply-bar-track { height: 28px; }
.theme-detail-shell .theme-content-grid .supply-bar-track span {
  top: 4px;
  height: 20px;
}

.calculation-callout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 13px 16px;
  border-radius: 12px;
  color: #607067;
  background: #eaf8f1;
  font-size: 12px;
  line-height: 1.55;
}
.calculation-callout::before {
  flex: 0 0 auto;
  content: "ⓘ";
  color: #6f7e75;
  font-size: 15px;
  line-height: 1;
}

.criteria-disclosure {
  margin: 16px 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.criteria-disclosure summary {
  position: relative;
  padding: 17px 42px 17px 20px;
  color: #526159;
  cursor: pointer;
  font-size: 14px;
  font-weight: 560;
  list-style: none;
}
.criteria-disclosure summary::-webkit-details-marker { display: none; }
.criteria-disclosure summary::after {
  position: absolute;
  top: 50%;
  right: 20px;
  content: "+";
  color: var(--green-dark);
  font-size: 20px;
  transform: translateY(-50%);
}
.criteria-disclosure[open] summary::after { content: "−"; }
.criteria-disclosure .theme-notice {
  margin: 0;
  padding: 15px 20px 17px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

@media (max-width: 760px) {
  .supply-filter-grid { grid-template-columns: 1fr; gap: 12px; }
  .supply-filter-group .segmented button { min-height: 46px; }
  .theme-flow-filter-grid { gap: 12px; }
  .theme-flow-filter-grid .segmented button { min-height: 46px; }
  .theme-flow-ranking-grid { grid-template-columns: 1fr; }
  .strong-filter-grid { gap: 10px; }
  .strong-filter-group .segmented button { font-size: 12px; }
  .constituent-status-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .constituent-status-toolbar .constituent-toolbar { align-self: stretch; }
  .theme-detail-shell .theme-hero-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-right: 4px;
    margin-left: 4px;
  }
  .theme-detail-shell .theme-content-grid {
    grid-template-columns: 1fr;
    margin-right: 4px;
    margin-left: 4px;
  }
}

@media (max-width: 430px) {
  .criteria-disclosure { margin-right: 4px; margin-left: 4px; }
  .overview-total b { font-size: 28px; }
  #supply-content > .flow-card { padding: 20px 16px; }
  #strong-page > .flow-card,
  #strong-page > .momentum-section { padding: 20px 16px; }
}

/* 참고 URL처럼 로고는 작게, 상단 메뉴는 작은 폭으로 묶어 우측 정렬한다. */
.site-header .brand-logo-frame { width: 72px; }
.site-header .primary-tabs {
  display: grid;
  grid-template-columns: 42px 72px 118px 104px 94px;
  justify-content: end;
  justify-self: end;
  gap: 10px;
  width: 470px;
}
.site-header .tab,
.site-header .tab-wide {
  width: auto;
  min-height: 40px;
  padding: 7px 14px;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .site-header .brand-logo-frame { width: 68px; }
  .site-header .primary-tabs {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    justify-content: space-between;
    justify-self: stretch;
    gap: 2px;
    width: 100%;
  }
  .site-header .tab,
  .site-header .tab-wide {
    min-height: 40px;
    padding: 7px 3px;
    font-size: 11.5px;
  }
}

@media (max-width: 430px) {
  .site-header .brand-logo-frame { width: 64px; }
  .site-header .tab,
  .site-header .tab-wide { padding-inline: 2px; font-size: 11px; }
}

/* 홈: 최신 종가 데이터를 빠르게 훑고 세부 분석으로 이동하는 브리핑 화면 */
.home-page { padding-top: 30px; }
.home-heading { margin-bottom: 22px; }
.home-heading .eyebrow { margin: 0 0 6px; }
.home-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}
.home-title-row h1 {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 38px);
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: -.04em;
}
.home-title-row > span {
  flex: 0 0 auto;
  color: #758079;
  font-size: 12px;
  font-weight: 520;
  white-space: nowrap;
}

.home-briefing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: stretch;
  gap: 16px;
}
.home-feature-card,
.home-pulse-card,
.home-idea-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
}
.home-feature-card {
  position: relative;
  display: flex;
  min-height: 360px;
  padding: 27px 26px 23px;
  overflow: hidden;
  flex-direction: column;
  color: var(--ink);
  background: #e7f8f0;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.home-feature-card:hover {
  border-color: #a8d9bd;
  box-shadow: 0 10px 24px rgba(0, 121, 68, .08);
  transform: translateY(-2px);
}
.home-card-label {
  display: block;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 620;
}
.home-feature-card h2 {
  margin: 18px 0 0;
  line-height: 1.42;
  letter-spacing: -.035em;
}
.home-feature-card h2 > strong,
.home-feature-card h2 > span { display: block; }
.home-feature-card h2 > strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: clamp(24px, 3.6vw, 29px);
  font-weight: 680;
  line-height: 1.25;
}
.home-feature-theme-suffix {
  display: inline;
  margin-left: 7px;
  letter-spacing: 0;
  vertical-align: .12em;
}
.home-feature-card h2 > span {
  color: #3d4b43;
  font-size: clamp(18px, 2.7vw, 21px);
  font-weight: 540;
  line-height: 1.45;
}
.home-feature-card h2 > span:last-child { color: var(--green-dark); font-weight: 630; }
.home-feature-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: auto;
  padding-top: 27px;
  border-top: 1px solid #c7e4d5;
}
.home-feature-metrics div + div {
  padding-left: 18px;
  border-left: 1px solid #c7e4d5;
}
.home-feature-metrics small {
  display: block;
  color: #66736b;
  font-size: 12px;
  line-height: 1.4;
}
.home-feature-metrics strong {
  display: block;
  margin-top: 7px;
  color: var(--positive);
  font-size: clamp(22px, 3.7vw, 29px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.home-feature-metrics strong.is-negative { color: var(--negative); }
.home-pulse-card { padding: 24px 23px 13px; background: #fff; }
.home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 32px 0 13px;
}
.home-section-heading.compact { margin: 0 0 9px; }
.home-section-heading h2 {
  margin: 5px 0 0;
  font-size: 21px;
  font-weight: 660;
  line-height: 1.35;
  letter-spacing: -.025em;
}
.home-pulse-list a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 67px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .16s ease, transform .16s ease;
}
.home-pulse-list a:last-child { border-bottom: 0; }
.home-pulse-list a:hover { background: #f6fbf8; transform: translateX(2px); }
.home-pulse-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--green-dark);
  background: var(--green-soft);
}
.home-pulse-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-pulse-copy { min-width: 0; }
.home-pulse-copy small {
  display: block;
  color: #7b867f;
  font-size: 11px;
  line-height: 1.35;
}
.home-pulse-copy strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-pulse-list a > b {
  color: var(--positive);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.home-pulse-list a > b.is-negative { color: var(--negative); }

.home-idea-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.home-idea-card {
  display: grid;
  min-height: 250px;
  padding: 24px;
  color: var(--ink);
  background: #fff;
  grid-template-rows: auto 1fr auto;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.home-idea-card:hover {
  border-color: #afd8c1;
  box-shadow: 0 10px 24px rgba(16, 32, 22, .06);
  transform: translateY(-2px);
}
.home-idea-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 23px;
  font-weight: 650;
}
.home-idea-card h3 {
  margin: 19px 0 7px;
  font-size: 21px;
  font-weight: 660;
  line-height: 1.35;
  letter-spacing: -.025em;
}
.home-idea-card p {
  margin: 0;
  color: #657169;
  font-size: 14px;
  line-height: 1.65;
}
.home-idea-card > span:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 21px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 650;
}
.home-tools-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  margin-top: 16px;
  border-radius: 12px;
  color: var(--ink);
  background: #e9eeeb;
  font-size: 14px;
  font-weight: 620;
  text-decoration: none;
}
.home-tools-link:hover { background: #dfe7e2; }
.home-disclaimer { margin: 14px 2px 0; color: #7b857f; font-size: 12px; }

@media (max-width: 760px) {
  .site-header .primary-tabs { grid-template-columns: repeat(5, max-content); }
  .site-header .tab-wide { display: grid; }
  .home-briefing-grid { grid-template-columns: 1fr; }
  .home-feature-card { min-height: 0; }
  .home-feature-metrics { margin-top: 22px; padding-top: 21px; }
}

@media (max-width: 560px) {
  .home-title-row { align-items: flex-start; gap: 10px; }
  .home-title-row h1 { font-size: 28px; }
  .home-title-row > span { padding-top: 7px; font-size: 11px; }
  .home-idea-grid { grid-template-columns: 1fr; }
  .home-idea-card { min-height: 235px; }
}

@media (max-width: 430px) {
  .site-header .primary-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-header .primary-tabs::-webkit-scrollbar { display: none; }
  .site-header .tab,
  .site-header .tab-wide { flex: 0 0 auto; padding-inline: 2px; }
  .home-page { padding-top: 26px; }
  .home-title-row h1 { font-size: 26px; }
  .home-title-row > span { font-size: 10px; }
  .home-feature-card { min-height: 0; padding: 23px 20px 20px; }
  .home-feature-card h2 > strong { font-size: 24px; }
  .home-feature-card h2 > span { font-size: 18px; }
  .home-feature-metrics { gap: 12px; margin-top: 18px; padding-top: 18px; }
  .home-feature-metrics div + div { padding-left: 12px; }
  .home-feature-metrics strong { font-size: 22px; }
  .home-pulse-card { padding-inline: 18px; }
  .home-pulse-list a { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; }
  .home-pulse-copy strong,
  .home-pulse-list a > b { font-size: 13px; }
}

/* 모바일 상단 메뉴: 글자 크기는 유지하고 선택 항목은 글자색과 밑줄로 구분한다. */
.mobile-nav-shell {
  min-width: 0;
  justify-self: end;
}
.mobile-nav-cue { display: none; }

@media (max-width: 760px) {
  .site-header {
    gap: 14px;
    padding-bottom: 0;
  }
  .site-header .mobile-nav-shell {
    position: relative;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    overflow: hidden;
  }
  .site-header .primary-tabs {
    display: flex;
    width: 100%;
    padding: 0 32px 0 2px;
    gap: 22px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-padding-inline: 30px;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  .site-header .primary-tabs::-webkit-scrollbar { display: none; }
  .site-header .tab,
  .site-header .tab-wide {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    width: auto;
    min-height: 46px;
    padding: 7px 0 10px;
    place-items: center;
    border: 0;
    border-radius: 0;
    color: #465149;
    background: transparent;
    box-shadow: none;
    white-space: nowrap;
  }
  .site-header .tab:hover,
  .site-header .tab.is-active,
  .site-header .tab.is-active:hover,
  .site-header .tab-wide:hover,
  .site-header .tab-wide.is-active,
  .site-header .tab-wide.is-active:hover {
    color: var(--green-dark);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }
  .site-header .tab.is-active::after,
  .site-header .tab-wide.is-active::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    content: "";
    background: var(--green);
  }
  .mobile-nav-cue {
    position: absolute;
    z-index: 4;
    top: 0;
    display: grid;
    width: 32px;
    height: 46px;
    padding: 0;
    place-items: center;
    border: 0;
    color: #445048;
    cursor: pointer;
    font-size: 27px;
    font-weight: 450;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
  }
  .mobile-nav-cue.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-nav-cue-left {
    left: 0;
    background: linear-gradient(90deg, #fff 58%, rgba(255, 255, 255, 0));
  }
  .mobile-nav-cue-right {
    right: 0;
    background: linear-gradient(270deg, #fff 58%, rgba(255, 255, 255, 0));
  }
}

/* 기본 화면의 회색 콘텐츠 영역과 운영사 정보를 하나의 흐름으로 잇는다. */
.app-shell:not(.tool-shell):not(.detail-shell) { padding-bottom: 0; }
