/* 월배당 ETF맵 공통 스타일 — 세종기업데이터 모바일 디자인 기준 */
:root {
  --navy: #14284B;
  --ink: #0E1A2B;
  --ink2: #4A5566;
  --ink3: #5F6B7A;
  --line: #E3E6EB;
  --line2: #EEF0F3;
  --bg: #F4F5F7;
  --chip: #F1F3F6;
  --teal: #0F5A5C;
  --teal-bg: #E3EFEF;
  --navy-bg: #E6ECF6;
  --up: #C8283A;
  --down: #1D4ED8;
  --warn-bg: #FFF8E6;
  --warn-line: #F2DFA8;
  --warn-ink: #4A3A0A;
  --tag: #FFD66B;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans KR', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font-family: inherit; }
.wrap { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* header */
.hd { background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.hd-top { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.logo { display: inline-flex; align-items: center; min-height: 44px; }
.logo img { display: block; width: 154px; height: auto; }
@media (max-width: 720px) { .logo img { width: 144px; } }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--chip); border-radius: 12px; }
.tabs a { height: 38px; border-radius: 9px; color: var(--ink2); font-size: 14px; font-weight: 600; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.tabs a[aria-current="page"] { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(14,26,43,.12); }

/* layout */
.sec { padding: 22px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.sec.tight { padding-top: 6px; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 700; background: var(--tag); padding: 3px 9px; border-radius: 999px; }
h1 { margin: 0; font-size: 25px; line-height: 1.3; font-weight: 700; letter-spacing: -0.6px; }
h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.4px; }
.lead { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink2); }
.sub { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink2); }
.note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink3); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pill-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pill { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #D5DAE1; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--chip); border-radius: 10px; }
.seg button { height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink2); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(14,26,43,.12); }
.amt { display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 16px; background: var(--chip); border: 1.5px solid var(--navy); border-radius: 12px; }
.amt input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 26px; font-weight: 700; color: var(--ink); outline: none; }
.amt span { font-size: 17px; font-weight: 600; color: var(--ink2); }
.search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border: 1.5px solid var(--navy); border-radius: 12px; color: var(--ink3); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 15px; color: var(--ink); outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* rows */
.row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--line2); text-decoration: none; color: var(--ink); }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .nm { font-size: 14px; font-weight: 600; line-height: 1.4; }
.row .meta { font-size: 12px; color: var(--ink3); }
.row .right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row .val { font-size: 14px; font-weight: 700; }
.chev { flex: none; color: var(--ink3); }
.pay { flex: none; font-size: 11px; font-weight: 700; padding: 3px 6px; border-radius: 6px; }
.pay.d15 { background: var(--teal-bg); color: var(--teal); }
.pay.dend { background: var(--navy-bg); color: var(--navy); }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--ink2); }
.more { height: 48px; border: 0; background: transparent; font-size: 14px; font-weight: 600; color: var(--navy); cursor: pointer; }
.link { font-size: 13px; font-weight: 600; color: var(--navy); text-decoration: none; }

/* type groups (계산기) */
.tg { border-bottom: 1px solid var(--line2); }
.tg-btn { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px 0 14px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.tg-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tg-name { font-size: 15px; font-weight: 700; }
.tg-mid { font-size: 19px; font-weight: 700; letter-spacing: -0.4px; }
.tg-bar { position: relative; display: block; height: 8px; background: var(--line2); border-radius: 999px; }
.tg-bar .rng { position: absolute; top: 0; height: 8px; border-radius: 999px; }
.tg-bar .dot { position: absolute; top: -3px; width: 14px; height: 14px; margin-left: -7px; background: #fff; border-radius: 50%; border: 3px solid; }
.tg-yoy { display: flex; justify-content: space-between; gap: 8px; border-radius: 8px; padding: 7px 10px; font-size: 12px; color: var(--ink2); }
.tg-list { background: #F7F8FA; border-radius: 12px; padding: 4px 12px 10px; margin-bottom: 12px; }
.sec-label { font-size: 12px; font-weight: 700; color: var(--ink2); padding: 14px 0 4px; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .k { font-size: 12px; color: var(--ink2); }
.tile .v { font-size: 17px; font-weight: 700; }
.tile.w { background: #fff; border: 1px solid var(--line); }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; border-bottom: 1px solid #D5DAE1; }
.bars div { flex: 1 1 0; min-width: 0; border-radius: 2px 2px 0 0; }
.bar-labels { display: flex; gap: 3px; }
.bar-labels div { flex: 1 1 0; min-width: 0; font-size: 10px; color: var(--ink3); white-space: nowrap; overflow: visible; }

/* warning box */
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; color: var(--warn-ink); font-size: 12px; line-height: 1.6; text-decoration: none; }
.warn b { font-size: 14px; display: block; margin-bottom: 2px; }

/* 광고 영역 — 광고가 채워지지 않으면 자리를 접어요 */
.ad-slot { padding: 14px 16px 6px; }
.ad-slot .ad-label { font-size: 11px; color: var(--ink3); text-align: center; margin-bottom: 4px; }
.ad-slot.rect ins.adsbygoogle { display: block; width: 300px; height: 250px; margin: 0 auto; }
.ad-slot.resp ins.adsbygoogle { display: block; min-height: 100px; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-slot:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* footer */
.ft { margin-top: auto; background: #fff; border-top: 1px solid var(--line); padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 10px; }
.ft p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink3); }

/* guide */
.notice-item { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line2); }
.notice-item .n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.notice-item b { font-size: 15px; display: block; margin-bottom: 4px; }
.notice-item p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink2); }


.ad-placeholder { background: var(--chip); border-radius: 12px; margin: 0 auto; }
.ad-slot.rect .ad-placeholder { width: min(300px, 100%); height: 250px; }
.ad-slot.resp .ad-placeholder { min-height: 100px; }
.tg-empty { display: grid; gap: 4px; padding: 14px 0; }

/* Keep preview placeholders out of the layout until a real ad is connected. */
.ad-slot[aria-hidden="true"] { display: none; }
.filter-label { flex: 0 0 76px; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--ink2); }
.pick-labels div { text-align: center; }
.pick-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick-metrics > div { display: grid; gap: 3px; padding: 9px; border-radius: 8px; background: var(--chip); overflow-wrap: anywhere; }
.tg-yoy { flex-wrap: wrap; gap: 3px 8px; }
.tg-yoy small, .tg-yoy > b { white-space: nowrap; }

.ad-slot[hidden], .ad-slot[data-etf-ad]:empty { display: none; }
