@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v3.2.1/dist/web/static/pretendard.min.css");

:root {
  --navy: #111827;
  --blue: #3182f6;
  --steel: #6b7280;
  --ink: #111827;
  --slate: #4b5563;
  --mute: #9ca3af;
  --up: #059669;
  --down: #e11d48;
  --warn: #d97706;
  --bg: #f9fafb;
  --card: #ffffff;
  --line: #e5e7eb;
  --soft: #f3f4f6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.2px;
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }

/* Header */
.head { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 24px; }
.head h1 { font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -0.5px; }
.head h1 small { font-size: 13px; color: var(--slate); font-weight: 500; margin-left: 12px; background: var(--line); padding: 4px 10px; border-radius: 6px; }
.head .meta { text-align: right; font-size: 12px; color: var(--slate); line-height: 1.6; }
.head .meta b { color: var(--navy); font-weight: 700; }

/* Tabs (Segmented Control Style) */
.tabs { display: flex; gap: 8px; background: var(--line); padding: 6px; border-radius: 12px; margin-bottom: 24px; }
.tab { 
  flex: 1; padding: 14px 10px; cursor: pointer; text-align: center; 
  border-radius: 8px; transition: all 0.2s ease;
  color: var(--slate); display: block;
}
.tab:hover { background: rgba(255,255,255,0.4); color: var(--navy); }
.tab.on { background: var(--card); color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.tab .t1 { font-size: 15px; font-weight: 800; display: block; }
.tab .t2 { font-size: 12px; color: var(--mute); display: block; margin-top: 4px; font-weight: 500; }
.tab.on .t1 { color: var(--navy); } 
.tab.on .t2 { color: var(--slate); }

/* Page */
.page { display: none; }
.page.on { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Zones */
.zone-h { font-size: 15px; color: var(--navy); font-weight: 800; margin: 32px 0 16px; display: flex; align-items: center; gap: 8px; }
.zone-h:first-child { margin-top: 0; }
.cap { font-size: 13px; color: var(--slate); margin-top: 8px; line-height: 1.6; }

/* Panels & Cards */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.chart-h { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.chart-s { font-size: 12px; color: var(--slate); margin-bottom: 16px; }
canvas { max-height: 240px; }

.cards { display: grid; gap: 16px; }
.c4 { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.c3 { grid-template-columns: 1fr 1fr 1fr; }
.grid2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; }
.grid2b { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); transition: all 0.2s ease; }
.card.dark { background: var(--navy); border: none; color: #fff; }
.card .lbl { font-size: 13px; font-weight: 600; color: var(--slate); margin-bottom: 8px; }
.card.dark .lbl { color: #9ca3af; }
.card .big { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -0.5px; }
.card.dark .big { color: #ffffff; }
.card .big .u { font-size: 14px; font-weight: 600; color: var(--slate); margin-left: 2px; }
.card.dark .big .u { color: #9ca3af; }
.card .sub { font-size: 12.5px; margin-top: 10px; font-weight: 500; }

/* Colors */
.up { color: var(--up); font-weight: 700; } .down { color: var(--down); font-weight: 700; } .warn { color: var(--warn); font-weight: 700; }

/* Tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
th { background: var(--bg); color: var(--slate); font-weight: 600; padding: 12px 2px; text-align: center; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); word-break: keep-all; }
th:first-child { border-left: 1px solid var(--line); border-radius: 8px 0 0 0; width: 9%; }
th:nth-child(2) { width: 19%; }
th:nth-child(3) { width: 13%; }
th:nth-child(4) { width: 13%; }
th:nth-child(5) { width: 14%; }
th:nth-child(6) { width: 15%; }
th:last-child { border-right: 1px solid var(--line); border-radius: 0 8px 0 0; width: 17%; }
td { padding: 12px 2px; text-align: center; border-bottom: 1px solid var(--line); word-break: keep-all; }
.rk { font-weight: 700; color: var(--navy); }

/* Pills */
.pill { font-size: 11px; padding: 4px 8px; border-radius: 4px; font-weight: 600; display: inline-block; }
.p-up { background: #d1fae5; color: var(--up); }
.p-down { background: #ffe4e6; color: var(--down); }
.p-warn { background: #fef3c7; color: var(--warn); }

/* Risks */
.risk { border-radius: 12px; padding: 16px 20px; font-size: 13px; line-height: 1.7; border: 1px solid var(--line); background: var(--card); }
.risk.r1 { border-left: 4px solid var(--down); }
.risk.r2 { border-left: 4px solid var(--warn); }
.risk h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.risk.r1 h4 { color: var(--down); } .risk.r2 h4 { color: var(--warn); }
.risk .it { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.risk .it:last-child { border: 0; padding-bottom: 0; }
.risk b { color: var(--ink); font-weight: 600; }

/* Telegram preview */
.tg { background: #1e293b; border-radius: 12px; padding: 20px; color: #f8fafc; font-size: 13px; line-height: 1.8; font-family: 'Consolas', 'Monaco', monospace; border: none; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.tg .hd { color: #38bdf8; font-weight: 800; margin-bottom: 8px; font-size: 14px; }
.tg .em { color: #f87171; font-weight: 700; }
.tg .gd { color: #34d399; font-weight: 700; }
.tg .mu { color: #64748b; letter-spacing: 2px; }

/* Messages */
.foot { margin-top: 40px; font-size: 12px; color: var(--mute); line-height: 1.65; border-top: 1px solid var(--line); padding-top: 20px; text-align: center; }
.keymsg { background: var(--soft); color: var(--navy); border-radius: 8px; padding: 16px 20px; font-size: 14px; line-height: 1.7; margin-top: 12px; border: 1px solid var(--line); }
.keymsg b { color: var(--blue); font-weight: 700; }