/* 이핀 시그널캐쳐 사용설명서 — 휴대폰(360px) 우선. 이핀 청록·하늘·빨강, 부드러운 곡선의 판 */
/* 글꼴은 각 HTML의 <head>에서 미리 연결해 불러온다 (CSS @import보다 빠름) */

:root {
  color-scheme: light;
  /* 브랜드 */
  --teal: #12aaaf;
  --teal-ink: #0a7378;
  --cyan: #18c9cf;
  --red: #e64847;
  --red-ink: #b8302f;
  /* 바탕과 글자 (청록에서 뽑은 차가운 중성색) */
  --bg: #f1f5f5;
  --panel: #ffffff;
  --ink: #1d2626;
  --ink-2: #4b5858;
  --line: #e1e8e8;
  /* 시장별 파스텔 판: 한국 = 청록, 미국 = 산호 */
  --kr: #d7efee;
  --kr-2: #c4e8e7;
  --kr-ink: #0a6a6e;
  --us: #fbe3e0;
  --us-2: #f8d2cd;
  --us-ink: #a3302d;
  /* 뜻이 있는 색 */
  --ok: #16804c;
  --ok-soft: #e1f3e8;
  --no: var(--red);
  --no-soft: #fde8e6;
  --cond: #9a4f00;
  --cond-soft: #fdefdc;
  --info: #335c7a;
  --info-soft: #e5eef4;
  --sand: #f4efe6;
  /* 형태 */
  --r-panel: 24px;
  --r-inner: 16px;
  --shadow: 0 1px 2px rgba(16, 52, 52, .06), 0 10px 26px -10px rgba(16, 52, 52, .24);
  --shadow-lift: 0 2px 4px rgba(16, 52, 52, .06), 0 14px 30px -12px rgba(16, 52, 52, .22);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #b9caca transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--kr-2); color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal-ink); outline-offset: 3px; border-radius: 10px; }
a { color: var(--teal-ink); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding-left: 1.2em; }
li { margin: 5px 0; }
b, strong { font-weight: 700; }
.small { font-size: 15px; }
.muted { color: var(--ink-2); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }
.ico { width: 20px; height: 20px; flex: none; }

/* ── 상단 */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(241, 245, 245, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 16px; white-space: nowrap; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; border-radius: 9px; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; }
.topnav { display: flex; gap: 6px; flex: none; }
.topnav a { text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 15px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.topnav a[aria-current="page"] { background: var(--panel); color: var(--teal-ink); box-shadow: var(--shadow); }

/* ── 첫 화면 */
.home-hero { padding: 26px 0 16px; }
.home-hero h1 { font-size: 27px; font-weight: 900; }
.home-hero p { color: var(--ink-2); margin: 6px 0 0; font-size: 16px; }
.market { border-radius: var(--r-panel); padding: 18px 16px 16px; margin-bottom: 14px; }
.market.kr { background: var(--kr); }
.market.us { background: var(--us); }
.market h2 { font-size: 19px; font-weight: 900; margin: 0 2px 12px; display: flex; align-items: baseline; gap: 8px; }
.market h2 span { font-size: 14px; font-weight: 700; }
.market.kr h2 span { color: var(--kr-ink); }
.market.us h2 span { color: var(--us-ink); }
.pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pick-btn {
  position: relative; aspect-ratio: 1 / 1; border-radius: 28px; background: var(--panel);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.pick-btn .pl { position: absolute; left: 14px; top: 8px; font-size: 40px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.2; }
.pick-btn .go { position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.market.kr .pick-btn .go { background: var(--kr); color: var(--kr-ink); }
.market.us .pick-btn .go { background: var(--us); color: var(--us-ink); }
.pick-btn .go .ico { width: 16px; height: 16px; }
.pick-btn:active { transform: scale(0.97); }
@media (hover: hover) { .pick-btn:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); } }
details.home-more { background: var(--panel); border-radius: var(--r-panel); padding: 14px 18px; margin: 12px 0; box-shadow: var(--shadow); }
details.home-more ul { margin-top: 10px; }

/* ── 접기 */
summary { cursor: pointer; font-weight: 700; color: var(--teal-ink); list-style: none; display: flex; align-items: center; gap: 8px; min-height: 32px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: auto; transition: transform 200ms var(--ease-out); }
details[open] > summary::after { transform: rotate(225deg) translateY(-2px); }

/* ── 로봇 페이지 머리 */
.rhero { border-radius: var(--r-panel); padding: 20px 20px 18px; margin: 14px 0 6px; position: relative; }
.rhero.kr { background: var(--kr); }
.rhero.us { background: var(--us); }
.rhero .letter { font-size: 64px; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }
.rhero.kr .letter { color: var(--kr-ink); }
.rhero.us .letter { color: var(--us-ink); }
.rhero .back { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .7); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.rhero h1 { font-size: 25px; font-weight: 900; margin-top: 12px; }
.rhero .lead { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 14px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: rgba(255, 255, 255, .75); color: var(--ink-2); text-decoration: none; }
.hint { font-size: 14px; color: var(--ink-2); margin: 10px 2px 0; }

/* 블록 바로가기 */
.blocknav { position: sticky; top: 56px; z-index: 9; background: rgba(241, 245, 245, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px 0; }
.blocknav .wrap { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.blocknav .wrap::-webkit-scrollbar { display: none; }
.blocknav a { flex: none; font-size: 14px; font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--panel); color: var(--ink-2); white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 52, 52, .06); }

/* ── 블록(판) */
.block { background: var(--panel); border-radius: var(--r-panel); padding: 22px 18px; margin: 14px 0; box-shadow: var(--shadow); scroll-margin-top: 118px; }
.block > h2 { font-size: 21px; font-weight: 900; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.block > h2 .no { width: 28px; height: 28px; border-radius: 50%; background: var(--kr); color: var(--kr-ink); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.block h3 { font-size: 18px; font-weight: 900; margin: 22px 0 10px; }
.block > h3:first-child { margin-top: 0; }
.oneliner { font-size: 20px; font-weight: 900; color: var(--teal-ink); margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 700; }
details.more { margin-top: 16px; background: var(--bg); border-radius: var(--r-inner); padding: 10px 14px; }

.callout { border-radius: var(--r-inner); padding: 14px 16px; margin: 12px 0; background: var(--info-soft); }
.callout.warn { background: var(--cond-soft); }
.callout.danger { background: var(--no-soft); }
.callout.ok { background: var(--ok-soft); }
.callout > strong:first-child { display: block; margin-bottom: 4px; }

/* 한눈에 보기 */
.glance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 8px; }
.gt { border-radius: 20px; padding: 14px; }
.gt .gk { font-weight: 900; font-size: 15px; margin-bottom: 4px; }
.gt .gv { font-size: 15px; line-height: 1.55; }
.gt.g-buy { background: var(--ok-soft); } .gt.g-buy .gk { color: var(--ok); }
.gt.g-much { background: var(--kr); } .gt.g-much .gk { color: var(--kr-ink); }
.gt.g-sell { background: var(--sand); } .gt.g-sell .gk { color: #7a5a1e; }
.gt.g-never { background: var(--no-soft); } .gt.g-never .gk { color: var(--red-ink); }
@media (max-width: 380px) { .glance { grid-template-columns: minmax(0, 1fr); } }

/* 신호 */
.sym { font-weight: 900; font-size: 19px; letter-spacing: 1px; white-space: nowrap; color: var(--teal-ink); }
.buy { display: inline-block; font-weight: 900; border-radius: 999px; padding: 2px 12px; white-space: nowrap; font-size: 15px; }
.buy.o { background: var(--ok-soft); color: var(--ok); }
.buy.x { background: var(--no); color: #fff; font-size: 20px; padding: 2px 16px; }
.buy.c { background: var(--cond-soft); color: var(--cond); }
.sigs { display: grid; }
.sig { padding: 14px 2px; display: grid; gap: 6px; border-top: 1px solid var(--line); }
.sig:first-child { border-top: 0; }
.sig.is-x { background: var(--no-soft); border-radius: 18px; padding: 14px 16px; border-top: 0; margin: 4px 0; }
.sig.is-x + .sig { border-top: 0; }
.sig-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sig-nums { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 16px; }
.sig-nums b { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sig-nums .k { color: var(--ink-2); margin-right: 4px; }

/* 텔레그램 알림 모양 */
.alert-wrap { margin: 0 0 16px; }
.alert { max-width: 330px; background: #e9f2f4; border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-size: 15px; line-height: 1.55; }
.alert .h { font-weight: 700; color: var(--teal-ink); }
.alert-cap { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* 체크리스트 */
.checklist { list-style: none; padding: 0; display: grid; }
.checklist li { margin: 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 13px 2px; cursor: pointer; }
.checklist input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--teal); }
.checklist input:checked + span { color: var(--ink-2); text-decoration: line-through; text-decoration-color: rgba(75, 88, 88, .5); }

/* 순서도 */
.flow { display: grid; margin: 6px 0 4px; }
.fnode { border-radius: 16px; padding: 13px 15px; box-shadow: inset 0 0 0 1.5px var(--line); }
.fnode.ask { box-shadow: inset 0 0 0 2px var(--kr-2); }
.fnode.end { background: var(--ok-soft); font-weight: 700; }
.fnode .q { font-weight: 700; }
.fexit { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 15px; }
.fexit .lbl { flex: none; font-weight: 900; border-radius: 999px; padding: 0 10px; background: var(--line); }
.fexit .t { font-weight: 700; }
.fexit.stop .lbl { background: var(--no-soft); color: var(--red-ink); } .fexit.stop .t { color: var(--red-ink); }
.fexit.sell .lbl { background: var(--kr); color: var(--kr-ink); }
.fexit.warn .lbl { background: var(--cond-soft); color: var(--cond); }
.fexit.info .lbl, .fexit.wait .lbl { background: var(--info-soft); color: var(--info); }
.farrow { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-2); font-size: 15px; font-weight: 700; padding: 4px 0; min-height: 34px; }
.farrow .ico { width: 18px; height: 18px; color: #8aa3a3; }

/* 하면 안 되는 것 */
.donts { list-style: none; padding: 0; display: grid; gap: 8px; }
.donts li { display: flex; gap: 12px; align-items: flex-start; border-radius: 18px; padding: 14px; background: var(--no-soft); margin: 0; }
.donts .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--red-ink); color: #fff; font-weight: 900; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.donts .t { font-weight: 700; }

/* 예시 차트 */
figure { margin: 0; }
.chart { display: block; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.chart-note { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 10px; margin: 0; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--kr); color: var(--kr-ink); font-weight: 900; font-size: 14px; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.placeholder { border: 2px dashed #c9d6d6; border-radius: 18px; padding: 22px 14px; text-align: center; color: var(--ink-2); margin-top: 14px; font-weight: 700; }

/* 설명 그림 */
.diagram { margin: 4px 0 8px; background: var(--bg); border-radius: 20px; padding: 12px; }
.diagram figcaption { font-size: 15px; margin-top: 6px; }
.diagram { max-width: 440px; }
.diagram.small { max-width: 340px; }
.dia { width: 100%; height: auto; display: block; font-family: inherit; }
.dia .line { fill: none; stroke: #2c3a3a; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.dia .dot { fill: var(--cyan); stroke: #fff; stroke-width: 2; }
.dia .dot.buy { fill: var(--ok); }
.dia .bar { fill: var(--teal); }
.dia .vol { fill: #c3d2d2; }
.dia .zone { fill: var(--ok-soft); stroke: var(--ok); stroke-dasharray: 4 3; }
.dia .dash { stroke: var(--red); stroke-width: 2; stroke-dasharray: 6 4; }
.dia .brace { fill: none; stroke: var(--cond); stroke-width: 2; }
.dia .arrow { stroke: var(--ok); stroke-width: 2; }
.dia .ma { fill: none; stroke: #d9a400; stroke-width: 3; }
.dia .ring { fill: none; stroke: var(--teal); stroke-width: 3; }
.dia .body.up, .dia .wick.up { fill: var(--red); stroke: var(--red); }
.dia .body.dn, .dia .wick.dn { fill: #2f6fd6; stroke: #2f6fd6; }
.dia .wick { stroke-width: 2; }
.dia text { font-size: 14px; fill: #2c3a3a; font-weight: 700; }
.dia text.sym { fill: var(--teal-ink); font-size: 15px; font-weight: 900; }
.dia text.num { fill: var(--teal-ink); font-size: 13px; }
.dia text.sell { fill: var(--ok); font-weight: 900; }
.dia text.warn { fill: var(--cond); font-weight: 900; }
.dia text.step { font-size: 14px; font-weight: 900; }
.dia text.macap { fill: #9c7700; }
.dia text.cap { font-weight: 400; }

/* 미국 장 시간 */
.hours { width: 100%; border-collapse: collapse; margin-top: 6px; }
.hours th, .hours td { text-align: left; padding: 10px 4px; border-bottom: 1px solid rgba(29, 38, 38, .08); }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours th { font-weight: 700; color: var(--ink-2); width: 40%; }
.hours td { font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hours.compact td { font-size: 17px; }
.season { display: inline-block; font-weight: 900; padding: 1px 10px; border-radius: 999px; background: var(--teal-ink); color: #fff; font-size: 14px; }

/* 퀴즈 */
.quiz { display: grid; }
.qcard { padding: 16px 2px; border-top: 1px solid var(--line); }
.qcard:first-child { border-top: 0; padding-top: 0; }
.qcard .qq { font-weight: 900; margin-bottom: 10px; }
.qopts { display: grid; gap: 6px; }
.qopts button { text-align: left; font: inherit; padding: 11px 14px; border-radius: 14px; border: 0; background: #fff; color: var(--ink); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out); }
.qopts button:active { transform: scale(0.98); }
.qopts button.right { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.qopts button.wrong { background: var(--no-soft); color: var(--red-ink); }
.qres { margin-top: 8px; font-weight: 700; }
.qres.ok { color: var(--ok); }
.qres.bad { color: var(--red-ink); }

/* 비교표 */
.table-scroll { overflow-x: auto; margin: 10px -18px 0; padding: 0 18px; }
table.cmp { border-collapse: collapse; min-width: 620px; font-size: 15px; }
table.cmp th, table.cmp td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
table.cmp thead th { color: var(--ink-2); font-weight: 700; white-space: nowrap; }
table.cmp th[scope="row"] { position: sticky; left: 0; background: var(--panel); font-weight: 900; font-size: 17px; }
table.cmp th[scope="row"] a { text-decoration: none; }
.yn { font-weight: 900; }
.yn.o { color: var(--ok); }
.yn.x { color: var(--red-ink); }
.yn.n { color: var(--ink-2); font-weight: 400; }
.scroll-hint { font-size: 14px; color: var(--ink-2); margin-top: 6px; }

/* 어려운 단어 */
.tw { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; text-decoration: underline dotted var(--teal) 2px; text-underline-offset: 4px; }
.tip { position: absolute; z-index: 30; background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-lift); font-size: 15px; transform-origin: top left; animation: tip-in 160ms var(--ease-out); }
.tip b { color: var(--teal-ink); font-weight: 900; }
.tip p { margin: 4px 0 8px; }
@keyframes tip-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }

/* 용어사전 */
.terms-hero { padding: 24px 0 8px; }
.terms-hero h1 { font-size: 27px; font-weight: 900; }
.terms-hero p { color: var(--ink-2); margin-top: 6px; }
.tgroup { margin-bottom: 8px; }
.tgroup-h { font-size: 19px; font-weight: 900; margin: 22px 2px 10px; }
.tgroup .chips { margin: 0 0 12px; }
.tgroup .chip { background: var(--panel); box-shadow: 0 1px 2px rgba(16, 52, 52, .06); color: var(--teal-ink); }
.terms { display: grid; gap: 10px; }
.term { background: var(--panel); border-radius: var(--r-panel); padding: 18px; box-shadow: var(--shadow); scroll-margin-top: 70px; }
.term h3 { font-size: 19px; font-weight: 900; margin-bottom: 8px; }
.term .easy { background: var(--kr); border-radius: 14px; padding: 10px 12px; font-weight: 700; }
.term .easy span { display: block; font-size: 13px; color: var(--kr-ink); font-weight: 900; }
.term .ex { font-size: 15px; color: var(--ink-2); }
.term .ex span { font-weight: 900; color: var(--ink); }

/* ── 하단 */
.foot { margin: 28px 0 0; padding: 24px 0 40px; background: #e6eded; }
.foot p { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.disclaimer { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-inner); background: #fff; color: #3b4848; font-size: 14px; line-height: 1.65; }
.loading { padding: 60px 0; text-align: center; color: var(--ink-2); }

@media (min-width: 640px) {
  .home-hero h1, .terms-hero h1 { font-size: 32px; }
  .pick { gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pick-btn .pl { font-size: 56px; left: 16px; top: 6px; }
  /* 미국 판은 타일 두 개 폭에 맞춘다 (한국 판 타일과 같은 크기) */
  .market.us { width: fit-content; }
  .market.us .pick { grid-template-columns: repeat(2, calc((min(100vw, 720px) - 32px - 32px - 48px) / 5)); }
  .block { padding: 26px 26px; }
  .table-scroll { margin: 10px -26px 0; padding: 0 26px; }
  .rhero { padding: 26px; }
  .rhero h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.lead-p { font-size: 18px; font-weight: 700; line-height: 1.6; }
